mkajnar / DailyBuyStrategy

GNU General Public License v3.0
30 stars 19 forks source link

Lookahead #11

Closed froggleston closed 9 months ago

froggleston commented 9 months ago

https://github.com/mkajnar/HighProfitStrategy/blob/main/HPStrategyV7.py#L68 is classic lookahead. You can't call max() on full series in backtesting - it'll use future data.

Using a pre-existing heiken calculation like qtpylib.heikenashi would remove the issue, and I doubt the existing strategy backtesting performance would remain.

mkajnar commented 9 months ago

Thanks for advices. :)

mkajnar commented 9 months ago

Reworked :)