Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

TA.EV_MACD UnboundLocalError: local variable 'x' referenced before assignment #47

Closed
higuamo opened this issue Dec 23, 2019 · 4 comments

Comments

@higuamo
Copy link

higuamo commented Dec 23, 2019

Example:
import finta
print(df)
macd = finta.TA.EV_MACD(df)

Output(Partial)
open close high low volume
2018-03-19 264.293667 261.528421 265.308880 259.720376 109208442.0
2018-03-20 261.963513 261.973181 262.669327 261.228692 59757271.0
2018-03-21 261.924838 261.470409 264.216318 261.238361 78709578.0
2018-03-22 259.033899 254.934374 259.962094 254.634645 148785916.0
2018-03-23 255.417809 249.500570 255.775550 249.287859 183534751.0
[446 rows x 5 columns]

macd = finta.TA.EV_MACD(df)

File "/home/xxx/.local/lib/python3.6/site-packages/finta/finta.py", line 517, in EV_MACD
evwma_slow = cls.EVWMA(ohlcv, period_slow)
File "/home/xxx/.local/lib/python3.6/site-packages/finta/finta.py", line 317, in EVWMA
for x, y in zip(x.fillna(0).iteritems(), y.iteritems()):
UnboundLocalError: local variable 'x' referenced before assignment

Versions:
python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Pandas 0.25.3

@peerchemist
Copy link
Owner

How many rows in that df?

@higuamo
Copy link
Author

higuamo commented Dec 25, 2019 via email

@peerchemist
Copy link
Owner

Hello, you did not attach anything.

@peerchemist
Copy link
Owner

I was not able to replicate this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants