Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Reacting to SPY

Hi there!
I've just started my journey with Algorithmic trading and I am curious whether it is possible to adjust the weights of the positions according to the behavior of SPY. For instance, if SPY yesterday observed minus returns, I want my portfolio to increase the number of short positions in it, conversely, when the SPY observed positive returns yesterday, the portfolio would need to increase the number of long positions in it.
Is such a trick possible in Quantopian?
Thanks for help !!!
Daniel