Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Cross over with t statistic on regression slope

My first attempt at moving average cross overs using t statistic of regression slope to affirm trend.

2 responses

After playing around with your code a bit I would suggest removing the (if p_value > .01) part out of the exit condition. I believe this could cause a breakout to exit the trade. Also a 5% stop loss doesn't hurt either. I have been trying to work with linear regression models also, but I never though to use the t-statistic. That was really smart. Thanks for sharing.

I’ve also been playing around with it and it seams to work better in daily mode and not minute mode although it does get some crazy high return’s at times when I add some code that should make it seem like it is in daily mode by restricting it to trading once a day. Any one think they know why?