Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help about ETF moving average technic

Hi!

I try to implement a simple technic. I buy SPY tracker when my short average is above the long and when the long is above, I sell SPY and I buy SX (an inverse SPY tracker)... but my code don't work, I don't understand. If someone have an idea to help me.

Thank you

JC

2 responses

Try this

Thank you very much but there is always un problem because sometimes SPY is shorted at the beginning and all the backtest is false... I don't really understand how the method order works and how the portfolio method works in order to check if I already have an equity of SPY or SX.

thanks a lot for your help and sorry for my english

JC