Skip to content

Tune on point-in-time pairs; re-tuned TrendRider4h overfits - #6

Merged
devam2001 merged 2 commits into
mainfrom
feature/pit-hyperopt
Oct 15, 2026
Merged

devam2001 merged 2 commits into
mainfrom
feature/pit-hyperopt

Conversation

@devam2001

Copy link
Copy Markdown
Owner

Why

research.py hyperopt passed no --pairs, so Freqtrade tuned on config.json's live list: today's top 25 coins by volume. That's a lookahead the rest of the research pipeline avoids. TrendRider4h's own parameters also came from tuning on a hand-picked list.

What

  • Fix: hyperopt now tunes on the point-in-time universe at the in-sample start, the same pairs the in-sample backtest uses. A regression test checks the command.

  • Experiment: TrendRider4hPIT is TrendRider4h re-tuned that way, with 300 trials on in-sample data only. It has its own parameter file, so the live strategy's parameters are untouched.

  • Result: it overfits.

    IS OOS OOS PF Walk-forward Gates
    TrendRider4h +5.6% +17.3% 1.43 64% 8 / 9
    TrendRider4hPIT +45.6% +13.8% 1.33 50% 7 / 9

    In-sample went up eightfold; out of sample got worse. TrendRider4h stays the lead candidate.

  • Gates re-run for all five strategies at 1000 and 65 USDT. The other four reproduce their published numbers exactly.

  • Docs:

    • RESEARCH.md: the finding, and a next step not to re-tune on this period again.
    • README: the hyperopt notes.
    • Case study: new section 5.7, now covering five strategies.

Testing

  • ruff check . clean, pytest 68 passed.
  • Case study PDF rebuilt and checked page by page.

research.py hyperopt passed no --pairs, so Freqtrade tuned on config.json's
live list: today's top 25 coins by volume, a lookahead the rest of the
pipeline avoids. It now tunes on the point-in-time universe at the in-sample
start, the same pairs the in-sample backtest uses. A test locks this in.

TrendRider4hPIT is TrendRider4h with its own parameter file, so re-tuning it
on point-in-time pairs can't change the live strategy's parameters.
TrendRider4hPIT (300 trials, in-sample only, point-in-time pairs) raised the
in-sample return from +5.6% to +45.6% but fell out of sample: +13.8% against
+17.3%, profit factor 1.33 against 1.43, walk-forward 50% against 64%. The
original parameters stay; the candidate is kept as evidence.

Gates re-run for all five strategies at 1000 and 65 USDT. RESEARCH.md, the
README's hyperopt notes and the case study (new section 5.7) are updated.
@devam2001
devam2001 merged commit 12bbeca into main Oct 15, 2026
2 checks passed
@devam2001 devam2001 mentioned this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant