Baseline v1: fix multi-trade bug, working confluence factors, PF=1.12 over 15 months
Some checks are pending
Build and Test / build (push) Waiting to run
Some checks are pending
Build and Test / build (push) Waiting to run
- 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=
This commit is contained in:
@@ -157,19 +157,19 @@ namespace NT8.Strategies.Examples
|
|||||||
? context.Session.SessionStart
|
? context.Session.SessionStart
|
||||||
: context.CurrentTime.Date.AddHours(9.5);
|
: context.CurrentTime.Date.AddHours(9.5);
|
||||||
|
|
||||||
// Validate session start is a legitimate RTH boundary (08:00-10:30 ET).
|
// Guard: only reset when the TRADING DATE has changed, not just the session
|
||||||
// Rejects spurious ETH-derived session boundaries that can reset _tradeTaken mid-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;
|
TimeSpan sessionStartTime = thisSessionStart.TimeOfDay;
|
||||||
bool isValidRthSessionStart = sessionStartTime >= new TimeSpan(8, 0, 0)
|
bool isValidRthSessionStart = sessionStartTime >= new TimeSpan(8, 0, 0)
|
||||||
&& sessionStartTime <= new TimeSpan(10, 30, 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
|
// Only trade during RTH
|
||||||
if (context.Session == null || !context.Session.IsRth)
|
if (context.Session == null || !context.Session.IsRth)
|
||||||
|
|||||||
Reference in New Issue
Block a user