PacktPublishing/Learn-Algorithmic-Trading

NameError: name 'signals' is not defined

Closed this issue · 3 comments

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

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

Could you please advise what file this comes from?

Ch.4 ch4_double_moving_average.py

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

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.