- NT8StrategyBase.cs: hide inert breakeven parameters with Browsable(false) and unused descriptions - SimpleORBNT8.cs: label settings export AutoBreakeven values as unused compatibility fields - NT8StrategyBaseBreakevenParamsTests.cs: add source assertions for hidden/inert parameters and no order-flow reads - SPRINT_BOARD.md/decisions.md: record Option A and verification evidence Build: clean | Tests: 555 passing; Core 466 passing | Dual-deployed: no - skipped by prompt
145 KiB
145 KiB
Architecture Decisions
Use this file to record durable project decisions that affect implementation patterns, interfaces, or workflow.
Decision Template
- ID: DEC-YYYYMMDD-XX
- Date:
- Status: proposed | accepted | superseded
- Context:
- Decision:
- Consequences:
- Related Files:
Decision Log
DEC-20260823-08
- ID: DEC-20260823-08
- Date: 2026-08-24
- Status: implemented
- Context: Mo reported watching several Grade-A
STATE:telemetry prints between 09:30-10:00 ET and asked why nothing traded — specifically noting these appeared to be "rejected because it wasn't 10AM yet." Investigatedsession_20260823_230519.logdirectly (continuous session, 2026-08-23 23:05 ET through 2026-08-24 20:20+ ET). - Finding 1 (not a defect — confirms by-design behavior): The 09:30-10:00 ET rejection is intentional and correct.
SimpleORBStrategy.OnBar()(~419-432) unconditionally rejects with reasonOrbRangeNotEstablished("ORB window still building") for any bar before the configured ORB window closes — an ORB strategy cannot evaluate a breakout of a range that hasn't finished forming. Confirmed the Grade-ASTATE:lines Mo saw in that window are a separate, always-on diagnostic telemetry stream (MaybeWriteStateTelemetry) that scores a hypothetical default-long intent (DirectionSource=DefaultLong, notOpeningRangeMidpoint) purely for dashboard visibility — confirmed via the log itself:STATE_CONTEXTomitsOrbHigh/OrbLow/OrbWindowStart/OrbWindowEnd/OrbReadyentirely before 10:00 ET, and only starts including them at10:04:59once the real ORB range exists. Nothing tradeable was missed; the real order-eligibility path was correctly blocked the whole time. - Finding 2 (real defect — logged as GAP-060): While confirming Finding 1, discovered the file log has zero visibility into reject reasons for the entire 09:30-16:00 ET trading day — a ~16-hour
REJECT SUMMARYblackout from23:55:01(Aug 23 night) to16:00:00(Aug 24 afternoon), spanning exactly the window Mo was asking about. Root cause traced toMaybeWriteRejectSummarySnapshot/LogRejectRateLimited(NT8StrategyBase.cs~1444-1496): (1) a blanketbarTime.TimeOfDay < 10:00 AMsuppression gate that blocks snapshots for the whole midnight-10am span every day, not just the ORB-forming window; (2)_orbRejectSummarySnapshotWrittenis a session-lifetime flag (reset only once, atWriteSessionHeader()), so on a multi-day continuous run it fires once — here, accidentally, during the first night's ETH activity at23:10:00— and then never again; (3) snapshots are only ever written as a side effect of some other reject occurring, with no independent timer, so a quiet stretch of the trading day goes dark even past the intended 15-minute cadence. Left open and flagged (not resolved) whetherOrbRangeNotEstablisheditself is even being counted during this window, since the one snapshot we do have (16:00:00) shows zero for that reason despite a full day with no confirmed breakout — the task must determine whether that's the same visibility defect or a second, distinct one. - Decision: Track as GAP-060. Logging/observability only — no order-flow, sizing, or risk logic involved. This directly explains why tonight's session couldn't answer "why didn't it trade" from the file log, and is a higher operational priority than GAP-059/051/052 (already queued) since it blocks diagnosing any future no-trade day, not just one telemetry factor.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs(MaybeWriteRejectSummarySnapshot/LogRejectRateLimited/ResetRejectTracking/WriteSessionHeader~1444-1517),src/NT8.Strategies/Examples/SimpleORBStrategy.cs(OnBar~355-432,RecordSignalRejection~1015-1026),session_20260823_230519.log - Implementation Note (2026-08-25): GAP-060 implemented as logging/observability only.
NT8StrategyBase.MaybeWriteRejectSummarySnapshot()no longer has a blanket midnight-to-10:00 AM suppression gate; suppression now delegates to an ORB-window-aware helper andSimpleORBNT8overrides that helper so the suppressed window is today's configured 09:30 +OpeningRangeMinutes. The once-after-ORB snapshot flag now resets perbarTime.Date, allowing a new post-ORB summary every day in a continuous multi-day session.OnBarUpdate()now callsMaybeWriteRejectSummarySnapshot(Time[0])on the live bar heartbeat after the first realtime-bar guard, so 15-minute summary cadence can flush from regular processed bars and is not solely dependent on a newly logged reject. Existing_rejectDetailsLoggedone-detail-line-per-reason rate limiting, reject reason strings,REJECT:/REJECT SUMMARY:formats, order flow, sizing, risk, and real trade decisions were unchanged. Open question resolved as possibility (a): the missingOrbRangeNotEstablishedvisibility was adapter summary reporting, not a second SimpleORB rejection defect. A focusedSimpleORBStrategy.OnBar()test proves the no-breakout RTH path recordsOrbRangeNotEstablishedboth while the ORB is building and after ORB close when no breakout confirms. Verification: focused GAP-060 tests passed 8/8;verify-build.batpassed with 543/543 tests (454 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 454/454. - Action Required: Deployment remains pending.
deployment\deploy-to-nt8.batwas attempted on 2026-08-25 but failed because NinjaTrader.exe PID 18800 lockedNT8.Core.dll; operator instructed Kilocode to commit without deploy. After NinjaTrader is closed, rerun deployment, start NT8, manually compile NinjaScript, and in the next SIM session spanning a full trading day confirmREJECT SUMMARYappears throughout RTH at a reasonable cadence.
DEC-20260825-02
- ID: DEC-20260825-02
- Date: 2026-08-25
- Status: implemented
- Context: GAP-053 was flagged by the original v7.0 review as
executive_summary.md/roadmap.md's Sprint 3 list presenting ~12 completed tasks as open.roadmap.mdalready contained its ownSTALE-LIST WARNING (GAP-053, added 2026-08-18)naming the specific stale items (TASK-06a, TASK-06b, GAP-003/004/005/006/008/009/010/019/022, plus GAP-011/GAP-040 separately), andexecutive_summary.mdstill listed four of the same already-completed items under "Critical Open Issues." - Decision: Prune only independently verified stale items from
executive_summary.mdandroadmap.md. Documentation-only, zero trading-behaviour risk. - Implementation Note (2026-08-25): Verified against
SPRINT_BOARD.mdhistorical records and decision entries before pruning: TASK-06a, TASK-06b, GAP-003, GAP-004, GAP-005, GAP-006, GAP-008, GAP-009, GAP-010, GAP-011, and GAP-019 are complete from the 2026-07-11 historical record; GAP-022 is partial with 5/8 verified on 2026-07-14 and remaining connection-state scenarios tracked as GAP-022-FOLLOWUP; GAP-040 is implemented/firing in production as of 2026-08-18.executive_summary.mdnow points at the v7.0 master reference, moves the four v6 critical issues into a resolved-since-v6 section, and lists current open items instead.roadmap.mdno longer contains theSTALE-LIST WARNINGor the open-looking July list; it records the pruned resolved history and leaves GAP-030/GAP-007 separate. No source code or tests changed. - Related Files:
docs/00-governance/executive_summary.md,docs/00-governance/roadmap.md,TASK_GAP053_STALE_DOCS_PRUNE_PROMPT.md - Action Required: None. Documentation-only; no operator validation required.
DEC-20260823-07
- ID: DEC-20260823-07
- Date: 2026-08-23/24
- Status: implemented
- Context: GAP-052 was flagged by the original v7.0 review as "two hardcoded tick-value tables" without further detail. Confirmed duplicated
GetTickValue(string symbol)helpers in Basic risk/sizing and additional Advanced risk/sizing helpers. The concrete defect was6A:BasicPositionSizerused$10.00whileBasicRiskManagerfell through to$12.50, producing a 25% risk-calculation mismatch if 6A were traded. NQ/MNQ were already consistent and remain unchanged. - Decision: Implement Option A — a shared static table — because
BasicRiskManager,BasicPositionSizer,AdvancedRiskManager, andAdvancedPositionSizerlive in platform-neutralNT8.Coreand cannot directly depend on NinjaTraderInstrument.MasterInstrumentAPIs without changing project layering. Option B remains a possible future adapter-supplied enhancement, not part of this platform-neutral fix. - Implementation Note (2026-08-25): Added
NT8.Core.Common.InstrumentTickValueTablewith the union of existing supported symbols (ES,MES,NQ,MNQ,CL,GC,6E,6A) and updated all four risk/sizing helpers to delegate to it. This fixes the concrete6Adefect ($10.00instead of the old BasicRiskManager$12.50default) and removes the duplicated hardcoded tables from those helpers. Verification: focusedBasicRiskManagerTestspassed 26/26;verify-build.batpassed with 552/552 tests (463 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 463/463. - Related Files:
src/NT8.Core/Common/InstrumentTickValueTable.cs,src/NT8.Core/Risk/BasicRiskManager.cs,src/NT8.Core/Sizing/BasicPositionSizer.cs,src/NT8.Core/Risk/AdvancedRiskManager.cs,src/NT8.Core/Sizing/AdvancedPositionSizer.cs,tests/NT8.Core.Tests/Risk/BasicRiskManagerTests.cs,TASK_GAP052_TICK_VALUE_CONSOLIDATION_PROMPT.md - Action Required: Deployment intentionally skipped per operator instruction. No operator validation required for currently traded NQ/MNQ; both remain unchanged at
$5.00/$0.50.
DEC-20260823-06
- ID: DEC-20260823-06
- Date: 2026-08-23/24
- Status: implemented
- Context: GAP-051 was flagged by the original v7.0 review as
MicroUpgradeThresholdfires every session.MonitorMicroAccountUpgrade()guarded on an in-memory_microUpgradeSuggestedflag, but that flag reset duringState.SetDefaults, so an account already above threshold re-loggedTIER_UPGRADE_SUGGESTEDon every restart. - Decision: Implement Option A from the task prompt: persist the suggested-state once per account lifetime in a small dedicated file, rather than accepting per-session reminders. This preserves the existing one-time advisory intent and avoids restart log noise without changing any trading behavior.
- Implementation Note (2026-08-25):
NT8StrategyBasenow loadsmicro_upgrade_suggested_<Account>.jsononly in realtime whenAccount != null, suppresses repeatTIER_UPGRADE_SUGGESTEDmessages whensuggested=trueis already present, and writes the dedicated JSON file only after the existing advisory message fires. Missing/corrupt persistence files fall back to allowing the reminder and emit a warning, because over-reminding is safer than suppressing the advisory forever. TheTIER_UPGRADE_SUGGESTEDmessage format,RiskTier, order flow, sizing, risk validation, and reject/signal behavior were unchanged. Verification: focused GAP-051 tests passed 5/5;verify-build.batpassed with 550/550 tests (461 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 461/461. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,tests/NT8.Core.Tests/Adapters/NT8StrategyBaseMicroUpgradeTests.cs,TASK_GAP051_MICRO_UPGRADE_PERSISTENCE_PROMPT.md - Action Required: Deployment intentionally skipped per operator instruction. If visual confirmation is desired later, close NinjaTrader, rerun deployment, manually compile NinjaScript, then restart twice on an above-threshold account and confirm the second restart does not re-log
TIER_UPGRADE_SUGGESTED.
DEC-20260823-05
- ID: DEC-20260823-05
- Date: 2026-08-23/24 (live SIM session spanning midnight)
- Status: implemented
- Context: Continuing tonight's post-compile SIM validation (
session_20260823_230519.log),STATE_DETAILlines from 08:29 ET through 10:49 ET (well past the 09:30-10:00 ORB window, withSTATE_CONTEXTconfirmingOrbReady=True OrbHigh=29243.00 OrbLow=28946.75) all still reportOrbRangeVsAtr="No daily bar context available"— the exact second symptom GAP-049's task description originally flagged, and which DEC-20260823-03's Action Required specifically asked to be re-checked live.GapDirectionAlignmentis confirmed working correctly in the same lines (e.g.Large gap -278.25 aligns with trade), so this is not a re-occurrence of the direction bug — it's a distinct, still-open issue. - Root cause:
OrbRangeVsAtrFactorCalculator.Calculate()requiresintent.Metadata["orb_range_ticks"]to be present. GAP-049's fix correctly adds that key whentelemetryDaily.OrbRangeTicks > 0.0, buttelemetryDaily.OrbRangeTickscopied the adapter-built_strategyConfig.Parameters["daily_bars"].OrbRangeTicks. That source was built inSimpleORBNT8.OnBarUpdate()from local fields_openingRangeHigh/_openingRangeLow, which were declared/read but never assigned, so the ORB range stayed0.0and telemetry never emittedorb_range_ticks. - Decision: Track as GAP-059 and fix the adapter daily-context data source only. Source
orbHigh/orbLowfrom(_sdkStrategy as SdkSimpleORB).OpeningRangeHigh/OpeningRangeLowwhenOpeningRangeReadyis true, matching the existingSTATE_CONTEXTand diagnostics source of truth, and remove the dead legacy fields. - Implementation Note (2026-08-25): GAP-059 implemented in
SimpleORBNT8.OnBarUpdate()by readingSdkSimpleORB sdkOrb = _sdkStrategy as SdkSimpleORBand usingsdkOrb.OpeningRangeHigh/sdkOrb.OpeningRangeLowonly whensdkOrb.OpeningRangeReadyis true. The unused_openingRangeHighand_openingRangeLowadapter fields were removed after search confirmed no writer existed.OrbRangeVsAtrFactorCalculator, GAP-049's telemetry clone, signal generation, sizing, risk, order submission, and line formats were unchanged. Scope nuance: the SDK strategy does read_config.Parameters["daily_bars"]for daily context, but real ORB-range metadata is still set fromSimpleORBStrategy.CreateIntent()/AttachDailyBarContext()once a real candidate exists; this fix corrects the adapter's stale daily-context source feeding telemetry and shared daily context. - Evidence: Added source-level
SimpleORBNT8DefaultsTestscoverage because NinjaScript strategies are not directly instantiated in normal Core tests; addedOrbConfluenceFactorTestscoverage proving realistic SDK ORB high/low-derived ticks produce a ratio-basedOrbRangeVsAtrreason instead of the neutral missing-context reason. Focused GAP-059 tests passed 32/32.verify-build.batpassed with 545/545 tests (456 Core, 79 Integration, 10 Performance).dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 456/456. - Action Required: Deployment remains pending.
deployment\deploy-to-nt8.batwas not rerun because NinjaTrader.exe PID 18800 remained active and previously lockedNT8.Core.dll; operator instructed Kilocode to commit without deploy. After NinjaTrader is closed, rerun deployment, start NT8, manually compile NinjaScript, and confirm a post-OrbReady=TrueSTATE_DETAILline reports a ratio-basedOrbRangeVsAtrreason instead ofNo daily bar context available.
DEC-20260823-03
- ID: DEC-20260823-03
- Date: 2026-08-23
- Status: implemented
- Context: GAP-049 found that
SimpleORBNT8.BuildStateTelemetryIntent()attached the shared_strategyConfig.Parameters["daily_bars"]object directly to syntheticSTATE:telemetry.GapDirectionAlignmentCalculatorandPriorDayCloseStrengthCalculatorreadDailyBarContext.TradeDirection, but the telemetry path deliberately does not callSimpleORBStrategy.AttachDailyBarContext()because that real-trade helper mutates shared daily context fields. Result: short telemetry could retain a stale long direction and log a downward gap as "opposes trade." The same log block also showedOrbRangeVsAtr="No daily bar context available"because telemetry had daily context but did not include the separateorb_range_ticksmetadata key required by that factor. - Decision: Keep GAP-049 observability-only by fixing only the synthetic telemetry path.
SimpleORBNT8.BuildStateTelemetryIntent()now builds a clone of theDailyBarContext, sets clone-only scalar fields from telemetry inputs (TradeDirection,BreakoutBarVolume,TodayOpen,AvgIntradayBarVolume), attaches that clone asdaily_bars, and addsorb_range_ticksmetadata from the cloned context. NoSIGNAL,SUBMIT,FILL,PNL_UPDATE,REJECT, sizing, risk, order submission, or real trade-decision path was changed. - P1-E Finding: The cited
-523.25point gap was a data-alignment defect in telemetry, not a real overnight NQ gap. The session logsession_20260818_071117.logreported different gap values throughout the same RTH session, ranging from roughly-389.75to-555.75, which cannot represent a fixed overnight open gap. External NQ SEP26 daily data showed 2026-08-17 close30096.00and 2026-08-18 open30077.00, a-19.00daily gap. Root cause: telemetry seededDailyBarContext.TodayOpenfrom the current primary bar'sOpen[0]; the clone now mirrors the real trade path and preferscontext.CustomData["session_open_price"]. - Evidence: Added source-level tests proving telemetry uses
CloneDailyBarContextForTelemetry, attaches the clone rather than the shared daily context, and emitsorb_range_ticks; added a factor test proving a large down gap with sell direction scores1.0and says "aligns with trade," not "opposes trade." Focused GAP-049 tests passed 30/30.verify-build.batpassed with 538/538 tests (449 Core, 79 Integration, 10 Performance).dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 449/449.deployment\deploy-to-nt8.batcompleted with backup20260823_151931and notedNinjaTrader.Custom.dllwas not present to invalidate. - Related Files:
src/NT8.Adapters/Strategies/SimpleORBNT8.cs,tests/NT8.Core.Tests/Adapters/SimpleORBNT8DefaultsTests.cs,tests/NT8.Core.Tests/Intelligence/OrbConfluenceFactorTests.cs,TASK_GAP049_TELEMETRY_DIRECTION_PROMPT.md - Action Required: Manual NT8 startup/compile remains required for NinjaScript source. In the next live/SIM diagnostic session, confirm
STATE_DETAILfor a sell setup with a down gap reportsGapDirectionAlignmentas aligned andOrbRangeVsAtrno longer says no daily context when daily warm-up is satisfied.
DEC-20260823-02
- ID: DEC-20260823-02
- Date: 2026-08-23
- Status: implemented
- Context: Discovered while independently verifying the GAP-048 implementation (
e36534b). Two of the three new tests intests/NT8.Core.Tests/Strategies/SimpleORBRejectionLoggingTests.cs(OnBar_BelowThresholdGrade_RecordsGradeFilterRejectLineWithScore,OnBar_RegimeVeto_RecordsRegimeVetoRejectLine) are legitimate — they call real production code (OnBar/RecordSignalRejectionvia reflection) and assert on its actual output. The third,RejectLineFormat_DiffersOnlyByReasonToken, is not: it hand-constructs two literal strings that were written to differ only by thereason=token, replaces that token with a placeholder in both, and asserts the results are equal. That assertion is true by construction — it never calls any production formatting code, so it cannot fail regardless of whetherNT8StrategyBase.cs/SimpleORBStrategy.csactually preserve the line format. Same defect class as the GAP-022 precedent this project already treats as a known failure mode (fabricated coverage that reads as a real regression test but tests nothing). - Decision: Track as GAP-058. Not blocking — the two real tests plus the byte-diff review already performed (
git show e36534b, confirmed onlyreason=tokens changed) give adequate confidence GAP-048 itself is correct. Recommended fix, low priority: replace the third test with one that drives the actual reject-line-emitting path (e.g. invoke the same code with two different reasons and diff the real output), or delete it if the two real tests are judged sufficient coverage on their own. - Related Files:
tests/NT8.Core.Tests/Strategies/SimpleORBRejectionLoggingTests.cs,TASK_GAP048_REJECT_TAXONOMY_PROMPT.md - Implementation Note (2026-08-23): GAP-058 replaced the tautological
RejectLineFormat_DiffersOnlyByReasonTokenliteral comparison with a test that invokesSimpleORBStrategy.RecordSignalRejectiontwice through the existing reflection helper, once withGradeFilterand once withRegimeVeto, then normalizes only thereason=token and compares the two real emitted lines. No production code changed. - Action Required: None.
DEC-20260823-01
- ID: DEC-20260823-01
- Date: 2026-08-23
- Status: accepted (2026-08-23)
- Operator Decision (2026-08-23): Approved — proceed with the designed weights.
- Implementation approach resolved (Claude, 2026-08-23): Read
ConfluenceScorer.csdirectly rather than assume. Two things confirmed that shape Part 2: (1)Score()'s composite (weightedScoreSum / totalWeight, ~line 183) already normalizes dynamically by whatever weights are actually applied — it is NOT hardcoded to divide by 10 or 5.85, so there is no separate normalization defect to fix; removing the bug is sufficient on its own. (2) The five wrong weights are hardcoded1.0literals in the constructor (ConfluenceScorer.cs~113-117) rather than the calculators' own designed values ever being consulted, even though aResolveWeight()/UpdateFactorWeights()mechanism already exists to make the dictionary the authoritative source — this reads as a placeholder value that was never replaced, not an architectural gap. Resolved fix: change the five literals directly (NarrowRange 1.0→0.20,OrbRangeVsAtr 1.0→0.15,GapDirectionAlignment 1.0→0.15,BreakoutVolumeStrength 1.0→0.20,PriorDayCloseStrength 1.0→0.15, verified againstFactorCalculators.cslines 569/670/797/897/1021) rather than removing the pre-population and routing throughResolveWeight's fallback path — smaller diff, same result, keeps the dictionary as the single source of truth the API already assumes. The "configuration-driven" alternative floated in the original task is not pursued now — no scenario surfaced that needs it, and it would add parameter surface for no behavioral benefit. Flag if you want it anyway. - Context: GAP-047 Part 1 completed the offline equal-weight versus designed-weight re-scoring study against existing NT8 SDK session logs. The study scanned 182
session_*.logfiles underC:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk, includingARCHIVE, and reproduced the required worked example fromsession_20260818_071117.logat 10:10:11.833: equal=0.640, designed=0.727. TheSTATE:telemetry population remains direction-degraded by GAP-049 and is reported separately from real signal samples. No runtime trading code was changed. - Evidence:
tools/rescore/GAP-047_weight_rescore_output.mdand.json. Headline results:STATE:telemetry samples=923, designed weights crossed A while equal weights did not in 82 samples and crossed B while equal weights did not in 164 samples. Real signal factor samples=81, designed weights crossed A while equal weights did not in 25 samples. Current logs contained 0SIGNAL_DETAIL:lines; signal scoring used realSIGNALlines followed by their numericFactors:breakdowns. - Decision: Replace the accidental equal 1.00 weights with the designed factor weights, per the resolved implementation approach above. Staged as
TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md. - Consequences: Designed weights will materially increase grade eligibility in the direction-degraded telemetry population and upgrade a meaningful subset of real signal samples to Grade A — this is the intended effect, directly targeting the low-trade-frequency problem. Because some real signal samples also downgrade under designed weights, this is a scoring-policy change, not a pure relaxation — expect a shift in which setups qualify, not just how many. Unlike GAP-054, this change is fully testable in the platform-neutral
NT8.Corelayer with ordinary unit tests — no NinjaTrader-specific managed-order call is involved, so no SIM trade is required to prove correctness (seeTASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.mdValidation). A fresh gate configuration freeze/baseline is still required before any gate evidence is collected after this lands, since trade-qualification behavior changes. Also worth revisiting once live: the workspace currently runsMinTradeGrade=4(B) while the Gate 3 plan targetsMinTradeGrade=A(5) — now that Grade A is actually reachable, the operator may want to reconsider which threshold to gate on. - Related Files:
tools/rescore/rescore_weights.py,tools/rescore/GAP-047_weight_rescore_output.md,tools/rescore/GAP-047_weight_rescore_output.json,TASK_GAP047_WEIGHT_RESCORE_PROMPT.md,TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md,src/NT8.Core/Intelligence/ConfluenceScorer.cs - Implementation Note (2026-08-23): Implemented in
src/NT8.Core/Intelligence/ConfluenceScorer.csby changing only the five approved constructor baseline weights:NarrowRange=0.20,OrbRangeVsAtr=0.15,GapDirectionAlignment=0.15,BreakoutVolumeStrength=0.20, andPriorDayCloseStrength=0.15.Score()normalization,ResolveWeight(),UpdateFactorWeights(), factor calculators, grade thresholds, and adapter/NinjaScript files were left unchanged. AddedConfluenceScorerTestscoverage proving the default total weight is 5.85, the 2026-08-18 10:10:11.833 worked example now scores 0.727 / Grade B instead of the old 0.640, andUpdateFactorWeights()still overrides the new baseline. Verification:verify-build.batpassed with 514/514 tests (425 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 425/425;deployment\deploy-to-nt8.batcompleted with backup20260823_135331and notedNinjaTrader.Custom.dllwas not present to invalidate. - Action Required: Fresh Gate 3 configuration freeze/baseline is required before collecting gate evidence after this scoring-policy change. Manual NT8 compile remains part of normal deploy hygiene, but no SIM trade is required for correctness.
DEC-20260821-01
- ID: DEC-20260821-01
- Date: 2026-08-21
- Status: logged, no operator decision needed — tracking only
- Context: Discovered while independently verifying the GAP-054 implementation (source read of
NT8StrategyBase.cs). Two small residual items surfaced that the GAP-054 task didn't require closing but that shouldn't get lost:- GAP-056 —
EnableAutoBreakeven/BreakevenTriggerTicks/BreakevenOffsetTicksare now fully inert. The only code path that ever read them was the runner breakeven block GAP-054 removed; there was never a separate scaler-leg breakeven implementation. All three parameters remain declared and defaulted in the strategy's NinjaTrader UI but do nothing. Not a trading-risk item — inert means harmless — but an operator settingEnableAutoBreakeven=truein the UI would reasonably expect it to do something. Recommended fix, low priority: either mark the parameters[Browsable(false)]/update theirDescriptionattributes to state they're currently unused, or remove them outright in a later cleanup pass. - GAP-057 — no test seam exposes NinjaScript's
SetStopLoss/SetTrailStopmanaged-order calls.TASK_GAP054_RUNNER_TRAIL_PROMPT.mdasked for a regression test asserting noSetStopLosscall is issued afterSetTrailStopfor a runner signal, with instructions to propose the smallest seam if none exists. Kilocode correctly did not fabricate coverage, but a concrete seam proposal wasn't written up. This is the same defect class as GAP-054 (silent exit-order clobbering) — worth closing so a future change to this block gets real regression coverage instead of relying on manual source review, as this review just did.
- GAP-056 —
- Decision: Track both, do not action either as part of GAP-054. No operator decision required to log them.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,TASK_GAP054_RUNNER_TRAIL_PROMPT.md - GAP-056 Implementation Note (2026-08-25): Implemented Option A for the inert breakeven parameters.
EnableAutoBreakeven,BreakevenTriggerTicks, andBreakevenOffsetTicksremain declared/defaulted for saved workspace and settings compatibility, but are now[Browsable(false)]and theirDisplaydescriptions state they are currently unused.SimpleORBNT8settings export now labels the values asUNUSED (retained for compatibility). This is reversible and avoids breaking persisted templates; Option B removal was not chosen because there was no concrete need to delete the fields and no benefit worth risking workspace/settings references. Added source-level tests proving the properties are hidden/marked unused and not read byOnBarUpdate()orSubmitOrderToNT8(). Verification: focused GAP-056 tests passed 3/3;verify-build.batpassed with 555/555 tests (466 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 466/466. Deploy intentionally skipped by task prompt. - Action Required: GAP-056 complete. GAP-057 remains ready as the remaining follow-up from this decision.
DEC-20260819-01
- ID: DEC-20260819-01
- Date: 2026-08-19
- Status: accepted
- Context: DEC-20260818-19 resolved the MaxTradeRisk/MaxStopTicks collision by moving the traded instrument from NQ to MNQ. This is a materially larger change than the other five items staged 2026-08-18: it changes
ConfigHash, invalidates every settings/provenance export and gate-run comparison made under NQ, and interacts with the roadmap's Stage 2 instrument sequencing (Section 9.5, P2-0, already documented in the v7.0 master document as a future step — this decision brings it forward rather than introducing it new). Layering an instrument cutover on top of unvalidated defect fixes (GAP-054, GAP-045/046, GAP-055) would make it impossible to tell, if something went wrong, whether the cause was a code defect or the instrument switch. - Decision: Sequence the MNQ cutover as its own final step, after — not concurrent with — the code-level fixes:
- Land and validate GAP-048, GAP-047 (Part 1), GAP-054, GAP-045/046 (Parts 1-3), GAP-055 on the current NQ configuration, in SIM/replay, per each task's own validation section.
- Only once all of the above pass validation, execute the MNQ instrument cutover: confirm MNQ is present in both hardcoded tick-value tables (GAP-052 —
BasicRiskManager.GetTickValueandBasicPositionSizer.GetTickValue), reconfigure the strategy instance to MNQ, and re-tuneMaxTradeRisk/MaxStopTicks/MaxContractsfor MNQ's $0.50/tick economics rather than leaving NQ-era values in place unexamined. - Run
preflight.ps1 --freezeand produce a newDEC-GATE3-CONFIGfor the MNQ configuration before any gate-run evidence is collected on it. Prior NQ-based gate evidence remains valid for its own record but is not comparable to post-cutover results.
- Consequences: Adds a discrete cutover step to the roadmap rather than folding it into GAP-045/046; keeps defect-fix validation and instrument-change validation from being confounded. Historical Strategy Analyzer/backtest results tied to NQ tick economics are not directly comparable post-cutover.
- Related Files:
docs/00-governance/decisions.md,docs/00-governance/roadmap.md,TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md,docs/00-governance/2026-08-19-run-book.md - Action Required: Execute in the order above. Flag to Claude/Mo once step 1 items are all validated so the MNQ cutover task can be staged as its own TASK_*.md prompt.
DEC-20260818-21
- ID: DEC-20260818-21
- Date: 2026-08-18
- Status: accepted (2026-08-19)
- Operator Decision (2026-08-19): Accepted as proposed — persist the daily trade count using the DEC-20260818-17 halt-file pattern, rehydrate at
State.Realtime, align to the CME 18:00 ET rollover. - Context:
MaxDailyTradesis enforced from_dailyTradeCount, a plain in-memory field inSimpleORBStrategy.cs(~39) zeroed at construction (~269) and on session rollover (~756, ~961). Nothing persists it across a strategy stop/start. The CME trading date 2026-08-17 (beginning 18:00 ET Sunday 08-16) took two trades underMaxDailyTrades=1: 08-16 19:12 (+$277.72,session_20260816_181528.log) and 08-17 11:04 (+$267.72,session_20260817_110049.log), in two different NT8 sessions. NT8 itself treated them as one trading day — the firstPNL_UPDATEof the 11:04 trade readsDayPnL=$271.96(the prior trade's $277.72 less the $5.76 entry commission) and the session closes atDayPnL=$545.44. This is the same class as the 7/28 breach that contributed to voiding Gate Run #2 (HIST-45) and is NOT closed by GAP-032, which fixed the within-session position-flat reset only. - Decision: Persist
{trading_date, daily_trade_count, account, strategy_name, symbol}to{LogDirectory}/daily_trade_count_<AccountName>_<StrategyName>.jsonon each increment, and rehydrate atState.Realtimeentry when the persisted trading date matches. Reuse the persistence pattern already established for the Conservative trailing-drawdown halt file (DEC-20260818-17) rather than inventing a second mechanism. Align the trading-date boundary with the CME session rollover (18:00 ET) rather than the calendar date, usingSessionManageror NT8's own session date if either already exposes it. Strategy Analyzer/backtest (Account == null) must neither read nor write the file so backtest behaviour is byte-for-byte unchanged. - Consequences: Gate discipline explicitly contemplates restarts (recompiles, workspace changes, connection recovery), so without this a gate run under
MaxDailyTrades=1cannot guarantee its own cap and its sample is uninterpretable in the same way the previous two were. Adds a small file-I/O dependency to the realtime path; a missing or corrupt file must degrade to count-zero plus a WARNING, never an exception. - Related Files:
src/NT8.Strategies/Examples/SimpleORBStrategy.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md,docs/00-governance/decisions.md - Implementation Note (2026-08-23): Implemented as opt-in live/SIM persistence from the adapter into
SimpleORBStrategy.NT8StrategyBaseenables persistence only whenAccount != null, passes account/name/resolved log directory metadata atState.Realtime, and also includes the metadata on realtime contexts.SimpleORBNT8seeds the same metadata into the sharedStrategyConfig.SimpleORBStrategyrehydrates once per trading date on the first realtime-eligible bar after session reset, restores when the file date matches, resets and overwrites when the date differs, writes after every daily-count increment, and logs eitherDAILY_TRADE_COUNT restored: date=<yyyy-MM-dd> count=<n> max=<n>orDAILY_TRADE_COUNT reset: new trading date <yyyy-MM-dd>. Missing/corrupt/unreadable files degrade to count zero plusDAILY_TRADE_COUNT warning...without throwing. Trading date follows the adapter/session date already used byBuildSessionInfo()/MarketSession.SessionStart, so 2026-08-16 19:12 ET and 2026-08-17 11:04 ET both resolve to trading date 2026-08-17. Backtest/Strategy Analyzer contexts withAccount == nulldo not read or write state even if persistence parameters are present. The file key is exactly the approved{AccountName}_{StrategyName}path;symbolis recorded in the payload, but multiple same-account/same-strategy instances intentionally share the counter and distinct per-instance keys remain out of scope. - Verification (2026-08-23): Added tests for same-date restore, new-date reset/overwrite, corrupt-file warning/no throw,
Account == nullno-read/no-write behavior, and the 2026-08-16 19:12 / 2026-08-17 11:04 same-CME-date restart scenario.verify-build.batpassed 521/521 tests (432 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 432/432;deployment\deploy-to-nt8.batcompleted with backup20260823_143311and notedNinjaTrader.Custom.dllwas not present to invalidate. - Action Required: Manually compile in NinjaTrader, then validate in SIM by taking one trade, stopping/restarting the strategy on the same trading day, and confirming the next signal is rejected with
REJECT: reason=MaxDailyTrades.
DEC-20260818-20
- ID: DEC-20260818-20
- Date: 2026-08-18
- Status: accepted (2026-08-19)
- Operator Decision (2026-08-19): Taxonomy split approved as proposed — no changes to the vocabulary list.
- Context: Three of the nine reject reasons in production are overloaded.
KillSwitchis emitted by four distinct paths inNT8StrategyBase.cs— the actual kill switch (~721), a portfolio-risk block (~1970), a Tier 1 per-strategy risk rejection (~2000) and a circuit-breaker open (~2055).GradeFilteris emitted by four paths acrossNT8StrategyBase.cs(~1979, ~1986, ~2020) andSimpleORBStrategy.cs(~613/~622, ~650).TrailingDrawdownBreachcovers both a genuine breach and an unconfigured monitor.REJECT SUMMARYaggregates onreason, andLogRejectRateLimited()emits the disambiguatingdetailline only on the first occurrence per reason, so the aggregate counts are the only thing an operator or the dashboard sees. Demonstrated:session_20260817_082103.logloggedreason=KillSwitch count=647from a real kill switch, andsession_20260818_071117.logloggedreason=KillSwitch count=5from aMaxTradeRiskrejection. This directly defeats the purpose GAP-035 was built for. - Decision: Split the reject vocabulary into distinct reasons —
KillSwitch,PortfolioRisk,MaxTradeRisk,CircuitBreaker,LongTradesDisabled,ShortTradesDisabled,SizeBelowMinContracts,RegimeVeto,GradeFilter(genuine grade rejection only),TrailingDrawdownBreach(real breach only) andTrailingDrawdownNotConfigured. Logging only: no guard condition, ordering or outcome may change, and theREJECT:/REJECT SUMMARY:line formats must remain byte-identical apart from thereason=token. TheHistoricalReplayCatchupexemption insideLogRejectRateLimited()(DEC-20260818-08) is preserved. - Consequences: The reason vocabulary becomes a contract for
tools/dashboard/parsers.py,tools/logtriage/logtriage.pyandtools/logwatch/logwatch.py; those parsers are believed reason-agnostic and must be read to confirm it rather than assumed. Splitting reasons slightly increasesREJECT:detail-line volume, since rate limiting is per unique reason.OrbRangeNotEstablishedretains its three sub-states under one reason for now — they are already distinguishable indetailand this is lower priority. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Strategies/Examples/SimpleORBStrategy.cs,tools/dashboard/parsers.py,tools/logtriage/logtriage.py,tools/logwatch/logwatch.py,TASK_GAP048_REJECT_TAXONOMY_PROMPT.md - Implementation Note (2026-08-23): Implemented the accepted vocabulary without changing guard conditions, ordering, outcomes, or
REJECT:/REJECT SUMMARY:formats. Final mapping: actual kill switch remainsKillSwitch; portfolio block ->PortfolioRisk; risk-manager/Tier 1 rejection ->MaxTradeRisk; circuit breaker ->CircuitBreaker; disabled long/short directions ->LongTradesDisabled/ShortTradesDisabled; size below minimum ->SizeBelowMinContracts; SimpleORB AVWAP regime veto ->RegimeVeto; genuine confluence grade threshold rejection remainsGradeFilter; real trailing drawdown halt remainsTrailingDrawdownBreach; unconfigured trailing drawdown monitor ->TrailingDrawdownNotConfigured;OrbRangeNotEstablishedremains unchanged. Verifiedtools/dashboard/parsers.py,tools/logtriage/logtriage.py, andtools/logwatch/logwatch.pyparse reasons generically; updated the dashboard's blocking-reason set so split blocking reasons continue feeding missed-setup approximation. Added SimpleORB tests proving genuine grade rejection remainsGradeFilter,RegimeVetorecords the same line format, and the line differs only byreason=token. Verification:verify-build.batpassed with 516/516 tests (427 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 427/427;python -m py_compile tools\dashboard\parsers.py tools\logtriage\logtriage.py tools\logwatch\logwatch.pypassed;deployment\deploy-to-nt8.batcompleted with backup20260823_142014and notedNinjaTrader.Custom.dllwas not present to invalidate. - Action Required: In the next live/SIM diagnostic session, confirm
REJECT SUMMARYdisplays distinct reasons and the dashboard rejection panels render them without frontend changes. Manual NT8 compile remains required after deploy.
DEC-20260818-19
- ID: DEC-20260818-19
- Date: 2026-08-18
- Status: accepted (2026-08-19). Both decisions made.
- Operator Decision (2026-08-19): Decision 1 → (c) move to MNQ. Decision 2 → per-position (total), not per-contract. MaxTradeRisk is now the ceiling on total single-trade dollar risk across all contracts in the position, not a per-contract stop-distance ceiling.
- Consequence of Decision 2 for the Tier 1 check: the ordering change flagged as "must not be made without an approved decision" in the original entry is now approved.
BasicRiskManager's Tier 1 check must move to afterBasicPositionSizerdetermines quantity (or take an estimated/candidate quantity) so thatStopTicks × tickValue × Qty ≤ MaxTradeRiskis the actual enforced inequality, replacing today'sStopTicks × tickValue ≤ MaxTradeRiskwith noQtyterm. - Consequence of Decision 2 for Part 1 Assertion D (TASK_GAP045_GAP046): under per-contract semantics the original assertion was
MaxTradeRisk × MaxContracts ≤ DailyLossLimit, reflecting a worst case scaled by contract count. Under per-position semantics,MaxTradeRiskalready is the worst-case single-trade dollar loss regardless of contract count, so the correct assertion isMaxTradeRisk ≤ DailyLossLimit(a single trade must not be able to consume the whole daily loss limit on its own). This is a strictly tighter, simpler, and safer bound than the one it replaces — worst-case single-trade risk drops from the previously undefined-in-practice $600 to whateverMaxTradeRiskis explicitly set to. - Sequencing (see DEC-20260819-01 below): the risk-guard code changes (Parts 1–3 of
TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md) are instrument-agnostic and should land and be validated on the current NQ configuration first. The MNQ instrument cutover itself is a separate, subsequent deployment step — see DEC-20260819-01. - Context (original): Two independent live outages on 2026-08-18 traced to parameter pairs that are individually valid and jointly impossible. (1)
BasicRiskManager.CalculateTradeRisk()returnsintent.StopTicks * tickValuewith no quantity term, evaluated before sizing. On NQ at $5.00/tick,MaxTradeRisk=$200caps the stop at 40 ticks whileMaxStopTicks=50(=$250) is configured, so the top 20% of the ATR stop range is unreachable.session_20260818_071117.logat 10:10:24 ET: five validSIGNAL: Sell NQlines, zero submissions,REJECT: reason=KillSwitch detail=Risk manager rejected: Trade risk too high: $225.00.MinContracts=1is already the floor, so the trade was unplaceable rather than resizable. (2) Separately, the parameter's display name is "Max Trade Risk" and master document v6.4 §3.2 documents the Tier 1 formula as(StopTicks × TickVal × Qty) > MaxTradeRisk. The code has never had the quantity term, so worst-case position risk isMaxTradeRisk × MaxContracts= $600 against a $1,000DailyLossLimit. - Decision (proposed, two parts): Decision 1 — resolve the collision. Choose one of: (a)
MaxTradeRisk = $250, makingMaxStopTicks=50reachable and raising per-contract worst case 25%; (b)MaxStopTicks = 40, leaving nothing unreachable but tightening the stop relative to ATR on volatile days and raising stop-out rate; (c) validate on MNQ at $0.50/tick, where 50 ticks = $25 per contract, the collision disappears entirely and sizing becomes granular enough forMaxContractsto do real work. Decision 2 — define the semantics. State explicitly whetherMaxTradeRiskis a per-contract stop-distance ceiling (what the code does today) or a per-position risk limit (what the name and the master document imply). If per-position, the Tier 1 check must move to after sizing or take an estimated quantity — a real ordering change that must not be made without this entry being accepted first. Independently of both, add startup assertions in the GAP-003 style for:EnableTrailingDrawdown ⇒ AccountStartingBalance > 0;MaxStopTicks × tickValue ≤ MaxTradeRisk;MinContracts ≤ MaxContracts; and a bound relatingMaxTradeRisk × MaxContractstoDailyLossLimit. - Consequences: Either value change alters
ConfigHashand requires a fresh freeze capture and a newDEC-GATE3-CONFIG. Option (c) is a larger strategic change than a parameter edit and interacts with the roadmap's instrument sequencing; it is also the only option that removes the class of problem rather than an instance of it. Until Decision 2 is answered, the system's true worst-case single-trade loss is undefined in the documentation and under-enforced in the code, which is the largest open drawdown exposure in the project. - Related Files:
src/NT8.Core/Risk/BasicRiskManager.cs,src/NT8.Core/Sizing/BasicPositionSizer.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md - Implementation Note (2026-08-23): Executed
TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.mdParts 1-3 on the current NQ configuration without changing the traded instrument or retuning NQ values. AddedRiskEnvelopeValidator.ValidateStartupConfiguration()and wiredNT8StrategyBasestartup to fail fast when:EnableTrailingDrawdown=TruewithAccountStartingBalance<=0;MaxStopTicks * TickValue > MaxTradeRisk;MinContracts<1orMinContracts>MaxContracts; orMaxTradeRisk>DailyLossLimit. Messages include the symbol and both conflicting values. GAP-048 had already split the nonconfigured trailing-drawdown reject reason toTrailingDrawdownNotConfigured, so no duplicate taxonomy change was needed. Confirmed MNQ exists at$0.50in both hardcoded tick-value tables; no table patch was needed. Implemented the approved per-position semantics by adding a sizedBasicRiskManager.ValidateOrder(..., candidateContracts)overload and movingNT8StrategyBase.ProcessStrategyIntent()to calculate size before risk validation, then enforceStopTicks * tickValue * Qty <= MaxTradeRiskagainst the selected quantity. ExistingIRiskManager.ValidateOrder()remains compatible and still validates one contract for older callers. - Verification (2026-08-23): Added tests for each startup assertion's fail/pass behavior, quantity-aware Tier 1 rejection, the old pre-quantity passing case now rejecting at two contracts, a bounded property-style sweep over declared ranges, and MNQ tick-value parity in both risk and sizing tables.
verify-build.batpassed 535/535 tests (446 Core, 79 Integration, 10 Performance);dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimalpassed 446/446;deployment\deploy-to-nt8.batcompleted with backup20260823_144817and notedNinjaTrader.Custom.dllwas not present to invalidate. - Action Required: Manually compile in NinjaTrader. Validate on NQ before MNQ cutover: verify the misconfigured trailing-drawdown pair refuses startup,
MaxTradeRisk<=DailyLossLimitis enforced, and a former 10:10-style high-ATR signal either sizes withinMaxTradeRiskor rejects from the quantity-aware per-position check. Do not perform the MNQ cutover in this validation step.
DEC-20260818-18
- ID: DEC-20260818-18
- Date: 2026-08-18
- Status: implemented (2026-08-21). Supersedes DEC-20260810-02 and DEC-20260815-01 on the runner question.
- Operator Decision (2026-08-19): Accepted — stop applying auto-breakeven to the runner leg.
- Parameter-scoping sub-question resolution: the entry left open whether
EnableAutoBreakevenbecomes runner-scoped-off by default or gains a separateEnableRunnerBreakevenflag. Not addressed in the 2026-08-19 acceptance message. Default resolved here rather than blocking implementation: unconditionally skip breakeven on the runner leg in theOnBarUpdateblock; do not add a new flag. Rationale — a trailing stop already dominates a frozen breakeven at every point once GAP-054 is fixed, so a toggle to re-enable the strictly worse behavior adds parameter surface and testing burden without a scenario where an operator would want it.EnableAutoBreakeven/BreakevenTriggerTicks/BreakevenOffsetTickscontinue to govern the scaler leg only, unchanged. If Mo wants the flag instead of the unconditional skip, say so and this line will be revised before Kilocode implements it. - Context:
SetStopLoss()andSetTrailStop()are mutually exclusive per signal name in NinjaScript — the later call replaces the earlier exit order.SubmitOrderToNT8()(NT8StrategyBase.cs~2178-2196) arms the runner correctly withSetStopLossthenSetTrailStop(_runnerSignalName, Ticks, RunnerTrailTicks)thenEnterLong/EnterShort. But the auto-breakeven block inOnBarUpdate()(797-804) then calls$275 gross, ~$252 net) versus the $25 gross / $1.96 net actually realised — roughly 24% of total realised P&L. Two secondary defects sit in the same block:SetStopLoss(_runnerSignalName, CalculationMode.Price, bePrice, false), replacing the live trail with a static stop at entry +BreakevenOffsetTicks. The runner never trails again. All four broker-confirmed trades log it:BREAKEVEN runner stop -> ... profit=28/25/24/26 ticks, at which points a 12-tick trail would have sat at +16/+13/+12/+14 ticks while the stop was moved to +1. The breakeven action therefore moves the stop backwards, giving back 11-15 ticks of already-locked profit and freezing. Conservative floor estimate: 55 ticks (entryPriceisPosition.AveragePrice, the blended average across both legs rather than the runner's own fill (on 2026-08-16 producing the off-tick breakeven price 30200.08 on a 0.25-tick instrument), andCalculate = OnBarClosemeansBreakevenTriggerTicks = 20actually fires at 24-28 ticks. - Decision (proposed): Stop applying auto-breakeven to the runner leg. A trailing stop already provides monotonically improving protection and does so better than a frozen breakeven at every point.
EnableAutoBreakeven,BreakevenTriggerTicksandBreakevenOffsetTicksremain as parameters; whether they become runner-scoped-off by default or gain a separateEnableRunnerBreakevenflag defaulting to false is an open sub-question for the operator. The existing prohibition on callingSetTrailStop()insideOnBarUpdate(which would reset the trail anchor to bar-close price — a real defect diagnosed 2026-04-13) stands unchanged. Before implementation, NinjaTrader's own documentation must be cited confirming the mutual-exclusivity behaviour; if it documents otherwise, the task stops and reports. - Consequences: This supersedes the framing in DEC-20260810-02 and DEC-20260815-01, both of which treated the runner as a parameter-placement problem and deferred or scoped a breakeven-trigger retune. The runner has in fact never been tested, so its economics are unknown rather than poor, and the earlier conclusion that it might be worth disabling was drawn from data the defect produced. RUNNER-001 must not execute until this lands — an 18-combination sweep over breakeven trigger × trail distance against a disabled trail would return a trail axis with no effect and a confident, meaningless recommendation. Historical Strategy Analyzer results involving the runner leg are not comparable across this change.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,tools/runnersweep/runnersweep.py,TASK_GAP054_RUNNER_TRAIL_PROMPT.md,docs/00-governance/decisions.md - Implementation Note (2026-08-21): Implemented Option 0 in
NT8StrategyBase.cs:OnBarUpdate()no longer callsSetStopLoss()orSetTrailStop()for_runnerSignalNameafter entry, and the stale runner breakeven diagnostic draw is removed. Local installed NT8 API documentation citation:C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Core.xmldocumentsStrategyBase.SetStopLoss(string, CalculationMode, double, bool)as tying the stop-loss exit tofromEntrySignal, andStrategyBase.SetTrailStop(string, CalculationMode, double, bool)as tying the trail-stop exit tofromEntrySignalwith trail stops amended tick-by-tick. The implementation preserves the single entry-timeSetTrailStop()call so NT8 owns the live runner trail. Verified 511/511 (verify-build.bat) and 422/422 (NT8.Core.Tests) passing,deploy-to-nt8.batsucceeded, deployed source hash confirmed matching the repo. - Independent source verification (Claude, 2026-08-21): Read the post-change
OnBarUpdate()block directly (not just the report) — confirms noSetStopLoss/SetTrailStopcall remains for_runnerSignalName, the block is now a comment-only no-op, and theBREAKEVEN runner stop ->FileLogline is gone (not merely the chart draw object). Correction to this entry's own "Parameter-scoping sub-question resolution" line above: it statedEnableAutoBreakeven/BreakevenTriggerTicks/BreakevenOffsetTicks"continue to govern the scaler leg only, unchanged." Source inspection shows this was never true — the original breakeven block only ever acted on_runnerSignalName; there was no separate scaler-leg breakeven path in the pre-fix code for it to have governed. All three parameters are declared, defaulted (EnableAutoBreakeven=true,BreakevenTriggerTicks=20,BreakevenOffsetTicks=1), and referenced once in a settings-export/log line — but are now fully inert with no functional effect anywhere. This is functionally fine (matches the intended zero-breakeven outcome) but is a stale-parameter hygiene issue, not a scaler-leg regression. Tracked as GAP-056 below rather than left as a silent contradiction in this entry. - Action Required: Deployed on 2026-08-21, not yet committed ("commits require explicit request" — operator to decide, see current_status.md). Manually compile NinjaScript, then validate on SIM/replay — NOT the live frozen account — that no
BREAKEVEN runner stop ->line appears and the runner exits materially above entry + 1 tick before this is eligible for a live gate run. This validation has not yet happened — GAP-054 still blocks RUNNER-001 until it does.
DEC-20260818-17
- ID: DEC-20260818-17
- Date: 2026-08-18
- Status: accepted
- Context: Funded-prop trailing drawdown risk must be tracked at the account level, not by strategy name.
PortfolioRiskManageris intentionally not reused as the model because it is currently keyed by strategy name only, which is GAP-042 and would silently let two strategies on one account each maintain a separate drawdown buffer. - Decision: Add an account-keyed
TrailingDrawdownMonitorinsideNT8StrategyBasewith one shared high-water/lock/breach state perAccount.Name. Equity is read withAccount.Get(AccountItem.NetLiquidation, Currency.UsDollar); installed NT8 API metadata confirmsAccountItem.NetLiquidationexists and labels it as Net liquidation, with separateCashValue,RealizedProfitLoss, andUnrealizedProfitLossaccount items. Runtime SIM validation must still cross-check this value against NT8 account display with an open position. Formula: updatecurrentPeak = max(currentPeak, equity). If not locked andcurrentPeak >= AccountStartingBalance + TrailingDrawdownLockOffset, setlocked=trueandlockedPeakValue=currentPeak. Reference point islocked ? lockedPeakValue : currentPeak; halt threshold isreferencePoint - TrailingDrawdownHaltBuffer. Ifequity <= haltThreshold, set account breach state, flatten registered strategies for that account withExitLong("TrailingDrawdownHalt")andExitShort("TrailingDrawdownHalt"), logTRAILING_DRAWDOWN_BREACH: Account=<name> Equity=<value> Peak=<value> Floor=<value> Locked=<bool> Time=<timestamp>, and block new entries with reject reasonTrailingDrawdownBreachfor the rest of the session. - Consequences: The monitor is fully opt-in via
EnableTrailingDrawdown=falsedefault, so existing gate-validation sessions are inert unless explicitly enabled. Multiple strategy instances sharing one account name share one drawdown floor and breach state. Conservative-tier breaches write{LogDirectory}/drawdown_halt_<AccountName>.json; startup with that file present enters halted state until the operator manually deletes it. Normal/Aggressive breaches are in-memory only and clear on restart. This task deliberately does not implement EOD/Option-2 mode or Python/Apprise notification wiring. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: In SIM, verify
AccountItem.NetLiquidationincludes unrealized P&L by comparing logged equity with NT8 account display while a position is open; test breach flattening, persisted Conservative halt, restart behavior by tier, lock-in floor behavior, disabled-mode inertness, and two-strategy shared account state.
DEC-20260818-16
- ID: DEC-20260818-16
- Date: 2026-08-18
- Status: accepted
- Context: The operator trades both a funded prop account with strict trailing drawdown rules and a small personal/micro account that should become eligible for a different risk posture as capital grows. One static risk posture cannot accurately represent both accounts.
- Decision: Add a manual
RiskTierNinjaScript setting withConservative,Normal, andAggressive, defaulting toNormal. AddMicroUpgradeThresholddefaulting to5000; each realtime bar reads account balance viaAccount.Get(AccountItem.CashValue, Currency.UsDollar)and, once per strategy session, logs/printsTIER_UPGRADE_SUGGESTED: Balance=<value> crossed threshold=<threshold>; review RiskTier setting.when crossed. The strategy never changesRiskTierautomatically. - Consequences: Risk posture becomes explicit in strategy settings and provenance without creating hidden automatic tier changes. The upgrade threshold is advisory only and safe for live use because it cannot alter sizing, risk validation, order submission, or drawdown halt behavior.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: Confirm in SIM that threshold crossing logs exactly once and does not change
RiskTieror any order behavior.
DEC-20260818-15
- ID: DEC-20260818-15
- Date: 2026-08-18
- Status: accepted
- Context: The dashboard console only showed rejection/risk visibility from the live raw-log tail, so a meaningful
REJECT:could scroll out and disappear from operator view even though the full session file still contained durableREJECT SUMMARY:andREJECT:records. The same dashboard also lacked signal-vs-fill visibility and had no approximation for good telemetry setups that could not become trades because a session-level block had already appeared. Today's 10:10SIGNALfollowed byKillSwitch/MaxTradeRisk rejection insession_20260818_071117.logmade the gap concrete. - Decision: Add read-only dashboard KPIs sourced from the full current
session_*.logfile on every/api/statepoll:session_reject_totals,signal_outcomes,signal_grade_summary,missed_grade_b_plus_count, and cappedmissed_grade_b_plus_samples. The full-file read per poll is an accepted dashboard observability trade-off and should not be over-engineered with caching unless it is measured as slow. Signal-vs-fill correlation treats aFILLbefore the nextSIGNALas filled and captures the followingREJECT:reason when present. OlderSIGNAL: Sell NQ | LIVE MODElines without inline grade/score use the latest priorSTATE:grade/score so current logs remain analyzable. - Consequences: Risk/reject counts are persistent for the full session and no longer disappear when raw-tail lines scroll out. Signal outcomes make rejected/unfilled generated signals visible by grade. Missed B+ setup counting is explicitly approximate: it infers blocked opportunity from
STATE:samples after blockingREJECT:reasons (RthGuard,MaxDailyTrades,KillSwitch,CmeHoliday) have appeared, not from a first-class signal-quality-vs-execution-outcome model. Revisit this metric once the pending MaxDailyTrades architecture decision discussed in today's DEC-20260818-14 follow-up session is implemented, because that design should make the distinction exact rather than inferred. This remains observability-only and cannot affect live trading behavior because it only reads log files undertools/dashboard. - Related Files:
tools/dashboard/parsers.py,tools/dashboard/server.py,tools/dashboard/console.html,tools/dashboard/console.js,docs/00-governance/decisions.md - Action Required: In a later live session, compare dashboard missed-setup samples against raw
STATE:lines after any realMaxDailyTradesblock and revise the approximation once MaxDailyTrades emits exact signal-quality/execution-outcome telemetry.
DEC-20260818-14
- ID: DEC-20260818-14
- Date: 2026-08-18
- Status: accepted
- Context: Follow-up verification for DEC-20260818-11 confirmed the
SimpleORBNT8side of fixed-position UI consolidation is wired, not just theNT8StrategyBaseextension point. The repo and deployed NT8 Custom source both containSimpleORBNT8.AppendTopLeftDiagnosticLines(List<string> lines)for TradeTaken/DailyTradeCount and a singleDiag_BottomLeftblock for ORBRange/BreakoutDir. - Decision: Treat the current
SimpleORBNT8implementation as completion of DEC-20260818-11 rather than a new visual feature. No additional code change is required: oldDiag_TradeTaken/Diag_DailyCountcleanup remains owned by the base consolidated top-left draw path, and oldDiag_ORBRange/Diag_BreakoutDircleanup remains owned by the SimpleORB bottom-left draw path before drawingDiag_BottomLeft. - Consequences: The intended fixed-position consolidation is complete in source and deployed NinjaScript source. Runtime visual validation is still required for stacked top-left and bottom-left rendering and for any collision with NT8's native strategy-parameter display.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: In NT8, visually confirm the consolidated top-left and bottom-left blocks render without overlap under simultaneous active conditions.
DEC-20260818-13
- ID: DEC-20260818-13
- Date: 2026-08-18
- Status: accepted
- Context: Follow-up verification for DEC-20260818-12 confirmed that event-driven telemetry's pending-breakout change detection depends on
SimpleORBNT8overridingGetStateTelemetryPendingBreakoutDirection(). Without that strategy-specific override, the base implementation returns0, causing the intended0 -> 1or0 -> -1breakout-arm transition to be invisible toMaybeWriteStateTelemetry(). - Decision: Treat the existing
SimpleORBNT8.GetStateTelemetryPendingBreakoutDirection()override as required completion of DEC-20260818-12 rather than a separate telemetry feature. The override reads_sdkStrategy as SdkSimpleORBand returnssdkOrb.PendingBreakoutDirectionwhen available, otherwise0, matching the null-check pattern used by the neighboring telemetry overrides. - Consequences: Pending-breakout direction changes now have a strategy-specific data source for the event-driven
STATE:path. Runtime validation is still required to confirm a live/SIM breakout-arm transition emits immediately and that the periodic 30-second snapshot remains unaffected. - Related Files:
src/NT8.Adapters/Strategies/SimpleORBNT8.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: In live/SIM, force a breakout-bar/confirmation sequence and confirm a
STATE:line appears whenPendingBreakoutDirectionchanges.
DEC-20260818-12
- ID: DEC-20260818-12
- Date: 2026-08-18
- Status: accepted
- Context: The 30-second
STATE:telemetry snapshot is useful for ambient health monitoring but can lag fast ORB breakout/confirmation transitions on primary bars that close less than 30 seconds apart. The operator needs to see entry-imminent state changes in real time without turningSTATE:into per-bar score-noise logging. - Decision:
MaybeWriteStateTelemetry()now samples on meaningful change, not only on a clock. It still preserves the existing 30-second periodic snapshot and its independent cooldown, but it also emits an immediate supplementarySTATE:/STATE_DETAIL:/STATE_CONTEXT:set whenever eitherSimpleORBNT8.PendingBreakoutDirectionchanges or the telemetry grade crosses the configuredMinTradeGradethreshold in either direction. The change-triggered emission does not reset_lastStateTelemetryTime, so the periodic health snapshot continues on its own cadence. This is deliberately limited to PendingBreakoutDirection and grade-threshold crossing; exact score decimal changes are ignored to avoid choppy log volume. - Consequences: Fast breakout arming/resetting and grade eligibility transitions should now appear in the session log immediately instead of waiting for the next 30-second snapshot. This design is distinct from the
REJECT:rate-limiting model:STATE:change-triggering is about sampling dynamic state at meaningful transitions, whileREJECT:rate limiting is about avoiding repetition of static facts. The two throttling strategies must not be conflated. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: In live/SIM, force a rapid breakout-bar/confirmation sequence and confirm
STATE:appears at the pending-direction change; run a quiet session to confirm periodic ~30sSTATE:output remains; measureSTATEline count during a choppy ORB window.
DEC-20260818-11
- ID: DEC-20260818-11
- Date: 2026-08-18
- Status: accepted
- Context: Multiple
Draw.TextFixed()diagnostics shared the same fixed chart positions. NinjaScript does not auto-stack these calls, soDiag_Regime,Diag_Runner,Diag_TradeTaken, andDiag_DailyCountcollided atTextPosition.TopLeft, whileDiag_ORBRangeandDiag_BreakoutDircollided atTextPosition.BottomLeft. This visual-only issue is independent of DEC-20260818-10's ETH refresh path, although ETH refresh made stale/colliding fixed labels more visible. - Decision:
NT8StrategyBase.DrawDiagnostics()now builds a single newline-joined top-left diagnostics block and exposesAppendTopLeftDiagnosticLines(List<string> lines)for derived strategies.SimpleORBNT8overrides that hook to append TradeTaken and DailyTradeCount under the same top-left draw call.SimpleORBNT8.DrawDiagnostics()now similarly builds one newline-joined bottom-left block for ORB range and breakout direction. Old separate tags are removed before the combined tags are drawn so stale chart objects do not linger. Color consolidation choice: the top-left block uses white text on a black background for mixed-status readability; the bottom-left ORB block uses white text on a dark-blue background, preserving the prior ORB range block's visual theme while accepting a single color for breakout direction. - Consequences: Simultaneously active diagnostic lines at the same fixed position now render as stacked text in one chart object instead of overlapping. Per-line colors are intentionally not preserved because
Draw.TextFixed()styles the whole fixed text object. Single-occupant positions (Diag_Sessiontop-right,Diag_TestModecenter, andDiag_Provbottom-right) are unchanged. Native NT8 strategy-parameter-display overlap has not been validated in this code session and still requires visual chart confirmation. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: Visually verify multiple top-left and bottom-left conditions render stacked, and confirm whether NT8's native strategy-parameter display still overlaps the consolidated top-left block.
DEC-20260818-10
- ID: DEC-20260818-10
- Date: 2026-08-18
- Status: accepted
- Context: DEC-20260818-07 intentionally scoped
EnableEthTelemetryto text telemetry only: the ETH branch calledMaybeWriteStateTelemetry()and returned beforeDrawDiagnostics(). Live chart review showed stale RTH visual labels during ETH becauseDrawDiagnostics()had not run since a prior RTH/TestMode bar. Source review ofNT8StrategyBase.DrawDiagnostics()andSimpleORBNT8.DrawDiagnostics()confirmed the methods are gated byEnableChartDiagnosticsand use chart drawing calls only, without_sdkStrategy.OnBar(),ProcessStrategyIntent(), order submission, or trading state mutation. - Decision: When a bar is outside RTH, TestMode is false, and
EnableEthTelemetryis true, the existing ETH telemetry branch now callsDrawDiagnostics()in the same try/catch after building read-only bar/context state and writing optional state telemetry. The branch still returns before_sdkStrategy.OnBar()andProcessStrategyIntent(), so ETH telemetry remains visual/read-only only. - Consequences: With
EnableEthTelemetry=trueandEnableChartDiagnostics=true, the chart's session tag, ORB box, trigger lines, and breakout indicators can refresh during ETH instead of displaying stale RTH drawings. WithEnableEthTelemetry=false, default ETH behavior remains unchanged. RTH and Strategy Analyzer paths are unchanged. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: In a live ETH session, verify
SESSION: ETHand ORB visual diagnostics refresh withEnableEthTelemetry=true/EnableChartDiagnostics=true, and verify noSUBMIT/FILLlines appear outside RTH from this path.
DEC-20260818-09
- ID: DEC-20260818-09
- Date: 2026-08-18
- Status: accepted
- Context:
ProcessStrategyIntent()calculated position size using the staticintent.StopTicksemitted by the SDK strategy, whileSubmitOrderToNT8()later overwroteintent.StopTickswith the ATR-derived dynamic stop whenEnableDynamicStop=true. That meant contract count was based on a stale stop distance and could diverge materially from the actual submitted stop risk. The same ordering defect affectedRecommendedContractstelemetry because the telemetry intent usedSimpleORBNT8.StopTicksrather than the current dynamic stop. This is distinct from DEC-20260818-08's historical-replay order-submission block. - Decision: Dynamic ATR stop finalization now happens before sizing.
NT8StrategyBase.ProcessStrategyIntent()applies the existingEnableDynamicStop && CurrentBars[0] >= AtrPeriodformula and min/max clamping before portfolio/per-strategy risk,_positionSizer.CalculateSize(), and submission.SubmitOrderToNT8()no longer recomputes or overwritesintent.StopTicks; it trusts the already-finalized value. Telemetry uses the same helper beforeRecommendedContractssizing, andSimpleORBNT8.BuildStateTelemetryIntent()seeds the telemetry intent with the finalized stop ticks rather than the staticStopTicksparameter. - Consequences: With
EnableDynamicStop=true, real order sizing,SUBMIT Stop=<ticks>, andRecommendedContractsnow reference the same stop distance. Historical Strategy Analyzer results with dynamic stop enabled are expected to change because this corrects a real contract-sizing defect. WithEnableDynamicStop=false, the helper is a no-op and static-stop behavior is unchanged. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: In NT8, compare one dynamic-stop signal end to end: dynamic stop log,
SUBMIT Stop=<ticks>, submitted contract count, andSTATE_CONTEXT RecommendedContractsshould all reflect the ATR-finalized stop. Run a Strategy Analyzer before/after comparison withEnableDynamicStop=trueand record the expected contract-count/P&L delta.
DEC-20260818-08
- ID: DEC-20260818-08
- Date: 2026-08-18
- Status: accepted
- Context: Live/SIM strategy startup can process NT8 historical catch-up bars before
State.Realtime. DEC-20260817-02 fixed the prior partial symptom by preventingWriteTradeProvenance()from writing phantomtrades_*.jsonlrows outside realtime, but it explicitly did not alter signal generation, risk validation, sizing, or order submission. Live evidence later confirmed that historical catch-up bars from prior RTH sessions could still produce a full Intent -> Risk approved -> Sized -> Submitted -> Filled sequence because the realtime replay-age guard and_realtimeBarSeenguard do not run whileState == State.Historical, and the RTH guard checks time of day without date freshness. - Decision:
NT8StrategyBase.ProcessStrategyIntent()now blocks live/SIM historical replay catch-up before any portfolio risk, direction, risk-manager, sizing, or order-submission logic whenState == State.Historical && Account != null. The reject reason is distinct:HistoricalReplayCatchup. Strategy Analyzer/backtest behavior remains intentionally untouched becauseAccount == nullduring genuineState.Historicalbacktests, so simulated historical orders still flow normally there.LogRejectRateLimited()permits this one reason to write aREJECT:line even thoughStateis historical, so the catch-up safety block is visible in session diagnostics. - Consequences: This closes the actual order-submission gap left open by DEC-20260817-02 while retaining that provenance-file gate as an independent second safety net. MaxDailyTrades and daily P&L should no longer be affected by live/SIM catch-up activity because catch-up-phase intents cannot reach submission at all. Validation still requires a live/SIM restart with catch-up history and a Strategy Analyzer regression comparison for unchanged trade count and P&L.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: Restart NT8 with the live/SIM strategy attached to an account and confirm
REJECT: reason=HistoricalReplayCatchupappears during catch-up with zeroSUBMIT/FILLuntilState.Realtimeand_realtimeBarSeenare true; run a Strategy Analyzer backtest over the same range and confirm trade count and P&L are unchanged.
DEC-20260818-07
- ID: DEC-20260818-07
- Date: 2026-08-18
- Status: accepted
- Context: In the consolidated fix batch, the operator needed regime/factor/grade telemetry during ETH hours without touching the real
SimpleORBStrategyentry state machine. The existing RTH guard inNT8StrategyBase.OnBarUpdate()returned beforeMaybeWriteStateTelemetry(), so sessions started during ETH produced noSTATE:lines. The real strategy path must remain protected: no ETH call to_sdkStrategy.OnBar(), noProcessStrategyIntent(), and no TestMode behavior changes. - Decision: Added opt-in
EnableEthTelemetry(falseby default) under Diagnostics. When a bar is outside RTH and TestMode is false, the existingRthGuardrejection still logs; if and only ifEnableEthTelemetryis true,NT8StrategyBasebuildsBarData/StrategyContextfrom current read-only adapter state, callsMaybeWriteStateTelemetry(), then returns immediately. This path does not callDrawDiagnostics(),_sdkStrategy.OnBar(), orProcessStrategyIntent(). - Consequences: Default ETH behavior remains unchanged. Operators can opt into
STATE:/STATE_DETAIL:/STATE_CONTEXT:during ETH at the existing telemetry throttle for diagnostics only, with no path to submit an ETH order through this feature. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: In a live ETH session, verify
EnableEthTelemetry=falseproduces no ETHSTATE:lines,EnableEthTelemetry=trueproduces state telemetry, and noSUBMIT/FILLlines appear outside RTH.
DEC-20260818-06
- ID: DEC-20260818-06
- Date: 2026-08-18
- Status: accepted
- Context: In the consolidated fix batch, real
STATE_DETAIL:output showed daily-context factors returning "No daily bar context available" even thoughSimpleORBNT8.OnBarUpdate()already buildsDailyBarContextevery bar and stores it at_strategyConfig.Parameters["daily_bars"]. Root cause: real intents get this context viaSimpleORBStrategy.AttachDailyBarContext(), but the syntheticSimpleORBNT8.BuildStateTelemetryIntent()created an empty metadata dictionary, and factor calculators read daily context fromintent.Metadata["daily_bars"]. - Decision:
SimpleORBNT8.BuildStateTelemetryIntent()now creates a metadata dictionary and, when_strategyConfig.Parameters["daily_bars"]exists, attaches that same object under"daily_bars"before returning the synthetic telemetry intent. It deliberately does not callAttachDailyBarContext()because that helper mutates trade-direction, breakout-volume, and ORB fields for real trade candidates. - Consequences: State telemetry factors can now use the same warmed daily context as the accepted-trade path without mutating SDK strategy state. Expected live result is real NR4/NR7 and ORB-vs-ATR reason text in
STATE_DETAIL:once daily context is warmed, with no change toSIGNAL/SUBMIT/FILL/REJECTbehavior. - Related Files:
src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: Confirm live
STATE_DETAIL:reason strings no longer report missing daily context once the daily series is warmed.
DEC-20260818-05
- ID: DEC-20260818-05
- Date: 2026-08-18
- Status: accepted
- Context: The dashboard Data Series Detail panel exposed that
SimpleORBNT8was loading duplicate daily bar series:SimpleORBNT8.OnStateChange()calledAddDataSeries(BarsPeriodType.Day, 1)inState.Configure, then calledbase.OnStateChange(), whoseState.Configurebranch also added the shared daily series for TASK-06c regime SMA20/50 context. Live evidence showedBarsArray[1]andBarsArray[2]were bothDayBarsType,DaysToLoad=365,HistoricalBarsLoaded=130. This was an existing latent bug that predated today's telemetry/dashboard work and was only made visible because the dashboard now shows the fullBarsArrayreadiness detail. - Decision: Removed the subclass
AddDataSeries(BarsPeriodType.Day, 1)call fromSimpleORBNT8. The base class remains the single owner of the shared daily series, soBarsArray[1]keeps the same role and ordering forSimpleORBNT8.BuildDailyBarContext()andNT8StrategyBase.BuildStrategyContext()regime calculations. A source comment now notes thatNT8StrategyBaseprovides the shared daily series to avoid reintroducing the duplicate. - Consequences: Expected live readiness is now two series total: primary bars plus one daily series, with the same daily historical count as before. NR7, ORB-vs-ATR, regime SMA20/50, signal generation, sizing, and order behavior should remain unchanged because all current consumers already read daily data from index
[1]; the removed[2]series had no intended consumer. - Related Files:
src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: After deploy and NT8 compile, confirm the Historical readiness block/dashboard Data Series Detail reports only primary plus one daily series and that daily bar count remains unchanged.
DEC-20260818-04
- ID: DEC-20260818-04
- Date: 2026-08-18
- Status: accepted
- Context: DEC-20260818-02/03 added
STATE_CONTEXT:(ORB high/low/window fromSimpleORBNT8, plus the universalRecommendedContractsfield fromNT8StrategyBase) but left dashboard parsing for a separate task, and verification against the actual deployed source (NT8StrategyBase.cs,SimpleORBNT8.cs) confirmed the format matched exactly what was documented. - Decision: Added
STATE_CONTEXT_RE/parse_state_context_fields()toparsers.py(plain space-separatedKey=Valuetokens, deliberately generic rather than ORB-specific since the field set is strategy-extensible per theGetStateTelemetryContextFields()extension point).server.py._apply_event()stores the result atlive_state.state_context.console.html/console.js: a new ORB range block rendersOrbHigh/OrbLow/window under Strategy Status's Session Filter section (with an honest "not yet established" empty state), and the State Telemetry stat-grid gains a fifthRecommended Contractsstat sourced live fromstate_context.RecommendedContractswhen present — distinct from the existing post-tradelast_submit.fieldssizing block, since this one updates continuously at the telemetry cadence rather than only after a real SUBMIT. - Consequences: Closes the loop on both DEC-20260818-02 and DEC-20260818-03's deferred dashboard work in one pass. Not yet executed against a live payload, since Claude has no code-execution access on the operator's machine — verify via
/api/stateor the console page once a session with an established ORB range is running. - Related Files:
tools/dashboard/parsers.py,tools/dashboard/server.py,tools/dashboard/console.html,tools/dashboard/console.js,docs/00-governance/decisions.md - Action Required: Confirm
live_state.state_contextpopulates withOrbHigh/OrbLow/OrbWindowStart/OrbWindowEnd/OrbReady/RecommendedContractsonce the ORB range establishes in a live session, and that the dashboard's ORB Range block and Recommended Contracts stat render correctly.
DEC-20260818-03
- ID: DEC-20260818-03
- Date: 2026-08-18
- Status: accepted
- Context: The operator re-authorized recommended-contract telemetry after DEC-20260818-01 clarified that
BasicPositionSizer.CalculateSize()has no internal mutable state a telemetry-only call could corrupt. The only side effect is logger output, which does not feed back into sizing/order behavior and is limited by the existing 30-second state telemetry throttle. - Decision:
MaybeWriteStateTelemetry()now calls_positionSizer.CalculateSize(telemetryIntent, context, _sizingConfig)after computing the confluence score, only inside the existingEnableStateTelemetry && EnableFileLogging && State == State.Realtimeand 30-second throttle gates. The resultingSizingResult.Contractsis logged only, never stored or used for order submission. Because DEC-20260818-02 already introducedSTATE_CONTEXT:, the recommended size extends that line asRecommendedContracts=<N>instead of creating another near-duplicate telemetry line. When ORB context is also ready, the full line isSTATE_CONTEXT: OrbHigh=<F2> OrbLow=<F2> OrbWindowStart=<HH:mm> OrbWindowEnd=<HH:mm> OrbReady=<True|False> RecommendedContracts=<N>; before ORB readiness,STATE_CONTEXT: RecommendedContracts=<N>may still be emitted. - Consequences: The dashboard/parser follow-up can read one context line for both strategy-specific context and display-only recommended sizing. Trustworthiness still requires live validation: when a real trade later submits under matching conditions,
RecommendedContractsshould matchSUBMIT'sScaler + Runnerquantity; if not, telemetry inputs must be reconciled before presenting the value as authoritative. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: Run a live session and compare
STATE_CONTEXT RecommendedContracts=<N>against the next matchingSUBMIT Scaler=<S> Runner=<R>total.
DEC-20260818-02
- ID: DEC-20260818-02
- Date: 2026-08-18
- Status: accepted
- Context: The operator needs the opening-range high/low and ORB window visible in text telemetry and the dashboard, but ORB fields are strategy-specific and should not become part of
NT8StrategyBase.cs's genericSTATE:schema.SimpleORBNT8.DrawDiagnostics()already reads these values fromSimpleORBStrategy's public diagnostic getters, so logging them can remain read-only and aligned with chart diagnostics. - Decision: Added
protected virtual Dictionary<string, string> GetStateTelemetryContextFields(BarData barData, StrategyContext context)toNT8StrategyBase; the base implementation returnsnull.MaybeWriteStateTelemetry()now calls the extension point at the same throttled cadence asSTATE:/STATE_DETAIL:and emitsSTATE_CONTEXT: Key1=Value1 Key2=Value2 ...only when a strategy returns non-empty fields.SimpleORBNT8overrides the method and returnsOrbHigh=<F2> OrbLow=<F2> OrbWindowStart=<HH:mm> OrbWindowEnd=<HH:mm> OrbReady=<True|False>oncesdkOrb.OpeningRangeReadyis true andOpeningRangeHigh > OpeningRangeLow; otherwise it returnsnullso consumers can distinguish not-ready from ready values. - Consequences: Future strategies can add strategy-specific state telemetry context without changing the generic
STATE:line or hardcoding ORB concepts into the base class. The format deliberately uses unquoted space-separated key/value tokens because these values are numeric/time/boolean tokens with no internal spaces. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: Parser/dashboard support for
STATE_CONTEXT:should be added in a separate presentation/data task if these fields need UI display.
DEC-20260818-01
- ID: DEC-20260818-01
- Date: 2026-08-18
- Status: accepted
- Context: The "show recommended contract count during state telemetry" task instructed Kilocode to stop if
BasicPositionSizer.CalculateSize()wasn't provably stateless, mirroring DEC-20260817-04's caution forRegimeManager/TrendRegimeDetector/VolatilityRegimeDetector. Kilocode correctly stopped, reportingCalculateSize()calls_logger.LogDebug()/LogWarning(), whichBasicLoggerroutes toConsole.WriteLine(), and is therefore not I/O-free. - Decision: Direct source read of
BasicPositionSizer.csconfirms it has exactly one instance field (_logger, set once in the constructor, never written to elsewhere) and no other state.CalculateSize()derives its result purely from its(intent, context, config)parameters and returns a freshSizingResulteach call; there is no internal history/dictionary a telemetry-only call could seed or corrupt. This is categorically different from theRegimeManagercase, where the disqualifying risk was a diagnostic call silently building up state (_barHistory,_currentStates,_transitions) that a future real caller would then see polluted.BasicPositionSizerhas no such state; its only side effect is console text output, which does not feed back into any calculation, does not affect order behavior, and is negligible in volume at the existing 30-second telemetry throttle. The task is re-authorized:MaybeWriteStateTelemetry()may call_positionSizer.CalculateSize()for display purposes. - Consequences: Establishes the actual test for future "is this safe to call for telemetry" questions: state that could corrupt a future real caller disqualifies a component (as with
RegimeManager); I/O alone, on a component with no other internal state, does not. Future prompts citing "not provably stateless" should specify which kind of impurity was found rather than treating all impurity as equally disqualifying. - Related Files:
src/NT8.Core/Sizing/BasicPositionSizer.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: Re-run the recommended-contract-count telemetry task per the original prompt, now unblocked.
DEC-20260817-11
- ID: DEC-20260817-11
- Date: 2026-08-17
- Status: accepted
- Context: Operator raised several architecture questions after reviewing the console dashboard: whether the platform-neutral SDK goal is still real, whether 24x7 trading means switching strategies or running them concurrently, whether a control-plane UI requires an NT8 AddOn, and flagged that multi-account/multi-timeframe support aren't yet real. Each was answered by direct source reading rather than recollection (
NT8.Corefile contents confirmed noNinjaTrader.*references;PortfolioRiskManager.csread in full to confirm its concurrent-strategy design and its lack of an account key). - Decision: Recorded findings in
docs/00-governance/architecture.md: a Platform-Neutral SDK Invariant section (with an explicit rule againstNT8.Coregaining NinjaTrader references), a Multi-Strategy / 24x7 Trading Architecture section confirming the "shared everything but entry" pattern is already real and thatPortfolioRiskManagerwas already built for concurrent strategies, and a Control Plane section presenting the external-command-channel alternative to an NT8 AddOn. AddedGAP-042(no account dimension inPortfolioRiskManager) to Sprint 4 inroadmap.md, and added multi-timeframe regime alignment as an unscoped Sprint 6 idea, both cross-referenced back toarchitecture.md. - Consequences: These answers are now durable repo state rather than only having existed in a chat response. Future sessions asking the same architecture questions can be pointed at
architecture.mddirectly.GAP-042must be resolved before Sprint 4's multi-strategy plans extend to multiple accounts. - Related Files:
docs/00-governance/architecture.md,docs/00-governance/roadmap.md,docs/00-governance/decisions.md - Action Required: None in code now.
GAP-042implementation and the multi-timeframe regime design pass are both unscoped future work, not queued into an active sprint.
DEC-20260817-10
- ID: DEC-20260817-10
- Date: 2026-08-17
- Status: accepted
- Context: DEC-20260817-09 added
STATE_DETAIL:/SIGNAL_DETAIL:log lines and appended sizing-rationale fields toSUBMIT, but explicitly left dashboard/logtriage parser updates for a separate task. Console.js's Confluences and Factor Breakdown panels had no way to surface the human-readable factor reasons (e.g. NR4/NR7 determination, ORB-vs-ATR ratio) the operator specifically asked for, and the R:R panel had no live per-trade sizing data, only static config. Also found and removed dead code predating this session's changes:parsers.pyhad twoSTATE_REdefinitions (the second silently overwrote the first), which left an entirestate = STATE_RE.search(message)branch inparse_session_event()permanently unreachable since the newer regex's branch, positioned earlier in the function, always matched and returned first. - Decision: Added
parse_quoted_reasons()(reversesEscapeLogValue()'s backslash/quote escaping) andSTATE_DETAIL_RE/SIGNAL_DETAIL_REtoparsers.py;parse_session_event()now returnstype: "STATE_DETAIL"/"SIGNAL_DETAIL"events with areasonsdict keyed by factor name. Addedparse_submit_fields()(numeric coercion forBaseTarget/DynamicTarget/GradeMult/ModeMult/CombinedMult, leaving"N/A"as a string so it's distinguishable from0) and enriched the existingSUBMITevent with afieldsdict.server.py._apply_event()stores these atlive_state.state_telemetry_reasons,live_state.last_signal_reasons, and withinlive_state.last_submit.fields.console.html/console.js: Confluences and Factor Breakdown rows now carry atitletooltip fromstate_telemetry_reasons[name]when available; a new "Live Sizing" block under the static R:R panel renderslast_submit.fieldsonce a trade has submitted this session, with an honest "no trade submitted yet" empty state otherwise. - Consequences: This closes the loop DEC-20260817-09 left open — factor reasons and per-trade sizing rationale now reach the dashboard, not just the session log. Parsing logic was verified by hand-tracing the documented formats against
DEC-20260817-09's exact line specifications (quoted-value escaping, unquotedSUBMITfields withN/Afallback) but not executed, since Claude has no code-execution access on the operator's machine, and the underlyingNT8StrategyBase.cschange has not yet been redeployed (blocked onNT8.Core.dllfile lock — NinjaTrader must fully close beforedeploy-to-nt8.batcan succeed). The deadSTATE_REshadow bug predated this session's own DASH-002 work but was only now discovered and removed. - Related Files:
tools/dashboard/parsers.py,tools/dashboard/server.py,tools/dashboard/console.html,tools/dashboard/console.js,docs/00-governance/decisions.md - Action Required: Once NT8.Core.dll is unlocked and the telemetry enrichment redeploys/recompiles cleanly, confirm via
/api/state(or the console page) thatstate_telemetry_reasons,last_signal_reasons, andlast_submit.fieldspopulate with real values, and that tooltips render correctly on hover.
DEC-20260817-09
- ID: DEC-20260817-09
- Date: 2026-08-17
- Status: accepted
- Context: DASH-002
STATE:telemetry and accepted-tradeSIGNAL/SUBMITlogging exposed scores and order shape but discarded already-computed sizing rationale and eachConfluenceFactor.Reason. The data already exists onintent.MetadataandConfluenceScore.Factors; surfacing it is logging-only and must not change signal generation, sizing, risk validation, or order submission behavior. - Decision: Keep existing score-bearing line formats intact except for appending metadata fields to
SUBMIT. Accepted-trade factor reasons are emitted as a separate line immediately afterSIGNAL:SIGNAL_DETAIL: Setup="<reason>" Trend="<reason>" Volatility="<reason>" Timing="<reason>" ExecutionQuality="<reason>" NarrowRange="<reason>" OrbRangeVsAtr="<reason>" GapDirectionAlignment="<reason>" BreakoutVolumeStrength="<reason>" PriorDayCloseStrength="<reason>". State telemetry factor reasons are emitted at the same cadence and immediately afterSTATE:STATE_DETAIL: Setup="<reason>" Trend="<reason>" Volatility="<reason>" Timing="<reason>" ExecutionQuality="<reason>" NarrowRange="<reason>" OrbRangeVsAtr="<reason>" GapDirectionAlignment="<reason>" BreakoutVolumeStrength="<reason>" PriorDayCloseStrength="<reason>". TheSUBMITline appendsBaseTarget=<base_target_ticks|N/A> DynamicTarget=<dynamic_target_ticks|N/A> GradeMult=<grade_multiplier|N/A> ModeMult=<mode_multiplier|N/A> CombinedMult=<combined_multiplier|N/A>after the existingMode=<mode>field. - Consequences: Dashboard/logtriage parsers can add support for
SIGNAL_DETAIL,STATE_DETAIL, and appendedSUBMITfields later without ambiguity. ExistingSIGNAL,Factors:,FILL,PNL_UPDATE, andREJECTlines are not removed or reordered. Reason values are double-quoted with backslashes and quotes escaped because reason text may contain punctuation or semicolons. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md - Action Required: Update dashboard/logtriage parsers in a separate task if these detail lines need structured UI display.
DEC-20260817-08
- ID: DEC-20260817-08
- Date: 2026-08-17
- Status: accepted
- Context: DASH-002's
STATE:telemetry line was confirmed live insession_20260817_202803.log(validated in a real realtime session:STATE: Regime=Neutral Direction=Buy DirectionSource=OpeningRangeMidpoint Score=0.550 Grade=D Factors=Setup=0.50x1.00;...), buttools/dashboard/parsers.py'sparse_session_event()had no handling for it — the dashboard'sconsole.html/console.jsplan (DASH-004) explicitly noted this as "pending DASH-002" and had no real data source yet. - Decision: Added
STATE_REandparse_state_factors()toparsers.py, following the sameFactors=name=scorexweight;...convention already used forGradeFilterreject-detail parsing.parse_session_event()now returns atype: "STATE"event withregime,direction,direction_source,score,grade, and a structuredfactorslist.server.py._apply_event()stores the latest one atlive_state.state_telemetry, refreshed every poll from the session-log tail like every other live field, so it is available via/api/statewith no additional wiring. - Consequences: Live regime/grade/factor data now actually reaches the dashboard rather than sitting only in the session log. Observed cadence in this test session was ~5 minutes, not the 30s floor from DEC-20260817-07, because this session's primary series is
MinuteBarsTypeandMaybeWriteStateTelemetry()only gets a chance to fire onOnBarUpdate()(bar close) — on the gate's actual HFT Algo Bars primary series, cadence will sit much closer to the 30s floor. Parsing logic was hand-verified against the real log line (all six capture groups resolve correctly, including theGrade=Dimmediately followed byFactors=boundary) but not executed, since Claude has no code-execution access on the operator's machine. - Related Files:
tools/dashboard/parsers.py,tools/dashboard/server.py,docs/00-governance/decisions.md - Action Required: Confirm via a live
/api/statepoll (or the dashboard once loaded) thatlive_state.state_telemetrypopulates and updates roughly on the observed cadence.
DEC-20260817-07
- ID: DEC-20260817-07
- Date: 2026-08-17
- Status: accepted
- Context: DASH-002 needs continuous confluence/regime telemetry for the dashboard, but per-HFT-bar logging could create excessive session-log volume and disk I/O on the strategy thread. The implementation must remain additive observability only and must not call state-mutating regime detector methods documented in DEC-20260817-04.
- Decision: Emit
STATE:telemetry at most once every 30 seconds whileState == State.Realtime,EnableFileLogging == true, andEnableStateTelemetry == true. The line recordsRegime, diagnosticDirection,DirectionSource,Score,Grade, andFactors=<FactorType>=<score>x<weight>;...using the same factor-breakdown convention consumed by dashboard GradeFilter parsing. Direction is explicit so synthetic diagnostic scoring cannot be mistaken for an accepted trade signal. - Consequences: Expected full RTH volume is approximately 780 lines per 6.5-hour session, plus normal session logs, which is low enough for operator diagnostics while avoiding per-bar HFT log flooding. Existing
SIGNAL,SUBMIT,FILL,PNL_UPDATE, andREJECTlines remain unchanged. The dashboard can replace its DASH-002 placeholder with real latest-state telemetry when these lines are present. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,tools/dashboard/parsers.py,tools/dashboard/server.py,tools/dashboard/console.html,tools/dashboard/console.js - Action Required: Dual-deploy, manually compile all NinjaScript in NT8, and verify
STATE:lines appear in a realtime session before relying on dashboard telemetry.
DEC-20260713-01
- ID: DEC-20260713-01
- Date: 2026-07-13
- Status: accepted
- Context: July 11 sprint executed 11 tasks from old pre-v6.1 queue (TASK-06a, TASK-06b, GAP-003/004/005/006/008/009/010/011/019) but skipped v6.1-mandated TASK-00a/00b (provenance + chart diagnostics). HEAD left broken (duplicate enum/property). Sprint 2.6 executed repair + v6.1 instrumentation in strict order.
- Decision: Accept July 11 work as valid Sprint 2 substance; Sprint 2.6 completes v6.1 instrumentation. Next sprint = Sprint 3 (Second Strategy + MNQ).
- Consequences: Sprint numbering aligned with v6.1. Governance artifacts now match code reality. SIM gate requires all 5 Sprint 2.6 tasks + governance reconciliation before live.
- Related Files:
docs/00-governance/current_status.md,SPRINT_BOARD.md,KILOCODE_RUNBOOK.md,docs/00-governance/decisions.md,docs/00-governance/active_work.md,docs/INDEX.md,docs/archive/master_docs/NT8_SDK_Master_Document_v6.1_Complete.docx,docs/archive/master_docs/NT8_SDK_Operator_Runbook_v1.0.docx - Action Required: All Sprint 2.6 governance artifacts committed. Sprint 3 queue active in KILOCODE_RUNBOOK.md. SIM gate remains blocked until governance reconciliation complete.
DEC-20260711-03
- ID: DEC-20260711-03
- Date: 2026-07-11
- Status: accepted
- Context: Without a portfolio-level heat limit, multiple strategies or multiple positions within a strategy could each risk 2-3% of account simultaneously, leading to 6-9%+ aggregate risk. Need a Tier 3.5 check that caps total open risk + new trade risk as % of account balance.
- Decision: Added MaxHeatPct (default 3.0%) to AdvancedRiskConfig. Implemented ValidatePortfolioHeat() in AdvancedRiskManager that computes: TotalOpenRisk = Σ|exposure| from _state.ExposureBySymbol; NewTradeRisk = |intent.StopTicks × tickValue × estimatedQty|; HeatPct = (TotalOpenRisk + NewTradeRisk) / Account.Equity × 100. Called as Tier 3.5 in ValidateOrder() after correlation checks. Returns Reject with detailed metrics when exceeded. Edge cases: skips if MaxHeatPct ≤ 0 or account balance ≤ 0. Logs via _logger.LogDebug.
- Consequences: Prevents aggregate risk blowout across strategies. Backward compatible: MaxHeatPct=0 disables. Dual-deployed to NT8 Custom\Strategies.
- Related Files:
src\NT8.Core\Risk\AdvancedRiskModels.cs(MaxHeatPct in AdvancedRiskConfig),src\NT8.Core\Risk\AdvancedRiskManager.cs(ValidatePortfolioHeat, Tier 3.5 call) - Action Required: Verify in SIM — session log should show "[SDK] Heat check: X% of 3.0% limit" when heat check runs; test rejection by loading multiple strategies/positions to exceed 3% heat.
DEC-20260711-04
- ID: DEC-20260711-04
- Date: 2026-07-11
- Status: accepted
- Context: RiskPerTrade (sizing parameter) could exceed MaxTradeRisk (validation limit) silently, allowing trades that would be rejected by the risk manager. This created a configuration hazard where the sizing engine would calculate position sizes based on RiskPerTrade, only to have them rejected by MaxTradeRisk check.
- Decision: Added RiskPerTrade property to RiskConfig (defaults to MaxTradeRisk for backward compatibility). In BasicRiskManager.ValidateOrder(), added startup assertion: if (config.RiskPerTrade > config.MaxTradeRisk) throw ArgumentException with clear message identifying both values. This fails fast at order validation time rather than silently rejecting trades.
- Consequences: Configuration errors are caught immediately with actionable message. Backward compatible: existing configs without explicit RiskPerTrade use MaxTradeRisk value. Added 3 unit tests: > throws, == accepted, < accepted.
- Related Files:
src\NT8.Core\Common\Models\Configuration.cs(RiskPerTrade in RiskConfig),src\NT8.Core\Risk\BasicRiskManager.cs(validation in ValidateOrder),tests\NT8.Core.Tests\Risk\BasicRiskManagerTests.cs(3 new tests) - Action Required: Verify in SIM with config where RiskPerTrade > MaxTradeRisk — should throw ArgumentException with clear message.
DEC-20260711-02
- ID: DEC-20260711-02
- Date: 2026-07-11
- Status: accepted
- Context: Fixed 8-tick stop on NQ ignores market volatility. At typical ATR of 20-40 ticks, an 8-tick stop causes chronic stop-outs before the move develops. Need dynamic ATR-based stop sizing that adapts to actual market conditions.
- Decision: Implemented ATR-based dynamic stop in NT8StrategyBase with 5 new parameters: EnableDynamicStop (default false), AtrPeriod (14), AtrMultiplier (1.5), MinStopTicks (12), MaxStopTicks (50). In SubmitOrderToNT8(), before sizing: if EnableDynamicStop and CurrentBars[0] >= AtrPeriod, compute dynStop = clamp(round(ATR[0]/TickSize × AtrMultiplier), Min, Max), override intent.StopTicks, recalculate target from R:R ratio, pass ATR to context.CustomData["current_atr"] for Factor 3 and TrailingStopManager. Added [SDK] Dynamic stop logging.
- Consequences: Stop now scales with volatility — tighter stops in quiet markets, wider in volatile. Backward compatible: EnableDynamicStop=false preserves fixed StopTicks. Dual-deployed to NT8 Custom\Strategies.
- Related Files:
src\NT8.Adapters\Strategies\NT8StrategyBase.cs(5 params, dynamic stop logic, logging) - Action Required: Verify in SIM with EnableDynamicStop=true — session log should show [SDK] Dynamic stop line with computed value inside 12-50t; chart stop line should sit at ATR distance, not fixed 40t.
DEC-20260711-01
- ID: DEC-20260711-01
- Date: 2026-07-11
- Status: accepted
- Context: The original runner architecture coupled position management to capital sizing via
useRunner = Qty >= 2. This meant the runner (trailing stop leg) never activated at responsible ATR-based stops (typically Qty=1 at $200 risk with NQ ATR=20-40 ticks). The runner should be a POSITION MANAGEMENT MODE, not a quantity gate. - Decision: Implemented
RunnerModeenum with four modes: Auto (resolves Mode1 when Qty≥2, Mode2 when Qty=1), Mode1DualLeg (scaler + runner), Mode2RunnerOnly (full qty on trail stop, no fixed target), Mode3ScalerOnly (full qty with fixed target, no runner), Disabled (original single-leg). Added[NinjaScriptProperty] RunnerActivationModeto NT8StrategyBase with defaultAuto. Replaced the hardcoded quantity check withResolveRunnerMode()logic and mode-specific order submission inSubmitOrderToNT8(). Added[SDK] Runner mode resolved: {Mode} (Qty={N})logging. - Consequences: Runner now fires at Qty=1 with ATR-based stops, decoupling position management from sizing. Backward compatible: existing configs with
EnableRunner=trueand Qty≥2 will resolve to Mode1DualLeg automatically. Dual-deployed to NT8 Custom\Strategies. - Related Files:
src\NT8.Core\Common\Models\Configuration.cs(RunnerMode enum),src\NT8.Adapters\Strategies\NT8StrategyBase.cs(RunnerActivationMode property, ResolveRunnerMode(), SubmitOrderToNT8() mode logic) - Action Required: Verify Mode2RunnerOnly behavior in SIM with Qty=1 scenarios.
DEC-20260711-06
- ID: DEC-20260711-06
- Date: 2026-07-11
- Status: accepted
- Context: The bar-driven
_tradeTakenre-arm inSimpleORBStrategy.OnBar()was unreliable — it cleared_tradeTakenon the next bar after a trade intent, regardless of whether the NT8 position actually closed. This could allow overlapping entries if a new breakout bar arrived before the first trade was filled or stopped out. The original decision (DEC-20260429-01) accepted this for SIM but noted it must be fixed before live. - Decision:
- Added
OnPositionUpdate()logic inNT8StrategyBasethat detects when position goes flat (MarketPosition.FlatorQuantity == 0) and sendsclear_trade_takento the SDK strategy viaSetParameters(). - Added
clear_trade_takenhandler inSimpleORBStrategy.SetParameters()that clears_tradeTaken,_breakoutBarSeen, and_pendingBreakoutDirection(but preserves_dailyTradeCount). - Added
EnableBarBasedRearmparameter (defaultfalse) to bothNT8StrategyBaseandSimpleORBNT8to gate the legacy bar-driven re-arm for SIM-only mode. - The bar-driven re-arm in
SimpleORBStrategy.OnBar()now only executes whenEnableBarBasedRearm == true.
- Added
- Consequences: Position-close re-arm is now the primary mechanism for live trading (reliable, NT8-native). Bar-driven re-arm is opt-in via
EnableBarBasedRearm=truefor SIM/backtest scenarios. Backward compatible: defaults disable bar-driven re-arm, preserving existing behavior when explicitly enabled. Dual-deployed to NT8 Custom\Strategies. - Related Files:
src\NT8.Adapters\Strategies\NT8StrategyBase.cs(EnableBarBasedRearm param, OnPositionUpdate clear_trade_taken),src\NT8.Adapters\Strategies\SimpleORBNT8.cs(EnableBarBasedRearm param),src\NT8.Strategies\Examples\SimpleORBStrategy.cs(_enableBarBasedRearm field, SetParameters handlers, gated bar-driven re-arm) - Action Required: Verify in SIM with EnableBarBasedRearm=false — position close should clear _tradeTaken and allow new breakout; test EnableBarBasedRearm=true for SIM comparison.
DEC-20260711-07
- ID: DEC-20260711-07
- Date: 2026-07-11
- Status: accepted
- Context: Short trades were being vetoed by the AVWAP slope check (slope > 0 = bullish regime) without a configurable parameter. This made the filter mandatory and untestable in isolation — users couldn't disable it for testing or strategies that intentionally trade counter-trend.
- Decision: Added
EnableShortTrendFilterparameter (defaulttrue) toNT8StrategyBase,SimpleORBNT8, andSimpleORBStrategy. InSimpleORBStrategy.OnBar(), the short veto logic now checks this flag: whentrue, shorts are blocked if AVWAP slope > 0; whenfalse, shorts are allowed regardless of regime. Long veto in bearish regime (slope < 0) remains always enforced. The flag is passed from NT8 adapter to SDK strategy viaStrategyContext.CustomData["EnableShortTrendFilter"]. - Consequences: Short trend filter is now configurable and testable. Backward compatible: default
truepreserves existing behavior. Dual-deployed to NT8 Custom\Strategies. - Related Files:
src\NT8.Adapters\Strategies\NT8StrategyBase.cs(EnableShortTrendFilter param, BuildStrategyContext),src\NT8.Adapters\Strategies\SimpleORBNT8.cs(EnableShortTrendFilter param + ConfigureStrategyParameters),src\NT8.Strategies\Examples\SimpleORBStrategy.cs(_enableShortTrendFilter field, SetParameters, OnBar gating) - Action Required: Verify in SIM with EnableShortTrendFilter=false — short trades should fire even in bullish regime; with EnableShortTrendFilter=true (default) — shorts blocked when AVWAP slope > 0.
DEC-20260429-01
- ID: DEC-20260429-01
- Date: 2026-04-29
- Status: accepted
- Context:
MaxDailyTradesre-arm logic inSimpleORBStrategy.OnBar()clears_tradeTakenand resets pullback confirmation state on the next bar after a trade intent is generated, not when the NT8 position actually closes. This is becauseSimpleORBStrategyis a pure C# core class with no visibility into NT8 position lifecycle — it only sees bars. - Decision: Accept bar-based re-arm for SIM data collection phase. The daily loss limit (
DailyLossLimit) andMaxOpenPositionsin the NT8 adapter act as the live position guard, preventing overlapping entries from causing runaway risk in practice. - Consequences: In a fast market, a second trade intent could be generated while the first position is still open if the next breakout bar arrives before NT8 has filled or stopped the first trade. This is acceptable in SIM but must be addressed before live trading. The fix is to wire re-arm to a position-close callback in
NT8StrategyBase(Sprint 3/4 concern). - Related Files:
src\NT8.Strategies\Examples\SimpleORBStrategy.cs,src\NT8.Adapters\Strategies\NT8StrategyBase.cs - Action Required (pre-live): Implement position-close-driven re-arm in
NT8StrategyBasebefore going live withMaxDailyTrades > 1.
DEC-20260711-08
- ID: DEC-20260711-08
- Date: 2026-07-11
- Status: accepted
- Context: The strategy had no awareness of CME holidays, meaning it would attempt to trade on days when the market is closed (New Year's Day, MLK Day, Presidents Day, Good Friday, Memorial Day, Independence Day, Labor Day, Thanksgiving, Christmas) or has early closes (day after Thanksgiving, Christmas Eve, New Year's Eve). This caused errors and wasted compute on non-trading days.
- Decision: Implemented
CmeHolidayCalendarwith full CME holiday schedule including observed dates (weekend -> nearest weekday). AddedEnableCMEHolidayGuardparameter (defaulttrue) toNT8StrategyBase,SimpleORBNT8, andSimpleORBStrategy. InNT8StrategyBase.OnBarUpdate(), checksCmeHolidayCalendar.IsHoliday(Time[0].Date)and skips bar processing. InSimpleORBStrategy.OnBar(), checksCmeHolidayCalendar.ShouldSkipOrbWindow(bar.Time.Date)and returns null. Holiday list: New Year's Day (Jan 1), MLK Jr. Day (3rd Mon Jan), Presidents Day (3rd Mon Feb), Good Friday (computed via Easter), Memorial Day (last Mon May), Independence Day (Jul 4), Labor Day (1st Mon Sep), Thanksgiving (4th Thu Nov), Christmas (Dec 25). Early-close days also tracked viaIsEarlyClose(). - Consequences: Strategy now automatically skips non-trading days. Backward compatible: default
truepreserves new behavior; can disable for testing. Dual-deployed to NT8 Custom\Strategies. - Related Files:
src\NT8.Core\Calendar\CmeHolidayCalendar.cs(new),src\NT8.Adapters\Strategies\NT8StrategyBase.cs(EnableCMEHolidayGuard, OnBarUpdate),src\NT8.Strategies\Examples\SimpleORBStrategy.cs(EnableCMEHolidayGuard, OnBar),src\NT8.Adapters\Strategies\SimpleORBNT8.cs(EnableCMEHolidayGuard) - Action Required: Verify in SIM — session log should show "[SDK] CME Holiday Guard: skipping bar YYYY-MM-DD (holiday)" on CME holidays; strategy should not generate signals on those days.
DEC-20260711-09
- ID: DEC-20260711-09
- Date: 2026-07-11
- Status: accepted
- Context: The runner trailing stop used a fixed
RunnerTrailTicks(default 12-20 ticks) regardless of market volatility. In quiet markets this was too wide (giving back profits); in volatile markets too tight (premature stop-outs). Need ATR-based trailing that adapts to actual market conditions. - Decision: Added ATR-based trailing stop with 5 new parameters:
EnableATRTrailing(defaultfalse),ATRTrailingPeriod(14),ATRTrailingMultiplier(2.0),ATRTrailingMinTicks(8),ATRTrailingMaxTicks(60). WhenEnableATRTrailing=trueandCurrentBars[0] >= ATRTrailingPeriod, computestrailTicks = clamp(round(ATR(Close, ATRTrailingPeriod)[0] / TickSize * ATRTrailingMultiplier), ATRTrailingMinTicks, ATRTrailingMaxTicks)and callsSetTrailStopwith this dynamic value instead of fixedRunnerTrailTicks. Added logging:[SDK] ATR Trail: ATR={X}ticks x {Y} = {Z}ticks (clamped {Min}-{Max}). When disabled, falls back to fixedRunnerTrailTicks. - Consequences: Trailing stop now scales with volatility — tighter in quiet markets, wider in volatile. Backward compatible:
EnableATRTrailing=falsepreserves fixed tick trail. Dual-deployed to NT8 Custom\Strategies. - Related Files:
src\NT8.Adapters\Strategies\NT8StrategyBase.cs(5 params, ATR trailing logic in SubmitOrderToNT8, logging),src\NT8.Strategies\Examples\SimpleORBStrategy.cs(_enableAtrTrailing field, SetParameters, ATRTrailingPeriod/Multiplier/MinTicks/MaxTicks properties),src\NT8.Adapters\Strategies\SimpleORBNT8.cs(EnableATRTrailing, ATRTrailingPeriod/Multiplier/MinTicks/MaxTicks params + ConfigureStrategyParameters) - Action Required: Verify in SIM with EnableATRTrailing=true — session log should show [SDK] ATR Trail line with computed value inside 8-60t; chart trail stop should sit at ATR distance, not fixed 20t.
DEC-20260713-01
- ID: DEC-20260713-01
- Date: 2026-07-13
- Status: superseded
- Context: Sprint 2.6 (July 11) completed all 5 technical tasks (TASK-FIX-01, TASK-00a, TASK-00b, TASK-06c, GAP-024) and build/tests passed (492 tests). However, the v6.1 Master Document and Operator Runbook (dated July 13) were not committed to the repository, and Sprint artifacts (SPRINT_BOARD.md, KILOCODE_RUNBOOK.md, current_status.md) still reflected Sprint 2.6 state. Governance required reconciliation: commit v6.1 docs to repo archive, promote Sprint 4 backlog to Sprint 3 queue, rewrite sprint artifacts for Sprint 3 (Second Strategy + MNQ Prep), and log this reconciliation decision.
- Decision:
- Committed NT8_SDK_Master_Document_v6.1_Complete.docx and NT8_SDK_Operator_Runbook_v1.0.docx to docs/archive/master_docs/
- Rewrote SPRINT_BOARD.md: all 6 Sprint 2.6 tasks marked COMPLETED; Sprint 4 backlog promoted to Sprint 3 queue (TASK-06a Runner Mode, TASK-06b ATR Dynamic Stop, GAP-019 Portfolio Heat, GAP-003 RiskPerTrade Assertion, GAP-004 orbRangeTicks Fix, GAP-005 GetRiskStatus, GAP-006 Position Close Re-arm, GAP-010 Short Regime Filter, GAP-008 CME Holiday, GAP-009 ATR Trailing, GAP-011 Gitea CI, GAP-022 Scenario Tests, GAP-007 Walk-Forward Docs)
- Rewrote KILOCODE_RUNBOOK.md for Sprint 3 (Second Strategy + MNQ Prep) with TASK-06a, GAP-013, GAP-015, GAP-014, MNQ-001, MNQ-002 as the Sprint 3 queue
- Logged DEC-20260713-01 in decisions.md (this entry)
- Updated current_status.md to Sprint 3 handoff state
- Consequences: Sprint 2.6 governance fully reconciled. Sprint 3 queue defined and staged. SIM Gate remains blocked until governance reconciliation complete (now satisfied). All governance files consistent. Build and 492 tests still pass.
- Related Files:
docs/archive/master_docs/NT8_SDK_Master_Document_v6.1_Complete.docx,docs/archive/master_docs/NT8_SDK_Operator_Runbook_v1.0.docx,SPRINT_BOARD.md,KILOCODE_RUNBOOK.md,docs/00-governance/current_status.md,docs/00-governance/decisions.md - Action Required: Verify .\verify-build.bat ✅ | dotnet test ✅ (492 tests) | git status clean
DEC-20260713-02
- ID: DEC-20260713-02
- Date: 2026-07-13
- Status: accepted
- Context: The 2026-07-13 reconciliation (DEC-20260713-01) incorrectly re-queued 12 implemented tasks, archived master docs, and staged TASK-06a as next action. Code greps confirm all 12 tasks already implemented in code (verified by grep on ResolveRunnerMode, EnableDynamicStop, orbRangeTicks, CmeHolidayCalendar, EnableShortTrendFilter, GetRiskStatus, OnPositionUpdate, clear_trade_taken, ValidatePortfolioHeat, RiskPerTrade).
- Decision: Restore governance to match code reality.
- Move 12 July 11 tasks back to COMPLETED with 2026-07-11 dates in SPRINT_BOARD.md.
- Sprint 2.7 queue = TASK-00a (reissued), GAP-024 data layer, GAP-022 scenario tests, GAP-025 diagnosis.
- Move master docs from
docs/archive/master_docs/→docs/+docs/02-runbooks/. - Overwrite NEXT_PROMPT.md with TASK-00a reissue (grep-verifiable acceptance).
- Log this decision as DEC-20260713-02 superseding DEC-20260713-01.
- Update current_status.md for Sprint 2.7.
- Consequences: Sprint numbering realigned (2.7 truth reconciliation before 3). Governance artifacts now match code greps. NEXT_PROMPT.md stages TASK-00a reissue. DEC-20260713-01 superseded by this entry.
- Related Files:
SPRINT_BOARD.md,KILOCODE_RUNBOOK.md,NEXT_PROMPT.md,docs/00-governance/current_status.md,docs/00-governance/decisions.md,docs/archive/master_docs/(to be moved) - Action Required: Complete TASK-GOV-02 (governance reconciliation), then TASK-00a reissue.
DEC-20260714-01
- ID: DEC-20260714-01
- Date: 2026-07-14
- Status: accepted
- Context:
ComputeConfigHash()correctly fingerprints NinjaScript parameters, but a mid-gate recompile or redeploy can change executable code while preserving every parameter value and therefore the same config hash. - Decision: Persist a compiled-code stamp in all gate-relevant provenance. The stamp is the running assembly version plus
ManifestModule.ModuleVersionId; it is written to session provenance, each trade JSONL record, settings exports, and the SimpleORB strategy snapshot. Each real-time signal also writes its TestMode/LIVE MODE state to the session file log. - Consequences: Parameter drift and code drift are distinguishable without relying on a manually maintained git SHA. The Gate Run #2 procedure must archive both
ConfigHashandCodeVersion, and it forbids dual-deploys after the configuration freeze. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Strategies/Examples/SimpleORBStrategy.cs,docs/00-governance/patterns_and_antipatterns.md,SPRINT_BOARD.md,NEXT_PROMPT.md. - Action Required: Deploy the cleanup source, compile it in NinjaTrader, then record
DEC-GATE2-CONFIGbefore starting the gate.
DEC-20260810-01
- ID: DEC-20260810-01
- Date: 2026-08-10
- Status: accepted
- Context: Three settings exports from the same 2026-08-07 session (
settings_Simple_ORB_NT8_20260807_101520.txt,_101543.txt,_150539.txt) showBarsPeriodvalues of "15 Minute", "5 Minute", and "13 42069" (HFT Algo Bars) respectively, yet all three carry the identicalConfigHashdf5ff56e6db3a332e40568849f2a2fc7a121f0d57cf228b07935278bc58c9c10.ComputeConfigHash()excludesBarsPeriodfrom its input, meaning structurally different bar-type configurations are indistinguishable by hash. - Decision: Add
BarsPeriod(value + unit/type) to theComputeConfigHash()input. Audit all remaining settings-export fields against current hash inputs and include any other field found in the export but absent from the hash. Hash-computation-only change; trading logic must remain byte-for-byte unaffected. Kilocode prompt issued 2026-08-10, execution pending next non-armed window. - Consequences: Any gate run or provenance record predating this fix has unverified config-hash provenance and cannot be cited as proof of a frozen configuration on hash-match alone. Once fixed, hash changes are expected whenever
BarsPeriodchanges between exports in the same session. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs(ComputeConfigHash()),docs/00-governance/decisions.md - Action Required: Deploy fix during a window when the gate strategy is disabled (never mid-armed-session). After deploy, export settings twice in one session with different
BarsPeriodvalues and confirmConfigHashdiffers.
DEC-20260810-02
- ID: DEC-20260810-02
- Date: 2026-08-10
- Status: accepted
- Context: Two broker-confirmed live trades (2026-08-07, 2026-08-10) on
SimSimple ORBreconciled to the penny against8-7_to_8-10_executions.csv. Both were winners; both had the runner leg stopped near breakeven — contributing +1 tick (~$5) on 8/7 and exactly $0 on 8/10 — while the scaler leg produced 100% of net P&L on both days ($227.72 and $262.72 respectively). On 8/10, breakeven triggered at +25 ticks profit, only 3 ticks before the ATR-derived 28-tick target, leaving the runner effectively no room to run before being parked at breakeven and then stopped out by 1 tick of adverse slippage. - Decision: No change to runner logic (breakeven trigger placement,
RunnerTrailTicks) for Gate Run #3. Sample size (n=2) is insufficient to hand-tune a live parameter; any redesign must go through the Optimization Protocol (backtest-validated via NT8 Strategy Analyzer) before deployment, not be patched into a live/armed run. - Consequences: Gate Run #3 continues paying commission on a 3rd (runner) contract with $0–5 demonstrated contribution to date. Revisit trigger set explicitly: after 10 gate trades (half the 20-trade minimum), review runner P&L contribution as a pattern; if still flat/negative, proceed to offline backtest redesign of breakeven trigger distance and/or trail mechanism.
- Related Files:
docs/00-governance/decisions.md,NT8_SDK_Optimization_Protocol.docx, trade records8-7_to_8-10_executions.csv, session logssession_20260807_101543.log,session_20260810_070736.log - Action Required: No code action now. At 10th gate trade, pull runner-specific P&L across all trades to date and decide: keep, disable, or queue for Optimization Protocol redesign.
DEC-20260815-01
- ID: DEC-20260815-01
- Date: 2026-08-15
- Status: accepted — supersedes DEC-20260810-02
- Context: DEC-20260810-02 deferred all runner-logic changes to a revisit at 10 gate trades, on the reasoning that n=2 was insufficient to tune a live parameter. That reasoning assumed a valid gate run was accumulating interpretable trades. It was not. Gate Run #2 was voided, Gate Run #3 has not started, and GAP-034 means a zero-trade day cannot currently be attributed to a strategy decision versus a defect. A revisit trigger anchored to gate-trade count therefore cannot fire. Additionally, the deferral's core concern — modifying a parameter on a live armed strategy — does not apply: the strategy is disarmed and this work is pre-gate preparation.
- Decision: Runner redesign is in scope now, during the disarmed pre-gate window. The mechanism is understood: the breakeven trigger at 20 ticks sits close to the scaler target at 16 ticks and the ATR-derived target (28 ticks observed 2026-08-10), leaving the runner no room to extend before being parked at breakeven. The 10-gate-trade revisit trigger from DEC-20260810-02 is withdrawn. Requirement retained from DEC-20260810-02: any new trigger distance must be backtest-validated via the Optimization Protocol, not hand-picked. Validation must use the 60-trading-day warm-up and Tick Replay requirements of DEC-20260814-03.
- Consequences: Runner parameters are unfrozen until the Gate Run #3 configuration freeze, at which point the swept value is locked with the rest of the config. Gate Run #3 begins with a runner leg that has a documented empirical basis rather than an inherited default.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,NT8_SDK_Optimization_Protocol.docx,docs/00-governance/roadmap.md - Action Required: Execute RUNNER-001 sweep, record the selected trigger distance and its supporting statistics in a superseding entry before
DEC-GATE3-CONFIG.
DEC-20260814-01
- ID: DEC-20260814-01
- Date: 2026-08-14
- Status: accepted
- Context: Sessions on 2026-08-03, 08-04, and 08-13 produced zero trades on days with clear NQ breakouts, while 08-07 and 08-10 produced broker-confirmed trades. The defect is intermittent.
ProcessStrategyIntentwrites aSIGNAL:line to the session file log unconditionally for every realtime intent; no such line appears on the zero-trade days, proving no intent was produced and isolating the fault upstream of the execution pipeline. The four remaining candidate causes (grade filter,MaxDailyTradeslatch, ORB range not established, RTH guard) all log exclusively via_loggerto the NT8 Output window and never to disk, so no session log can distinguish them retrospectively. - Decision: Treat this as GAP-034 and block Gate Run #3 until root cause is identified. Prerequisite fix is GAP-035: route every signal-rejection reason to
FileLogalongside_loggerso a no-trade day is self-documenting. Do not restart the gate clock on the assumption that quiet days are normal Grade-A filtering. - Consequences: Gate Run #3 start date slips. All Sprint 3 completion criteria now include GAP-034 closure. Any future zero-trade day becomes diagnosable from disk without requiring the Output window to have been open at the right moment.
- Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Strategies/Examples/SimpleORBStrategy.cs,docs/00-governance/current_status.md,docs/00-governance/common_failures.md - Action Required: Execute GAP-035, redeploy during the disarmed window, then run one session with the Output window open as a cross-check that file and Output agree.
DEC-20260814-02
- ID: DEC-20260814-02
- Date: 2026-08-14
- Status: accepted
- Context:
GetRiskMode()reads_strategyConfig.Parameters["risk_mode"]while the SDK writes resolved risk mode tocandidate.Metadata["risk_mode"]. The key is never present inParameters, so every trade record serializesrisk_modeas"Unknown". This is the same defect class as GAP-031, which fixed four fields by name and did not audit theParameters/Metadatasplit for other consumers. - Decision: Fix as GAP-036 by sourcing from
intent.MetadatawithParametersretained as fallback. Additionally require that any provenance field capable of holding a sentinel value ("Unknown",0.0,"None") carry a round-trip test asserting a real value survives serialization. - Consequences: All trade records to date have unusable
risk_modeprovenance. Gate evidence citing risk mode must be regenerated after the fix. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Core/Logging/TradeProvenanceSerializer.cs,tests/NT8.Core.Tests/Logging/TradeProvenanceSerializerTests.cs - Action Required: Execute GAP-036 in the 2026-08-15 to 08-17 disarmed window.
DEC-20260814-03
- ID: DEC-20260814-03
- Date: 2026-08-14
- Status: accepted
- Context: A backtest of a day that traded live produces zero trades. In Strategy Analyzer the secondary daily series loads only from the backtest start date, so
BuildDailyBarContextreturnsCount=0below 2 daily bars and daily-dependent confluence factors score neutral, pushing the composite below the Grade A threshold. The regime gate separately requires 50 daily bars (CurrentBars[1] >= SmaPeriodLong) and never arms on short backtests. Neither path raises an error, and the NR7 warm-up advisory deliberately does not block. - Decision: This is expected behaviour, not a defect. Backtests intended to reproduce live behaviour must set the Strategy Analyzer start date at least 60 trading days before the target day. When the primary series is non-time-based (HFT Algo Bars, range, tick, volume), Tick Replay must be enabled or bar construction will differ from live regardless of warm-up.
- Consequences: A zero-trade backtest is not evidence that no signal existed and must not be cited as such. Prior single-day backtest results are void as comparative evidence.
- Related Files:
src/NT8.Strategies/Examples/SimpleORBNT8.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/common_failures.md - Action Required: None in code. Fold the 60-day rule and the Tick Replay requirement into the operator runbook and the Optimization Protocol.
DEC-20260814-04
- ID: DEC-20260814-04
- Date: 2026-08-14; accepted 2026-08-16
- Status: accepted
- Context:
SimpleORBNT8.SetDefaults()setsEnableShortTrades = false, commented "Long-only: short trades permanently disabled pending backtest confirmation." Live runs have taken Sell entries via workspace override. Source and runtime therefore disagree, and no gate run is reproducible from a clean checkout. Separately,StartBehavior = AdoptAccountPositionis an undocumented change from the last recorded state. - Decision: Shorts are in scope for the strategy under validation.
SimpleORBNT8.SetDefaults()must setEnableShortTrades = trueso a clean checkout matches live workspace usage.StartBehavior = AdoptAccountPositionis retained because it avoids NT8 start-up synchronization submitting or flattening during historical replay bursts before the first live bar. - Consequences: Direction defaults are reproducible from source, and the StartBehavior choice is explicitly documented. Workspace overrides should not be required to reproduce short-enabled gate runs.
- Related Files:
src/NT8.Adapters/Strategies/SimpleORBNT8.cs,src/NT8.Adapters/Strategies/NT8StrategyBase.cs,tests/NT8.Core.Tests/Adapters/SimpleORBNT8DefaultsTests.cs - Action Required: None.
DEC-20260816-01
- ID: DEC-20260816-01
- Date: 2026-08-16
- Status: accepted
- Context:
roadmap.md'sLast Updatednote carried a rolling "full republish planned 2026-08-16" annotation, and the master document's Section 23.4 heartbeat rule allowed governance docs to go up to 7 days without review on a rolling clock rather than a fixed date. In practice this let a republish drift to whenever convenient; on 2026-08-16 the working tree was also found dirty enough to fail two consecutive Gate 3 freeze/verify attempts (freeze_20260816_003543,freeze_20260816_003653), with the last substantiveroadmap.md/current_status.mdupdate two days stale relative to same-day decisions (DEC-20260814-04 accepted 2026-08-16; DEC-20260815-01 not yet reflected in either doc). - Decision: Replace the rolling 7-day heartbeat allowance with a fixed weekly cadence:
roadmap.mdandcurrent_status.mdare reviewed and republished every Sunday, before every Monday–Friday gate week, permanently and without exception, whether or not anything material changed. Full process defined indocs/02-runbooks/weekly_roadmap_cadence.md. A recurring Sunday scheduled review is configured on the operator's Claude session scheduler to drive this; if repo/device access is unavailable at trigger time, the scheduled review drafts from the Claude Project's operational artifacts and flags what it could not verify against live repo state, rather than skipping the week. - Consequences: Every gate week starts with governance docs that are at most a few hours stale, not up to 7 days. The master document's Section 23.4 heartbeat language is superseded by this entry and should read as a pointer to this runbook in the next master document revision (v6.4).
- Related Files:
docs/00-governance/roadmap.md,docs/00-governance/current_status.md,docs/02-runbooks/weekly_roadmap_cadence.md,docs/00-governance/decisions.md - Action Required: None in code. First scheduled Sunday review configured 2026-08-16 for 2026-08-23 onward.
DEC-20260817-01
- ID: DEC-20260817-01
- Date: 2026-08-17
- Status: accepted
- Context:
WriteSessionProvenance()andWriteTradeProvenance()returned silently whenLogDirectorywas blank, whileInitFileLog()andWriteSettingsFile()already used the default pathDocuments\NinjaTrader 8\log\nt8-sdk. The ORB-specificWriteSessionProvenance()override had the same silent guard. This created a split-brain evidence state:session_*.logandsettings_*.txtcontinued writing, butprovenance_*.jsonandtrades_*.jsonldid not. The affected period includes broker-confirmed trades from 2026-08-07, 2026-08-10, 2026-08-16, and 2026-08-17. - Decision: Provenance and trade JSONL writes must use the same default log directory fallback as session logs/settings whenever
LogDirectoryis blank. The fallback must be explicit in bothPrint()andFileLog()so this failure mode is never silent again. - Consequences: Gate evidence for trades since 2026-07-31 cannot rely on missing provenance/trade JSONL as proof of no trades or no submissions. Broker statements/session logs remain necessary for those sessions. Future blank
LogDirectoryconfigurations produce provenance and trade records at the default path with visible warnings. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,src/NT8.Adapters/Strategies/SimpleORBNT8.cs,docs/00-governance/decisions.md - Action Required: Redeploy and manually NinjaScript-compile before relying on new provenance/trade JSONL artifacts.
DEC-20260817-02
- ID: DEC-20260817-02
- Date: 2026-08-17
- Status: accepted
- Context:
trades_Simple_ORB_NT8_20260817.jsonlreceived 57 rows during a 14-second restart replay window (2026-08-17T16:51:16.124Zthrough2026-08-17T16:51:30.109Z) while broker execution grid review showed no matching activity.OnExecutionUpdate()and live session-logSIGNAL/SUBMITwrites are alreadyState.Realtimegated, butWriteTradeProvenance()was called fromSubmitOrderToNT8()without an equivalent gate. Source review also found that live-chart historical replay passesAllowDailyTradeCountIncrement=falsewhenState.HistoricalandAccount != null, so accepted historical intents do not increment_dailyTradeCountandMaxDailyTradescannot cap the replay burst in that mode. The persisted trade JSONL has only wall-clocktimestamp_utc; it does not include the bar's own historical timestamp, so exact per-row bar-date distribution cannot be reconstructed from the file. - Decision:
WriteTradeProvenance()must return immediately unlessState == State.Realtime. This is a provenance/data-integrity gate only and must not alter signal generation, risk validation, order submission, or entry/exit behavior. Do not change historical daily-count logic without a separate approved task because it may affect Strategy Analyzer/backtest behavior. - Consequences: Historical catch-up/replay can no longer append phantom trade provenance rows. Existing
trades_Simple_ORB_NT8_20260817.jsonlis contaminated by 57 phantom rows (49Buy,8Sell;43RTH_ORB,14ETH; all quantity3, gradeA) and must not be used by dashboard/logtriage as clean gate evidence. Future forensic schema work should consider adding abar_timefield to trade provenance so replay investigations can map rows to historical bars. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,docs/00-governance/decisions.md,C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk\trades_Simple_ORB_NT8_20260817.jsonl - Action Required: Archive the contaminated 2026-08-17 trade JSONL before the next gate attempt, redeploy with the strategy disabled, delete
NinjaTrader.Custom.dll, compile all NinjaScript cleanly, and verify a clean session start before re-arming.
DEC-20260817-06
- ID: DEC-20260817-06
- Date: 2026-08-17
- Status: accepted
- Context:
tools/runnersweep/runnersweep.py'sis_runner_leg()classified a trade row as a runner leg only if the literal words "runner" or "run" appeared in its Leg/Entry name/Exit name/Signal name fields (and excluded rows containing "scaler"/"scale").SubmitOrderToNT8()inNT8StrategyBase.csactually names legsSDK_{Symbol}_R_{hex}(runner) andSDK_{Symbol}_S_{hex}(scaler) — neither word appears in either name. Every combo in the 18-run sweep would therefore have been marked invalid with "missing runner-leg rows" regardless of how correctly the Strategy Analyzer backtests were run and exported, discovered before any backtest time was spent by readingSubmitOrderToNT8()'s signal-naming logic directly rather than assuming the tool's existing matcher was correct. - Decision:
is_runner_leg()now also matches the literal_r_/_s_token from the real signal-naming convention, in addition to the original word-based matching (kept for compatibility with differently-named strategies). Verified safe: the{hex}suffix inSDK_{Symbol}_R_{hex}/SDK_{Symbol}_S_{hex}is a GUID-derived hex string (characters0-9a-fonly), which cannot contain the lettersrorsneeded to form a false_r_/_s_match, so there is no risk of misclassifying the hex portion as a leg marker. - Consequences: The sweep can now correctly separate runner-leg trades from scaler-leg trades once real Strategy Analyzer exports are analyzed. This was caught before any of the 18 backtests were run, avoiding wasted analyzer time on exports the tool would have silently mis-scored.
- Related Files:
tools/runnersweep/runnersweep.py,src/NT8.Adapters/Strategies/NT8StrategyBase.cs(SubmitOrderToNT8()),docs/00-governance/decisions.md - Action Required: None in code beyond the fix already made. When real Strategy Analyzer exports exist, spot-check that
runner_trades/combined_trade_countin the JSON output look proportionally reasonable (Mode1DualLeg splits each fill into one scaler row and one runner row) before trusting the recommendation.
DEC-20260817-05
- ID: DEC-20260817-05
- Date: 2026-08-17
- Status: accepted
- Context: DEC-20260817-03 noted that
tools/dashboard/server.pyalready parsedREJECT:/REJECT SUMMARY:lines for the live current-session tail via a private_parse_rejections()/_parse_key_values()pair, buttools/logtriage/logtriage.py's file-based parser had no reject handling at all — so any offline/historicallogtriage.py --jsonrun (the primary use case for silent-day forensics on past sessions) exposed no rejection data, and the two files carried duplicate, divergence-prone parsing logic. - Decision: Added
parse_key_values()tologtriage.pyas the canonical parser (identical marker-bounded-value approach to the originalserver.pyimplementation, sodetailtext containing=or the word "bar" parses correctly).SessionSummarynow carriesreject_summaries,reject_records, andreject_summary_final(last-observed count per reason), populated while parsingsession_*.logand exposed viato_dict(). TheSILENT DAYdiagnostic inbuild_diagnostics()now appends aRejections: <reason>=<count>, ...breakdown (and machine-readablereject_totals) whenever data is available, so a silent day is self-explanatory in triage output rather than merely flagged.server.py._build_current_rows()no longer needs its own reject parsing —logtriage.parse_session_file()already supplies the fields onrow_dicts[0]— so the duplicate_parse_rejections()/_parse_key_values()methods and the now-unusedlinesparameter on_build_current_rows()were removed. Field names/shapes are unchanged from whatserver.pyproduced before and match whattools/dashboard/app.jsalready expects (row.reject_summaries[].{reason,count,line},row.reject_records[].{reason,detail,bar,line}), so no frontend change was needed. - Consequences:
logtriage.py --jsonrun against archived log directories now surfaces the same rejection data the live dashboard already showed for the current session, closing the gap DEC-20260817-03 flagged. There is exactly one parser for this line format going forward instead of two. Logic was verified by hand-tracing both theREJECT:andREJECT SUMMARY:lines from the realsession_20260817_125115.logarchive; it has not been executed, since Claude has no code-execution access on the operator's machine — an operator run ofpython tools/logtriage/logtriage.py --jsonagainst the archive is the next real validation step. - Related Files:
tools/logtriage/logtriage.py,tools/logtriage/README.md,tools/dashboard/server.py,docs/00-governance/decisions.md - Action Required: Run
python tools/logtriage/logtriage.py "C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk\ARCHIVE" --jsonand confirmreject_summaries/reject_records/reject_summary_finalappear on session rows with no exceptions raised; spot-check theSILENT DAYdiagnostic message on a known silent day.
DEC-20260817-04
- ID: DEC-20260817-04
- Date: 2026-08-17
- Status: accepted
- Context: DASH-002 was blocked pending confirmation that synthetic telemetry generation does not invoke state-mutating paths in
RegimeManager,TrendRegimeDetector, orVolatilityRegimeDetector. Direct source review ofNT8StrategyBase.cs,SimpleORBStrategy.cs, andFactorCalculators.csconfirms these three classes are instantiated inInitializeSdkComponents()but never called anywhere in the live signal path. The regime/volatility values actually used for signal generation are computed independently: inline SMA20/50 math inBuildStrategyContext()and pure-function ATR-ratio math insideVolatilityRegimeFactorCalculator/TrendAlignmentFactorCalculator, both of which read fromcontext.CustomDatawith no side effects.RegimeManager.UpdateRegime(),TrendRegimeDetector.DetectTrend(), andVolatilityRegimeDetector.DetectRegime()mutate bar history, current-regime dictionaries, and transition logs on every call, and are currently dead code. - Decision: DASH-002 is unblocked. Telemetry implementation must sample only from the existing side-effect-free sources (the inline regime calc in
BuildStrategyContextand the existingIFactorCalculator.Calculate()pure functions) and must not callRegimeManager.UpdateRegime(),TrendRegimeDetector.DetectTrend(), orVolatilityRegimeDetector.DetectRegime()for periodic sampling. This constraint is now recorded inTASK_DASH-002_PROMPT.md. - Consequences: DASH-002 can proceed without risk of corrupting future use of the regime-detector classes. If a later task wires
RegimeManager/TrendRegimeDetector/VolatilityRegimeDetectorinto the live decision path, it starts from genuinely empty state rather than state pre-seeded by telemetry sampling. - Related Files:
TASK_DASH-002_PROMPT.md,src/NT8.Core/Intelligence/RegimeManager.cs,src/NT8.Core/Intelligence/TrendRegimeDetector.cs,src/NT8.Core/Intelligence/VolatilityRegimeDetector.cs,docs/00-governance/decisions.md - Action Required: None in code from this decision alone. Kilocode proceeds with DASH-002 per the updated prompt.
DEC-20260817-03
- ID: DEC-20260817-03
- Date: 2026-08-17
- Status: accepted
- Context: GAP-035 made per-reason rejection details readable by logging only the first
REJECT:line for each unique reason. Aggregate counts were still only written byWriteRejectSummary()atState.Terminated, leaving armed live sessions without current silent-day counts until the strategy stopped. Dashboard live parsing andlogwatch.pyalready understandREJECT SUMMARY: reason=<Reason> count=<count>, buttools/logtriage/logtriage.pydoes not currently parse these lines despite dashboard copy referring to "logtriage JSON" for silent-day summary data. - Decision: Keep per-detail
LogRejectRateLimited()behavior unchanged, but write aggregateREJECT SUMMARYsnapshots during live sessions. The cadence is first live rejection at or after 10:00 ET, then every 15 bar-minutes while live rejections continue. The summary line format remains unchanged so existing live dashboard/logwatch parsers continue to consume it. - Consequences: Operators can see current rejection counts during the session without flooding the log with every individual rejection. Offline
logtriage.py --jsonwill still not expose these summaries until a separate parser update is approved. - Related Files:
src/NT8.Adapters/Strategies/NT8StrategyBase.cs,tools/logwatch/logwatch.py,tools/dashboard/server.py,tools/dashboard/app.js,tools/logtriage/logtriage.py,docs/00-governance/decisions.md - Action Required: Validate in a live RTH session that at least one
REJECT SUMMARYsnapshot appears before termination and that displayed counts match_rejectCountsat snapshot time.