Skip to content

examples: RealTest -> crucible round trip (MA crossover) [draft] - #73

Draft
mspinola wants to merge 1 commit into
mainfrom
examples/realtest-roundtrip
Draft

examples: RealTest -> crucible round trip (MA crossover) [draft]#73
mspinola wants to merge 1 commit into
mainfrom
examples/realtest-roundtrip

Conversation

@mspinola

Copy link
Copy Markdown
Owner

Draft — do not merge until the .rts is 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; SaveTradesAs emits the trade CSV. This is the part that needs your RealTest test (see below).
  • examples/realtest_ingest.py — reads a SaveTradesAs CSV, converts PctGain/PctMFE/PctMAE to R (r = PctGain / --r-pct), drops duplicate correlated fills, runs edge_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 .rts describes.
  • 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)

VERDICT (expectancy): +0.211 R   95% CI [-0.143, +0.599]
                     p(edge>0) = 0.872        ->  FRAGILE

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.rts was written from RealTest's published docs. I verified from those docs that comments are // / /* */ / { } and the direction key is Side:, but the order-price / stop keys (EntryPrice, ExitPrice, ExitStop) I could not confirm against a full example. Please:

  1. Run ma_cross.rts in RealTest against your data feed (adjust the Import block).
  2. Confirm it produces a SaveTradesAs CSV with the documented columns.
  3. Feed your real export in: 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.py runs on the bundled sample (100 trades, reproducible verdict)
  • Sample CSV regenerates byte-identical (deterministic)
  • New README prose: 0 em dashes, 0 semicolons (house voice)
  • Examples import-safe (plotly only imported lazily); CI's quickstart.py step unaffected

🤖 Generated with Claude Code

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>
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