mkajnar / DailyBuyStrategy

GNU General Public License v3.0
26 stars 17 forks source link

Lookahead #11

Closed froggleston closed 6 months ago

froggleston commented 6 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 6 months ago

Thanks for advices. :)

mkajnar commented 6 months ago

Reworked :)