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

Hi everyone, I made this algorithm to buy and sell the SPY at its hypothesized daily dip and peak. It buys one minute before the close and sells at noon. I wanted this to repeat everyday but it seems like it only did it the first day, anyone know how to fix it?

1 response

I think you meant to have this to close your position:

def close_positions(context, data):
order_target_percent(context.spy, 0.0)