Repository navigation
Paper vs replay reconciliation: the last go-live gate - #4
Merged
Merged
Conversation
Replays the exact period a paper session ran (same strategy, pairs, balance, max open trades), matches trades by pair and entry time, and checks that paper results are close to the replay: 28+ days, 80%+ of trades in both, realised return within 2 points, fills within 0.3% per side. The return gap is split into matched-trade execution, paper-only and replay-only trades, and anything the replay can't reproduce (manual pause/resume/flatten, halts, code changed mid-session) is flagged. - ridgeline/reconcile.py: session discovery, trade matching, checks - panel/replay.py: data top-up, session replay, background jobs - panel: Paper vs replay card; the Research tab's last gate shows real results - scripts/reconcile.py: CLI for panel sessions and the Docker bot - panel sessions now record their pairs, balance, start and a code fingerprint in <session>.meta.json (config.json's pair list changes monthly)
devam2001
force-pushed
the
feature/paper-vs-replay
branch
from
October 10, 2026 15:49
19eaeeb to
fcd05b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The go-live rules say a strategy must paper-trade for 4+ weeks "with results close to a replay of the same weeks", but nothing checked that. This adds the check.
What
Replays a paper session's exact period:
Matches trades: same pair, entries at most 1.5 candles apart.
Checks: the session is "close to the replay" only if all four pass.
Explains the gap: splits it into matched-trade execution, paper-only trades and replay-only trades. It also flags what a replay can't reproduce:
Records what each session ran. New panel sessions write
<session>.meta.jsonwith pairs, balance, start and a code fingerprint.config.json's pair list changes monthly; existing sessions already traded 15-, 26- and 25-pair lists. Older sessions and the Docker bot fall back to the bot log and database.Where
ridgeline/reconcile.py: session discovery, matching, checks (no Freqtrade import at module load)panel/replay.py: data top-up, session replay, one-at-a-time background jobsscripts/reconcile.py: CLI for panel sessions (<session-id>) and the Docker bot (--db/--log)docs/OPERATIONS.md(new "Paper vs replay" section), RESEARCH.md next steps*.reconcile.jsonadded to.gitignoreTesting
ruff check .clean;pytest: 63 passed (11 new):The four targets are a first proposal and live in
CHECKSinridgeline/reconcile.py.