jameschch / LeanOptimization

Genetic optimization using LEAN
Apache License 2.0
50 stars 14 forks source link

Unequal backtesting and forward walking periods #27

Closed Doggie52 closed 4 years ago

Doggie52 commented 6 years ago

It would be great to use unequal backtesting and forward walking periods.

I.e., it would be nice to backtest over e.g. 6 months and walk forward those parameters 1 month, then rinse and repeat. As the tool stands right now, I don't see a way this can be achieved.

jameschch commented 6 years ago

It is possible to specify an in sample period and a walk forward that skips an unequal window, so for instance you can have an in sample of 5 days that walks forward to skip the weekend. You can specify this pattern with this kind of setting:

"hourSegments": [ 24, 24, 24, 24, 72 ]

This was only ever quite rudimentary as I've turned my attention to a different approach using an adaptive fitness measure. The AdaptiveSharpeRatioFitness will increase the size of in sample period directly proportional to an increase in Sharpe Ratio.

Neither of these things are exactly what you're asking for but may keep you going whilst I decide how to approach the overlapping walk forward you're interested in.

jameschch commented 4 years ago

I have now merged a first working version of a walk forward optimizer into my new .net core port of the Lean Optimizer here:

https://github.com/jameschch/LeanParameterOptimization

This is not fully tested at this stage but I do recommend you switching over to the other project as I will probably not be updating this codebase with any new features.

jameschch commented 4 years ago

Closing this as walk forward is now supported in other repo