examples: RealTest -> crucible round trip (MA crossover) [draft] - #73
Draft
mspinola wants to merge 1 commit into
Draft
examples: RealTest -> crucible round trip (MA crossover) [draft]#73mspinola wants to merge 1 commit into
mspinola wants to merge 1 commit into
Conversation
Add a runnable end-to-end example of feeding a RealTest trade export into crucible, and expand the README's RealTest section around it. - examples/realtest/ma_cross.rts: a 20/50 SMA crossover (long only) as a RealTest strategy template. The protective stop (StopPct) defines 1R; SaveTradesAs emits the trade CSV. Written from RealTest's docs, not executed here, so it's marked adapt-and-verify. - examples/realtest_ingest.py: reads a SaveTradesAs CSV, converts PctGain/MFE/MAE to R (r = PctGain / --r-pct), de-duplicates correlated fills, and runs edge_report + reality_check, optionally writing a tearsheet. - examples/realtest/ma_cross_trades.csv: a committed sample export (100 trades, 1993-2024) so the crucible side runs offline with no RealTest license. - examples/realtest/make_sample_export.py: the maintainer helper that generates that sample from the same rule the .rts describes. - docs/img/realtest_tearsheet.png: the tearsheet the example produces (FRAGILE: +0.211R, 95% CI straddles zero at n=100). The verdict is the teaching point: a convincing rising cumulative-R curve that crucible flags as not distinguishable from noise at this sample size. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Draft — do not merge until the
.rtsis validated in RealTest.A runnable RealTest → crucible round trip, using a 20/50 MA crossover as the shared strategy, plus an expanded README section around it.
What's here
examples/realtest/ma_cross.rts— the MA-crossover strategy as a RealTest script. The protective stop (StopPct) defines 1R;SaveTradesAsemits the trade CSV. This is the part that needs your RealTest test (see below).examples/realtest_ingest.py— reads aSaveTradesAsCSV, convertsPctGain/PctMFE/PctMAEto R (r = PctGain / --r-pct), drops duplicate correlated fills, runsedge_report+reality_check, and optionally writes a tearsheet. Fully runnable now.examples/realtest/ma_cross_trades.csv— a committed sample export (100 trades, 1993–2024) so the crucible side runs offline with no RealTest license.examples/realtest/make_sample_export.py— the maintainer helper that generated the sample from the same rule the.rtsdescribes.docs/img/realtest_tearsheet.png— the tearsheet the example produces.README.md— the "How this compares to RealTest" export subsection rewritten into a worked round trip with the figure.The result (bundled sample)
A convincing rising cumulative-R curve that crucible flags as not distinguishable from noise at n=100 — the whole teaching point.
What still needs you
I can't run RealTest, so
ma_cross.rtswas written from RealTest's published docs. I verified from those docs that comments are////* *//{ }and the direction key isSide:, but the order-price / stop keys (EntryPrice,ExitPrice,ExitStop) I could not confirm against a full example. Please:ma_cross.rtsin RealTest against your data feed (adjust theImportblock).SaveTradesAsCSV with the documented columns.python examples/realtest_ingest.py --csv your_trades.csv --r-pct 5(keep--r-pct==StopPct).If the real export's numbers differ from the synthetic sample, I'll update the figure and the README console block to match your actual run.
Verification done here
examples/realtest_ingest.pyruns on the bundled sample (100 trades, reproducible verdict)quickstart.pystep unaffected🤖 Generated with Claude Code