Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why won't my algorithm make trades?

My algorithm won't make trades. I don't know why. Is my structure wrong?

2 responses

Two reason why it maybe isn't trading...

First, add the timezone in your 'get_datetime' function. Otherwise it defaults to UTC.

time = get_datetime('US/Eastern')

Second, it appears your condition

current_returns_abs>=(2*real_avg_returns)

is never True for these particular stocks over these dates. Take that out of the 'if' statement (leaving only the time) and you get trades. Maybe logically that statement can never be True (didn't look that closely at the code) but also possible just not True very often?

thanks