Hello...I am very new to Python and Quantopian and I was wondering if you could let me know where I am going wrong here.
Basically I want to use the crossover SMA of SPY to define what leverage I should be using...now I'm not great at coding so Im not sure where I have gone wrong here?!? Please see my attached code.
Any help would be greatly appreciated. Thanks!