# Current Status — NT8 SDK **Last Updated:** 2026-08-26 (GAP-030 implemented/deployed test-only) --- ## 2026-08-26 — GAP-030 verified; repo-side fix is test coverage only Implemented `TASK_GAP030_ORB_HYDRATION_VERIFY_PROMPT.md` as a verify-first, test-only task. The source trace checked out: `SimpleORBStrategy.OnBar()` has no historical/realtime state input and builds the ORB range from every delivered in-window bar; `NT8StrategyBase.OnBarUpdate()` does not block `State.Historical` bars before `_sdkStrategy.OnBar()`; `ProcessStrategyIntent()` retains the live-account `State == State.Historical && Account != null` guard before portfolio risk, sizing, and submission. No production hydration logic was added. Added tests proving full-window replay hydrates `_openingRangeHigh`/`_openingRangeLow` and marks `OpeningRangeReady` on the first post-window bar, partial-window delivered bars hydrate from the bars actually delivered, `OnBarUpdate()` does not contain an executable pre-`OnBar` historical block, and `ProcessStrategyIntent()` keeps the `HistoricalReplayCatchup` order-submission guard. Focused GAP-030 tests passed 4/4; `verify-build.bat` passed 576/576. Deploy completed with backup `20260826_010653`; `NinjaTrader.Custom.dll` was already absent. External NT8 docs fetched during the task did not prove whether a late enable always receives same-day historical bars, so that platform behavior remains an operator observation point rather than a source-code defect. --- ## 2026-08-26 — GAP-025 implemented; runner/scaler order lifecycle logging added Implemented and deployed `TASK_GAP025_RUNNER_ORDER_LIFECYCLE_LOGGING_PROMPT.md` as additive logging only. `NT8StrategyBase.OnOrderUpdate()` now writes realtime `ORDER SDK_... State=... Filled=.../... AvgFillPrice=...` lines for SDK-managed order transitions, making submitted/accepted/working/cancelled/rejected lifecycle state visible in the persistent session log. `OnExecutionUpdate()` keeps the existing `FILL` line shape but adds `Signal=...` so scaler (`SDK_*_S_*`) and runner (`SDK_*_R_*`) fills are distinguishable after the fact. Verification passed: focused Adapter tests 81/81 and `verify-build.bat` 572/572. Existing order-management behavior was not changed: `SubmitOrderToNT8`, managed order calls, `_circuitBreaker.RecordOrderRejection`, `_executionAdapter.ProcessOrderUpdate`, `_executionAdapter.ProcessExecution`, and `PortfolioRiskManager.ReportFill` remain intact. Deploy completed with backup `20260826_010153`; `NinjaTrader.Custom.dll`/`.pdb` were invalidated. --- ## 2026-08-26 — GAP-062 implemented; scoring behavior changed, deploy skipped Kilocode implemented `TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md` as a real confluence-scoring fix. `SimpleORBStrategy.UpdateConfluenceInputs()` now publishes side-specific `trend_confirm_long` and `trend_confirm_short` values from the existing AVWAP slope, and `TrendAlignmentFactorCalculator` selects the value matching `intent.Side` while preserving the existing `+0.4` price-vs-AVWAP, `+0.3` slope-aligned, and `+0.3` trend-confirm additive structure. The legacy `TrendConfirm` telemetry field remains the same log key, but its backing value is now resolved against the pending/current breakout direction where available. Verification passed: focused Intelligence tests 89/89 and `verify-build.bat` 569/569. No `TrendConfirm`/`AvwapSlope` lines were present in the current NT8 session log directory, so there was no deployed GAP-061 telemetry evidence to compare before this source fix. Deploy was intentionally skipped per the task header. This is not behavior-neutral: short setups that were previously capped below Grade A can now qualify, so SIM before/after observation is required before trusting the change live. --- ## 2026-08-25 — GAP-060/059/051/052 verified via diff review; deploy pending Kilocode reported all four complete (`6c672a5`/`7e82b2c`/`18877c3`/`8b9a2e2`). Read every diff directly rather than trusting the summaries. All four confirmed correct and matching their task prompts: GAP-060's snapshot suppression is now a proper date-aware window (not the old blanket midnight-10am gate), the once-after-ORB flag resets per trading day, and a heartbeat call makes the flush independent of a reject occurring — a real execution test proves `OrbRangeNotEstablished` was always being recorded correctly (the visibility gap was purely in the reporting layer). GAP-059 correctly sources ORB high/low from the live SDK tracker and removes the dead fields, verified with a real factor-calculator test using tonight's actual logged range. GAP-051 implements Option A (persisted advisory, safe fallback on corrupt/missing file). GAP-052 implements Option A and, as a legitimate bonus, found and consolidated two *additional* undocumented tick-value tables in `AdvancedRiskManager`/`AdvancedPositionSizer` that had the same drift risk — not something the original task asked for, but the right call. One process note, not a code defect: for GAP-060/GAP-059, `deploy-to-nt8.bat` was actually run and only failed because a running `NinjaTrader.exe` held a lock on `NT8.Core.dll` — the "commit only, do not deploy" instruction added to those two task files didn't reach Kilocode (it committed an older cached copy of the files without that line). GAP-051/052 correctly skipped deploy, per a direct operator instruction given mid-run rather than from the file text. Net effect tonight was harmless, but worth knowing the instruction didn't do its job on its own. Full detail in `decisions.md` DEC-20260825-01, including a separate note about uncommitted working-tree drift and a `.git/index.lock` warning surfaced during verification — not investigated further, worth an operator check before the next Kilocode run. --- ## 2026-08-24 — Suspected missed 10:49 ET A-grade setup investigated: not a missed trade Mo flagged a likely-missed A setup just after 10:00 ET. Found two real `Grade=A` `STATE:` prints at `10:49:59` (Score=0.838) and `10:54:59` (Score=0.804), both `Direction=Buy DirectionSource=OpeningRangeMidpoint`. Confirmed this is the same synthetic-telemetry pattern as the earlier 09:30-10:00 finding, one tier further along: `OpeningRangeMidpoint` means the side was chosen purely by which half of the ORB range price sat in, not a confirmed breakout — `sdkOrb.PendingBreakoutDirection` was `0` at that moment. A genuinely actionable setup shows `DirectionSource=PendingBreakout` instead, and that value does appear correctly elsewhere in the same multi-day log on a later trading day, confirming the field works as designed. Zero `[SDK] Intent generated` prints anywhere in the entire session corroborates no real signal ever fired. Full evidence in `decisions.md` DEC-20260824-01. Recommended (not yet a task) a clarity improvement: flag Grade as informational-only in the dashboard/log whenever `DirectionSource != PendingBreakout`, so a high score doesn't read as a real signal at a glance. Also: staged `TASK_GAP060/059/051/052` prompts now explicitly instruct Kilocode to commit and verify-build only — no `deploy-to-nt8.bat` — while `Sim101` stays live under investigation. Deploy is a manual operator step once ready. --- ## 2026-08-24 — No-trade RTH day reviewed: 09:30-10:00 telemetry explained, new REJECT-visibility defect found (GAP-060) Mo reported no trades taken, price never broke out, and asked about several Grade-A `STATE:` prints seen between 09:30-10:00 ET that appeared to reject because "it wasn't 10AM yet." Reviewed `session_20260823_230519.log` (continuous session, 2026-08-23 23:05 ET → 2026-08-24 20:20+ ET) directly. **Not a defect — confirmed by-design:** `SimpleORBStrategy.OnBar()` correctly and unconditionally rejects with `OrbRangeNotEstablished` for any bar before the ORB window (09:30-10:00 ET) closes — an ORB strategy cannot evaluate a breakout of a range that hasn't finished forming. The Grade-A `STATE:` lines Mo saw in that window are a separate, always-on diagnostic telemetry stream that scores a hypothetical default-long intent (`DirectionSource=DefaultLong`) for dashboard purposes only — confirmed via `STATE_CONTEXT` omitting `OrbHigh`/`OrbLow`/`OrbReady` entirely before 10:00 ET, appearing only from `10:04:59` on. Nothing tradeable was missed. **New finding, GAP-060:** While confirming the above, found the file log has a ~16-hour `REJECT SUMMARY` blackout — `23:55:01` (Aug 23 night) to `16:00:00` (Aug 24 afternoon) — covering the entire trading day Mo was asking about. Root cause traced to `MaybeWriteRejectSummarySnapshot`'s time-of-day gate (blocks the whole midnight-10am span daily, not just the ORB window), a session-lifetime (not per-day) "already written" flag that fires once on a multi-day run and never again, and a snapshot mechanism that's only ever triggered as a side effect of some other reject — no independent timer. Left open whether `OrbRangeNotEstablished` itself is being counted at all during this window (the one snapshot we do have, at 16:00, shows zero for that reason despite a full no-breakout day) — flagged for Kilocode to determine via a live/test trace rather than assumed. Full evidence in `decisions.md` DEC-20260823-08; task prompt staged as `TASK_GAP060_REJECT_SUMMARY_VISIBILITY_PROMPT.md`. Recommended ahead of GAP-059/051/052 in priority — this blocks diagnosing any future no-trade day from the file log alone. --- ## 2026-08-23/24 — Live SIM results: two fixes confirmed live, one new telemetry-only defect found Continuing the same `Sim101` SIM session from DEC-20260823-04 through the market open and ORB window. Findings from reading the live `STATE:`/`STATE_DETAIL` lines directly: **Confirmed correct, live, in production (not just unit tests):** - GAP-047 Part 2 — every `STATE:` line's factor weights read the designed values (`...x0.20`/`x0.15`/`x0.15`/`x0.20`/`x0.15`) exactly. - GAP-049's direction fix — `GapDirectionAlignment` correctly reads "aligns with trade" for a down gap on a Sell setup, and "opposes trade" for a down gap on a Buy setup. Both directions confirmed correct in live output. **New finding, GAP-059:** `OrbRangeVsAtr` still reads "No daily bar context available" on every `STATE_DETAIL` line from 08:29 ET through at least 10:49 ET, despite `STATE_CONTEXT` confirming `OrbReady=True` with a real, formed opening range (`OrbHigh=29243.00 OrbLow=28946.75`). Traced to source: `SimpleORBNT8.OnBarUpdate()` computes the ORB range from `_openingRangeHigh`/`_openingRangeLow`, two fields that are declared and read but never assigned anywhere in the file — a pre-existing dead-field bug, not something GAP-049 introduced. The correct live values already exist in the same file (`sdkOrb.OpeningRangeHigh`/`OpeningRangeLow`, the same fields that correctly populate `STATE_CONTEXT`'s own `OrbHigh`/`OrbLow`). Confirmed telemetry-only — `_strategyConfig.Parameters["daily_bars"]` is read in exactly one place in the file (the telemetry builder), so real trade-signal scoring is unaffected. Full evidence and recommended fix in `decisions.md` DEC-20260823-05; task prompt staged as `TASK_GAP059_ORB_RANGE_TELEMETRY_PROMPT.md`. No SIGNAL/SUBMIT/FILL activity yet as of 10:49 ET — price has not broken the ORB range. GAP-045/046's sizing/risk behavior, GAP-048's reject taxonomy, and GAP-055's restart persistence all still await a real signal to validate. --- ## 2026-08-23, late — Post-compile SIM validation: SDK init failure hit and resolved Operator compiled NinjaScript (picking up GAP-054/045-046/048/055/049 in one pass) and started the strategy on `Sim101`. First start silently failed: session-start diagnostics looked normal (they print unconditionally regardless of SDK health), but every bar rejected with `WarmupIncomplete detail=SdkInitialized=False StrategyNull=True`. Diagnosed via the exported settings + `RiskEnvelopeValidator.ValidateStartupConfiguration()` source: NQ's pre-existing `MaxStopTicks=50` (code default, not overridden) × `$5.00` tick value = `$250.00`, exceeding the configured `MaxTradeRisk=$200.00` — the original GAP-045 collision, now enforced as a hard startup throw rather than a per-trade rejection. This means the current NQ configuration cannot start the strategy at all until the pair is reconciled — a stronger consequence than the original GAP-045/046 review anticipated, since DEC-20260818-19/DEC-20260819-01 deferred the actual fix to a later MNQ cutover. Operator raised `MaxTradeRisk` to `$250.00` on `Sim101` only (SIM-only, interim bridge; does not touch the frozen gate account or reverse the MNQ-cutover plan). Restarted; confirmed SDK initialized successfully this time via the session header's `Risk: ... MaxTradeRisk=$250 ...` line, no further `SdkInitialized=False` rejects, and a clean run through NT8's historical catch-up replay burst (78 bars correctly discarded by the pre-existing replay-burst guard) to `[REALTIME ELIGIBILITY]`. Full detail in `decisions.md` DEC-20260823-04, including an incidental but genuine real-world confirmation that GAP-045/046's Assertion B works correctly both when violated and when reconciled. One real observability gap surfaced by this: SDK-initialization failures only reach NT8's Output/Log window, never the persistent session file — so a normal-looking startup in the file log is not proof the strategy is actually running. Worth a future low-priority task to route init-failure messages through `FileLog` too. Strategy is now at `[REALTIME ELIGIBILITY]` on `Sim101` with the corrected config. Group A validation (GAP-045/046 sizing/risk behavior, GAP-048 REJECT SUMMARY taxonomy, GAP-055 restart persistence, GAP-049 STATE_DETAIL gap alignment) has not yet been observed — in progress. --- ## 2026-08-23 — GAP-049 IMPLEMENTED, manual NT8/live SIM STATE_DETAIL spot-check pending Kilocode executed `TASK_GAP049_TELEMETRY_DIRECTION_PROMPT.md` (commit `a005dee`). `SimpleORBNT8.BuildStateTelemetryIntent()` now clones `DailyBarContext` rather than attaching the shared object directly, sets clone-only `TradeDirection`/`BreakoutBarVolume`/`TodayOpen`/`AvgIntradayBarVolume` from the telemetry intent's own side plus the existing stable `session_open_price`/`avg_volume` context fields, and adds `orb_range_ticks` metadata. No `SIGNAL`/`SUBMIT`/`FILL`/`PNL_UPDATE`/`REJECT`/sizing/risk/order-submission path touched. Independent verification: read the full `SimpleORBNT8.cs` diff directly. Confirmed `DailyBarContext` is a `struct` (`FactorCalculators.cs` ~408) whose only fields this fix reassigns are scalars — the array fields (`Highs`/`Lows`/`Closes`/`Opens`/`Volumes`) are read but never mutated, so the value-type copy `daily = source` is a genuinely safe clone that satisfies DEC-20260818-06's no-shared-mutation constraint. Confirmed `session_open_price`/`avg_volume` are pre-existing fields already populated once per session by the real trade path (`SimpleORBStrategy.cs`), not new/fabricated inputs. P1-E gap-magnitude finding also verified as sound on its own internal evidence, independent of the external NQ price citation: the same session log reported the "-523.25" figure as different values throughout one RTH session (per `decisions.md` DEC-20260823-03, roughly -389.75 to -555.75), which by itself proves the old code was reading a drifting current-bar value rather than a fixed overnight open. Test coverage: `OrbConfluenceFactorTests.cs`'s new `GapDirection_LargeDownGapForSell_ScoresOneAndAligns` is a real execution test against the exact cited 30096.00/30077.00 values, confirmed to call the actual `GapDirectionAlignmentCalculator` and assert Score=1.0 / "aligns with trade." `SimpleORBNT8DefaultsTests.cs`'s two new tests are source-text assertions (grep the compiled method body), not execution tests — consistent with that file's pre-existing pattern for this NinjaScript-derived adapter class, which cannot be instantiated outside NT8; not a new GAP-058-style tautology, just the weaker coverage tier this codebase already uses where no execution seam exists. No errors found. `active_work.md` row 7 and the run book's Play 9 were stale (still read "READY") — updated to reflect implementation. --- ## 2026-08-23 — Independent verification of all four Kilocode reports complete Read every diff directly (not just Kilocode's summary) for `80c5f53` (GAP-047 Part 2), `e36534b` (GAP-048), `6658d2d` (GAP-055), and `d652e29` (GAP-045/046), plus the new/changed test files and the governance-doc updates each commit carried. All four are code-complete, correctly scoped to their `TASK_*.md` prompts, and no functional defect was found. One minor finding: `SimpleORBRejectionLoggingTests.cs`'s third new test (`RejectLineFormat_DiffersOnlyByReasonToken`) is tautological — it never calls production code, only compares two hand-written literal strings. Logged as **GAP-058** (`decisions.md` DEC-20260823-02), tracking-only, does not block anything; the other two new tests in that file are sound and do exercise real code. **Update, same day:** GAP-058 fixed and committed (`f45adca`). Verified the diff directly — the test now invokes `SimpleORBStrategy.RecordSignalRejection` twice (once with `GradeFilter`, once with `RegimeVeto`) through the existing reflection helper and compares the two real emitted lines, rather than two hand-typed literals. `DEC-20260823-02` correctly flipped to `implemented` with an accurate implementation note. No production code touched. Test count unchanged at 535/535 (a replacement, not an addition), consistent with the report. All four implementations still carry a manual-validation step Kilocode itself flagged honestly, none of which has happened yet: - GAP-047 Part 2 — none required; fully proven in `NT8.Core` unit tests, no NinjaTrader dependency. - GAP-048 — one live/SIM diagnostic session confirming `REJECT SUMMARY` shows distinct reasons and the dashboard renders them. - GAP-055 — one SIM trade, stop/restart same trading day, confirm the next signal rejects with `REJECT: reason=MaxDailyTrades`. - GAP-045/046 — NQ SIM guard checks (misconfigured trailing-drawdown pair refuses startup, `MaxTradeRisk<=DailyLossLimit` enforced) plus a high-ATR signal behavior check. GAP-054 (runner trail) remains the one item with its own dedicated live validation path — NinjaTrader Market Replay — which the operator has explicitly deferred to a separate session ("Market Replay test later"). --- ## 2026-08-23 — GAP-045/046 IMPLEMENTED, manual NT8/NQ SIM validation pending Kilocode executed `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` Parts 1-3 on the current NQ configuration. The MNQ instrument cutover was not performed and remains a separate DEC-20260819-01 follow-on. Implementation notes: - Added startup risk-envelope assertions via `RiskEnvelopeValidator` and `NT8StrategyBase`. - `EnableTrailingDrawdown=True` now requires `AccountStartingBalance>0` at startup. - `MaxStopTicks * TickValue <= MaxTradeRisk`, `MinContracts>=1`, `MinContracts<=MaxContracts`, and `MaxTradeRisk<=DailyLossLimit` are enforced before runtime order flow. - GAP-048 had already split the misconfigured trailing-drawdown reject reason to `TrailingDrawdownNotConfigured`; no duplicate taxonomy change was needed. - Confirmed MNQ is present and valued at `$0.50` in both `BasicRiskManager` and `BasicPositionSizer` tick-value tables. - Added quantity-aware per-position risk enforcement: the NT8 live path now sizes first, then validates `StopTicks * TickValue * Qty <= MaxTradeRisk` against the selected quantity. - Existing `IRiskManager.ValidateOrder()` compatibility remains for older callers and validates one contract. Evidence: - Added tests for all startup assertions, quantity-aware Tier 1 rejection, the old pre-quantity pass / new two-contract reject case, bounded property-style range coverage, and MNQ tick table parity. - `verify-build.bat`: passed, 535/535 tests. - `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal`: passed, 446/446. - `deployment\deploy-to-nt8.bat`: completed; backup `deployment\backups\20260823_144817`; `NinjaTrader.Custom.dll` was not present to invalidate. Next required action: manual NinjaScript compile after starting NinjaTrader, then NQ SIM validation of startup guard failures and the quantity-aware per-position `MaxTradeRisk` behavior. Do not validate or execute the MNQ cutover as part of this task. --- ## 2026-08-23 — GAP-055 IMPLEMENTED, manual NT8/SIM restart validation pending Kilocode executed `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md`. `MaxDailyTrades` now persists across live/SIM strategy restarts by writing `{LogDirectory}\daily_trade_count__.json` after each daily-count increment and rehydrating once per trading date on the first realtime-eligible bar after session reset. Implementation notes: - Persistence is opt-in from the NT8 adapter and enabled only when `Account != null`. - Strategy Analyzer/backtest paths with `Account == null` do not read or write the file. - Trading date follows the adapter/session date already used by `BuildSessionInfo()` / `MarketSession.SessionStart`, so the 2026-08-16 19:12 ET and 2026-08-17 11:04 ET sessions both resolve to trading date 2026-08-17. - Missing/corrupt/unreadable files start at zero, log a warning, and do not throw. - File key is account + strategy name as specified; `symbol` is stored in the payload, and multiple same-account/same-strategy instances share the same counter by design for this task. Evidence: - Added tests for same-date restore, new-date reset/overwrite, corrupt-file warning/no throw, `Account == null` no-read/no-write behavior, and the 2026-08-16 evening / 2026-08-17 morning same-CME-date scenario. - `verify-build.bat`: passed, 521/521 tests. - `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal`: passed, 432/432. - `deployment\deploy-to-nt8.bat`: completed; backup `deployment\backups\20260823_143311`; `NinjaTrader.Custom.dll` was not present to invalidate. Next required action: manual NinjaScript compile after starting NinjaTrader, then SIM validation by taking one trade, stopping/restarting the strategy on the same trading day, and confirming the next signal is rejected with `REJECT: reason=MaxDailyTrades`. --- ## 2026-08-23 — GAP-048 IMPLEMENTED, manual NT8 compile/dashboard spot-check pending Kilocode executed `TASK_GAP048_REJECT_TAXONOMY_PROMPT.md` as a logging-only change. Guard conditions, ordering, outcomes, and `REJECT:` / `REJECT SUMMARY:` line formats were left unchanged; only overloaded `reason=` token values were split. Final vocabulary changes: - Actual kill switch remains `KillSwitch`. - Portfolio block -> `PortfolioRisk`. - Risk-manager/Tier 1 rejection -> `MaxTradeRisk`. - Circuit breaker -> `CircuitBreaker`. - Disabled long/short settings -> `LongTradesDisabled` / `ShortTradesDisabled`. - Size below minimum -> `SizeBelowMinContracts`. - SimpleORB AVWAP regime veto -> `RegimeVeto`. - Genuine confluence grade threshold rejection remains `GradeFilter`. - Real trailing drawdown halt remains `TrailingDrawdownBreach`. - Unconfigured trailing drawdown monitor -> `TrailingDrawdownNotConfigured`. - `OrbRangeNotEstablished` remains unchanged. Evidence: - `verify-build.bat`: passed, 516/516 tests. - `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal`: passed, 427/427. - `python -m py_compile tools\dashboard\parsers.py tools\logtriage\logtriage.py tools\logwatch\logwatch.py`: passed. - `deployment\deploy-to-nt8.bat`: completed; backup `deployment\backups\20260823_142014`; `NinjaTrader.Custom.dll` was not present to invalidate. Next required action: manual NinjaScript compile after starting NinjaTrader, then one live/SIM diagnostic session confirming `REJECT SUMMARY` shows distinct reasons and dashboard rejection panels render without frontend changes. --- ## 2026-08-23 — GAP-047 Part 2 IMPLEMENTED, fresh gate freeze required Kilocode executed `TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md`. The runtime scoring fix is intentionally minimal: `ConfluenceScorer` now uses the designed baseline weights for the five non-core factors (`0.20/0.15/0.15/0.20/0.15`) while leaving scoring normalization, overrides, calculators, grade thresholds, and NinjaScript/adapter files unchanged. Evidence: - `src/NT8.Core/Intelligence/ConfluenceScorer.cs` changed only the five approved baseline weight constants. - `tests/NT8.Core.Tests/Intelligence/ConfluenceScorerTests.cs` now asserts total default weight is 5.85, reproduces the 2026-08-18 worked example at weighted score 0.727 / Grade B, and verifies `UpdateFactorWeights()` still overrides the baseline. - `verify-build.bat`: passed, 514/514 tests. - `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal`: passed, 425/425. - `deployment\deploy-to-nt8.bat`: completed; backup `deployment\backups\20260823_135331`; `NinjaTrader.Custom.dll` was not present to invalidate. Next required action: run the normal manual NT8 compile/deploy hygiene when starting NinjaTrader, then capture a fresh Gate 3 configuration freeze/baseline before collecting any gate evidence because trade-qualification behavior changed. No SIM trade is required to prove correctness for this platform-neutral `NT8.Core` change. --- ## 2026-08-23 — GAP-047 Part 1 COMPLETE, runtime change not started Kilocode executed `TASK_GAP047_WEIGHT_RESCORE_PROMPT.md` as an analysis-only study. No runtime trading source was changed. Evidence produced: - `tools/rescore/rescore_weights.py` - `tools/rescore/GAP-047_weight_rescore_output.md` - `tools/rescore/GAP-047_weight_rescore_output.json` - DEC-20260823-01 proposed in `docs/00-governance/decisions.md` Key findings: - 182 session logs scanned from `C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk`, including `ARCHIVE`. - Required arithmetic check passed: `session_20260818_071117.log` 10:10:11.833 reproduced equal=0.640 and designed=0.727. - `STATE:` telemetry population: 923 samples; designed weights crossed Grade A while equal weights did not in 82 samples, and crossed Grade B while equal weights did not in 164 samples. - Real signal factor population: 81 samples; designed weights crossed Grade A while equal weights did not in 25 samples. - Current corpus had 0 `SIGNAL_DETAIL:` lines; real signal scoring used `SIGNAL` lines followed by numeric `Factors:` breakdowns. `STATE:` telemetry remains direction-degraded by GAP-049 and is reported separately. Next required action: operator accepts or rejects the proposed weighting direction, then GAP-047 Part 2 is staged as a separate runtime-change prompt because it changes score behavior and `ConfigHash`. --- ## 2026-08-21 — GAP-054 Option 0 IMPLEMENTED, independently source-verified, NOT yet validated or committed Kilocode reported implementing Option 0 (DEC-20260818-18) in `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`: removed the `OnBarUpdate()` call that set a static `SetStopLoss` on the runner leg after entry, added no new `SetTrailStop()` call, removed the stale `Diag_Breakeven` runner draw object, and cited local NT8 API documentation (`NinjaTrader.Core.xml`) confirming `SetStopLoss`/`SetTrailStop` are both signal-scoped `fromEntrySignal` methods. `verify-build.bat` (511/511) and `NT8.Core.Tests` (422/422) passed, `deploy-to-nt8.bat` succeeded, and the deployed source hash was confirmed matching the repo. No new regression test was added for the SetStopLoss/SetTrailStop ordering itself — Kilocode reported no clean test seam exists for NT8's managed-order calls and correctly declined to fabricate coverage, per the task file's own instruction for that scenario. **This review independently re-read the changed code** (not just Kilocode's report) and confirms: - The `OnBarUpdate()` runner block is now comment-only — no `SetStopLoss`/`SetTrailStop` call remains. - The `BREAKEVEN runner stop ->` `FileLog` line is gone, not just the chart diagnostic. - **Correction to the record:** DEC-20260818-18's implementation carried forward a line (written during the 2026-08-19 decision-acceptance pass) claiming `EnableAutoBreakeven`/`BreakevenTriggerTicks`/ `BreakevenOffsetTicks` "continue to govern the scaler leg only, unchanged." Source inspection shows this was never accurate — the pre-fix breakeven block only ever acted on the runner signal; there was no separate scaler-leg breakeven path to preserve. All three parameters are now fully inert (declared, defaulted, referenced once in a log/settings line, read nowhere else). Functionally harmless — it matches the intended zero-breakeven outcome — but is a stale-parameter hygiene issue. Corrected in `decisions.md`; logged as **GAP-056** (new, DEC-20260821-01) for a future low-priority cleanup (Description-attribute update or removal). - **GAP-057** (new, same entry): the missing test-seam proposal for NT8 managed-order call assertions is worth its own lightweight follow-up, since this is the same defect class (silent exit-order clobbering) that produced GAP-054 in the first place. **What's still outstanding before this is done:** 1. **SIM/replay validation has not happened.** Per the task file and DEC-20260818-18's own Action Required: take one SIM trade reaching +25 ticks or more, confirm no `BREAKEVEN runner stop ->` line, confirm the runner exits materially above entry + 1 tick as a trail stop rather than a fixed stop, confirm the scaler leg's target behavior is unchanged. NinjaTrader is currently closed, so this requires a manual NinjaScript compile and a SIM session before it can run. 2. **Not committed.** Kilocode explicitly held off ("commits require explicit request"). This now sits on top of the still-unreconciled DASH-002 diff flagged 2026-08-19 below — GAP-054 and DASH-002 are both uncommitted in the same working tree. Recommend committing as two separate commits (DASH-002 first, GAP-054 second) to preserve an isolated, reviewable history for each, once the operator decides to commit. 3. **RUNNER-001 remains blocked** until validation (item 1) passes — the sweep must not run against an unvalidated fix any more than it should run against the original defect. --- ## 2026-08-19 — PREFLIGHT HALTED before GAP-054 start (operator call, correctly enforced) All five decisions from the 2026-08-18 v7.0 review were accepted 2026-08-19 (DEC-20260818-18/19/20/21, DEC-20260819-01), and all six staged `TASK_*.md` prompts were marked ✅ READY. Before handing GAP-054 to Kilocode, the operator ran the run book's Section 0 preflight and correctly halted on four findings. **No GAP-054 (or any) implementation work has started.** This section documents the findings — read-only investigation only, nothing in `src/` was touched by this investigation. ### Finding 1 — the two modified `src/` files are known, already-accepted work-in-progress, not unknown changes `git diff --stat -- src/` shows: - `src/NT8.Adapters/Strategies/NT8StrategyBase.cs` — 881 insertions / 84 deletions - `src/NT8.Adapters/Strategies/SimpleORBNT8.cs` — 159 insertions Content inspection (`git diff` keyword search) confirms both diffs are **DASH-002** — the `TrailingDrawdownMonitor` implementation (DEC-20260818-17, accepted 2026-08-18) plus the `EnableStateTelemetry`/`EnableEthTelemetry` continuous confluence/regime telemetry (DEC-20260817-* series, unblocked 2026-08-17/18). `TASK_DASH-002_PROMPT.md` itself is also modified (34-line append, consistent with the task file's own completion-note convention). `roadmap.md` already noted this state: "DASH-002 (`EnableStateTelemetry`) remains prompt-staged; no implementation has [been] committed." This is expected, tracked, already-decided work sitting uncommitted — **not** an unauthorized or unexplained change. It is still a real precondition problem for GAP-054: landing GAP-054's runner-trail fix in `NT8StrategyBase.cs` on top of an uncommitted 881-line diff makes GAP-054's own diff impossible to review in isolation and impossible to cleanly roll back. **Recommended reconciliation: commit the DASH-002 work as its own commit (citing DEC-20260818-17 and the DEC-20260817-04/09 series) before any GAP-054/045/046/055 work starts**, so each subsequent fix produces an isolated, reviewable diff. This is Kilocode/operator's call, not made unilaterally here. ### Finding 2 — the currently configured account is logged as the GATE account, not a separate SIM account Today's session log (`session_20260819_073754.log`, 07:37:54–09:13:39 ET) logs: `Account : SimSimple ORB` ... `WARNING: EnableKillSwitch=False for gate account SimSimple ORB.` The phrase **"gate account SimSimple ORB"** is the strategy's own internal label. This directly bears on the operator's stop condition #4 (confirm the test account is a non-gate SIM account) — the evidence points the other way: the account currently wired into the NT8 instance appears to be the same one used for gate-run evidence, not a separate disposable SIM account. **This needs explicit operator confirmation before any validation activity, live or SIM, touches NT8** — testing GAP-054 on the gate account risks the same kind of contamination that voided Gate Run #2 (HIST-45), even in SIM mode, if it leaves state, logs, or habits that bleed into the next real gate attempt. ### Finding 3 — position status cannot be confirmed from static files; this file inspection does not substitute for a live check Same session log: zero `ENTRY`/`EXIT`/`MarketPosition` lines appear anywhere in the file — every line is a `REJECT` (`HistoricalReplayCatchup` x1, `RthGuard` x7, `WarmupIncomplete` x1) — consistent with a flat position as of the session's own end at 09:13:39 ET. The settings export (`settings_Simple_ORB_NT8_20260819_073755.txt`) still shows `AccountStartingBalance: $0.00` with `EnableTrailingDrawdown` — the exact GAP-046 misconfiguration — still live in the deployed config. **This is supporting evidence only.** The session log file is a static snapshot from a session that had already ended before this investigation; NinjaTrader is reported running now (PID 34864), and no tool available to this review can query live position state. The operator's own live check of the NT8 Account/Positions tab remains the only real confirmation. ### Finding 4 — `tools/runnersweep/RUNNER-001_sweep_output.{json,md}` predate the GAP-054 finding Both files are timestamped 2026-08-17 22:01, before the 2026-08-18 review that diagnosed the runner trail defect. Per `TASK_GAP054_RUNNER_TRAIL_PROMPT.md`'s own sequencing note, a sweep run against a runner whose trail was silently disabled "would return a trail axis with no effect and a confident, meaningless recommendation." **This existing output should be treated as superseded/invalid and RUNNER-001 re-run only after GAP-054 lands and validates** — flagging so it isn't mistaken for a current result. ### What is NOT blocked GAP-048 (reject taxonomy) and GAP-047 Part 1 (offline weight re-scoring study) remain zero-risk, diagnostics/analysis-only, and do not touch `src/` in a way that interacts with position state or the gate account question — Plays 2-4 in the run book can proceed independently of this halt. ### 2026-08-19, later same day — Findings 2 and 3 resolved by operator; Finding 1 still open Operator confirmed directly: live position is flat, NinjaTrader is closed (removing all account-touching risk for the moment), and the current `SimSimple ORB` account/label is "not of consequence" — a new account with `gate3` explicitly in its name will be set up for the actual Gate Run #3 evidence, kept distinct from whatever account casual SIM testing uses. This resolves the ambiguity Finding 2 raised: `SimSimple ORB` is not being relied on as gate-run evidence, so testing GAP-054 on it does not risk contaminating Gate 3 the way Gate Run #2 was contaminated. **Recommended going forward: apply the same explicit-naming discipline to every future purpose-specific account** (a `gate3`-named account for gate evidence, clearly distinct names for anything else), so this ambiguity doesn't recur — worth folding into `DEC-GATE3-CONFIG` guidance whenever that's next touched. **Finding 1 (the uncommitted DASH-002 diff in `src/`) is still open** — not addressed by this message. NinjaTrader being closed makes now a safe window to commit it before GAP-054 lands on top, but that action (`git add`/`git commit`) has not been taken; it needs an explicit go-ahead rather than being done unilaterally, since it formalizes already-implemented code into history. Recurring housekeeping note: a stale `.git/index.lock` has now appeared twice in this repo (cleared both times by renaming it aside); if this keeps recurring it's worth finding what's creating it before it blocks an actual `git commit`. --- ## 2026-08-18 — v7.0 REVIEW: TWO NEW LIVE BLOCKERS AND ONE LONG-STANDING DEFECT Source: `docs/NT8_SDK_Master_Document_v7.0_Complete.docx` (+ `docs/NT8_SDK_v7.0_Visual_Pack.html`). First review conducted with simultaneous access to the repository **and** the live NinjaTrader log directory. **No source code was changed by this review.** Everything below is a finding plus a recommendation; nothing has been applied. ### BLOCKER — GAP-045: `MaxTradeRisk` / `MaxStopTicks` collision stops all trades on high-ATR days `session_20260818_071117.log`, 10:10:24 ET: `REJECT: reason=KillSwitch detail=Risk manager rejected: Trade risk too high: $225.00` Five valid `SIGNAL: Sell NQ` lines, zero submissions. `BasicRiskManager.CalculateTradeRisk()` returns `StopTicks x tickValue` (no quantity term, evaluated before sizing). A 45-tick ATR stop on NQ = $225 > `MaxTradeRisk` $200. `MinContracts=1` is already the floor, so the trade is unplaceable, not resizable. `MaxStopTicks=50` (= $250) and `MaxTradeRisk=$200` are mutually inconsistent: the top 20% of the configured stop range is unreachable. **Fix: choose `MaxTradeRisk=$250` or `MaxStopTicks=40`, record the decision.** ### BLOCKER — GAP-046: trailing-drawdown monitor blocks every entry when misconfigured `session_20260818_142340.log`, 14:30 ET onward, 27 rejections: `REJECT: reason=TrailingDrawdownBreach detail=EnableTrailingDrawdown=True but AccountStartingBalance is not configured` Confirmed in `settings_Simple_ORB_NT8_20260818_142340.txt`: `EnableTrailingDrawdown: True`, `AccountStartingBalance: $0.00`. The guard behaviour is correct; there is no startup assertion pairing the two, and a misconfiguration is indistinguishable from a real breach in the summary counts. **Fix: set `AccountStartingBalance` or disable the monitor; add the GAP-003-style startup assertion.** ### CRITICAL — GAP-047: confluence factor weights are pre-populated to 1.0; designed weights are unreachable `ConfluenceScorer.cs` ~108-117 pre-populates `_factorWeights` with 1.0 for all ten `FactorType` values. `ResolveWeight()` (~410-419) checks that dictionary first, so the `fallbackWeight` branch carrying each calculator's designed weight (NarrowRange 0.20, OrbRangeVsAtr 0.15, GapDirectionAlignment 0.15, BreakoutVolumeStrength 0.20, PriorDayCloseStrength 0.15) is unreachable dead code. Runtime-confirmed: every factor in every `STATE:` line reads `x1.00`. Designed total weight 5.85; actual 10.00. Under the designed scheme Grade A (0.80) is reachable on factors 1-5 alone; under equal weights it requires all ten to average 0.80, which is close to structurally unreachable. Today's live example: composite 0.640 (Grade C) at equal weights vs **0.727 (Grade B)** under the designed weights. **This is now the primary suspect for GAP-034's silent zero-trade days.** **Fix: offline re-scoring study first, then an explicit weighting decision, then implementation.** ### CRITICAL — GAP-054: auto-breakeven destroys the runner's trailing stop (it has never trailed) `SetStopLoss()` and `SetTrailStop()` are mutually exclusive per signal name in NinjaScript. At entry (`NT8StrategyBase.cs` ~2178-2196) the runner is armed correctly: `SetStopLoss` then `SetTrailStop(_runnerSignalName, Ticks, RunnerTrailTicks=12)` then `EnterLong/Short`. Then in `OnBarUpdate` (~803) the auto-breakeven block calls `SetStopLoss(_runnerSignalName, CalculationMode.Price, bePrice, false)` — **replacing the live trail with a static stop at entry + 1 tick.** The trail never runs again for that trade. The source comment four lines below correctly warns against re-calling `SetTrailStop` here; the `SetStopLoss` call above it was not recognised as doing the same damage. Runtime proof, all four broker-confirmed trades: | Trade | Log line | Profit when BE fired | Where a 12t trail sat | Where the stop went | |---|---|---|---|---| | 08-07 | `BREAKEVEN runner stop -> 29826.00 profit=28ticks` | +28 t | +16 t | +1 t | | 08-10 | `BREAKEVEN runner stop -> 29848.50 profit=25ticks` | +25 t | +13 t | +1 t | | 08-16 | `BREAKEVEN runner stop -> 30200.08 profit=24ticks` | +24 t | +12 t | +1 t | | 08-17 | `BREAKEVEN runner stop -> 30271.00 profit=26ticks` | +26 t | +14 t | +1 t | The breakeven action moves the stop **backwards**, giving back 11-15 ticks of already-locked profit per trade and then freezing. Conservative floor estimate: the runner would have banked 55 ticks = $275 gross / ~$252 net instead of $25 / $1.96 — roughly a **24% uplift on total realised P&L** from deleting one call site. Two secondary defects in the same block: `entryPrice` is `Position.AveragePrice` (the blended 3-contract average, not the runner's fill — on 08-16 it produced the off-tick price `30200.08`), and `Calculate = OnBarClose` means the 20-tick trigger actually fires at 24-28 ticks. **This supersedes the "runner underperforms, retune the trigger" framing in DEC-20260810-02 and DEC-20260815-01.** The runner has never been tested. **Fix before RUNNER-001** — sweeping breakeven-trigger x trail-distance against a disabled trail measures nothing. **Recommended fix: stop applying auto-breakeven to the runner leg at all.** A trailing stop already provides monotonically improving protection. ### HIGH — GAP-055: `MaxDailyTrades` does not survive a strategy restart, and was breached 2026-08-17 `_dailyTradeCount` is an in-memory field in `SimpleORBStrategy` (~39), zeroed at construction (~269) and on session rollover (~756, ~961). Nothing persists it. CME trading date 2026-08-17 begins 18:00 ET Sunday 08-16. Two trades were taken on that date — 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, with `MaxDailyTrades=1`. NT8 itself treated them as one day: the first `PNL_UPDATE` of the 11:04 trade reads `DayPnL=$271.96` (= $277.72 less the $5.76 entry commission) and the session closes at `DayPnL=$545.44`. Same class as the 7/28 breach that helped void Gate Run #2. **A gate run under `MaxDailyTrades=1` cannot currently guarantee its own cap**, because gate discipline explicitly contemplates restarts. Fix: persist the count and its trading date with session provenance and rehydrate at startup; align the date boundary with the CME 18:00 ET rollover. ### Recommended split of GAP-034 - **GAP-034a** — no candidate produced (08-03, 08-04, 08-13). Primary suspect: GAP-047. Still open. - **GAP-034b** — candidate produced but blocked at a risk gate. **ROOT-CAUSED** by GAP-045/046. ### Other findings (see v7.0 Sections 1, 6, 7) - **GAP-048** — reject taxonomy conflates four causes under `KillSwitch` (portfolio block, Tier 1 risk, circuit breaker, actual kill switch). 08-17 logged `count=647` from a real kill switch; 08-18 logged `count=5` from `MaxTradeRisk`. Same label. Defeats GAP-035's purpose. - **GAP-049** — the dashboard's headline Score/Grade come from the telemetry path, whose `DailyBarContext.TradeDirection` is stale by design (DEC-20260818-06). Live proof: a -523 gap scored as "opposes trade" on a `Direction=Sell` setup. - **GAP-050** — `MaxTradeRisk` has no quantity term. Worst-case position risk is `MaxTradeRisk x MaxContracts` = $600 against a $1,000 daily limit. The master document has described this control incorrectly since v4. - **GAP-051** — `MicroUpgradeThreshold` fires every session at a $49k balance. - **GAP-052** — two independent hardcoded tick-value tables (`BasicRiskManager`, `BasicPositionSizer`). - **GAP-053** — `executive_summary.md` (dated 2026-05-04) and this roadmap's Sprint 3 list present ~12 tasks completed on 2026-07-11 as still open. Actively misleads onboarding. ### Configuration drift — the frozen baseline no longer describes anything that runs 2026-08-18 alone produced **nine distinct `ConfigHash` values, three distinct `CodeVersion` MVIDs and five different bar periods** (HFT Algo 13/42069, 13 Minute, 5 Minute, 15 Minute, 30 Minute). Drifted from `baseline.json`: `MinTradeGrade` 5 -> 4, `EnableKillSwitch` True -> False, `RiskPerTrade` $200 -> $100, plus the new `EnableTrailingDrawdown=True`. Two strategy instances also ran concurrently on the same account and instrument (`065020` and `071117`), both emitting `SIGNAL: Sell NQ` at 10:10:24 — the single-frozen-account doctrine violated again. `docs/gate-runs/gate3/baseline.json` should be treated as historical and re-captured. Note also that the frozen settings export (`settings_..._20260816_121735.txt`) came from a session archived the same day as having **no trading activity at all**. ### Trading record to date (broker-confirmed, reconciled against execution grids) Four trades, all long, all winners, **net $1,035.88** after $69.12 commission. Only **three** are RTH_ORB (the 2026-08-16 trade entered 19:12 ET, outside RTH) — $758.16. No two share a `ConfigHash`. The **runner leg has earned $1.96 net across four trades** (0.19% of P&L for 33% of exposure) and **-$7.28 on RTH_ORB trades only**. Breakeven trigger 20 ticks fires before the 28-tick ATR target in 4/4 trades. This is now enough evidence to act on; RUNNER-001 should test *disabling* the runner as a candidate, not only tuning the trigger. ### Working tree **DIRTY again** — 17 modified, 5 untracked, including `NT8StrategyBase.cs` and `SimpleORBNT8.cs` carrying the uncommitted DEC-20260818-01..-17 work that is deployed and running. The running system is ahead of the last commit. Branch is `cleanup/wrappers-pass2`, not `main`. ### Recommended immediate order of work (v7.0 Section 10) N-01 set `AccountStartingBalance` or disable the monitor - N-02 resolve `MaxTradeRisk` - N-03 stage the reject-taxonomy + startup-assertion prompt - N-04 commit the tree - N-05 reduce to one armed instance - N-06 make `configdiff` a failing preflight check - N-07 re-capture the freeze - N-08 fix the stale governance docs - **N-09 the offline factor-weighting re-scoring study (highest-value task in the project)**. ### Timeline reality At the observed rate of ~0.7 broker-confirmed trades per week, a 20-trade gate sample takes roughly **seven months**. Trade frequency, not per-trade edge, is the binding constraint on profitability. If GAP-047 is the cause of the low rate, fixing it is worth more than everything else on the roadmap combined. --- ## RESOLVED 2026-08-16 — Dirty working tree blocked Gate 3 freeze Earlier freeze attempts today (`freeze_20260816_003543`, `freeze_20260816_003653`, plus `verify_20260816_003653`) failed because `git status --porcelain` was not clean. The reviewed governance, runtime remediation, GAP-037/038 tests, and standalone `tools/` tree were committed in logical groups. `preflight.ps1 --freeze` then succeeded and produced `docs/gate-runs/gate3/baseline.json` from `freeze_20260816_170304`. `DEC-GATE3-CONFIG.md` remains `Status: draft` because GAP-034 is still open, not because the freeze capture failed. ## BLOCKER 1 — GAP-034: Silent zero-trade defect (UNDIAGNOSED) Sessions on 2026-08-03, 08-04, and 08-13 produced **zero trades on days with clear NQ breakouts**. Root cause is NOT identified. Gate Run #3 cannot start until it is. **Proven:** `ProcessStrategyIntent` writes a `SIGNAL:` line to the session file log unconditionally for every realtime intent (`NT8StrategyBase.cs` ~1236). No `SIGNAL:` line appears in any of these sessions. Therefore no intent was produced — the failure is **upstream of the execution pipeline**. **Ruled out:** portfolio risk block, per-strategy risk rejection, sizing failure, order submission, broker rejection, runner/scaler leg logic, connection-loss latch (`_connectionLost` is correctly cleared on restore, `NT8StrategyBase.cs` ~870). **The defect is INTERMITTENT, not a hard failure.** Broker-confirmed trades executed on 2026-08-07 and 2026-08-10 (DEC-20260810-02) between the zero-trade days. Any hypothesis requiring a persistent latch is therefore weakened. **Remaining candidates** — before GAP-035, all four logged via `_logger` only (NT8 Output window), never to file, which is why historical session logs cannot distinguish them. GAP-035 is now deployed and should make the next quiet/no-trade session self-documenting: 1. **Grade filter rejection** (composite score below `MinTradeGrade=5` / Grade A) — RANKED FIRST. Score varies day to day, which fits an intermittent pattern exactly. A "clear breakout" visually is not the same as a Grade A confluence score. 2. ORB range never established on the HFT Algo Bars primary series — plausible if bar construction varies with volume/tick density between sessions. 3. `MaxDailyTrades` latch — `_dailyTradeCount` pre-incremented by historical replay. WEAKENED: would likely persist across days once latched, yet 08-07 and 08-10 traded. Still possible if enable time relative to the ORB window differs by day. 4. RTH window guard evaluating outside 09:30-10:00 — WEAKENED for the same reason; a timezone fault would be constant, not intermittent. **Next step (per DEC-20260814-01):** GAP-035 is committed and deployed; the operator must run one session with the Output window open as a cross-check that file and Output agree. Full operator instructions are in the GAP-034 handoff checklist. **GAP-035 line formats to grep during the cross-check:** new session-file rejection lines use `REJECT: reason= detail= bar=`. Grade rejections look like `REJECT: reason=GradeFilter detail=Score= Grade= MinTradeGrade= Factors==x;... bar=