Chart Selection & Diamond Rating Methodology — Multi-Instrument & Session-Aware Reference
status: ACTIVE tier: 2 (design reference) last-verified: 2026-11-28 verified-against: 3bcb2867 (Specialist Studio v1.11.0 / manage_data v1.9.1 / instrument_specs v1.0.0) owner-initiative: Projects/Specialist Studio Multi-Instrument & Intrabar MtM Drawdown
Purpose. Before committing disk, ingestion time, and hundreds of GPU/CPU evolution hours to a chart ({INSTRUMENT}_{CHART}), we evaluate whether its bar geometry and session cadence can produce statistically sound, low-drawdown Generalist and Session-Specialist (ASIA / EU / US) Diamonds. This reference records the quantitative criteria, the 1–10 rating rubric, the session-shift law discovered across 73,000+ evolved genomes in trades.db / backtests.db, the active vs. retired chart registry across all 8 CME futures (MNQ, MES, MHG, MGC, MCL, MYM, M2K, NQ), and the reproducible evaluation script for newly exported ATAS CSVs.
1. The Four Quantitative Criteria for Chart Evaluation
Every candidate chart is evaluated on four physical microstructure dimensions per trading shift (ASIA: 17:00–02:00 CT, EU: 02:00–08:00 CT, US: 08:00–16:00 CT) as well as across the full 23-hour CME session day:
Criterion 1 — Shift-Specific Bar Cadence (bars/shift & bars/day)
Our indicators and genetic filters depend on rolling bar windows (Trimmed ATR-14, Session-Scoped Demand Index EMA-10, swing_left/right 2..8, trend_n / rev_m / pullback / min_build):
- Daily 23h Sweet Spot: 80 to 350 bars/day (~140,000 to 650,000 bars over a 7-year 1,800-session dataset).
- Per-Shift (ASIA / EU / US) Sweet Spot: 35 to 220 bars/shift (median bar duration 30 seconds to 10 minutes).
- Failure Mode A — Too Fast (> 450 bars/shift or > 900 bars/day, e.g., MNQ_M1, MNQ_T900, NQ_V300, MES_V3000, MGC_Renko_20 in 2026 US RTH):
- Sub-20-second bars trigger on HFT order-book noise and stop-hunt wicks.
- Increases 7-year Master size to 1.4M–3.4M bars (4×–15× slower GA evolution per generation) while collapsing elite diamond yield (2.5%–6.1% on MNQ_M1/T900 vs. 37%–47% on MNQ_M10/D500/M5/Renko_64).
- Failure Mode B — Too Slow (< 12 bars/shift or < 30 bars/day, e.g., MYM_D200 in Asia/EU at 4–5 bars/shift, MES_Renko_32 in Asia/EU at 6–7 bars/shift):
- ATR-14 and DI-10 cannot even complete their warm-up within the shift.
- Produces < 35 lifetime trades in that shift, failing the Specialist Studio statistical significance and coverage gates.
Criterion 2 — Bar Geometry vs. Execution Friction (med_rng_t, p90_rng_t, % of ADR)
Every trade pays realistic execution friction (slippage + commission ≈ 2–4 ticks round-trip):
- Median Bar Range Sweet Spot: 22 to 85 native ticks (or 5% to 12% of the instrument's 2025–2026 Daily ADR in ticks).
- P90 Bar Range Sweet Spot: 35 to 180 native ticks (must fit inside Specialist Studio's $0.50 eq-tick single-trade max_risk_adapted cap of 320 eq-ticks = $160 at 1 contract).
- Failure Mode A — Micro-Bars (< 16 ticks median range on $0.50–$1.25 contracts, e.g., MES_V3000 at 14–16t, MES_M1/M5):
- A 15-tick bar has an ATR of ~15t; a 1.5× ATR stop (22t) loses 15%–20% of its gross expectancy to 3–4 ticks of fill friction.
- Failure Mode B — Giant Bars (> 200 ticks median / > 450 ticks P90 on $0.50+ contracts, e.g., MNQ_H1 in US RTH at 268t median / 503t P90):
- Structural candle-pair stops (sl_mode=1, sl_struct_count=1..3) frequently exceed the $160 (320 eq-tick) 1-contract risk cap, forcing post-entry stop outs or over_budget_at_1c rejections.
Criterion 3 — Multi-Year Secular Regime Stability (life_bd vs. 25_26_bd)
Because genomes are evolved and validated across 2020–2026 (1Y through Lifetime horizons in Specialist Studio):
- Ideal Stability Ratio: (2025–2026 bars/day) / (2020–2026 median bars/day) between 0.8× and 2.2×.
- Secular Drift Hazard (> 4× drift): When an asset's nominal price and tick ADR expand 2.5×–3× (such as MGC Gold moving from $1,500 / 306t ADR in 2020 to $3,000–$4,000+ / 754t ADR in 2025–2026), fixed-tick charts (MGC_Renko_20) can jump from 40–70 bars/day (2020–2024) to 1,019 bars/day (2026), concentrating 63% of total 7-year bars into a single year.
- Mitigation: On secular-trend commodities (MGC), prefer coarser price-path bars (MGC_RangeUS_0_40_40, MGC_Renko_32), volume bars (MGC_V1000), and time charts (MGC_M15 with clock-decayed ATR_ref_ticks / VPT_ref variable genes).
Criterion 4 — Contract Tick Value & Portfolio Sizing Granularity (w_usd)
Under Specialist Studio's Option D ($0.50 MNQ-Equivalent Tick Basis):
[
w_{\text{usd}}(\text{inst}) = \frac{\text{tick_value_usd}(\text{inst})}{0.50}
]
- Micro contracts (MNQ, MYM, M2K at $0.50/t → w_usd = 1.0; MGC, MCL at $1.00/t → w_usd = 2.0; MES, MHG at $1.25/t → w_usd = 2.5) allow fine-grained 1..15 contract risk-parity scaling inside a $2,500 (5,000 eq-tick) drawdown budget.
- Full-size contracts (NQ at $5.00/t → w_usd = 10.0; ES at $12.50/t → w_usd = 25.0) consume 1,500–2,500 eq-ticks on a single 1-contract stop loss, destroying multi-slot portfolio diversification. Always evolve and deploy on the Micro contract (MNQ, MES, MGC, MCL, MYM, M2K, MHG).
2. The Session-Shift Law (ASIA vs. EU vs. US)
[!IMPORTANT] Never judge a non-time chart solely by its full-day or
US-session average. A non-time chart that is too fast inUSRTH is frequently the #1 diamond producer inASIAorEU, and vice versa.
Empirical proof from backtests.db (38,500+ evaluated runs across MNQ, MES, MHG):
1. Order-Flow & Volume Charts Step Down Overnight:
- In US RTH (08:00–16:00 CT): MNQ_D500 (266 bars/US shift, 81.9% Ret/DD ≥ 1.5 yield) and MNQ_V5000 (292 bars/US shift, 72.5% yield) dominate, while MNQ_D200 (1,002 bars/US shift, 15.9s/bar) is too noisy.
- In ASIA (17:00–02:00 CT): MNQ_D500 drops to 38 bars/shift (16.1% yield), whereas MNQ_D200 slows down to 165 bars/shift and becomes the #1 ASIA chart on MNQ (40.5% Ret/DD ≥ 1.0 yield, 308 strict Asian diamonds) alongside MNQ_V2500 (113 bars/shift, 40.7% yield)!
2. RangeUS & Renko Step Down Overnight:
- Coarser bricks/ranges dominate US RTH: MNQ_Renko_64 (142 b/shift), MNQ_Renko_100 (57 b/shift), MES_Renko_24 (42 b/shift, 22.6% elite yield), MES_RangeUS_0_20_20 (104 b/shift, 68.7% strict US yield), MYM_RangeUS_0_25_25 (188 b/shift), M2K_RangeUS_0_25_25 (112 b/shift), MCL_RangeUS_0_20_20 (68 b/shift).
- Finer bricks/ranges dominate ASIA & EU: MNQ_RangeUS_0_50_50 (133 Asia / 118 EU), MNQ_Renko_32 (180 Asia / 158 EU, 39.8% EU yield), MES_Renko_16 (28 Asia / 28 EU, 20.2% Asia yield vs 8.8% on Renko_24), MYM_RangeUS_0_15_15 (100 Asia / 134 EU vs 492 US), M2K_RangeUS_0_15_15 (68 Asia / 84 EU vs 293 US), MCL_RangeUS_0_12_12 (134 Asia / 110 EU), MGC_RangeUS_0_25_25 (150 EU).
3. Time Charts (M5..H1) by Session:
- On US equity indices (MNQ, MES, MYM, M2K), time charts (M5, M10, M15, M30, H1) perform poorly in ASIA (0.1%–2.2% strict yield) because low overnight volume prints flat 2-tick candles that corrupt ATR-14 and swing structure.
- In EU (London open 02:00–08:00 CT), H1 and M15 are premier breakout/structural charts (MNQ_H1: 17.0% strict EU yield & 70 Studio EU slots; MES_M15: 22.5% strict EU yield & 70 Studio EU slots; MES_H1: 21.8% strict EU yield & 28 Studio EU slots).
- In US RTH, MNQ_M10 (46.8% elite yield), MNQ_M5 (39.2% elite yield, 105 Studio US slots), MNQ_M15 (37.2% elite yield), and MNQ_M30 (175 total Studio slots as low-CV roster stabilizer) are top-tier.
4. Commodity Session Physics (MHG, MGC, MCL):
- MHG (Copper): Driven by Shanghai/LME metals trading in ASIA and EU. MHG_RangeUS_0_16_16 (37.6% Asia yield, 24.6% EU yield, 4.6% US yield) and MHG_Renko_12 (31.8% Asia yield, 77 Studio Asia slots) are ASIA/EU superstars and should barely be evolved for US.
- MGC (Gold): Trades actively across all 3 sessions (ASIA physical/Shanghai open, EU London bullion fix, US COMEX RTH). MGC_RangeUS_0_40_40, MGC_Renko_32, MGC_V1000, and MGC_M15 (62t median Asia bar!) rate 8.5–9.6 / 10 across all three shifts.
- MCL (Crude Oil): Active across ASIA (52–134 b/shift), EU (42–110 b/shift), and US NYMEX (68–182 b/shift), providing near-zero correlation with equity index slots.
3. The 1–10 Chart Rating Rubric
Use this rubric both pre-evolution (when scoring a newly exported chart from its microstructure) and post-evolution (when auditing an existing chart in trades.db / backtests.db):
| Rating Tier | Score | Pre-Evolution Microstructure Criteria (in Target Session(s)) | Post-Evolution Empirical Criteria (trades.db / backtests.db) |
Action Policy |
|---|---|---|---|---|
| Tier 1 — Elite Diamond Factory | 9.0 – 10.0 |
45–250 bars/shift (80–350 bars/day), median bar range 22–130t (6%–12% of ADR), < 2.5× secular cadence drift, Micro contract (w_usd ≤ 2.5). |
Overall PF ≥ 1.25 yield ≥ 50% (MNQ ≥ 70%), Elite (PF ≥ 1.50) yield ≥ 18% (MNQ ≥ 35%), or Session Ret/DD ≥ 1.0 yield ≥ 30% in target shift (ASIA/EU). |
Primary Evolution Priority. Allocate 60%+ of GA compute here. |
| Tier 2 — High-Yield Core / Session Specialist | 8.0 – 8.9 |
25–350 bars/shift in at least one target session (ASIA, EU, or US), median bar range 18–195t, clean CandleVAH/PW* structure. |
Overall PF ≥ 1.25 yield 38%–49%, Elite yield 12%–17%, or high Specialist Studio roster representation (≥ 25 slots as low-correlation diversifier). |
Active Evolution — Route to Best Shift(s). Use --session_mode or specialist shift targeting where appropriate. |
| Tier 3 — Situational / Single-Shift Niche | 6.5 – 7.9 |
Either fast in US (300–600 b/shift) but sweet-spot in ASIA/EU (65–180 b/shift), OR slow overnight (< 15 b/shift) and viable only in US RTH (35–80 b/shift). |
Modest overall yield (30%–40%), but positive edge in one specific shift (e.g., H1 in EU, RangeUS_0_15_15 in ASIA/EU). |
Restrict to Target Session Only. Never run blind 24h generalist sweeps on 6.5–7.5 charts. |
| Tier 4 — Compute Drain / Retire | ≤ 6.2 |
> 1,000 bars/day (< 20s median duration in RTH), OR < 16t median bar range on $1.00+ ticks (friction-dominated), OR full-size contract (w_usd ≥ 10). |
Overall PF ≥ 1.25 yield < 36% AND Elite (PF ≥ 1.50) yield < 7% across all sessions, with 1.3M–3.4M bars dragging down compute. |
RETIRE & PURGE. Delete Master/Yearly exports and purge genomes from trades.db & backtests.db. |
4. Master Chart Rating Registry (Active vs. Retired)
A. Active Charts (53 Target Masters across 7 Micro Futures)
| Instrument | Chart | Total Bars (7Y / 5.4Y*) |
Overall Rating | ASIA Rating |
EU Rating |
US Rating |
Primary Deployment & Evolution Scope |
|---|---|---|---|---|---|---|---|
MNQ |
MNQ_M10 |
243,989 |
9.8 | 6.2 |
8.4 |
9.6 | #1 overall elite diamond rate (46.8%); US & EU time anchor |
MNQ |
MNQ_D500 |
351,091 |
9.7 | 8.0 |
8.6 |
9.8 | #1 US order-flow chart (81.9% US yield, 4,079 diamonds) |
MNQ |
MNQ_Renko_64 |
209,628 |
9.6 | 9.4 | 7.8 |
9.5 | Dual ASIA (37.2% yield) + US (50.1% yield) brick powerhouse |
MNQ |
MNQ_M5 |
487,480 |
9.5 | 5.5 |
8.8 | 9.7 | #1 US Studio slot producer (105 US slots, 39.2% elite); skip in ASIA |
MNQ |
MNQ_M15 |
162,548 |
9.3 | 6.5 |
8.2 |
9.3 | Fast-evolving generalist & US structural anchor (37.2% elite) |
MNQ |
MNQ_V5000 |
466,760 |
8.8 | 8.3 |
9.6 | 9.6 | #1 EU (45.4%) & US (72.5%) heavy-volume chart |
MNQ |
MNQ_Renko_100 |
85,664 |
8.7 | 6.8 |
6.5 |
9.2 | US large-brick macro trend specialist (84 US Studio slots) |
MNQ |
MNQ_RangeUS_0_50_50 |
647,487 |
8.5 | 9.3 | 9.3 | 8.2 |
Core ASIA (34.5%) & EU (37.5%) overnight range specialist |
MNQ |
MNQ_M30 |
81,482 |
8.5 | 7.8 |
8.3 |
8.6 | #1 Studio cross-horizon harmony stabilizer (175 total slots) |
MNQ |
MNQ_Renko_32 |
871,239 |
7.8 | 8.8 | 9.0 | 7.4 |
ASIA (27.5%) & EU (39.8%) brick specialist (too fast in US) |
MNQ |
MNQ_V2500 |
932,564 |
7.2 | 9.4 | 9.1 | 7.0 |
ASIA (40.7%) & EU (36.9%) volume specialist (V5000 takes US) |
MNQ |
MNQ_D200 |
1,374,946 |
6.8 | 9.6 | 8.8 | 6.2 |
#1 ASIA order-flow chart (40.5% Ret/DD, 308 strict diamonds) — evolve for ASIA/EU only! |
MNQ |
MNQ_H1 |
40,755 |
6.8 | 4.5 |
9.2 | 6.5 |
Pure EU London-open specialist (70 EU Studio slots, 17.0% strict EU yield) |
MES |
MES_Renko_24 |
77,512 |
9.4 | 7.8 |
8.0 |
9.6 | #1 MES overall (57.9%) & elite (22.6%) yield; US brick leader |
MES |
MES_RangeUS_0_20_20 |
187,752 |
9.3 | 8.4 |
8.3 |
9.7 | #1 MES US strict yield (68.7%, 1,291 strong US genomes) |
MES |
MES_M15 |
162,585 |
9.2 | 7.6 |
9.6 | 9.0 | #1 MES EU chart (70 EU Studio slots, 31.8% EU yield) + US |
MES |
MES_Renko_16 |
181,362 |
9.0 | 9.1 | 8.6 | 8.9 | #1 MES ASIA (20.2%) & EU (15.4%) brick chart |
MES |
MES_M30 |
81,491 |
8.8 | 5.5 |
8.4 |
9.0 | EU (21 slots) & US (35 slots) swing stabilizer |
MES |
MES_D500 |
341,163 |
8.4 | 9.0 | 8.0 |
9.2 | #1 MES ASIA (21.9%) & US (65.3%) delta chart |
MES |
MES_Renko_32 |
43,556 |
7.4 | 6.0 |
5.8 |
8.2 |
US-only large-brick swing chart (too sparse overnight at 6–7 b/shift) |
MES |
MES_H1 |
40,755 |
7.2 | 4.5 |
9.1 | 5.0 |
Pure EU specialist (28 EU Studio slots, 23.3% EU yield) |
MHG |
MHG_RangeUS_0_16_16 |
89,548* |
8.8 | 9.6 | 8.9 | 6.0 |
#1 Copper ASIA (37.6%, 77 slots) & EU (24.6%) chart |
MHG |
MHG_Renko_12 |
109,518* |
8.7 | 9.5 | 8.5 | 7.2 |
Co-#1 Copper ASIA (31.8%, 77 slots) & EU (15.4%) chart |
MHG |
MHG_V250 |
45,356* |
7.8 | 8.5 | 7.2 |
6.0 |
ASIA (22.4% yield) copper volume specialist |
MHG |
MHG_Renko_20 |
38,166* |
7.5 | 8.0 |
7.4 |
6.5 |
Slower ASIA (35 Studio slots) swing brick |
MHG |
MHG_M15 |
91,781* |
7.5 | 8.0 |
7.6 |
5.0 |
ASIA/EU time anchor + mandatory 14:45 CT re-pricing Master |
MHG |
MHG_D50 |
38,939* |
7.2 | 7.8 |
6.2 |
6.8 |
Secondary ASIA/US delta burst chart |
MGC |
MGC_RangeUS_0_40_40 |
162,960 |
9.5 | 9.5 | 9.2 | 9.6 | #1 Gold all-session range chart (60–106 b/shift, 53t range) |
MGC |
MGC_V1000 |
247,830 |
9.0 | 9.4 | 9.2 | 9.4 | #1 Gold all-session institutional volume chart (75–140 b/shift) |
MGC |
MGC_Renko_32 |
~140,000 |
8.8 | 9.3 | 9.4 | 9.4 | Preferred Gold all-session Renko chart (87–150 b/shift, 62t range) |
MGC |
MGC_M15 |
165,318 |
8.5 | 8.5 | 8.8 | 8.6 | Regime-invariant time chart (62–67t median bar across all 3 shifts) + 14:45 CT Master |
MGC |
MGC_D200 |
109,294 |
8.0 | 8.4 | 7.8 |
8.6 | US & ASIA Gold delta-impulse chart (53–69 b/shift) |
MGC |
MGC_RangeUS_0_25_25 |
402,985 |
7.5 | 8.6 | 9.3 | 7.5 |
EU (150 b/shift) & ASIA (250 b/shift) Gold specialist |
MCL |
MCL_Renko_12 |
309,099* |
9.0 | 9.0 | 9.3 | 9.4 | #1 Crude Oil all-session brick chart (76–124 b/shift, zero regime drift) |
MCL |
MCL_RangeUS_0_20_20 |
168,760* |
8.5 | 8.0 |
8.3 |
9.2 | #1 Crude Oil US NYMEX RTH structural range chart (27t range) |
MCL |
MCL_V500 |
271,245* |
8.5 | 8.2 |
8.8 | 9.1 | EU & US energy volume-flow chart (66–129 b/shift) |
MCL |
MCL_M15 |
127,391* |
8.0 | 7.6 |
8.4 | 8.5 | EU/US time chart + mandatory 14:45 CT re-pricing Master |
MCL |
MCL_RangeUS_0_12_12 |
442,167* |
7.5 | 9.0 | 9.1 | 7.6 |
ASIA (134 b/shift) & EU (110 b/shift) Crude Oil specialist |
MCL |
MCL_D200 |
84,943* |
7.5 | 7.0 |
7.4 |
8.4 | US NYMEX open (39 b/shift, 30t range) delta breakout chart |
MYM |
MYM_RangeUS_0_25_25 |
375,886 |
9.0 | 7.8 |
8.5 | 9.4 | #1 Micro Dow US (188 b/shift) & EU (53 b/shift) range chart |
MYM |
MYM_Renko_20 |
355,355 |
9.0 | 7.8 |
8.5 | 9.4 | Co-#1 Micro Dow US (177 b/shift) & EU (51 b/shift) brick chart |
MYM |
MYM_D100 |
~195,000 |
8.8 | 6.0 |
7.2 |
9.3 | #1 Micro Dow US (112 b/shift, 39t range) order-flow delta chart |
MYM |
MYM_V500 |
442,866 |
8.5 | 7.0 |
7.8 |
9.2 | US (205 b/shift) volume-flow chart |
MYM |
MYM_M15 |
164,620 |
8.0 | 7.0 |
8.3 | 8.6 | EU/US time chart + mandatory 14:45 CT re-pricing Master |
MYM |
MYM_RangeUS_0_15_15 |
978,358 |
6.5 | 9.1 | 9.2 | 6.0 |
ASIA (100 b/shift) & EU (134 b/shift) specialist ONLY (skip in US at 492 b/shift) |
M2K |
M2K_RangeUS_0_25_25 |
263,861 |
8.5 | 7.2 |
7.8 |
9.3 | #1 Micro Russell US (112 b/shift, 33t range) chart |
M2K |
M2K_Renko_20 |
247,981 |
8.5 | 7.2 |
7.8 |
9.3 | Co-#1 Micro Russell US (105 b/shift, 38t range) brick chart |
M2K |
M2K_D100 |
191,622 |
8.5 | 5.5 |
6.2 |
9.1 | #1 Micro Russell US (78 b/shift, 34t range) delta chart |
M2K |
M2K_V500 |
351,196 |
8.0 | 6.8 |
7.2 |
9.0 | US (135 b/shift, 32t range) volume chart |
M2K |
M2K_M15 |
164,700 |
7.5 | 6.8 |
7.8 |
8.4 | EU/US time chart + mandatory 14:45 CT re-pricing Master |
M2K |
M2K_RangeUS_0_15_15 |
689,156 |
6.5 | 8.9 | 9.1 | 6.5 |
ASIA (68 b/shift) & EU (84 b/shift) specialist ONLY (skip in US at 293 b/shift) |
B. Retired Charts Log (What Did Not Work & Why)
| Retired Date | Instrument & Chart | Bars (7Y) |
Overall Rating | Root Cause of Failure / Retirement |
|---|---|---|---|---|
2026-11-27 |
MNQ_V300 |
7,530,000 |
4.0 | 4,200+ bars/day; extreme micro-bar noise and 15× compute penalty vs V2500/V5000. |
2026-11-27 |
MNQ_RangeUS_0_15_15 |
6,045,669 |
4.2 | 15-tick ($7.50) range on 1,650t-ADR MNQ printed 3,400+ bars/day; friction-dominated. |
2026-11-27 |
MES_M1, MES_M5, MES_M10 |
240k–2.4M |
4.5–5.8 | On 316t-ADR MES, 1–10 min bars have median ranges of 4t–14t; 1–2 ticks of fill slippage destroys expectancy (MES_M15/M30 at 24t–34t median range are required). |
2026-11-27 |
MES_T1000, MES_T2000, MES_Renko_8 |
500k–1.0M |
4.8–5.5 | 8t–12t micro-bars on MES; outperformed 3× by MES_Renko_16, MES_Renko_24, and MES_RangeUS_0_20_20. |
2026-11-28 |
NQ_V300 |
3,376,423 |
4.5 | 1,790 bars/day (17.1s median bar in US RTH) + $5.00/tick (w_usd = 10.0) contract size breaks $0.50 eq-tick risk-parity granularity. |
2026-11-28 |
MNQ_T900 |
2,274,311 |
4.8 | Lowest diamond yield on MNQ (27.6% PF≥1.25, 6.1% elite) at 1,852 bars/day (1,430 in US RTH at 18.4s/bar). |
2026-11-28 |
MNQ_M1 |
2,435,542 |
5.0 | Lowest elite yield on MNQ (2.5% elite across 2,756 genomes) despite 2.44M bars (1,380 bars/day). |
2026-11-28 |
MES_V3000 |
611,550 |
6.2 | Lowest elite yield on MES (5.9% elite); 14t–16t median bar range in US RTH (325 bars/US shift) is too small relative to S&P fill friction. |
2026-11-28 |
MYM_D200 & MGC_Renko_20 |
72k / 380k |
7.0 / 8.0 | Replaced by MYM_D100 (8.8 — D200 printed only 4–5 bars/shift in Asia/EU) and MGC_Renko_32 (8.8 — Renko_20 jumped to 1,019 bars/day in 2026). |
5. Reproducible Pre-Ingestion Chart Audit Script
Whenever new Export_{INST}_{CHART}_*.csv files are placed in ~/Documents or ~/Downloads, run this one-liner via ./py.sh before running ./Backtesting/scripts/ingest_chart_data.sh:
./py.sh -c "
import sys, os, glob
sys.path.insert(0, 'Backtesting')
import pandas as pd, numpy as np
from engine.instrument_specs import get_instrument_spec
from engine import manage_data as md
REQ = {'SessionVWAP', 'SessionVAH', 'SessionVAL', 'NakedPDH', 'NakedPDL', 'NakedPDPOC', 'CandleVAH', 'PWH', 'PWVAL'}
for f in sorted(glob.glob(os.path.expanduser('~/Documents/Export_*.csv')) + glob.glob(os.path.expanduser('~/Downloads/Export_*.csv'))):
bn = os.path.basename(f)
inst = bn.split('_')[1]
ch = md.canonical_chart_from_filename(bn, inst)
tsize = get_instrument_spec(inst).tick_size
df = pd.read_csv(f, comment='#')
ok_cols = REQ.issubset(df.columns)
trunc, nom = md._check_raw_export_truncation(bn, df['Timestamp'].iloc[-1] if len(df) else None)
df['ts'] = pd.to_datetime(df['Timestamp'])
df = df[df['ts'] >= '2020-01-01'].copy()
df['rng_t'] = (df['High'] - df['Low']) / tsize
hr = df['ts'].dt.hour
df['sess'] = np.where((hr >= 8) & (hr < 16), 'US', np.where((hr >= 2) & (hr < 8), 'EU', 'ASIA'))
life_bd = float(df.groupby('SessionDay').size().median())
rec = df[df['ts'] >= '2025-01-01']
rec_days = max(1, rec['SessionDay'].nunique())
rec_bd = float(rec.groupby('SessionDay').size().median()) if len(rec) else life_bd
sc = rec.groupby('sess').size() / rec_days
sr = rec.groupby('sess')['rng_t'].median()
print(f'{inst}_{str(ch):<18} | cols={len(df.columns)}(ok={ok_cols}) trunc={trunc} | bars={len(df):>7,} days={df[\"SessionDay\"].nunique():>4} | '
f'b/d={life_bd:>5.1f}->{rec_bd:>5.1f} | ASIA:{sc.get(\"ASIA\",0):>5.1f}({sr.get(\"ASIA\",0):>4.1f}t) '
f'EU:{sc.get(\"EU\",0):>5.1f}({sr.get(\"EU\",0):>4.1f}t) US:{sc.get(\"US\",0):>5.1f}({sr.get(\"US\",0):>4.1f}t)')
"