Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
long-short mean reversion attempt

Here's something to consider. Needs some re-factoring, clean-up, comments, etc. It may be an over-fit, but recent performance looks pretty good. --Grant

5 responses

Long-term backtest. Not so good.

Thanks for sharing your code! I really like these OLMAR approaches. I notice slippage and commission were overridden. I ran with default slippage and commission (by just commenting out lines 14 and 15) and the results are different. See below. I didn't see this degradation nor need to override with your other OLMAR posts (e.g. see simple OLMAR w/ optimizer & get_fundamentals)

Thanks Marc,

Not sure what's going on. There may be a lot of turn-over combined with the high level of capital? So, the slippage model kicks in?

Here's another version

Note:

set_commission(commission.PerTrade(cost=0))
set_slippage(slippage.FixedSlippage(spread=0.00))

Since this takes over an hour to run in Quantopian 1, this might be a great candidate to test in Quantopian 2. I tried to port it... most is straight forward except dies with cryptic "error: failed in converting 4th argument `xl' of _slsqp.slsqp to C/Fortran array".