Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Have you tried to reverse a strategy that incur loses and made it profitable?

I am starting to learn quantitative strategy, in my naive attempt, I created a strategy that gives big losses, and reverting it naturally gives nice profit, obviously either my initial hypothesis is plain wrong or my implementation is off (less likely as it is really simple).

I am going to try it out with more data as test set, but I would like to know your opinion on such case, will you investigate further?

2 responses

" I created a strategy that gives big losses, and reverting it naturally gives nice profit ". That isn't always true. It doesn't 'naturally' follow in all cases. However, if it does, it's generally a confirmation there is some sort of correlation between your logic and your results.

A lot of strategies aren't easy to 'invert'. However if you can invert a factor, or a whole strategy, and the results invert accordingly, that's usually a good sign. Actually, it's often good practice to do exactly that in the course of testing an algorithm. If one DOESN'T see a corresponding change by inverting some factor, then maybe it's not really that factor that's generating results but something else.

One other thing to try when testing is to set commissions to zero (just remember to set it it back).


    set_commission(commission.PerShare(cost=0.0, min_trade_cost=0.0))


Often poorly performing algorithms (from a return perspective) are due to high transaction costs even though the underlying logic may be sound. If one sees a big change when turning commissions off then maybe focus on reducing transactions.

Just some thoughts. Good luck!

Thanks for reminding me such correlation does not always exists, also nice tips on transaction costs.

I'll tried it out more