# Current Status — NT8 SDK **Last Updated:** 2026-08-21 (GAP-054 implemented and source-verified, not yet validated or committed — see below) --- ## 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=