PacktPublishing / Learn-Algorithmic-Trading

Learn Algorithmic Trading, Published by Packt
MIT License
802 stars 302 forks source link

NameError: name 'signals' is not defined #7

Closed EM5813 closed 3 years ago

EM5813 commented 3 years ago

positions = pd.DataFrame(index=signals.index).fillna(0.0)

positions = pd.DataFrame(index=signals.index).fillna(0.0) NameError: name 'signals' is not defined

jiripik commented 3 years ago

Could you please advise what file this comes from?

EM5813 commented 3 years ago

Ch.4 ch4_double_moving_average.py

If you comment out line 61 and run the full script. Unless I am misunderstanding that script.

jiripik commented 3 years ago

I think the objective of the script was to stop at line 57 and all afterwards should NOT have been included.

I do recognize this is certainly not best practice. The codebase contains some temporary code.

For now please remove all lines after 57.

I will arrange the code to be updated.

Thank you for raising this.