From ae8ac0501793c2bf236734973b618951f72b8bea Mon Sep 17 00:00:00 2001 From: mo Date: Sun, 22 Mar 2026 19:26:17 -0400 Subject: [PATCH] Baseline v1: fix multi-trade bug, working confluence factors, PF=1.12 over 15 months - Fix BreakoutVolumeStrength: was always 0.50 due to self-referential volume comparison - Fix VolatilityRegime: was always ~0.50 due to single-bar value area baseline - Fix multi-trade-per-day: session reset now compares trading date not session timestamp - Add NT8.Strategies.dll to deploy script (was missing from every deployment) - Fix grade filter minimum from C to B (MinTradeGrade=4) - Add MinTradeGrade as configurable NinjaScript property - Fix confluence_score metadata: now stores full ConfluenceScore object not double - Baseline: B-grade long-only 30min ORB on ES, Jan 2025-Mar 2026 120 trades, 35.8% win rate, PF=1.12, Sharpe=0.18, MaxDD= --- src/NT8.Strategies/Examples/SimpleORBStrategy.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NT8.Strategies/Examples/SimpleORBStrategy.cs b/src/NT8.Strategies/Examples/SimpleORBStrategy.cs index f34857d..88e00a5 100644 --- a/src/NT8.Strategies/Examples/SimpleORBStrategy.cs +++ b/src/NT8.Strategies/Examples/SimpleORBStrategy.cs @@ -157,18 +157,18 @@ namespace NT8.Strategies.Examples ? context.Session.SessionStart : context.CurrentTime.Date.AddHours(9.5); - // Validate session start is a legitimate RTH boundary (08:00-10:30 ET). - // Rejects spurious ETH-derived session boundaries that can reset _tradeTaken mid-session. + // Guard: only reset when the TRADING DATE has changed, not just the session + // start timestamp. Using trading date prevents mid-session resets caused by + // _openingRangeStart holding a stale value from a previous day. + DateTime thisTradingDate = thisSessionStart.Date; + TimeSpan sessionStartTime = thisSessionStart.TimeOfDay; bool isValidRthSessionStart = sessionStartTime >= new TimeSpan(8, 0, 0) && sessionStartTime <= new TimeSpan(10, 30, 0); - if (isValidRthSessionStart) + if (isValidRthSessionStart && thisTradingDate != _currentSessionDate) { - if (thisSessionStart != _openingRangeStart || _currentSessionDate == DateTime.MinValue) - { - ResetSession(thisSessionStart); - } + ResetSession(thisSessionStart); } // Only trade during RTH