Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Algorithm: t test using scipy

Just playing around. Has a sharpe > 1 but don't fully understand why.

3 responses

Attached backtest

Interesting Pavy, It looks like a crossover of price regression slopes and a t-test whose null hypothesis is that the samples have the same mean, am I right? I noticed that you never set context.PrevPrice in the handle data loop, was that just left over from fiddling with different settings? I switched it over to use order_target_percent so it re-invests earnings and it looks pretty beastly. I'm not sure why either, I'd have to pick through the signals you are generating, but it looks worth exploring.

David

Yes David. I removed the context.PrevPrice and changed the trading rule a bit. Amazing results on Apple stock. 10 Sharpe!!