chore: checkpoint remaining pre-gate worktree changes
- governance: stage v7.0 review prompts, run book, roadmap/current-status/decision updates, and sprint board state - adapters: capture DASH/trailing-drawdown/state-telemetry strategy work already present in the worktree - tools: capture dashboard console/KPI parser updates, logtriage notes, and runnersweep output Build: previously clean | Tests: previously 511 passing | Includes all open staged files
This commit is contained in:
120
docs/00-governance/2026-08-19-run-book.md
Normal file
120
docs/00-governance/2026-08-19-run-book.md
Normal file
@@ -0,0 +1,120 @@
|
||||
# NT8-SDK — Today's Run Book
|
||||
**Date:** 2026-08-19
|
||||
**Prepared by:** Claude (Senior PM role, v7.0 review follow-through)
|
||||
**Scope:** Execute the six staged `TASK_*.md` prompts and four proposed decisions from the 2026-08-18 v7.0 review, in a sequence that gets zero-risk items done first and gates every exit-logic or risk-parameter change behind an explicit Mo decision.
|
||||
**Governing constraint carried into today:** nothing in this run book authorizes Claude to touch `src/`. Every "run" step below is Kilocode's job, triggered by you handing it the named prompt file after you've made the paired decision.
|
||||
|
||||
Source documents this run book operationalizes: `SPRINT_BOARD.md` (blockers section), `docs/00-governance/active_work.md` (staged section), `docs/00-governance/decisions.md` (DEC-20260818-18 through -21), and the six `TASK_*.md` prompts at repo root.
|
||||
|
||||
---
|
||||
|
||||
## 0. Before you touch anything
|
||||
|
||||
1. `git status --short` — working tree should show only the governance/doc files from the 2026-08-18/19 review as modified. If `src/` shows changes you didn't make, stop and find out why before Kilocode runs anything.
|
||||
2. Confirm no live position is open. GAP-054 and GAP-055 both touch behavior that matters mid-trade; don't start either while a position is live.
|
||||
3. Confirm which account Kilocode's test/sim runs will use — per gate discipline this should NOT be the frozen live account used for gate evidence.
|
||||
|
||||
**STATUS 2026-08-19: 🛑 HALTED HERE.** The operator ran this checklist and correctly stopped on all
|
||||
three items. Findings (full detail in `docs/00-governance/current_status.md` § 2026-08-19):
|
||||
1. `src/` showed two modified files. Investigated and identified as known DASH-002 work-in-progress
|
||||
(trailing-drawdown monitor + state telemetry, both already-accepted decisions) sitting uncommitted
|
||||
— not unauthorized, but must be reconciled (recommend: commit DASH-002 as its own commit) before
|
||||
GAP-054 lands on top of it, so each fix's diff stays isolated and reviewable.
|
||||
2. Position status: today's last session log (ended 09:13:39 ET) shows zero entries/exits, consistent
|
||||
with flat — but that's a static file from an already-ended session, not a live query, and does not
|
||||
substitute for checking the actual NT8 Account/Positions tab now that NinjaTrader is confirmed running.
|
||||
3. Account: today's session log labels the configured account **"gate account SimSimple ORB"** in its
|
||||
own warning line. This is the opposite of confirmed-non-gate — needs explicit operator resolution
|
||||
before any SIM/test activity touches NT8, to avoid contaminating gate-run cleanliness the way Gate
|
||||
Run #2 was contaminated (HIST-45).
|
||||
|
||||
**Nothing past this point in the run book proceeds until items 1-3 above are explicitly resolved by
|
||||
the operator.** Plays 2-4 (GAP-048, GAP-047 Part 1) are the exception — zero risk, no account
|
||||
interaction, no `src/` conflict with DASH-002 — and remain clear to run.
|
||||
|
||||
**UPDATE 2026-08-19, later same day — 2 of 3 cleared.** Operator confirmed: position flat,
|
||||
NinjaTrader closed, and the account question is moot for now — `SimSimple ORB` isn't gate
|
||||
evidence; a distinctly `gate3`-named account will be stood up for the real Gate Run #3. Items 2
|
||||
and 3 are resolved. **Item 1 (uncommitted DASH-002 diff in `src/`) is still open** — NinjaTrader
|
||||
being closed makes this a safe window to commit it, but that's an explicit go/no-go for the
|
||||
operator, not something to do by default. Play 5 (GAP-054) should still hold until this is
|
||||
answered, so the fix lands as an isolated, reviewable diff rather than on top of DASH-002's
|
||||
881-line uncommitted change.
|
||||
|
||||
---
|
||||
|
||||
## 1. Decision gate — CLEARED 2026-08-19
|
||||
|
||||
All five decisions were made today. `decisions.md` has been updated to `accepted` for each, and a new entry `DEC-20260819-01` was added to sequence the MNQ cutover as a separate follow-on step.
|
||||
|
||||
| Decision | Ask | Your call (2026-08-19) | Stakes |
|
||||
|---|---|---|---|
|
||||
| **DEC-20260818-18** | Stop applying auto-breakeven to the runner leg (Option 0) | **Accepted.** Parameter-scoping sub-question (flag vs. unconditional skip) resolved by default to unconditional skip, no new flag — flag if you want it different. | High — changes live exit behavior |
|
||||
| **DEC-20260818-19a** | Resolve MaxTradeRisk/MaxStopTicks collision | **Accepted — (c) move to MNQ.** | High — changes risk envelope |
|
||||
| **DEC-20260818-19b** | Is MaxTradeRisk per-contract or per-position? | **Accepted — per-position (total).** Requires the Tier 1 check to move to after sizing; now written into `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` Part 3. | Medium |
|
||||
| **DEC-20260818-20** | Approve the split reject-reason taxonomy vocabulary | **Accepted**, as proposed. | Zero |
|
||||
| **DEC-20260818-21** | Approve MaxDailyTrades restart-persistence design | **Accepted**, as proposed. | Low-medium |
|
||||
| **DEC-20260819-01** *(new)* | Sequencing: land all code fixes on NQ first, cut over to MNQ as a separate later step with a fresh Gate 3 freeze | **Accepted** — this is my recommendation, written up as its own decision entry so the MNQ switch doesn't get conflated with defect-fix validation. Flag if you'd rather cut over sooner. | Medium — affects order, not outcome |
|
||||
|
||||
All six `TASK_*.md` prompts are now unblocked. Nothing is waiting on you to clear Section 2 anymore — every Play below can run today.
|
||||
|
||||
---
|
||||
|
||||
## 2. Play by play
|
||||
|
||||
**Play 1 — Decide. DONE 2026-08-19.** All five decisions recorded in `decisions.md`.
|
||||
|
||||
**Play 2 — Kick off the two zero-risk tracks in parallel.**
|
||||
- Hand `TASK_GAP048_REJECT_TAXONOMY_PROMPT.md` to Kilocode.
|
||||
- Hand `TASK_GAP047_WEIGHT_RESCORE_PROMPT.md` to Kilocode.
|
||||
Both can run at the same time; neither touches runtime behavior.
|
||||
|
||||
**Play 3 — Review GAP-048 output.** Confirm the four overloaded KillSwitch paths and four overloaded GradeFilter paths now log distinguishable reasons, that existing log-line formats are unchanged (only the reason string), and that the existing test suite still passes. Mark SPRINT_BOARD entry done.
|
||||
|
||||
**Play 4 — Review GAP-047 output.** This is a study, not a change — read the re-scoring report (equal-weight vs. designed-weight composite against historical STATE:/SIGNAL_DETAIL: lines). Confirm it reports the pre/post GAP-049 telemetry populations separately, per the task's caveat. Do NOT apply any weight change from this yet; it's an input to a future decision, not an approved fix.
|
||||
|
||||
**Play 5 — Runner trail fix (DEC-18 accepted). DONE 2026-08-21, source-verified.**
|
||||
Kilocode implemented Option 0: removed the `OnBarUpdate()` `SetStopLoss` call on the runner signal, added no new `SetTrailStop` call, removed the stale `Diag_Breakeven` draw, cited NT8's own API docs on the mutual-exclusivity behavior. Independently re-read the changed code directly (not just the report) — confirmed. Build/tests/deploy all passed, hash matches. Two low-priority follow-ups logged in the process (GAP-056: breakeven params now fully inert, not scaler-scoped as previously assumed; GAP-057: no test seam for NT8 managed-order call assertions) — see `decisions.md` DEC-20260821-01. **Not committed yet** — sits on top of the still-unreconciled DASH-002 diff from Section 0; recommend two separate commits (DASH-002 first, GAP-054 second) when the operator is ready to commit.
|
||||
|
||||
**Play 6 — Validate GAP-054 before any live exposure. STILL PENDING — this is the next actual step.**
|
||||
NinjaTrader needs to be reopened for a manual NinjaScript compile, then a SIM trade run reaching +25 ticks or more, confirming no `BREAKEVEN runner stop ->` line appears and the runner's exit is materially better than entry + 1 tick (a trail stop in the execution grid, not a fixed stop), and that the scaler leg's target behavior is unchanged. Only after this passes is GAP-054 done and RUNNER-001 unblocked.
|
||||
|
||||
**Play 7 — Risk guards, all three parts (DEC-19a/19b accepted).**
|
||||
Hand `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` to Kilocode in full — Part 3 is now written as directly actionable: implement the Tier 1 check reordering (post-sizing, `Qty`-aware) and confirm MNQ is present and correctly valued in both `GetTickValue` tables (GAP-052) as prep for the later cutover. **Do this on the current NQ configuration — do not switch the traded instrument as part of this task.** That's Play 11.
|
||||
|
||||
**Play 8 — MaxDailyTrades persistence (DEC-21 accepted).**
|
||||
Hand `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md` to Kilocode. Validate with a manual restart test spanning a simulated 18:00 ET rollover boundary — confirm the count persists across a restart within the same trading day and resets across the boundary.
|
||||
|
||||
**Play 9 — GAP-049 telemetry direction fix.**
|
||||
No decision gate — this is dashboard/telemetry accuracy only. Hand `TASK_GAP049_TELEMETRY_DIRECTION_PROMPT.md` to Kilocode any time today. Validate by re-checking the implausible -523.25 point gap value the task flags; confirm it resolves to a sane number after the fix.
|
||||
|
||||
**Play 10 — Close out today's six items.**
|
||||
For every item completed today: flip its `decisions.md` Status to `implemented` as appropriate, update `SPRINT_BOARD.md` and `active_work.md` to move it out of the blockers section, and commit the governance-doc changes. Leave anything not completed today explicitly marked with what's left and why.
|
||||
|
||||
**Play 11 — MNQ cutover (DEC-20260819-01), only after Plays 5-8 all pass validation.**
|
||||
This is a separate, later step — not part of today's six tasks. Once GAP-054, GAP-045/046, and GAP-055 have landed and validated on NQ: stage a new `TASK_MNQ_CUTOVER_PROMPT.md` (not yet written), reconfigure the strategy instance to trade MNQ, retune `MaxTradeRisk`/`MaxStopTicks`/`MaxContracts` for MNQ's $0.50/tick economics rather than carrying over NQ-era values unexamined, then run `preflight.ps1 --freeze` and record a new `DEC-GATE3-CONFIG` before collecting any gate-run evidence on MNQ. Don't compress this into the same session as the code fixes — if something breaks, you want to know whether it was a defect fix or the instrument switch.
|
||||
|
||||
---
|
||||
|
||||
## 3. Stop conditions — halt and escalate rather than push through
|
||||
|
||||
- Any existing test fails after a Kilocode change.
|
||||
- Kilocode touches a file outside the task's explicit DO list.
|
||||
- Anything in Play 5-6 (GAP-054) is tested against the live frozen account before sim/replay validation passes.
|
||||
- Play 11 (MNQ cutover) starts before Plays 5-8 have all validated on NQ.
|
||||
- Kilocode changes the traded instrument as a side effect of Play 7 — that's explicitly out of scope for `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md`.
|
||||
|
||||
---
|
||||
|
||||
## 4. End-of-day checklist
|
||||
|
||||
- [x] Section 1 decisions recorded — all accepted 2026-08-19
|
||||
- [ ] GAP-048 taxonomy: implemented, tested, SPRINT_BOARD updated
|
||||
- [ ] GAP-047 Part 1: study delivered, read, weight-change decision explicitly deferred (not silently applied)
|
||||
- [ ] GAP-054 runner trail: implemented, validated on sim/replay before any live gate run
|
||||
- [ ] GAP-055 persistence: implemented, restart/rollover-boundary test passed
|
||||
- [ ] GAP-045/046 all three parts: implemented on NQ, including the post-sizing Tier 1 reorder and the MNQ tick-table check
|
||||
- [ ] GAP-049 telemetry: implemented, -523.25 anomaly re-checked and resolved
|
||||
- [ ] `git status --short` re-checked: confirm exactly the files each TASK prompt's DO list authorized, nothing else
|
||||
- [ ] SPRINT_BOARD.md, active_work.md, decisions.md all reflect end-of-day state
|
||||
- [ ] MNQ cutover (Play 11) explicitly NOT started until the six items above are validated — confirm it's still pending, not skipped
|
||||
@@ -1,9 +1,36 @@
|
||||
# Active Work
|
||||
**Last Updated:** 2026-08-16
|
||||
**Last Updated:** 2026-08-19 (all four proposed decisions accepted; see decisions.md)
|
||||
|
||||
## READY 2026-08-19 — v7.0 review blockers, decisions accepted, none yet executed
|
||||
|
||||
All four decisions proposed 2026-08-18 were accepted by the operator on 2026-08-19
|
||||
(DEC-20260818-18, -19, -20, -21), plus a new DEC-20260819-01 sequencing the MNQ
|
||||
instrument cutover as its own follow-on step. Nothing below has been implemented yet —
|
||||
these are now unblocked for Kilocode, not still awaiting a decision.
|
||||
Play-by-play execution order: `docs/00-governance/2026-08-19-run-book.md`.
|
||||
Full detail: `docs/NT8_SDK_Master_Document_v7.0_Complete.docx`.
|
||||
|
||||
| Order | Item | Prompt | Owner | Blocking |
|
||||
|---|---|---|---|---|
|
||||
| 1 | **GAP-046** — set `AccountStartingBalance` or disable `EnableTrailingDrawdown` | operator action, no code | Operator | Every entry, from 14:30 ET daily |
|
||||
| 2 | **GAP-045/046 guards** — resolved: MNQ (cutover staged separately) + per-position semantics | `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` (Part 3 now actionable) | Kilocode, on current NQ config | All high-ATR days |
|
||||
| 3 | **GAP-048** — split the reject taxonomy | `TASK_GAP048_REJECT_TAXONOMY_PROMPT.md` | Kilocode | Nothing — diagnostics only, safe now |
|
||||
| 4 | **GAP-055** — persist `MaxDailyTrades` across restarts | `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md` | Kilocode | Gate Run #3 sample integrity |
|
||||
| 5 | **GAP-047 Part 1** — offline factor-weight re-scoring study | `TASK_GAP047_WEIGHT_RESCORE_PROMPT.md` | Kilocode | Nothing — analysis only. **Highest value on the board** |
|
||||
| 6 | **GAP-054** — auto-breakeven destroys the runner trail | `TASK_GAP054_RUNNER_TRAIL_PROMPT.md` — **Option 0 implemented + source-verified 2026-08-21, NOT yet SIM-validated, NOT committed** | Kilocode implemented; operator validates | **RUNNER-001**, still blocked until SIM/replay validation passes |
|
||||
| 7 | **GAP-049** — telemetry `STATE:` score is direction-incorrect | `TASK_GAP049_TELEMETRY_DIRECTION_PROMPT.md` | Kilocode | Dashboard trustworthiness; degrades item 5 |
|
||||
| 8 | **MNQ cutover** — reconfigure instrument, retune risk params for $0.50/tick, fresh Gate 3 freeze | not yet staged as its own TASK file | Operator + Kilocode | Only after items 2, 4, 5, 6 pass validation on NQ |
|
||||
|
||||
**Sequencing note:** items 3 and 5 carry zero trading risk and can proceed immediately, in
|
||||
parallel with everything else. Item 6 must land (and validate on SIM/replay) before
|
||||
RUNNER-001 is executed. Item 8 (MNQ cutover) must NOT start until items 2, 4, 5, and 6
|
||||
have landed and validated on the current NQ configuration — see DEC-20260819-01.
|
||||
|
||||
---
|
||||
|
||||
## GAP-035 — Rejection-reason file logging (HIGHEST PRIORITY)
|
||||
**Owner:** Kilocode
|
||||
**State:** Deployed 2026-08-16; pending live Output-window-to-file cross-check. It is not fully closed until the operator session confirms Output and session file agree.
|
||||
**State:** Deployed 2026-08-17 (deploy-to-nt8.bat, backup `20260817_180455`); DEC-20260817-01/02 provenance fixes deployed in the same pass, source hashes verified against repo. `NinjaTrader.Custom.dll`/`.pdb` confirmed absent — clean recompile is queued for next NT8 launch. Not yet compiled or cross-checked live.
|
||||
|
||||
All four zero-trade candidates log via `_logger` only and never reach the session file.
|
||||
Route every signal-rejection reason through `FileLog` alongside `_logger` so a no-trade
|
||||
|
||||
@@ -26,3 +26,77 @@ SimpleORBNT8.cs
|
||||
## Governance Notes
|
||||
- Core Risk/Sizing/OMS/Intelligence/Analytics layers are treated as complete and stable unless explicitly re-opened by approved work.
|
||||
- Hardening changes are concentrated in targeted adapter/utility components per active-work scope.
|
||||
|
||||
## Platform-Neutral SDK Invariant (confirmed 2026-08-17)
|
||||
`NT8.Core` (Risk, Sizing, OMS, Intelligence, Analytics, Common) contains zero
|
||||
`NinjaTrader.*` references anywhere in the project — confirmed by direct read
|
||||
of every file touched in recent sessions (`RegimeManager.cs`,
|
||||
`TrendRegimeDetector.cs`, `VolatilityRegimeDetector.cs`, `FactorCalculators.cs`,
|
||||
`PortfolioRiskManager.cs`, and others). `NT8.Adapters` is the only layer that
|
||||
references NinjaTrader assemblies; it exists specifically to translate between
|
||||
`NT8.Core`'s broker-agnostic models (`BarData`, `StrategyContext`,
|
||||
`StrategyIntent`, `OrderSide`, etc.) and NT8's own types. This is a real,
|
||||
maintained property today, not an aspiration — a future adapter for a
|
||||
different broker/API would implement the same bridge pattern `NT8.Adapters`
|
||||
uses, without touching `NT8.Core`.
|
||||
**Rule:** `NT8.Core` must never gain a `using NinjaTrader.*` reference. Any
|
||||
PR/Kilocode prompt that would add one should be rejected or redirected to
|
||||
put that logic in `NT8.Adapters` instead.
|
||||
|
||||
## Multi-Strategy / 24x7 Trading Architecture (clarified 2026-08-17)
|
||||
The "shared everything but entry" pattern referenced in earlier planning is
|
||||
already the real architecture, not a future change:
|
||||
- `NT8StrategyBase.cs` (shared): risk gate sequencing, sizing, provenance,
|
||||
logging, runner/breakeven management, regime gate, portfolio coordination.
|
||||
- Each strategy's *entry* logic is a separate `IStrategy` implementation
|
||||
(e.g. `SimpleORBStrategy.cs`) paired with a thin NinjaScript adapter
|
||||
subclass of `NT8StrategyBase` (e.g. `SimpleORBNT8.cs`).
|
||||
- Sprint 4 (`roadmap.md`) already plans exactly this pattern for
|
||||
`VWAPMeanReversion`, `OvernightGapContinuation`/`OvernightGapReversion`,
|
||||
and `LondonORBNT8` — each a new entry module, not a rewrite of the shared
|
||||
base.
|
||||
|
||||
**24x7 coverage is concurrent strategy instances with disjoint session
|
||||
windows, not an on/off switch between strategies.** Each session-scoped
|
||||
strategy (RTH ORB, London ORB, overnight gap) runs as its own NinjaScript
|
||||
strategy instance, simultaneously, each gated to its own trading window.
|
||||
`PortfolioRiskManager.Instance` already exists specifically to coordinate
|
||||
risk across concurrently-registered strategies (`RegisterStrategy()`,
|
||||
`ValidatePortfolioRisk()` enforces a combined daily loss limit and a total
|
||||
open-contract cap across every registered strategy) — this was already
|
||||
built for this scenario, it just hasn't been exercised with more than one
|
||||
strategy family yet. Running `SimpleORBNT8` plus a future `LondonORBNT8`
|
||||
simultaneously on the same account is the intended production pattern, not
|
||||
a single-frozen-account gate-validation-only concept (that doctrine
|
||||
governs *gate validation discipline*, not permanent production topology).
|
||||
|
||||
**Known gap: no multi-account dimension.** `PortfolioRiskManager` is a
|
||||
process-wide singleton keyed only by `strategyId` — there is no account key
|
||||
anywhere in its state (`_strategyPnL`, `_strategyOpenContracts`,
|
||||
`_registeredStrategies` are all `Dictionary<string, ...>` with no account
|
||||
segregation). Two strategies on *different* accounts would currently have
|
||||
their P&L and contract counts aggregated together incorrectly. This must be
|
||||
fixed (add an account key to the singleton's internal dictionaries, or move
|
||||
to per-account instances) before "multiple accounts simultaneously" is safe
|
||||
to run. Tracked as GAP-042 in `roadmap.md`.
|
||||
|
||||
## Control Plane (answers "must this be an NT8 AddOn?")
|
||||
Two real paths exist; the NT8 AddOn is not the only option:
|
||||
1. **NT8 AddOn (WPF panel)** — already on the roadmap (Sprint 6, "NT8 Add-On
|
||||
WPF panel"). Fully NT8-native, can call directly into running strategy
|
||||
instances. Ties the control UI to NT8's process and UI framework.
|
||||
2. **External command channel** — more aligned with the platform-neutral
|
||||
goal. `IStrategy.SetParameters(Dictionary<string, object>)` already
|
||||
exists and is already used internally (`force_session_reset`,
|
||||
`clear_trade_taken`). This could be extended so `NT8StrategyBase`
|
||||
polls a small local command file/HTTP endpoint on each bar close (which
|
||||
already fires every bar regardless of strategy) and applies any pending
|
||||
command via the existing `SetParameters()` path, then acknowledges it.
|
||||
This keeps the command surface broker-agnostic — the same mechanism
|
||||
would work if `NT8.Adapters` were ever joined by an adapter for a
|
||||
different platform, whereas an NT8 AddOn only ever works for NT8.
|
||||
**Recommendation:** build the external command channel first (smaller,
|
||||
platform-neutral, reuses existing `SetParameters()` plumbing) and treat the
|
||||
NT8 AddOn as an optional additional UI surface later, not a prerequisite.
|
||||
Neither is scoped for implementation yet — this section records the design
|
||||
direction so it isn't re-litigated from scratch later.
|
||||
|
||||
@@ -1,5 +1,281 @@
|
||||
# Current Status — NT8 SDK
|
||||
**Last Updated:** 2026-08-16 (weekly Sunday republish — see `docs/02-runbooks/weekly_roadmap_cadence.md`)
|
||||
**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
|
||||
@@ -147,7 +423,11 @@ Bar boundaries differ, so breakout bars differ. Tick Replay must be on for compa
|
||||
- All five directories above are committed as standalone tooling.
|
||||
|
||||
## Authoritative documents
|
||||
- Master document: **v6.4, republished 2026-08-16** — supersedes the v6.1 reference below.
|
||||
- Master document: **v7.0, 2026-08-18** — `docs/NT8_SDK_Master_Document_v7.0_Complete.docx`,
|
||||
with the interactive companion `docs/NT8_SDK_v7.0_Visual_Pack.html`. Supersedes v6.4 for status,
|
||||
gap register, roadmap, parameters and next steps. v6.4's Appendices B, D, E and F (NT8 Add-On
|
||||
XAML, ViewModel contracts, UI wireframes) remain valid as build references.
|
||||
- Prior master document (superseded): **v6.4, republished 2026-08-16**.
|
||||
Delivered by the operator's Claude session; placing the file under `docs/` and updating this
|
||||
pointer is tracked alongside the Blocker 1 cleanup commit.
|
||||
- Prior reference (superseded): `docs/NT8_SDK_Master_Document_v6.1_Complete.docx`
|
||||
|
||||
@@ -13,6 +13,300 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
|
||||
## Decision Log
|
||||
|
||||
### 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:
|
||||
1. **GAP-056 — `EnableAutoBreakeven`/`BreakevenTriggerTicks`/`BreakevenOffsetTicks` are 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 setting `EnableAutoBreakeven=true` in the UI would reasonably expect it to do something. Recommended fix, low priority: either mark the parameters `[Browsable(false)]`/update their `Description` attributes to state they're currently unused, or remove them outright in a later cleanup pass.
|
||||
2. **GAP-057 — no test seam exposes NinjaScript's `SetStopLoss`/`SetTrailStop` managed-order calls.** `TASK_GAP054_RUNNER_TRAIL_PROMPT.md` asked for a regression test asserting no `SetStopLoss` call is issued after `SetTrailStop` for 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.
|
||||
- **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`
|
||||
- **Action Required:** None immediate. Stage as low-priority follow-up prompts when convenient.
|
||||
|
||||
### 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:
|
||||
1. 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.
|
||||
2. 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.GetTickValue` and `BasicPositionSizer.GetTickValue`), reconfigure the strategy instance to MNQ, and re-tune `MaxTradeRisk`/`MaxStopTicks`/`MaxContracts` for MNQ's $0.50/tick economics rather than leaving NQ-era values in place unexamined.
|
||||
3. Run `preflight.ps1 --freeze` and produce a new `DEC-GATE3-CONFIG` for 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:** `MaxDailyTrades` is enforced from `_dailyTradeCount`, a plain in-memory field in `SimpleORBStrategy.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 under `MaxDailyTrades=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 first `PNL_UPDATE` of the 11:04 trade reads `DayPnL=$271.96` (the prior trade's $277.72 less the $5.76 entry commission) and the session closes at `DayPnL=$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>.json` on each increment, and rehydrate at `State.Realtime` entry 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, using `SessionManager` or 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=1` cannot 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`
|
||||
- **Action Required:** Accepted. Execute `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md`; then verify by taking one SIM trade, restarting the strategy 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. `KillSwitch` is emitted by four distinct paths in `NT8StrategyBase.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). `GradeFilter` is emitted by four paths across `NT8StrategyBase.cs` (~1979, ~1986, ~2020) and `SimpleORBStrategy.cs` (~613/~622, ~650). `TrailingDrawdownBreach` covers both a genuine breach and an unconfigured monitor. `REJECT SUMMARY` aggregates on `reason`, and `LogRejectRateLimited()` emits the disambiguating `detail` line 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.log` logged `reason=KillSwitch count=647` from a real kill switch, and `session_20260818_071117.log` logged `reason=KillSwitch count=5` from a `MaxTradeRisk` rejection. 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) and `TrailingDrawdownNotConfigured`. Logging only: no guard condition, ordering or outcome may change, and the `REJECT:` / `REJECT SUMMARY:` line formats must remain byte-identical apart from the `reason=` token. The `HistoricalReplayCatchup` exemption inside `LogRejectRateLimited()` (DEC-20260818-08) is preserved.
|
||||
- **Consequences:** The reason vocabulary becomes a contract for `tools/dashboard/parsers.py`, `tools/logtriage/logtriage.py` and `tools/logwatch/logwatch.py`; those parsers are believed reason-agnostic and must be read to confirm it rather than assumed. Splitting reasons slightly increases `REJECT:` detail-line volume, since rate limiting is per unique reason. `OrbRangeNotEstablished` retains its three sub-states under one reason for now — they are already distinguishable in `detail` and 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`
|
||||
- **Action Required:** Confirmed. Execute `TASK_GAP048_REJECT_TAXONOMY_PROMPT.md`.
|
||||
|
||||
### 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 after `BasicPositionSizer` determines quantity (or take an estimated/candidate quantity) so that `StopTicks × tickValue × Qty ≤ MaxTradeRisk` is the actual enforced inequality, replacing today's `StopTicks × tickValue ≤ MaxTradeRisk` with no `Qty` term.
|
||||
- **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, `MaxTradeRisk` already *is* the worst-case single-trade dollar loss regardless of contract count, so the correct assertion is `MaxTradeRisk ≤ 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 whatever `MaxTradeRisk` is 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()` returns `intent.StopTicks * tickValue` with no quantity term, evaluated before sizing. On NQ at $5.00/tick, `MaxTradeRisk=$200` caps the stop at 40 ticks while `MaxStopTicks=50` (=$250) is configured, so the top 20% of the ATR stop range is unreachable. `session_20260818_071117.log` at 10:10:24 ET: five valid `SIGNAL: Sell NQ` lines, zero submissions, `REJECT: reason=KillSwitch detail=Risk manager rejected: Trade risk too high: $225.00`. `MinContracts=1` is 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 is `MaxTradeRisk × MaxContracts` = $600 against a $1,000 `DailyLossLimit`.
|
||||
- **Decision (proposed, two parts):** **Decision 1 — resolve the collision.** Choose one of: (a) `MaxTradeRisk = $250`, making `MaxStopTicks=50` reachable 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 for `MaxContracts` to do real work. **Decision 2 — define the semantics.** State explicitly whether `MaxTradeRisk` is 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 relating `MaxTradeRisk × MaxContracts` to `DailyLossLimit`.
|
||||
- **Consequences:** Either value change alters `ConfigHash` and requires a fresh freeze capture and a new `DEC-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`
|
||||
- **Action Required:** Both decisions made — see above. Execute `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` in full (Part 3 is now unblocked) on the current NQ configuration. Hold the MNQ instrument cutover itself for DEC-20260819-01's sequencing.
|
||||
|
||||
### 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 `EnableAutoBreakeven` becomes runner-scoped-off by default or gains a separate `EnableRunnerBreakeven` flag. Not addressed in the 2026-08-19 acceptance message. Default resolved here rather than blocking implementation: **unconditionally skip breakeven on the runner leg in the `OnBarUpdate` block; 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`/`BreakevenOffsetTicks` continue 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()` and `SetTrailStop()` 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 with `SetStopLoss` then `SetTrailStop(_runnerSignalName, Ticks, RunnerTrailTicks)` then `EnterLong/EnterShort`. But the auto-breakeven block in `OnBarUpdate()` (~797-804) then calls `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 (~$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: `entryPrice` is `Position.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), and `Calculate = OnBarClose` means `BreakevenTriggerTicks = 20` actually 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`, `BreakevenTriggerTicks` and `BreakevenOffsetTicks` remain as parameters; whether they become runner-scoped-off by default or gain a separate `EnableRunnerBreakeven` flag defaulting to false is an open sub-question for the operator. The existing prohibition on calling `SetTrailStop()` inside `OnBarUpdate` (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 calls `SetStopLoss()` or `SetTrailStop()` for `_runnerSignalName` after entry, and the stale runner breakeven diagnostic draw is removed. Local installed NT8 API documentation citation: `C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Core.xml` documents `StrategyBase.SetStopLoss(string, CalculationMode, double, bool)` as tying the stop-loss exit to `fromEntrySignal`, and `StrategyBase.SetTrailStop(string, CalculationMode, double, bool)` as tying the trail-stop exit to `fromEntrySignal` with trail stops amended tick-by-tick. The implementation preserves the single entry-time `SetTrailStop()` call so NT8 owns the live runner trail. Verified 511/511 (`verify-build.bat`) and 422/422 (`NT8.Core.Tests`) passing, `deploy-to-nt8.bat` succeeded, 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 no `SetStopLoss`/`SetTrailStop` call remains for `_runnerSignalName`, the block is now a comment-only no-op, and the `BREAKEVEN runner stop ->` `FileLog` line is gone (not merely the chart draw object). **Correction to this entry's own "Parameter-scoping sub-question resolution" line above:** it stated `EnableAutoBreakeven`/`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. `PortfolioRiskManager` is 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 `TrailingDrawdownMonitor` inside `NT8StrategyBase` with one shared high-water/lock/breach state per `Account.Name`. Equity is read with `Account.Get(AccountItem.NetLiquidation, Currency.UsDollar)`; installed NT8 API metadata confirms `AccountItem.NetLiquidation` exists and labels it as Net liquidation, with separate `CashValue`, `RealizedProfitLoss`, and `UnrealizedProfitLoss` account items. Runtime SIM validation must still cross-check this value against NT8 account display with an open position. Formula: update `currentPeak = max(currentPeak, equity)`. If not locked and `currentPeak >= AccountStartingBalance + TrailingDrawdownLockOffset`, set `locked=true` and `lockedPeakValue=currentPeak`. Reference point is `locked ? lockedPeakValue : currentPeak`; halt threshold is `referencePoint - TrailingDrawdownHaltBuffer`. If `equity <= haltThreshold`, set account breach state, flatten registered strategies for that account with `ExitLong("TrailingDrawdownHalt")` and `ExitShort("TrailingDrawdownHalt")`, log `TRAILING_DRAWDOWN_BREACH: Account=<name> Equity=<value> Peak=<value> Floor=<value> Locked=<bool> Time=<timestamp>`, and block new entries with reject reason `TrailingDrawdownBreach` for the rest of the session.
|
||||
- **Consequences:** The monitor is fully opt-in via `EnableTrailingDrawdown=false` default, 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.NetLiquidation` includes 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 `RiskTier` NinjaScript setting with `Conservative`, `Normal`, and `Aggressive`, defaulting to `Normal`. Add `MicroUpgradeThreshold` defaulting to `5000`; each realtime bar reads account balance via `Account.Get(AccountItem.CashValue, Currency.UsDollar)` and, once per strategy session, logs/prints `TIER_UPGRADE_SUGGESTED: Balance=<value> crossed threshold=<threshold>; review RiskTier setting.` when crossed. The strategy never changes `RiskTier` automatically.
|
||||
- **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 `RiskTier` or 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 durable `REJECT SUMMARY:` and `REJECT:` 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:10 `SIGNAL` followed by `KillSwitch`/MaxTradeRisk rejection in `session_20260818_071117.log` made the gap concrete.
|
||||
- **Decision:** Add read-only dashboard KPIs sourced from the full current `session_*.log` file on every `/api/state` poll: `session_reject_totals`, `signal_outcomes`, `signal_grade_summary`, `missed_grade_b_plus_count`, and capped `missed_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 a `FILL` before the next `SIGNAL` as filled and captures the following `REJECT:` reason when present. Older `SIGNAL: Sell NQ | LIVE MODE` lines without inline grade/score use the latest prior `STATE:` 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 blocking `REJECT:` 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 under `tools/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 real `MaxDailyTrades` block 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 `SimpleORBNT8` side of fixed-position UI consolidation is wired, not just the `NT8StrategyBase` extension point. The repo and deployed NT8 Custom source both contain `SimpleORBNT8.AppendTopLeftDiagnosticLines(List<string> lines)` for TradeTaken/DailyTradeCount and a single `Diag_BottomLeft` block for ORBRange/BreakoutDir.
|
||||
- **Decision:** Treat the current `SimpleORBNT8` implementation as completion of DEC-20260818-11 rather than a new visual feature. No additional code change is required: old `Diag_TradeTaken`/`Diag_DailyCount` cleanup remains owned by the base consolidated top-left draw path, and old `Diag_ORBRange`/`Diag_BreakoutDir` cleanup remains owned by the SimpleORB bottom-left draw path before drawing `Diag_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 `SimpleORBNT8` overriding `GetStateTelemetryPendingBreakoutDirection()`. Without that strategy-specific override, the base implementation returns `0`, causing the intended `0 -> 1` or `0 -> -1` breakout-arm transition to be invisible to `MaybeWriteStateTelemetry()`.
|
||||
- **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 SdkSimpleORB` and returns `sdkOrb.PendingBreakoutDirection` when available, otherwise `0`, 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 when `PendingBreakoutDirection` changes.
|
||||
|
||||
### 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 turning `STATE:` 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 supplementary `STATE:`/`STATE_DETAIL:`/`STATE_CONTEXT:` set whenever either `SimpleORBNT8.PendingBreakoutDirection` changes or the telemetry grade crosses the configured `MinTradeGrade` threshold 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, while `REJECT:` 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 ~30s `STATE:` output remains; measure `STATE` line 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, so `Diag_Regime`, `Diag_Runner`, `Diag_TradeTaken`, and `Diag_DailyCount` collided at `TextPosition.TopLeft`, while `Diag_ORBRange` and `Diag_BreakoutDir` collided at `TextPosition.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 exposes `AppendTopLeftDiagnosticLines(List<string> lines)` for derived strategies. `SimpleORBNT8` overrides 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_Session` top-right, `Diag_TestMode` center, and `Diag_Prov` bottom-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 `EnableEthTelemetry` to text telemetry only: the ETH branch called `MaybeWriteStateTelemetry()` and returned before `DrawDiagnostics()`. Live chart review showed stale RTH visual labels during ETH because `DrawDiagnostics()` had not run since a prior RTH/TestMode bar. Source review of `NT8StrategyBase.DrawDiagnostics()` and `SimpleORBNT8.DrawDiagnostics()` confirmed the methods are gated by `EnableChartDiagnostics` and 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 `EnableEthTelemetry` is true, the existing ETH telemetry branch now calls `DrawDiagnostics()` in the same try/catch after building read-only bar/context state and writing optional state telemetry. The branch still returns before `_sdkStrategy.OnBar()` and `ProcessStrategyIntent()`, so ETH telemetry remains visual/read-only only.
|
||||
- **Consequences:** With `EnableEthTelemetry=true` and `EnableChartDiagnostics=true`, the chart's session tag, ORB box, trigger lines, and breakout indicators can refresh during ETH instead of displaying stale RTH drawings. With `EnableEthTelemetry=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: ETH` and ORB visual diagnostics refresh with `EnableEthTelemetry=true`/`EnableChartDiagnostics=true`, and verify no `SUBMIT`/`FILL` lines 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 static `intent.StopTicks` emitted by the SDK strategy, while `SubmitOrderToNT8()` later overwrote `intent.StopTicks` with the ATR-derived dynamic stop when `EnableDynamicStop=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 affected `RecommendedContracts` telemetry because the telemetry intent used `SimpleORBNT8.StopTicks` rather 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 existing `EnableDynamicStop && CurrentBars[0] >= AtrPeriod` formula and min/max clamping before portfolio/per-strategy risk, `_positionSizer.CalculateSize()`, and submission. `SubmitOrderToNT8()` no longer recomputes or overwrites `intent.StopTicks`; it trusts the already-finalized value. Telemetry uses the same helper before `RecommendedContracts` sizing, and `SimpleORBNT8.BuildStateTelemetryIntent()` seeds the telemetry intent with the finalized stop ticks rather than the static `StopTicks` parameter.
|
||||
- **Consequences:** With `EnableDynamicStop=true`, real order sizing, `SUBMIT Stop=<ticks>`, and `RecommendedContracts` now 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. With `EnableDynamicStop=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, and `STATE_CONTEXT RecommendedContracts` should all reflect the ATR-finalized stop. Run a Strategy Analyzer before/after comparison with `EnableDynamicStop=true` and 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 preventing `WriteTradeProvenance()` from writing phantom `trades_*.jsonl` rows 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 `_realtimeBarSeen` guard do not run while `State == 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 when `State == State.Historical && Account != null`. The reject reason is distinct: `HistoricalReplayCatchup`. Strategy Analyzer/backtest behavior remains intentionally untouched because `Account == null` during genuine `State.Historical` backtests, so simulated historical orders still flow normally there. `LogRejectRateLimited()` permits this one reason to write a `REJECT:` line even though `State` is 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=HistoricalReplayCatchup` appears during catch-up with zero `SUBMIT`/`FILL` until `State.Realtime` and `_realtimeBarSeen` are 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 `SimpleORBStrategy` entry state machine. The existing RTH guard in `NT8StrategyBase.OnBarUpdate()` returned before `MaybeWriteStateTelemetry()`, so sessions started during ETH produced no `STATE:` lines. The real strategy path must remain protected: no ETH call to `_sdkStrategy.OnBar()`, no `ProcessStrategyIntent()`, and no TestMode behavior changes.
|
||||
- **Decision:** Added opt-in `EnableEthTelemetry` (`false` by default) under Diagnostics. When a bar is outside RTH and TestMode is false, the existing `RthGuard` rejection still logs; if and only if `EnableEthTelemetry` is true, `NT8StrategyBase` builds `BarData`/`StrategyContext` from current read-only adapter state, calls `MaybeWriteStateTelemetry()`, then returns immediately. This path does not call `DrawDiagnostics()`, `_sdkStrategy.OnBar()`, or `ProcessStrategyIntent()`.
|
||||
- **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=false` produces no ETH `STATE:` lines, `EnableEthTelemetry=true` produces state telemetry, and no `SUBMIT`/`FILL` lines 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 though `SimpleORBNT8.OnBarUpdate()` already builds `DailyBarContext` every bar and stores it at `_strategyConfig.Parameters["daily_bars"]`. Root cause: real intents get this context via `SimpleORBStrategy.AttachDailyBarContext()`, but the synthetic `SimpleORBNT8.BuildStateTelemetryIntent()` created an empty metadata dictionary, and factor calculators read daily context from `intent.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 call `AttachDailyBarContext()` 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 to `SIGNAL`/`SUBMIT`/`FILL`/`REJECT` behavior.
|
||||
- **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 `SimpleORBNT8` was loading duplicate daily bar series: `SimpleORBNT8.OnStateChange()` called `AddDataSeries(BarsPeriodType.Day, 1)` in `State.Configure`, then called `base.OnStateChange()`, whose `State.Configure` branch also added the shared daily series for TASK-06c regime SMA20/50 context. Live evidence showed `BarsArray[1]` and `BarsArray[2]` were both `DayBarsType`, `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 full `BarsArray` readiness detail.
|
||||
- **Decision:** Removed the subclass `AddDataSeries(BarsPeriodType.Day, 1)` call from `SimpleORBNT8`. The base class remains the single owner of the shared daily series, so `BarsArray[1]` keeps the same role and ordering for `SimpleORBNT8.BuildDailyBarContext()` and `NT8StrategyBase.BuildStrategyContext()` regime calculations. A source comment now notes that `NT8StrategyBase` provides 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 from `SimpleORBNT8`, plus the universal `RecommendedContracts` field from `NT8StrategyBase`) 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()` to `parsers.py` (plain space-separated `Key=Value` tokens, deliberately generic rather than ORB-specific since the field set is strategy-extensible per the `GetStateTelemetryContextFields()` extension point). `server.py._apply_event()` stores the result at `live_state.state_context`. `console.html`/`console.js`: a new ORB range block renders `OrbHigh`/`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 fifth `Recommended Contracts` stat sourced live from `state_context.RecommendedContracts` when present — distinct from the existing post-trade `last_submit.fields` sizing 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/state` or 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_context` populates with `OrbHigh`/`OrbLow`/`OrbWindowStart`/`OrbWindowEnd`/`OrbReady`/`RecommendedContracts` once 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 existing `EnableStateTelemetry && EnableFileLogging && State == State.Realtime` and 30-second throttle gates. The resulting `SizingResult.Contracts` is logged only, never stored or used for order submission. Because DEC-20260818-02 already introduced `STATE_CONTEXT:`, the recommended size extends that line as `RecommendedContracts=<N>` instead of creating another near-duplicate telemetry line. When ORB context is also ready, the full line is `STATE_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, `RecommendedContracts` should match `SUBMIT`'s `Scaler + Runner` quantity; 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 matching `SUBMIT 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 generic `STATE:` schema. `SimpleORBNT8.DrawDiagnostics()` already reads these values from `SimpleORBStrategy`'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)` to `NT8StrategyBase`; the base implementation returns `null`. `MaybeWriteStateTelemetry()` now calls the extension point at the same throttled cadence as `STATE:`/`STATE_DETAIL:` and emits `STATE_CONTEXT: Key1=Value1 Key2=Value2 ...` only when a strategy returns non-empty fields. `SimpleORBNT8` overrides the method and returns `OrbHigh=<F2> OrbLow=<F2> OrbWindowStart=<HH:mm> OrbWindowEnd=<HH:mm> OrbReady=<True|False>` once `sdkOrb.OpeningRangeReady` is true and `OpeningRangeHigh > OpeningRangeLow`; otherwise it returns `null` so 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 for `RegimeManager`/`TrendRegimeDetector`/`VolatilityRegimeDetector`. Kilocode correctly stopped, reporting `CalculateSize()` calls `_logger.LogDebug()`/`LogWarning()`, which `BasicLogger` routes to `Console.WriteLine()`, and is therefore not I/O-free.
|
||||
- **Decision:** Direct source read of `BasicPositionSizer.cs` confirms 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 fresh `SizingResult` each call; there is no internal history/dictionary a telemetry-only call could seed or corrupt. This is categorically different from the `RegimeManager` case, where the disqualifying risk was a diagnostic call silently building up state (`_barHistory`, `_currentStates`, `_transitions`) that a future real caller would then see polluted. `BasicPositionSizer` has 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.Core` file contents confirmed no `NinjaTrader.*` references; `PortfolioRiskManager.cs` read 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 against `NT8.Core` gaining NinjaTrader references), a Multi-Strategy / 24x7 Trading Architecture section confirming the "shared everything but entry" pattern is already real and that `PortfolioRiskManager` was already built for concurrent strategies, and a Control Plane section presenting the external-command-channel alternative to an NT8 AddOn. Added `GAP-042` (no account dimension in `PortfolioRiskManager`) to Sprint 4 in `roadmap.md`, and added multi-timeframe regime alignment as an unscoped Sprint 6 idea, both cross-referenced back to `architecture.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.md` directly. `GAP-042` must 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-042` implementation 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 to `SUBMIT`, 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.py` had two `STATE_RE` definitions (the second silently overwrote the first), which left an entire `state = STATE_RE.search(message)` branch in `parse_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()` (reverses `EscapeLogValue()`'s backslash/quote escaping) and `STATE_DETAIL_RE`/`SIGNAL_DETAIL_RE` to `parsers.py`; `parse_session_event()` now returns `type: "STATE_DETAIL"`/`"SIGNAL_DETAIL"` events with a `reasons` dict keyed by factor name. Added `parse_submit_fields()` (numeric coercion for `BaseTarget`/`DynamicTarget`/`GradeMult`/`ModeMult`/`CombinedMult`, leaving `"N/A"` as a string so it's distinguishable from `0`) and enriched the existing `SUBMIT` event with a `fields` dict. `server.py._apply_event()` stores these at `live_state.state_telemetry_reasons`, `live_state.last_signal_reasons`, and within `live_state.last_submit.fields`. `console.html`/`console.js`: Confluences and Factor Breakdown rows now carry a `title` tooltip from `state_telemetry_reasons[name]` when available; a new "Live Sizing" block under the static R:R panel renders `last_submit.fields` once 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, unquoted `SUBMIT` fields with `N/A` fallback) but not executed, since Claude has no code-execution access on the operator's machine, and the underlying `NT8StrategyBase.cs` change has not yet been redeployed (blocked on `NT8.Core.dll` file lock — NinjaTrader must fully close before `deploy-to-nt8.bat` can succeed). The dead `STATE_RE` shadow 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) that `state_telemetry_reasons`, `last_signal_reasons`, and `last_submit.fields` populate 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-trade `SIGNAL`/`SUBMIT` logging exposed scores and order shape but discarded already-computed sizing rationale and each `ConfluenceFactor.Reason`. The data already exists on `intent.Metadata` and `ConfluenceScore.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 after `SIGNAL`: `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 after `STATE`: `STATE_DETAIL: Setup="<reason>" Trend="<reason>" Volatility="<reason>" Timing="<reason>" ExecutionQuality="<reason>" NarrowRange="<reason>" OrbRangeVsAtr="<reason>" GapDirectionAlignment="<reason>" BreakoutVolumeStrength="<reason>" PriorDayCloseStrength="<reason>"`. The `SUBMIT` line appends `BaseTarget=<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 existing `Mode=<mode>` field.
|
||||
- **Consequences:** Dashboard/logtriage parsers can add support for `SIGNAL_DETAIL`, `STATE_DETAIL`, and appended `SUBMIT` fields later without ambiguity. Existing `SIGNAL`, `Factors:`, `FILL`, `PNL_UPDATE`, and `REJECT` lines 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 in `session_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;...`), but `tools/dashboard/parsers.py`'s `parse_session_event()` had no handling for it — the dashboard's `console.html`/`console.js` plan (DASH-004) explicitly noted this as "pending DASH-002" and had no real data source yet.
|
||||
- **Decision:** Added `STATE_RE` and `parse_state_factors()` to `parsers.py`, following the same `Factors=name=scorexweight;...` convention already used for `GradeFilter` reject-detail parsing. `parse_session_event()` now returns a `type: "STATE"` event with `regime`, `direction`, `direction_source`, `score`, `grade`, and a structured `factors` list. `server.py._apply_event()` stores the latest one at `live_state.state_telemetry`, refreshed every poll from the session-log tail like every other live field, so it is available via `/api/state` with 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 `MinuteBarsType` and `MaybeWriteStateTelemetry()` only gets a chance to fire on `OnBarUpdate()` (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 the `Grade=D` immediately followed by ` Factors=` 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/state` poll (or the dashboard once loaded) that `live_state.state_telemetry` populates 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 while `State == State.Realtime`, `EnableFileLogging == true`, and `EnableStateTelemetry == true`. The line records `Regime`, diagnostic `Direction`, `DirectionSource`, `Score`, `Grade`, and `Factors=<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`, and `REJECT` lines 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
|
||||
@@ -237,3 +531,63 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
- **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()` and `WriteTradeProvenance()` returned silently when `LogDirectory` was blank, while `InitFileLog()` and `WriteSettingsFile()` already used the default path `Documents\NinjaTrader 8\log\nt8-sdk`. The ORB-specific `WriteSessionProvenance()` override had the same silent guard. This created a split-brain evidence state: `session_*.log` and `settings_*.txt` continued writing, but `provenance_*.json` and `trades_*.jsonl` did 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 `LogDirectory` is blank. The fallback must be explicit in both `Print()` and `FileLog()` 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 `LogDirectory` configurations 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.jsonl` received 57 rows during a 14-second restart replay window (`2026-08-17T16:51:16.124Z` through `2026-08-17T16:51:30.109Z`) while broker execution grid review showed no matching activity. `OnExecutionUpdate()` and live session-log `SIGNAL`/`SUBMIT` writes are already `State.Realtime` gated, but `WriteTradeProvenance()` was called from `SubmitOrderToNT8()` without an equivalent gate. Source review also found that live-chart historical replay passes `AllowDailyTradeCountIncrement=false` when `State.Historical` and `Account != null`, so accepted historical intents do not increment `_dailyTradeCount` and `MaxDailyTrades` cannot cap the replay burst in that mode. The persisted trade JSONL has only wall-clock `timestamp_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 unless `State == 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.jsonl` is contaminated by 57 phantom rows (`49` Buy, `8` Sell; `43` `RTH_ORB`, `14` `ETH`; all quantity `3`, grade `A`) and must not be used by dashboard/logtriage as clean gate evidence. Future forensic schema work should consider adding a `bar_time` field 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`'s `is_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()` in `NT8StrategyBase.cs` actually names legs `SDK_{Symbol}_R_{hex}` (runner) and `SDK_{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 reading `SubmitOrderToNT8()`'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 in `SDK_{Symbol}_R_{hex}`/`SDK_{Symbol}_S_{hex}` is a GUID-derived hex string (characters `0-9a-f` only), which cannot contain the letters `r` or `s` needed 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_count` in 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.py` already parsed `REJECT:`/`REJECT SUMMARY:` lines for the live current-session tail via a private `_parse_rejections()`/`_parse_key_values()` pair, but `tools/logtriage/logtriage.py`'s file-based parser had no reject handling at all — so any offline/historical `logtriage.py --json` run (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()` to `logtriage.py` as the canonical parser (identical marker-bounded-value approach to the original `server.py` implementation, so `detail` text containing `=` or the word "bar" parses correctly). `SessionSummary` now carries `reject_summaries`, `reject_records`, and `reject_summary_final` (last-observed count per reason), populated while parsing `session_*.log` and exposed via `to_dict()`. The `SILENT DAY` diagnostic in `build_diagnostics()` now appends a `Rejections: <reason>=<count>, ...` breakdown (and machine-readable `reject_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 on `row_dicts[0]` — so the duplicate `_parse_rejections()`/`_parse_key_values()` methods and the now-unused `lines` parameter on `_build_current_rows()` were removed. Field names/shapes are unchanged from what `server.py` produced before and match what `tools/dashboard/app.js` already expects (`row.reject_summaries[].{reason,count,line}`, `row.reject_records[].{reason,detail,bar,line}`), so no frontend change was needed.
|
||||
- **Consequences:** `logtriage.py --json` run 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 the `REJECT:` and `REJECT SUMMARY:` lines from the real `session_20260817_125115.log` archive; it has not been executed, since Claude has no code-execution access on the operator's machine — an operator run of `python tools/logtriage/logtriage.py --json` against 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" --json` and confirm `reject_summaries`/`reject_records`/`reject_summary_final` appear on session rows with no exceptions raised; spot-check the `SILENT DAY` diagnostic 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`, or `VolatilityRegimeDetector`. Direct source review of `NT8StrategyBase.cs`, `SimpleORBStrategy.cs`, and `FactorCalculators.cs` confirms these three classes are instantiated in `InitializeSdkComponents()` 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 in `BuildStrategyContext()` and pure-function ATR-ratio math inside `VolatilityRegimeFactorCalculator`/`TrendAlignmentFactorCalculator`, both of which read from `context.CustomData` with no side effects. `RegimeManager.UpdateRegime()`, `TrendRegimeDetector.DetectTrend()`, and `VolatilityRegimeDetector.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 `BuildStrategyContext` and the existing `IFactorCalculator.Calculate()` pure functions) and must not call `RegimeManager.UpdateRegime()`, `TrendRegimeDetector.DetectTrend()`, or `VolatilityRegimeDetector.DetectRegime()` for periodic sampling. This constraint is now recorded in `TASK_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`/`VolatilityRegimeDetector` into 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 by `WriteRejectSummary()` at `State.Terminated`, leaving armed live sessions without current silent-day counts until the strategy stopped. Dashboard live parsing and `logwatch.py` already understand `REJECT SUMMARY: reason=<Reason> count=<count>`, but `tools/logtriage/logtriage.py` does 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 aggregate `REJECT SUMMARY` snapshots 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 --json` will 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 SUMMARY` snapshot appears before termination and that displayed counts match `_rejectCounts` at snapshot time.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Roadmap
|
||||
**Last Updated:** 2026-08-16 (weekly Sunday republish — see `docs/02-runbooks/weekly_roadmap_cadence.md`, DEC-20260816-01)
|
||||
**Master Reference:** NT8_SDK_Master_Document_v6.4_Complete.docx — Sections 7, 8, 21
|
||||
**Last Updated:** 2026-08-18 (v7.0 master-document review; last Sunday republish 2026-08-16 — see `docs/02-runbooks/weekly_roadmap_cadence.md`, DEC-20260816-01)
|
||||
**Master Reference:** NT8_SDK_Master_Document_v7.0_Complete.docx — Sections 7, 8, 9, 10, 12
|
||||
(+ interactive companion `docs/NT8_SDK_v7.0_Visual_Pack.html`). v6.4 remains the reference for
|
||||
Appendices B, D, E and F only.
|
||||
|
||||
## Sequencing Rule
|
||||
No sprint advances until its gate criteria are met. No exceptions.
|
||||
@@ -12,10 +14,53 @@ allowance. See `docs/02-runbooks/weekly_roadmap_cadence.md` and `DEC-20260816-01
|
||||
|
||||
---
|
||||
|
||||
## CURRENT BLOCKER
|
||||
1. **GAP-034** — Gate Run #3 cannot start. Three sessions (08-03, 08-04, 08-13) produced
|
||||
zero trades on days with clear NQ breakouts, root cause unidentified. See
|
||||
`current_status.md` and `TASK_GAP035_GAP034_PROMPT.md`.
|
||||
## CURRENT BLOCKERS (revised 2026-08-18 by the v7.0 review — see `current_status.md`)
|
||||
|
||||
1. **GAP-045 — `MaxTradeRisk` / `MaxStopTicks` collision.** `StopTicks x tickValue` with no
|
||||
quantity term, evaluated before sizing. NQ: `MaxStopTicks` 50 x $5 = $250 > `MaxTradeRisk` $200,
|
||||
so the top 20% of the ATR stop range is unreachable and high-ATR days produce zero trades.
|
||||
**Confirmed live 2026-08-18 10:10 ET: five valid Sell signals, all rejected at $225.00.**
|
||||
2. **GAP-046 — trailing-drawdown monitor blocks every entry when `AccountStartingBalance` is unset.**
|
||||
Confirmed live 2026-08-18 from 14:30 ET, 27 rejections. Needs a startup assertion pairing
|
||||
`EnableTrailingDrawdown` with a positive `AccountStartingBalance`.
|
||||
3. **GAP-047 — confluence factor weights pre-populated to 1.0; the designed weights are dead code.**
|
||||
`ConfluenceScorer.cs` ~108-117 / ~410-419. Runtime-confirmed by `x1.00` on every factor in every
|
||||
`STATE:` line. Makes Grade A close to structurally unreachable. **Primary suspect for GAP-034a.**
|
||||
4. **GAP-034a — silent zero-trade defect, no candidate produced** (08-03, 08-04, 08-13). Still open;
|
||||
GAP-047 is now the leading hypothesis, ahead of the four candidates previously ranked.
|
||||
(**GAP-034b — candidate produced but blocked at a risk gate — is ROOT-CAUSED** by GAP-045/046.)
|
||||
5. **GAP-054 — auto-breakeven destroys the runner's trailing stop.** `SetStopLoss()` on
|
||||
`_runnerSignalName` (~803) replaces the `SetTrailStop()` issued at entry (~2188/2196); the two
|
||||
are mutually exclusive per signal name in NinjaScript. Confirmed in 4/4 broker-confirmed trades:
|
||||
the trail was 12-16 ticks in profit when breakeven fired and was moved back to +1.
|
||||
**Blocks RUNNER-001** — the sweep would measure a disabled trail. Supersedes the
|
||||
"retune the breakeven trigger" framing of DEC-20260810-02 / DEC-20260815-01.
|
||||
6. **GAP-055 — `MaxDailyTrades` does not survive a restart.** In-memory counter only. CME trading
|
||||
date 2026-08-17 took two trades under `MaxDailyTrades=1` across two NT8 sessions; the second
|
||||
session's `DayPnL` proves NT8 treated them as one day.
|
||||
7. **Dirty working tree.** 17 modified, 5 untracked, including `NT8StrategyBase.cs` and
|
||||
`SimpleORBNT8.cs` carrying uncommitted DEC-20260818-01..-17 work that is deployed and running.
|
||||
|
||||
### Also raised by the v7.0 review (open, not blocking Gate 3 start)
|
||||
- **GAP-048** — reject taxonomy conflates four causes under `KillSwitch` (portfolio block, Tier 1
|
||||
risk, circuit breaker, actual kill switch). Diagnostics-only fix; zero trading-behaviour risk.
|
||||
- **GAP-049** — telemetry `STATE:` score is direction-incorrect and is presented as the trade grade.
|
||||
- **GAP-050** — `MaxTradeRisk` has no quantity term; worst case is $600 vs a $1,000 daily limit.
|
||||
- **GAP-051** — `MicroUpgradeThreshold` fires every session at the current balance.
|
||||
- **GAP-052** — two independent hardcoded tick-value tables.
|
||||
- **GAP-053** — `executive_summary.md` and this document's Sprint 3 list present ~12 tasks
|
||||
completed 2026-07-11 as still open. Prune or regenerate.
|
||||
|
||||
### Numbering caution
|
||||
v6.4 renumbered the July 17-31 data-audit findings to GAP-041..046, which now collide with this
|
||||
document's own GAP-042/043/044. **This register is authoritative for `GAP-` numbers.** The historical
|
||||
audit findings are renamed `HIST-41`..`HIST-46` in v7.0 Section 7.6.
|
||||
|
||||
### Configuration freeze status
|
||||
`docs/gate-runs/gate3/baseline.json` no longer describes any running system: 2026-08-18 produced
|
||||
nine distinct `ConfigHash` values, three `CodeVersion` MVIDs and five bar periods, with
|
||||
`MinTradeGrade` 5->4, `EnableKillSwitch` True->False and `RiskPerTrade` $200->$100 drifted from the
|
||||
baseline. Two instances also ran concurrently on the same account and instrument. Re-capture required.
|
||||
|
||||
Resolved 2026-08-16: the dirty working tree blocker was cleared and
|
||||
`docs/gate-runs/gate3/baseline.json` was produced by `freeze_20260816_170304`.
|
||||
@@ -58,9 +103,16 @@ distance, recorded in a superseding decision entry, before `DEC-GATE3-CONFIG` is
|
||||
## Sprint 3 — Production Hardening (ACTIVE)
|
||||
All tasks in order in SPRINT_BOARD.md. Full prompts in KILOCODE_RUNBOOK.md.
|
||||
|
||||
Architecture defects (blocks live trading):
|
||||
- TASK-06a: Runner Mode enum + NT8StrategyBase redesign
|
||||
- TASK-06b: ATR-based dynamic stop
|
||||
> **STALE-LIST WARNING (GAP-053, added 2026-08-18).** The lists immediately below still show
|
||||
> TASK-06a, TASK-06b, GAP-003, GAP-004, GAP-005, GAP-006, GAP-008, GAP-009, GAP-010, GAP-019 and
|
||||
> GAP-022 as open work. **All of these were completed on 2026-07-11 / 07-14** — see the historical
|
||||
> record in `SPRINT_BOARD.md` and DEC-20260711-01..09, DEC-20260713-02. GAP-011 was completed
|
||||
> 2026-07-11 and GAP-040 is implemented and firing in production as of 2026-08-18. This block has
|
||||
> not been pruned since July and misleads anyone onboarding. Prune it at the next republish.
|
||||
|
||||
Architecture defects (COMPLETED 2026-07-11 — retained here only until this block is pruned):
|
||||
- ~~TASK-06a: Runner Mode enum + NT8StrategyBase redesign~~ ✅ 2026-07-11 (DEC-20260711-01)
|
||||
- ~~TASK-06b: ATR-based dynamic stop~~ ✅ 2026-07-11 (DEC-20260711-02)
|
||||
|
||||
Risk hardening:
|
||||
- GAP-019: Portfolio Heat Tier 3.5 (MaxHeatPct enforcement)
|
||||
@@ -117,6 +169,84 @@ Gate criteria for Sprint 3 → Sprint 4:
|
||||
- GAP-013: ContractRollHandler completion
|
||||
- GAP-015: Config JSON export/import
|
||||
- GAP-014: LiquidityMonitor Level II prep
|
||||
- GAP-042: `PortfolioRiskManager` has no account dimension (singleton keyed
|
||||
only by strategyId) — must be fixed before running strategies on
|
||||
different accounts simultaneously; see `docs/00-governance/architecture.md`
|
||||
"Multi-Strategy / 24x7 Trading Architecture" for detail. Required before
|
||||
Sprint 4's multi-strategy plans extend to multiple accounts.
|
||||
- GAP-043: Primary bar series (`HFTAlgoBarsType`) is a third-party custom
|
||||
bar type, not native to NT8 — confirmed 2026-08-18 by full-repo search
|
||||
(zero matches; it does not exist anywhere in this SDK). Vendor
|
||||
dependency risk: if the add-on stops being maintained, updated, or
|
||||
compatible with a future NT8 version, the primary series becomes
|
||||
unavailable with no in-repo fallback. Operator has deferred deep
|
||||
investigation but wants to revisit.
|
||||
**Candidates to evaluate:** Tick Bars (500, 1000 ticks), Volume Bars
|
||||
(1000, 2500 contracts), Range Bars (4-tick/1.0pt, 8-tick/2.0pt) — all
|
||||
native NT8 bar types, all well-documented under Strategy Analyzer + Tick
|
||||
Replay (ties to `DEC-20260814-03`'s 60-day warm-up rule).
|
||||
**Order Flow+** is not a peer candidate for bar cadence — it's NT8's
|
||||
premium volumetric/footprint data layer, normally applied on top of a
|
||||
time/tick/volume bar type rather than replacing it. None of today's
|
||||
factor calculators consume anything beyond OHLCV+volume, so adopting it
|
||||
would require new factor-calculator work (e.g. a real order-flow-
|
||||
imbalance confluence factor) before it changed strategy behavior at
|
||||
all — a separate, larger project from the bar-cadence question, and it
|
||||
requires a Level II/market-depth subscription.
|
||||
**Before comparing:** confirm `HFTAlgoBarsType` actually supports
|
||||
Strategy Analyzer + Tick Replay — some custom bar generators are
|
||||
live-only and can't produce a matched backtest baseline, in which case
|
||||
the comparison would need to lean on existing live/SIM session history
|
||||
as the baseline instead.
|
||||
**Data limitation:** `SIGNAL`/`SUBMIT`/`STATE_DETAIL` FileLog lines only
|
||||
write during `State.Realtime`, not Strategy Analyzer backtests — grade/
|
||||
score/factor-reason data won't be available for backtest comparison,
|
||||
only NT8's native Trades-tab columns (entry/exit price, P&L, MAE/MFE,
|
||||
bars-in-trade). Comparison would need to lean on trade count, win rate,
|
||||
profit factor, average R-multiple, and average bars-in-trade (a proxy
|
||||
for confirmation-timing character) rather than confluence grading.
|
||||
**Sequencing:** run this only after GAP-034-adjacent live-risk fixes
|
||||
(historical-replay order submission, sizing-before-dynamic-stop
|
||||
reordering) are confirmed clean on the *current* bar type — changing
|
||||
bar type in the same window as fixing live-risk bugs would make it hard
|
||||
to attribute any behavior change to the right cause. A bar-type change
|
||||
also alters `ConfigHash` (`DEC-20260810-01`), so it requires restarting
|
||||
Gate validation from a clean baseline regardless of when it happens.
|
||||
- GAP-044: Primary series `DaysToLoad` does not respect the operator's
|
||||
configured value, and this is now confirmed independent of bar type —
|
||||
originally observed 2026-08-18 with the third-party `HFTAlgoBarsType`
|
||||
(configured 120, logged `DaysToLoad=3`), then reproduced the same day
|
||||
with fully native `MinuteBarsType` on 5-minute bars (configured 90,
|
||||
logged `DaysToLoad=5`). This rules out the vendor bar type (`GAP-043`)
|
||||
as the cause — the two issues are unrelated and should not be
|
||||
conflated. Full-repo search confirms nothing in this SDK's source sets
|
||||
or overrides `DaysToLoad` for the primary series (`BarsArray[0]`); it is
|
||||
driven entirely by NT8 platform/workspace state invisible to the
|
||||
codebase (either the chart's own Data Series configuration, or the
|
||||
Strategies dialog's independent Data Series tab, depending on how the
|
||||
strategy is attached), so this cannot be diagnosed or fixed from source
|
||||
alone. `DEC-20260814-03`'s 60-trading-day warm-up requirement for valid
|
||||
backtests depends on `DaysToLoad` actually taking effect, so this
|
||||
should be resolved before relying on backtest comparisons for `GAP-043`
|
||||
or any other Strategy Analyzer work.
|
||||
**Operator-side troubleshooting, not yet attempted/ruled out:** confirm
|
||||
which dialog actually governs `BarsArray[0]` for the current attach
|
||||
method (chart-inherited vs. Strategies-dialog independent series);
|
||||
check for a saved workspace/template reasserting a stale value on load;
|
||||
try disabling the strategy, changing the value, then re-enabling rather
|
||||
than editing live; check whether the field is set to an explicit number
|
||||
vs. a "Default"/auto mode that may resolve independently of the typed
|
||||
value.
|
||||
**Operator hypothesis (2026-08-18):** the saved NT8 workspace is
|
||||
reasserting a stale `DaysToLoad` value on load — operator reports a
|
||||
prior, similar experience with workspace state persisting settings it
|
||||
shouldn't have. Confirmation test: create a brand-new chart (not opened
|
||||
from the existing saved workspace) and attach the strategy there with
|
||||
the desired `DaysToLoad`. If it holds on the fresh chart, the workspace
|
||||
is confirmed as the cause; if it still reverts, the cause is elsewhere
|
||||
(see troubleshooting list above). NT8 workspaces are stored as XML under
|
||||
`Documents\NinjaTrader 8\workspaces\` if direct inspection or discarding
|
||||
the stale one becomes necessary. Not yet tested as of this entry.
|
||||
- Go live with 1 MNQ contract (micro) after SIM gate + Sprint 3 complete
|
||||
|
||||
Gate criteria: 2 weeks live MNQ PF > 1.8, max loss < $100/day
|
||||
@@ -139,7 +269,18 @@ Gate criteria: 60+ days live fills, model trained and walk-forward validated
|
||||
---
|
||||
|
||||
## Sprint 6 — Full Dashboard + iOS (deferred)
|
||||
- Dashboard Phase 3 (control layer: pause, flatten, kill switch)
|
||||
- Dashboard Phase 3 (control layer: pause, flatten, kill switch) — two
|
||||
design paths recorded in `docs/00-governance/architecture.md` "Control
|
||||
Plane": an NT8 Add-On WPF panel (below) or an external command-file
|
||||
channel extending the existing `SetParameters()` plumbing. Recommendation
|
||||
is to build the external channel first for platform-neutrality.
|
||||
- Dashboard Phase 4 (intelligence layer: playbook, health score, missed trades)
|
||||
- Multi-timeframe regime alignment (raised by operator 2026-08-17): the
|
||||
console dashboard mockup's "full timeframe continuity" concept — scoring
|
||||
regime agreement across several timeframes (e.g. 5m/15m/1h/daily) rather
|
||||
than today's single daily SMA20/50 value — is a real feature idea but not
|
||||
scoped. Needs its own `NT8.Core/Intelligence` design pass (new factor
|
||||
calculator or `RegimeManager` usage across multiple bar series) before
|
||||
implementation; not a quick addition to existing telemetry.
|
||||
- iOS companion app
|
||||
- NT8 Add-On WPF panel (Section 22 / Appendix D of master doc)
|
||||
|
||||
BIN
docs/NT8_SDK_Master_Document_v7.0_Complete.docx
Normal file
BIN
docs/NT8_SDK_Master_Document_v7.0_Complete.docx
Normal file
Binary file not shown.
556
docs/NT8_SDK_v7.0_Visual_Pack.html
Normal file
556
docs/NT8_SDK_v7.0_Visual_Pack.html
Normal file
@@ -0,0 +1,556 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="light">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>NT8-SDK v7.0 — Visual Pack</title>
|
||||
<style>
|
||||
:root{
|
||||
color-scheme: light;
|
||||
--page:#f9f9f7; --surface:#fcfcfb;
|
||||
--ink:#0b0b0b; --ink2:#52514e; --muted:#898781;
|
||||
--grid:#e1e0d9; --axis:#c3c2b7; --ring:rgba(11,11,11,0.10);
|
||||
--s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s7:#4a3aa7;
|
||||
--good:#0ca30c; --warning:#fab219; --serious:#ec835a; --critical:#d03b3b;
|
||||
--good-text:#006300;
|
||||
}
|
||||
:root[data-theme="dark"]{
|
||||
color-scheme: dark;
|
||||
--page:#0d0d0d; --surface:#1a1a19;
|
||||
--ink:#ffffff; --ink2:#c3c2b7; --muted:#898781;
|
||||
--grid:#2c2c2a; --axis:#383835; --ring:rgba(255,255,255,0.10);
|
||||
--s1:#3987e5; --s2:#d95926; --s3:#199e70; --s7:#9085e9;
|
||||
--good-text:#0ca30c;
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;padding:0}
|
||||
body{
|
||||
background:var(--page); color:var(--ink);
|
||||
font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
|
||||
font-size:15px; line-height:1.55;
|
||||
}
|
||||
.wrap{max-width:1180px;margin:0 auto;padding:32px 24px 96px}
|
||||
header.top{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;flex-wrap:wrap;margin-bottom:8px}
|
||||
h1{font-size:26px;margin:0 0 4px;letter-spacing:-0.01em}
|
||||
.sub{color:var(--ink2);font-size:14px;margin:0}
|
||||
button.theme{
|
||||
background:var(--surface);color:var(--ink);border:1px solid var(--ring);
|
||||
border-radius:8px;padding:7px 14px;font:inherit;font-size:13px;cursor:pointer;
|
||||
}
|
||||
button.theme:hover{background:var(--grid)}
|
||||
nav.toc{display:flex;flex-wrap:wrap;gap:6px;margin:20px 0 32px}
|
||||
nav.toc a{
|
||||
font-size:12.5px;text-decoration:none;color:var(--ink2);
|
||||
background:var(--surface);border:1px solid var(--ring);border-radius:999px;padding:5px 12px;
|
||||
}
|
||||
nav.toc a:hover{color:var(--ink);border-color:var(--axis)}
|
||||
section{
|
||||
background:var(--surface);border:1px solid var(--ring);border-radius:12px;
|
||||
padding:24px 26px 28px;margin-bottom:22px;
|
||||
}
|
||||
h2{font-size:19px;margin:0 0 4px;letter-spacing:-0.01em}
|
||||
h3{font-size:14.5px;margin:26px 0 10px;color:var(--ink2);text-transform:uppercase;letter-spacing:0.05em;font-weight:600}
|
||||
.lede{color:var(--ink2);font-size:14px;margin:0 0 18px;max-width:78ch}
|
||||
.note{font-size:13px;color:var(--ink2);margin-top:14px;max-width:82ch}
|
||||
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:0.88em;background:var(--grid);padding:1px 5px;border-radius:4px}
|
||||
:root[data-theme="dark"] code{background:#262624}
|
||||
|
||||
/* status chips */
|
||||
.chip{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:999px;white-space:nowrap}
|
||||
.chip.ok{background:color-mix(in srgb,var(--good) 16%,transparent);color:var(--good-text)}
|
||||
.chip.warn{background:color-mix(in srgb,var(--warning) 26%,transparent);color:var(--ink)}
|
||||
.chip.ser{background:color-mix(in srgb,var(--serious) 24%,transparent);color:var(--ink)}
|
||||
.chip.crit{background:color-mix(in srgb,var(--critical) 20%,transparent);color:var(--critical)}
|
||||
.chip.neut{background:var(--grid);color:var(--ink2)}
|
||||
|
||||
/* layer stack */
|
||||
.layers{display:flex;flex-direction:column;gap:4px}
|
||||
.layer{display:grid;grid-template-columns:34px 1fr 190px 116px;gap:12px;align-items:center;
|
||||
background:var(--page);border:1px solid var(--ring);border-radius:8px;padding:9px 12px}
|
||||
.layer .n{font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums;font-size:13px}
|
||||
.layer .nm{font-weight:600;font-size:14px}
|
||||
.layer .cp{font-size:12px;color:var(--ink2)}
|
||||
.layer.adapter{border-left:3px solid var(--s2)}
|
||||
.layer.core{border-left:3px solid var(--s1)}
|
||||
|
||||
/* pipeline */
|
||||
.pipe{display:flex;flex-direction:column;gap:3px}
|
||||
.stage{display:grid;grid-template-columns:30px 1fr 210px 128px;gap:10px;align-items:center;
|
||||
padding:7px 12px;border-radius:7px;background:var(--page);border:1px solid var(--ring);font-size:13.5px}
|
||||
.stage .n{color:var(--muted);font-variant-numeric:tabular-nums;font-size:12px;font-weight:700}
|
||||
.stage .rr{font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--ink2)}
|
||||
.stage.block{border-color:var(--critical);background:color-mix(in srgb,var(--critical) 9%,var(--page))}
|
||||
.stage.suspect{border-color:var(--warning);background:color-mix(in srgb,var(--warning) 12%,var(--page))}
|
||||
.stage.sig{border-color:var(--s1);background:color-mix(in srgb,var(--s1) 8%,var(--page))}
|
||||
|
||||
/* generic table */
|
||||
table{border-collapse:collapse;width:100%;font-size:13.5px;margin-top:6px}
|
||||
th{text-align:left;font-weight:600;color:var(--ink2);border-bottom:1px solid var(--axis);padding:7px 10px 7px 0;font-size:12.5px}
|
||||
td{padding:8px 10px 8px 0;border-bottom:1px solid var(--grid);vertical-align:top}
|
||||
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums;padding-right:14px}
|
||||
tr.total td{border-top:2px solid var(--axis);border-bottom:none;font-weight:700}
|
||||
|
||||
/* bar chart */
|
||||
.chart{margin-top:8px}
|
||||
.legend{display:flex;gap:18px;align-items:center;font-size:12.5px;color:var(--ink2);margin-bottom:14px}
|
||||
.legend i{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:6px;vertical-align:-1px}
|
||||
.frow{display:grid;grid-template-columns:172px 1fr;gap:12px;align-items:center;margin-bottom:9px}
|
||||
.flabel{font-size:12.5px;color:var(--ink2);text-align:right}
|
||||
.fbars{display:flex;flex-direction:column;gap:3px}
|
||||
.fbar{height:13px;border-radius:0 4px 4px 0;position:relative;min-width:2px}
|
||||
.fbar span{position:absolute;left:calc(100% + 7px);top:-2px;font-size:11px;color:var(--ink2);font-variant-numeric:tabular-nums;white-space:nowrap}
|
||||
.fbar.d{background:var(--s1)}
|
||||
.fbar.a{background:var(--s2)}
|
||||
|
||||
/* composite readout */
|
||||
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin-top:16px}
|
||||
.tile{background:var(--page);border:1px solid var(--ring);border-radius:10px;padding:14px 16px}
|
||||
.tile .k{font-size:11.5px;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);font-weight:600}
|
||||
.tile .v{font-size:27px;font-weight:700;letter-spacing:-0.02em;margin:4px 0 2px;font-variant-numeric:tabular-nums}
|
||||
.tile .d{font-size:12px;color:var(--ink2)}
|
||||
|
||||
/* decision tree */
|
||||
.tree{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;line-height:1.75;
|
||||
background:var(--page);border:1px solid var(--ring);border-radius:9px;padding:16px 18px;overflow-x:auto;white-space:pre;color:var(--ink2)}
|
||||
.tree b{color:var(--ink);font-weight:700}
|
||||
.tree .bad{color:var(--critical);font-weight:700}
|
||||
.tree .warnc{color:var(--serious);font-weight:700}
|
||||
.tree .okc{color:var(--good-text);font-weight:700}
|
||||
|
||||
/* collision map */
|
||||
.cmap{display:grid;grid-template-columns:repeat(auto-fill,minmax(268px,1fr));gap:10px}
|
||||
.cell{border:1px solid var(--ring);border-left-width:4px;border-radius:8px;padding:11px 13px;background:var(--page)}
|
||||
.cell .t{font-size:13px;font-weight:600;margin-bottom:3px}
|
||||
.cell .b{font-size:12px;color:var(--ink2)}
|
||||
.cell.crit{border-left-color:var(--critical)}
|
||||
.cell.warn{border-left-color:var(--warning)}
|
||||
.cell.ser{border-left-color:var(--serious)}
|
||||
.cell.ok{border-left-color:var(--good)}
|
||||
|
||||
/* gap grid */
|
||||
.gaps{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
|
||||
.gap{border-radius:8px;padding:9px 11px;border:1px solid var(--ring);background:var(--page)}
|
||||
.gap .id{font-weight:700;font-size:12.5px;font-family:ui-monospace,Menlo,monospace}
|
||||
.gap .txt{font-size:11.5px;color:var(--ink2);margin-top:3px;line-height:1.4}
|
||||
.gap.crit{background:color-mix(in srgb,var(--critical) 12%,var(--page));border-color:color-mix(in srgb,var(--critical) 40%,var(--ring))}
|
||||
.gap.high{background:color-mix(in srgb,var(--serious) 14%,var(--page))}
|
||||
.gap.med{background:color-mix(in srgb,var(--warning) 15%,var(--page))}
|
||||
.gap.done{background:color-mix(in srgb,var(--good) 11%,var(--page))}
|
||||
|
||||
/* roadmap */
|
||||
.road{display:flex;flex-direction:column;gap:8px}
|
||||
.rstage{display:grid;grid-template-columns:96px 1fr 150px;gap:14px;align-items:center;
|
||||
background:var(--page);border:1px solid var(--ring);border-radius:9px;padding:11px 14px}
|
||||
.rstage .sn{font-weight:700;font-size:13px}
|
||||
.rstage .items{font-size:12.5px;color:var(--ink2)}
|
||||
.rstage .dur{font-size:12px;color:var(--ink2);text-align:right;font-variant-numeric:tabular-nums}
|
||||
.rstage.now{border-color:var(--s1);border-left:4px solid var(--s1)}
|
||||
.rstage.key{border-left:4px solid var(--critical)}
|
||||
|
||||
/* timeline */
|
||||
.tl{position:relative;padding-left:22px}
|
||||
.tl::before{content:"";position:absolute;left:6px;top:6px;bottom:6px;width:2px;background:var(--grid)}
|
||||
.ev{position:relative;margin-bottom:14px}
|
||||
.ev::before{content:"";position:absolute;left:-20px;top:6px;width:9px;height:9px;border-radius:50%;background:var(--axis);box-shadow:0 0 0 3px var(--surface)}
|
||||
.ev.sig::before{background:var(--s1)}
|
||||
.ev.rej::before{background:var(--critical)}
|
||||
.ev .t{font-family:ui-monospace,Menlo,monospace;font-size:12px;color:var(--muted)}
|
||||
.ev .m{font-size:13.5px}
|
||||
.ev .m b{font-weight:700}
|
||||
footer{color:var(--muted);font-size:12.5px;text-align:center;margin-top:36px}
|
||||
@media (max-width:820px){
|
||||
.layer,.stage{grid-template-columns:26px 1fr}
|
||||
.layer .cp,.layer .st,.stage .rr,.stage .st{display:none}
|
||||
.frow{grid-template-columns:1fr}
|
||||
.flabel{text-align:left}
|
||||
.rstage{grid-template-columns:1fr}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
|
||||
<header class="top">
|
||||
<div>
|
||||
<h1>NT8-SDK — Visual Pack v7.0</h1>
|
||||
<p class="sub">Companion to <em>NT8_SDK_Master_Document_v7.0_Complete.docx</em> · rev B · evidence as of 2026-08-18 · repo <code>C:\dev\nt8-sdk</code> @ <code>f617574</code></p>
|
||||
</div>
|
||||
<button class="theme" id="tt">Dark mode</button>
|
||||
</header>
|
||||
|
||||
<nav class="toc">
|
||||
<a href="#arch">1 · Architecture</a>
|
||||
<a href="#pipe">2 · Bar→Trade pipeline</a>
|
||||
<a href="#risk">3 · Risk tiers</a>
|
||||
<a href="#conf">4 · Confluence weighting</a>
|
||||
<a href="#runner">5 · Runner economics</a>
|
||||
<a href="#collide">6 · Parameter collisions</a>
|
||||
<a href="#gaps">7 · Gap register</a>
|
||||
<a href="#road">8 · Roadmap</a>
|
||||
<a href="#today">9 · 08-18 forensics</a>
|
||||
<a href="#clock">10 · 24×5 session clock</a>
|
||||
</nav>
|
||||
|
||||
<!-- 1 ARCHITECTURE -->
|
||||
<section id="arch">
|
||||
<h2>1 · Nine-layer architecture</h2>
|
||||
<p class="lede">Layers 1–8 are platform-free. Layer 9 is the only one that imports NinjaTrader. That separation is real and maintained — it is what makes a broker-neutral platform achievable rather than a rewrite. The status column is honest about which layers are actually load-bearing today.</p>
|
||||
<div class="layers">
|
||||
<div class="layer core"><div class="n">1</div><div><div class="nm">Strategy</div><div class="cp">IStrategy · SimpleORBStrategy · NT8 wrappers</div></div><div class="cp">Signal only. Emits StrategyIntent</div><div class="st"><span class="chip ok">load-bearing</span></div></div>
|
||||
<div class="layer core"><div class="n">2</div><div><div class="nm">Intelligence</div><div class="cp">ConfluenceScorer · 10 × IFactorCalculator · GradeFilter</div></div><div class="cp">Quality gate before risk</div><div class="st"><span class="chip crit">weighting defect</span></div></div>
|
||||
<div class="layer core"><div class="n">3</div><div><div class="nm">Risk</div><div class="cp">BasicRisk T1 · AdvancedRisk T2/T3/T3.5 · PortfolioRiskManager</div></div><div class="cp">Four checkpoints per trade</div><div class="st"><span class="chip crit">blocking trades</span></div></div>
|
||||
<div class="layer core"><div class="n">4</div><div><div class="nm">Sizing</div><div class="cp">BasicPositionSizer · GradeBasedSizer · VolatilityAdjustedSizer</div></div><div class="cp">Dollar risk → contracts</div><div class="st"><span class="chip ok">load-bearing</span></div></div>
|
||||
<div class="layer core"><div class="n">5</div><div><div class="nm">OMS</div><div class="cp">OrderStateMachine · BasicOrderManager · DuplicateOrderDetector</div></div><div class="cp">Thread-safe order lifecycle</div><div class="st"><span class="chip ok">load-bearing</span></div></div>
|
||||
<div class="layer core"><div class="n">6</div><div><div class="nm">Analytics</div><div class="cp">TradeRecorder · PerformanceCalculator · MonteCarlo · PnLAttributor</div></div><div class="cp">Measurement, ML dataset</div><div class="st"><span class="chip warn">built, unconsumed</span></div></div>
|
||||
<div class="layer core"><div class="n">7</div><div><div class="nm">Execution</div><div class="cp">CircuitBreaker · TrailingStopManager · ExecutionQualityTracker</div></div><div class="cp">Execution safety, fill quality</div><div class="st"><span class="chip ok">wired</span></div></div>
|
||||
<div class="layer core"><div class="n">8</div><div><div class="nm">Market Data</div><div class="cp">SessionManager · AVWAPCalculator · LiquidityMonitor</div></div><div class="cp">Context for factors</div><div class="st"><span class="chip warn">depth hardcoded</span></div></div>
|
||||
<div class="layer adapter"><div class="n">9</div><div><div class="nm">NT8 Adapter Ring</div><div class="cp">NT8StrategyBase (2,880 lines) · OrderAdapter · DataAdapter · LoggingAdapter</div></div><div class="cp">Only layer importing NinjaTrader</div><div class="st"><span class="chip ok">load-bearing</span></div></div>
|
||||
</div>
|
||||
<p class="note"><strong>Dead code worth knowing about:</strong> <code>RegimeManager</code>, <code>TrendRegimeDetector</code> and <code>VolatilityRegimeDetector</code> are instantiated in Layer 2 but never called in the live signal path (DEC-20260817-04). The regime values actually used come from inline SMA20/50 arithmetic in <code>BuildStrategyContext()</code>.</p>
|
||||
</section>
|
||||
|
||||
<!-- 2 PIPELINE -->
|
||||
<section id="pipe">
|
||||
<h2>2 · The bar-to-trade pipeline</h2>
|
||||
<p class="lede">Eighteen stages between a bar closing and an order reaching the broker. The order matters: <code>SIGNAL:</code> is written at stage 8, <em>before</em> every risk gate, which is what makes a silent day diagnosable. Red rows are where trades died on 2026-08-18.</p>
|
||||
<div class="pipe">
|
||||
<div class="stage"><div class="n">1</div><div>CME holiday guard</div><div class="rr">CmeHoliday</div><div class="st"><span class="chip ok">clear</span></div></div>
|
||||
<div class="stage"><div class="n">2</div><div>Connection state</div><div class="rr">— (bar skipped)</div><div class="st"><span class="chip ok">clear</span></div></div>
|
||||
<div class="stage"><div class="n">3</div><div>Kill switch</div><div class="rr">KillSwitch</div><div class="st"><span class="chip ok">off today</span></div></div>
|
||||
<div class="stage"><div class="n">4</div><div>Warm-up — first realtime bar</div><div class="rr">WarmupIncomplete</div><div class="st"><span class="chip neut">17 today</span></div></div>
|
||||
<div class="stage"><div class="n">5</div><div>RTH window guard</div><div class="rr">RthGuard</div><div class="st"><span class="chip neut">233 today</span></div></div>
|
||||
<div class="stage"><div class="n">6</div><div>ETH telemetry branch → return</div><div class="rr">—</div><div class="st"><span class="chip neut">opt-in</span></div></div>
|
||||
<div class="stage"><div class="n">7a</div><div>ORB range established</div><div class="rr">OrbRangeNotEstablished</div><div class="st"><span class="chip ok">OrbReady=True</span></div></div>
|
||||
<div class="stage"><div class="n">7b</div><div>Two-bar pullback confirmation</div><div class="rr">OrbRangeNotEstablished</div><div class="st"><span class="chip ok">confirmed</span></div></div>
|
||||
<div class="stage"><div class="n">7c</div><div>Direction filters · AVWAP short veto</div><div class="rr">GradeFilter</div><div class="st"><span class="chip ok">passed</span></div></div>
|
||||
<div class="stage suspect"><div class="n">7d</div><div>Confluence grade ≥ MinTradeGrade</div><div class="rr">GradeFilter</div><div class="st"><span class="chip ser">GAP-047 suspect</span></div></div>
|
||||
<div class="stage"><div class="n">7e</div><div>MaxDailyTrades cap</div><div class="rr">MaxDailyTrades</div><div class="st"><span class="chip ok">not hit</span></div></div>
|
||||
<div class="stage sig"><div class="n">8</div><div><strong>SIGNAL: written — unconditional, before all risk gates</strong></div><div class="rr">—</div><div class="st"><span class="chip ok">5 today</span></div></div>
|
||||
<div class="stage"><div class="n">9</div><div>Historical replay catch-up block</div><div class="rr">HistoricalReplayCatchup</div><div class="st"><span class="chip neut">317 today</span></div></div>
|
||||
<div class="stage"><div class="n">10</div><div>Dynamic ATR stop finalised — <em>before</em> sizing</div><div class="rr">—</div><div class="st"><span class="chip neut">45 ticks</span></div></div>
|
||||
<div class="stage block"><div class="n">11</div><div>Trailing drawdown monitor</div><div class="rr">TrailingDrawdownBreach</div><div class="st"><span class="chip crit">27 blocked</span></div></div>
|
||||
<div class="stage"><div class="n">12</div><div>Portfolio risk</div><div class="rr">KillSwitch <em>(mislabelled)</em></div><div class="st"><span class="chip ok">passed</span></div></div>
|
||||
<div class="stage block"><div class="n">13</div><div><strong>Tier 1 per-trade risk — StopTicks × tickValue ≤ MaxTradeRisk</strong></div><div class="rr">KillSwitch <em>(mislabelled)</em></div><div class="st"><span class="chip crit">5 blocked</span></div></div>
|
||||
<div class="stage"><div class="n">14</div><div>Position sizing</div><div class="rr">GradeFilter <em>(mislabelled)</em></div><div class="st"><span class="chip neut">never reached</span></div></div>
|
||||
<div class="stage"><div class="n">15</div><div>Circuit breaker</div><div class="rr">KillSwitch <em>(mislabelled)</em></div><div class="st"><span class="chip neut">never reached</span></div></div>
|
||||
<div class="stage"><div class="n">16</div><div>Runner mode resolution</div><div class="rr">—</div><div class="st"><span class="chip neut">never reached</span></div></div>
|
||||
<div class="stage"><div class="n">17</div><div>SetStopLoss / SetProfitTarget → Enter…Managed</div><div class="rr">—</div><div class="st"><span class="chip crit">0 today</span></div></div>
|
||||
<div class="stage"><div class="n">18</div><div>SUBMIT: + provenance row (realtime only)</div><div class="rr">—</div><div class="st"><span class="chip crit">0 today</span></div></div>
|
||||
</div>
|
||||
<p class="note"><strong>Four rows share the label <code>KillSwitch</code></strong> (stages 3, 12, 13, 15) and four share <code>GradeFilter</code> (7c, 7d, 14). <code>REJECT SUMMARY</code> aggregates on <em>reason</em>, so its counts are ambiguous. On 2026-08-17 a session logged <code>KillSwitch count=647</code> from a genuine kill switch; on 08-18 a session logged <code>KillSwitch count=5</code> from a MaxTradeRisk rejection. Splitting the taxonomy is task P0-C.</p>
|
||||
</section>
|
||||
|
||||
<!-- 3 RISK -->
|
||||
<section id="risk">
|
||||
<h2>3 · Risk validation — four tiers plus the new monitor</h2>
|
||||
<p class="lede">A trade must clear every applicable tier. The annotation on Tier 1 is the most consequential correction in v7.0.</p>
|
||||
<div class="tree">
|
||||
<b>TIER 1 — BasicRiskManager</b>
|
||||
├─ Daily loss P&L ≤ −DailyLossLimit ($1,000) → HALT for the day
|
||||
├─ <span class="bad">Per-trade risk StopTicks × tickValue > MaxTradeRisk ($200) → REJECT</span>
|
||||
│ <span class="bad">↑ NO QUANTITY TERM. Evaluated BEFORE sizing.</span>
|
||||
│ <span class="bad">↑ NQ: caps the stop at 40 ticks. MaxStopTicks is 50.</span>
|
||||
│ <span class="bad">↑ 2026-08-18: rejected 5 signals at $225.00 > $200.00</span>
|
||||
│ <span class="warnc">↑ Real worst case = MaxTradeRisk × MaxContracts = $600</span>
|
||||
├─ Position count OpenPositions ≥ MaxOpenPositions (3) → REJECT
|
||||
└─ 80% warning P&L ≤ −$800 → LOG only
|
||||
|
||||
<b>TIER 2 — AdvancedRiskManager (weekly + drawdown)</b>
|
||||
├─ Weekly loss WeeklyPnL ≤ −WeeklyLossLimit → HALT, resets Monday
|
||||
├─ Trailing DD TrailingDrawdown ≥ DrawdownLimit → HALT until recovery
|
||||
└─ DD 80% DrawdownPct ≥ 0.8 → LOG alert
|
||||
|
||||
<b>TIER 3 — cross-strategy</b>
|
||||
└─ Cross exposure TotalExposure > MaxCrossStrategyExposure → REJECT
|
||||
|
||||
<b>TIER 3.5 — portfolio heat</b>
|
||||
└─ Heat % (TotalOpenRisk + NewTradeRisk) / Equity × 100 → REJECT if > MaxHeatPct (3.0%)
|
||||
<span class="okc">↑ this tier DOES include quantity — Tier 1 does not</span>
|
||||
|
||||
<b>TRAILING DRAWDOWN MONITOR — account-keyed, new 2026-08-18</b>
|
||||
├─ equity = Account.Get(AccountItem.NetLiquidation) <span class="warnc">← not yet validated</span>
|
||||
├─ peak = max(peak, equity)
|
||||
├─ lock-in if peak ≥ AccountStartingBalance + LockOffset (100) → lock
|
||||
├─ reference = locked ? lockedPeak : peak
|
||||
├─ floor = reference − HaltBuffer (2000)
|
||||
└─ <span class="bad">GUARD: EnableTrailingDrawdown=True + AccountStartingBalance=0 → BLOCK ALL ENTRIES</span>
|
||||
<span class="bad">↑ 2026-08-18 14:30 onward. 27 rejections. No startup assertion.</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 4 CONFLUENCE -->
|
||||
<section id="conf">
|
||||
<h2>4 · Confluence scoring — designed weights vs what actually runs</h2>
|
||||
<p class="lede">Each factor calculator emits its designed weight. <code>ConfluenceScorer</code>'s constructor pre-populates a weight dictionary with 1.0 for all ten factor types, and <code>ResolveWeight()</code> checks that dictionary first — so the calculators' weights are unreachable dead code. Every <code>STATE:</code> line in production reads <code>x1.00</code>.</p>
|
||||
<div class="chart">
|
||||
<div class="legend">
|
||||
<span><i style="background:var(--s1)"></i>Designed weight (from the factor calculators)</span>
|
||||
<span><i style="background:var(--s2)"></i>Actual runtime weight (pre-populated, always 1.00)</span>
|
||||
</div>
|
||||
<div id="wchart"></div>
|
||||
</div>
|
||||
|
||||
<h3>The same ten factor scores, both ways — live data, 2026-08-18 10:10:11 ET</h3>
|
||||
<div class="tiles">
|
||||
<div class="tile"><div class="k">Composite — equal weights</div><div class="v" style="color:var(--critical)">0.640</div><div class="d">Grade C · what the system logged</div></div>
|
||||
<div class="tile"><div class="k">Composite — designed weights</div><div class="v" style="color:var(--s1)">0.727</div><div class="d">Grade B · one full grade higher</div></div>
|
||||
<div class="tile"><div class="k">Total weight</div><div class="v">10.00 <span style="font-size:15px;color:var(--muted)">vs</span> 5.85</div><div class="d">Context factors carry 50% instead of 14.5%</div></div>
|
||||
<div class="tile"><div class="k">Grade A reachability</div><div class="v" style="font-size:20px">structurally hard</div><div class="d">Needs all ten factors ≥ 0.80 average; designed scheme reaches A on factors 1–5 alone</div></div>
|
||||
</div>
|
||||
|
||||
<h3>Live factor scores that produced those composites</h3>
|
||||
<table>
|
||||
<thead><tr><th>#</th><th>Factor</th><th class="num">Score</th><th class="num">Designed wt</th><th class="num">Actual wt</th><th>Reason logged</th></tr></thead>
|
||||
<tbody id="ftab"></tbody>
|
||||
</table>
|
||||
<p class="note">Grade thresholds: A+ ≥ 0.90 · A ≥ 0.80 · B ≥ 0.70 · C ≥ 0.60 · D below · F at floor. The live gate configuration froze <code>MinTradeGrade = 5</code> (Grade A); today's workspace runs <code>MinTradeGrade = 4</code> (Grade B) — itself a drift from the frozen baseline.</p>
|
||||
</section>
|
||||
|
||||
<!-- 5 RUNNER -->
|
||||
<section id="runner">
|
||||
<h2>5 · Runner economics — why the third contract earns nothing</h2>
|
||||
<p class="lede"><strong>Revised in rev B — the diagnosis changed.</strong> The runner is not badly tuned. Its trailing stop is <em>switched off mid-trade</em>. <code>SetStopLoss()</code> and <code>SetTrailStop()</code> are mutually exclusive per signal name in NinjaScript, and the auto-breakeven block calls <code>SetStopLoss()</code> on the runner signal — replacing a live 12-tick trail with a static stop at entry +1. In 4/4 trades the trail was already 12–16 ticks in profit when breakeven fired and was moved <em>backwards</em>.</p>
|
||||
<div class="tree">
|
||||
<b>AT ENTRY — correct NinjaScript</b>
|
||||
SetStopLoss (_runnerSignalName, Ticks, intent.StopTicks) initial protective stop
|
||||
<span class="okc">SetTrailStop(_runnerSignalName, Ticks, RunnerTrailTicks=12) ← replaces it with a LIVE 12-tick trail</span>
|
||||
EnterLong/EnterShort(runnerQty, _runnerSignalName)
|
||||
|
||||
<b>IN OnBarUpdate — the defect (NT8StrategyBase.cs ~803)</b>
|
||||
if (EnableAutoBreakeven && !_breakevenMoved && profitTicks >= 20)
|
||||
<span class="bad">SetStopLoss(_runnerSignalName, Price, entry+1tick) ← DESTROYS THE TRAIL</span>
|
||||
|
||||
<b>WHAT THAT DOES TO THE STOP</b>
|
||||
entry ──────────────────────────────────────────────────────────────────▶ price
|
||||
│
|
||||
├── <span class="okc">+12..16t where the live 12-tick trail already sat when breakeven fired</span>
|
||||
│
|
||||
├── <span class="bad">+1t where SetStopLoss moved it ← 11–15 ticks of locked profit given back</span>
|
||||
│
|
||||
├── +24..28t breakeven actually fires here, not at 20 (Calculate = OnBarClose)
|
||||
│
|
||||
└── ... <span class="bad">trail is gone. Runner sits static until stopped near entry.</span>
|
||||
|
||||
<b>THE SOURCE COMMENT FOUR LINES BELOW</b>
|
||||
<span class="warnc">"Do NOT call SetTrailStop here — that resets the trail anchor..."</span>
|
||||
The author correctly avoided that trap and did not notice that the
|
||||
SetStopLoss call above it destroys the trail outright.
|
||||
</div>
|
||||
<table>
|
||||
<thead><tr><th>Trade</th><th class="num">Profit when BE fired</th><th class="num">Where a 12t trail sat</th><th class="num">Where the stop went</th><th class="num">Runner gross</th><th class="num">Runner net</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>2026-08-07</td><td class="num">+28 t</td><td class="num" style="color:var(--s1);font-weight:600">+16 t</td><td class="num" style="color:var(--critical);font-weight:600">+1 t</td><td class="num">$5.00</td><td class="num" style="color:var(--critical)">−$0.76</td></tr>
|
||||
<tr><td>2026-08-10</td><td class="num">+25 t</td><td class="num" style="color:var(--s1);font-weight:600">+13 t</td><td class="num" style="color:var(--critical);font-weight:600">+1 t</td><td class="num">$0.00</td><td class="num" style="color:var(--critical)">−$5.76</td></tr>
|
||||
<tr><td>2026-08-16</td><td class="num">+24 t</td><td class="num" style="color:var(--s1);font-weight:600">+12 t</td><td class="num" style="color:var(--critical);font-weight:600">+1 t</td><td class="num">$15.00</td><td class="num" style="color:var(--good-text)">+$9.24</td></tr>
|
||||
<tr><td>2026-08-17</td><td class="num">+26 t</td><td class="num" style="color:var(--s1);font-weight:600">+14 t</td><td class="num" style="color:var(--critical);font-weight:600">+1 t</td><td class="num">$5.00</td><td class="num" style="color:var(--critical)">−$0.76</td></tr>
|
||||
<tr class="total"><td>4 trades</td><td class="num">—</td><td class="num">55 t = $275</td><td class="num">4 t = $20</td><td class="num">$25.00</td><td class="num">+$1.96</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="tiles">
|
||||
<div class="tile"><div class="k">Total net P&L</div><div class="v">$1,035.88</div><div class="d">4 broker-confirmed trades, after $69.12 commission</div></div>
|
||||
<div class="tile"><div class="k">Runner share of P&L</div><div class="v" style="color:var(--critical)">0.19%</div><div class="d">for 33% of contract exposure</div></div>
|
||||
<div class="tile"><div class="k">RTH_ORB trades only</div><div class="v">3</div><div class="d">$758.16 · the 08-16 trade was ETH</div></div>
|
||||
<div class="tile"><div class="k">Runner net, RTH only</div><div class="v" style="color:var(--critical)">−$7.28</div><div class="d">on gate-eligible trades, it loses money</div></div>
|
||||
<div class="tile"><div class="k">Runner net with a working trail</div><div class="v" style="color:var(--good-text)">≈$252</div><div class="d">conservative floor: exit at the trail's position when BE fired. It ratchets further, so this is a lower bound</div></div>
|
||||
<div class="tile"><div class="k">Uplift on realised P&L</div><div class="v" style="color:var(--good-text)">≈24%</div><div class="d">$1,035.88 → ≈$1,286 · from deleting one call site</div></div>
|
||||
</div>
|
||||
<p class="note"><strong>Two secondary defects in the same block.</strong> <code>entryPrice</code> is <code>Position.AveragePrice</code> — the <em>blended</em> 3-contract average, not the runner's own fill. On 08-16 that produced a breakeven price of <code>30200.08</code>, which is not a valid NQ price (tick 0.25). And because <code>Calculate = OnBarClose</code>, the 20-tick trigger actually fires at 24–28 ticks.<br><br><strong>Consequence for STAGE 2:</strong> the RUNNER-001 sweep must not run until this is fixed. An 18-combination sweep over <em>breakeven trigger × trail distance</em> against a runner whose trail is disabled would return a trail axis with no effect and a confident, meaningless recommendation. Fix first (task <strong>P2-0</strong>), then sweep.</p>
|
||||
</section>
|
||||
|
||||
<!-- 6 COLLISIONS -->
|
||||
<section id="collide">
|
||||
<h2>6 · Parameter interaction map</h2>
|
||||
<p class="lede">Fourteen interactions between parameters that are individually reasonable. Four are actively broken; two of those are stopping trades today.</p>
|
||||
<div class="cmap" id="cmap"></div>
|
||||
</section>
|
||||
|
||||
<!-- 7 GAPS -->
|
||||
<section id="gaps">
|
||||
<h2>7 · Gap register</h2>
|
||||
<p class="lede">Colour is severity. GAP-045 through GAP-053 are new in v7.0. Note the numbering caution: <code>GAP-042/043/044</code> mean the repository's definitions; the July audit findings that v6.4 gave those numbers are renamed <code>HIST-41…46</code> to make a third collision impossible.</p>
|
||||
<h3>Blocking</h3>
|
||||
<div class="gaps" id="g-block"></div>
|
||||
<h3>Open — high</h3>
|
||||
<div class="gaps" id="g-high"></div>
|
||||
<h3>Open — medium and low</h3>
|
||||
<div class="gaps" id="g-med"></div>
|
||||
<h3>Recently closed</h3>
|
||||
<div class="gaps" id="g-done"></div>
|
||||
</section>
|
||||
|
||||
<!-- 8 ROADMAP -->
|
||||
<section id="road">
|
||||
<h2>8 · Roadmap v7.0 — critical path</h2>
|
||||
<p class="lede">Re-sequenced around three principles: unblock before optimising, fix the measuring instrument before measuring, and treat sample rate as a first-class objective. Stage 3's duration is the whole story.</p>
|
||||
<div class="road">
|
||||
<div class="rstage now"><div class="sn">STAGE 0<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Unblock</span></div><div class="items">P0-A trailing drawdown · P0-A2 startup assertion · P0-B MaxTradeRisk · P0-C reject taxonomy · P0-D commit tree · P0-E re-freeze</div><div class="dur">1–2 days<br><span style="color:var(--muted)">optimistic 1</span></div></div>
|
||||
<div class="rstage key"><div class="sn">STAGE 1<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Trustworthy instrument</span></div><div class="items"><strong>P1-A factor weighting ← highest-value item in the project</strong> · P1-B risk envelope · P1-C coherence assertions · P1-D telemetry direction · P1-E gap magnitude · P1-F DaysToLoad · P1-G configdiff as a gate</div><div class="dur">1–2 weeks<br><span style="color:var(--muted)">optimistic 3d</span></div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 2<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Runner</span></div><div class="items">P2-A analyzer viability → P2-B 18-combination sweep → P2-C analyse → P2-D superseding decision · <em>depends on P1-F</em></div><div class="dur">1–2 weeks<br><span style="color:var(--muted)">optimistic 2d</span></div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 3<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Gate Run #3</span></div><div class="items">≥2 weeks AND ≥20 RTH_ORB trades, single frozen account · outcome matrix decides PASS / CONDITIONAL / MARGINAL / NO EDGE / NEGATIVE / FAIL-on-risk</div><div class="dur" style="color:var(--critical);font-weight:600">2–7 months<br><span style="color:var(--muted);font-weight:400">optimistic 2wk</span></div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 4<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Ruling</span></div><div class="items">Gate report · grade-vs-outcome correlation (never measured) · direction split · runner attribution · cost analysis · GAP-007 walk-forward</div><div class="dur">1–2 weeks</div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 5<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Live micro</span></div><div class="items">1 MNQ contract · real capital · trailing drawdown properly configured · PF > 1.8, max daily loss < $100</div><div class="dur">6–10 weeks</div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 6<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Scale</span></div><div class="items">GAP-042 account dimension (prerequisite) · scale NQ size · LondonORBNT8 · VWAPMeanReversion · overnight gap · GAP-043 bar-type evaluation</div><div class="dur">—</div></div>
|
||||
<div class="rstage"><div class="sn">STAGE 7<br><span style="font-weight:400;font-size:11.5px;color:var(--muted)">Platform</span></div><div class="items">External command channel (read side can start in Stage 3) · broker-neutral event schema · web + mobile dashboard · additional broker adapters</div><div class="dur">—</div></div>
|
||||
</div>
|
||||
<div class="tiles">
|
||||
<div class="tile"><div class="k">Trades in the last 6 weeks</div><div class="v">4</div><div class="d">≈0.7 per week</div></div>
|
||||
<div class="tile"><div class="k">20-trade sample at that rate</div><div class="v" style="color:var(--critical)">≈7 months</div><div class="d">This is the binding constraint, not the edge</div></div>
|
||||
<div class="tile"><div class="k">To first live capital</div><div class="v">4–10 mo</div><div class="d">optimistic ≈11 weeks</div></div>
|
||||
<div class="tile"><div class="k">If GAP-047 is the cause</div><div class="v" style="color:var(--good-text)">weeks</div><div class="d">Fixing the weighting could compress Stage 3 from months to weeks</div></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 9 TODAY -->
|
||||
<section id="today">
|
||||
<h2>9 · 2026-08-18 — the day in evidence</h2>
|
||||
<p class="lede">Sixteen sessions started. Five valid signals. Zero orders. Two independent blockers, both root-caused, both fixable this week.</p>
|
||||
<div class="tl">
|
||||
<div class="ev"><div class="t">06:50 / 07:11</div><div class="m">Two strategy instances arm on the <b>same account and instrument</b> (<code>SimSimple ORB</code> / NQ SEP26), both on HFT Algo Bars. Both run until 13:12. <span class="chip warn">single-account doctrine violated</span></div></div>
|
||||
<div class="ev"><div class="t">07:11:17</div><div class="m">Session header: <code>DaysToLoad=3</code> on the primary series (configured 120) · <code>WARNING: EnableKillSwitch=False for gate account</code> · factor warm-up SATISFIED, 87 daily bars</div></div>
|
||||
<div class="ev"><div class="t">09:30 – 10:00</div><div class="m">Opening range forms: high <b>29,769.75</b>, low <b>29,604.75</b> — a 165-point range</div></div>
|
||||
<div class="ev"><div class="t">10:10:11</div><div class="m"><code>STATE: Regime=Bearish Direction=Sell Score=0.640 Grade=C</code> — every factor at <code>x1.00</code>. <code>STATE_CONTEXT: OrbReady=True RecommendedContracts=1</code>. The same block reports <code>GapDirectionAlignment="Large gap −523.25 opposes trade"</code> on a <em>Sell</em> — the telemetry path's direction is stale <span class="chip ser">Finding 5</span></div></div>
|
||||
<div class="ev sig"><div class="t">10:10:24.956</div><div class="m"><b>SIGNAL: Sell NQ | LIVE MODE</b> — the real intent passed the grade filter</div></div>
|
||||
<div class="ev rej"><div class="t">10:10:24.956</div><div class="m"><b>REJECT: reason=KillSwitch detail=Risk manager rejected: Trade risk too high: $225.00</b><br>45-tick ATR stop × $5.00 = $225.00 > MaxTradeRisk $200.00. <code>MinContracts=1</code> is already the floor; there is nothing to reduce. <span class="chip crit">Blocker A</span></div></div>
|
||||
<div class="ev sig"><div class="t">10:10:25 → 10:10:46</div><div class="m">Four more <code>SIGNAL: Sell NQ</code> lines. All rejected. <code>REJECT SUMMARY: reason=KillSwitch count=5</code></div></div>
|
||||
<div class="ev"><div class="t">13:19 – 14:23</div><div class="m">Five more sessions started across <b>five different bar periods</b> — HFT Algo, 5 Minute, 15 Minute, 30 Minute, 13 Minute. Nine distinct <code>ConfigHash</code> values and three distinct <code>CodeVersion</code> MVIDs on the day <span class="chip warn">config freeze not in force</span></div></div>
|
||||
<div class="ev rej"><div class="t">14:30:00.133</div><div class="m"><b>REJECT: reason=TrailingDrawdownBreach detail=EnableTrailingDrawdown=True but AccountStartingBalance is not configured</b><br>The monitor added today (DEC-20260818-17) correctly refuses to run without a floor — and its refusal blocks every entry for the rest of the session. 27 rejections. <span class="chip crit">Blocker B</span></div></div>
|
||||
<div class="ev"><div class="t">16:40</div><div class="m">Last session terminates. <b>Signals: 5 · Submissions: 0 · Fills: 0 · P&L: $0.00</b></div></div>
|
||||
</div>
|
||||
<p class="note"><strong>What this day proves.</strong> The strategy found a textbook setup — a clean 165-point opening range, a confirmed breakout, a bearish regime, and 4.1× average breakout volume — and could not act on it, twice, for two reasons that have nothing to do with the trading hypothesis. That is the whole argument for Stage 0.</p>
|
||||
</section>
|
||||
|
||||
<!-- 10 SESSION CLOCK -->
|
||||
<section id="clock">
|
||||
<h2>10 · The 24×5 session clock</h2>
|
||||
<p class="lede">24×5 coverage is <strong>concurrent strategy instances with disjoint session windows</strong>, not switching between strategies — settled in <code>architecture.md</code> on 2026-08-17. <code>PortfolioRiskManager</code> was already built for it. A new strategy is a new <code>IStrategy</code> plus a thin NinjaScript subclass; the shared base is not forked. The roadmap names four strategies. It has never had a clock. Here it is.</p>
|
||||
<div class="pipe">
|
||||
<div class="stage"><div class="n">03:00</div><div><strong>LondonORBNT8</strong> — 03:00–03:30 ET opening range</div><div class="rr">Sprint 4 · named only</div><div class="st"><span class="chip warn">no design</span></div></div>
|
||||
<div class="stage sig"><div class="n">09:30</div><div><strong>SimpleORBNT8</strong> — 09:30–10:00 ET opening range</div><div class="rr">under validation</div><div class="st"><span class="chip ok">the one that exists</span></div></div>
|
||||
<div class="stage"><div class="n">11:00</div><div><strong>VWAPMeanReversion</strong> — 11:00–14:00 ET</div><div class="rr">Sprint 4 · named only</div><div class="st"><span class="chip warn">no design</span></div></div>
|
||||
<div class="stage suspect"><div class="n">15:00</div><div><em>unassigned</em> — closing drive / second RTH ORB</div><div class="rr">not on the roadmap</div><div class="st"><span class="chip ser">gap</span></div></div>
|
||||
<div class="stage suspect"><div class="n">18:00</div><div><em>unassigned</em> — Asia-session ORB, the symmetric counterpart to London</div><div class="rr">not on the roadmap</div><div class="st"><span class="chip ser">gap</span></div></div>
|
||||
<div class="stage"><div class="n">O/N</div><div><strong>OvernightGapContinuation / OvernightGapReversion</strong> — event-driven</div><div class="rr">Sprint 4 · named only</div><div class="st"><span class="chip warn">no design</span></div></div>
|
||||
</div>
|
||||
<h3>Prerequisites before any of this starts</h3>
|
||||
<table>
|
||||
<thead><tr><th>Prerequisite</th><th>Why</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>Stage 5 passed</td><td>Do not multiply an unvalidated edge</td></tr>
|
||||
<tr><td><strong>GAP-042</strong> — account dimension in <code>PortfolioRiskManager</code></td><td>The singleton is keyed only by <code>strategyId</code>. Fine for several strategies on <em>one</em> account; unsafe across accounts</td></tr>
|
||||
<tr><td><strong>GAP-055</strong> — <code>MaxDailyTrades</code> persistence</td><td>A cap that resets on restart becomes per-strategy-per-restart once several instances run</td></tr>
|
||||
<tr><td>A portfolio daily loss limit distinct from the sum of per-strategy limits</td><td>Three strategies at $1,000 each is a $3,000 day. The hook exists; the number has never been set</td></tr>
|
||||
<tr><td>Instrument decision (MNQ vs NQ)</td><td>Three strategies on NQ at <code>MinContracts=1</code> is a much blunter instrument than three on MNQ</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="note"><strong>Assessment:</strong> the roadmap covers roughly two thirds of a tradeable 24×5 clock, by name only — no entry hypothesis, no session-window map before this one, no per-strategy design pass. The architecture to support it is genuinely ready and has never been collected. Correctly sequenced behind Stage 5, but the design work is a real outstanding item, not a checkbox.</p>
|
||||
</section>
|
||||
|
||||
<footer>NT8-SDK Visual Pack v7.0 rev B · generated 2026-08-18 · companion to NT8_SDK_Master_Document_v7.0_Complete.docx<br>All figures traced to <code>C:\dev\nt8-sdk</code> and <code>Documents\NinjaTrader 8\log\nt8-sdk</code>. No source code was modified.</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// theme toggle
|
||||
const tt=document.getElementById('tt');
|
||||
if(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches){document.documentElement.dataset.theme='dark';}
|
||||
function sync(){tt.textContent=document.documentElement.dataset.theme==='dark'?'Light mode':'Dark mode';}
|
||||
tt.onclick=()=>{document.documentElement.dataset.theme=document.documentElement.dataset.theme==='dark'?'light':'dark';sync();};
|
||||
sync();
|
||||
|
||||
// ---- factor data (live, session_20260818_071117.log @ 10:10:11.833)
|
||||
const F=[
|
||||
{n:1,name:'Setup (ORB validity)',s:1.00,d:1.00,r:'ORB validity from range, candle quality, volume, timing'},
|
||||
{n:2,name:'Trend alignment',s:0.30,d:1.00,r:'AVWAP location, slope, confirmation'},
|
||||
{n:3,name:'Volatility regime',s:0.70,d:1.00,r:'Volatility suitability from ATR ratio'},
|
||||
{n:4,name:'Timing in session',s:1.00,d:1.00,r:'Session timing suitability'},
|
||||
{n:5,name:'Execution quality',s:0.80,d:1.00,r:'Recent execution quality suitability'},
|
||||
{n:6,name:'Narrow range',s:0.45,d:0.20,r:'Range near avg — no significant contraction'},
|
||||
{n:7,name:'ORB vs ATR',s:0.50,d:0.15,r:'No daily bar context available'},
|
||||
{n:8,name:'Gap direction',s:0.10,d:0.15,r:'Large gap −523.25 opposes trade — high fade risk'},
|
||||
{n:9,name:'Breakout volume',s:0.85,d:0.20,r:'Breakout volume 2.6× avg — strong confirmation'},
|
||||
{n:10,name:'Prior-day close',s:0.70,d:0.15,r:'Prior close in lower half — moderate bearish bias'}
|
||||
];
|
||||
// weight chart
|
||||
const W=document.getElementById('wchart');
|
||||
const MAX=1.0, PX=380;
|
||||
W.innerHTML=F.map(f=>`
|
||||
<div class="frow">
|
||||
<div class="flabel">${f.n}. ${f.name}</div>
|
||||
<div class="fbars">
|
||||
<div class="fbar d" style="width:${Math.max(2,f.d/MAX*PX)}px"><span>${f.d.toFixed(2)} designed</span></div>
|
||||
<div class="fbar a" style="width:${PX}px"><span>1.00 actual</span></div>
|
||||
</div>
|
||||
</div>`).join('');
|
||||
// factor table
|
||||
document.getElementById('ftab').innerHTML=F.map(f=>`
|
||||
<tr><td>${f.n}</td><td>${f.name}</td><td class="num">${f.s.toFixed(2)}</td>
|
||||
<td class="num">${f.d.toFixed(2)}</td><td class="num" style="color:var(--s2);font-weight:600">1.00</td>
|
||||
<td style="font-size:12.5px;color:var(--ink2)">${f.r}</td></tr>`).join('');
|
||||
|
||||
// ---- collisions
|
||||
const C=[
|
||||
['crit','1 · MaxTradeRisk × MaxStopTicks × tick value','50 ticks × $5 = $250 > $200. The top 20% of the ATR stop range is unreachable. <b>Blocking trades today.</b>'],
|
||||
['crit','9 · EnableTrailingDrawdown × AccountStartingBalance','Enabled without the balance blocks every entry. No startup assertion. <b>Blocking trades today.</b>'],
|
||||
['crit','7 · MinTradeGrade × factor weighting','Grade A (0.80) near-unreachable at equal weights. <b>Suppressing signals.</b>'],
|
||||
['crit','5 · BreakevenTriggerTicks × dynamic target','Trigger 20 vs target 28 leaves the runner 8 ticks. <b>Costs the runner its entire contribution.</b>'],
|
||||
['ser','2 · MaxTradeRisk × MaxContracts × DailyLossLimit','No quantity term in Tier 1 → worst case $600 against a $1,000 daily limit. <b>Under-enforced.</b>'],
|
||||
['warn','8 · RegimeGate=GradePenalty × MinTradeGrade','A one-grade penalty on an already-suppressed score. Compounds #7.'],
|
||||
['warn','6 · BreakevenOffsetTicks × slippage','1-tick offset means one tick of adverse noise stops the runner flat.'],
|
||||
['warn','3 · RiskPerTrade × MinContracts','MinContracts=1 overrides the risk target upward. By design, but undocumented.'],
|
||||
['warn','12 · SmaPeriodLong × backtest start date','Regime gate never arms below 50 daily bars. Mandatory 60-day warm-up.'],
|
||||
['warn','10 · MaxDailyTrades = 1','Caps daily upside at one trade regardless of setup count. Deliberate for the gate; revisit after.'],
|
||||
['warn','11 · EnableDynamicStop × StopTicks / TargetTicks','Static values are overwritten and become misleading in settings exports.'],
|
||||
['warn','13 · EnableShortTrendFilter vs the long veto','Shorts are configurably vetoed; longs unconditionally. Undocumented asymmetry.'],
|
||||
['warn','14 · Two hardcoded tick-value tables','BasicRiskManager and BasicPositionSizer each carry a copy. Latent divergence.'],
|
||||
['ok','4 · RiskPerTrade ≤ MaxTradeRisk','Asserted at startup since GAP-003. Currently 100 ≤ 200 — satisfied.']
|
||||
];
|
||||
document.getElementById('cmap').innerHTML=C.map(([k,t,b])=>
|
||||
`<div class="cell ${k}"><div class="t">${t}</div><div class="b">${b}</div></div>`).join('');
|
||||
|
||||
// ---- gaps
|
||||
function gaps(el,arr,cls){document.getElementById(el).innerHTML=arr.map(([id,txt])=>
|
||||
`<div class="gap ${cls}"><div class="id">${id}</div><div class="txt">${txt}</div></div>`).join('');}
|
||||
gaps('g-block',[
|
||||
['—','Dirty working tree: 17 modified, 5 untracked. Two live strategy files uncommitted'],
|
||||
['GAP-054','Auto-breakeven SetStopLoss destroys the runner trailing stop. 4/4 trades. Blocks RUNNER-001'],
|
||||
['GAP-045','MaxTradeRisk / MaxStopTicks collision blocks all high-ATR days'],
|
||||
['GAP-046','EnableTrailingDrawdown without AccountStartingBalance blocks every entry'],
|
||||
['GAP-047','Factor weights pre-populated to 1.0; designed weights unreachable'],
|
||||
['GAP-034a','Silent day — no candidate produced (08-03/04/13). GAP-047 is the primary suspect'],
|
||||
['GAP-034b','Silent day — candidate blocked at a risk gate. ROOT-CAUSED'],
|
||||
['RUNNER-001','Sweep never executed against real exports']
|
||||
],'crit');
|
||||
gaps('g-high',[
|
||||
['GAP-055','MaxDailyTrades does not survive a restart. Breached on CME date 2026-08-17'],
|
||||
['GAP-048','Reject taxonomy conflates four causes under KillSwitch'],
|
||||
['GAP-049','Telemetry STATE score is direction-incorrect, presented as the trade grade'],
|
||||
['GAP-050','MaxTradeRisk has no quantity term; documented formula is wrong'],
|
||||
['GAP-044','Primary-series DaysToLoad not respected — blocks all Strategy Analyzer work'],
|
||||
['GAP-007','Walk-forward validation — the edge is unproven until this passes'],
|
||||
['GAP-025','Runner no-fill anomaly diagnosis — blocks live promotion'],
|
||||
['GAP-030','Historical ORB state hydration on a late enable'],
|
||||
['GAP-022-F','Injectable connection-state seam — unblocks 3 deferred scenarios']
|
||||
],'high');
|
||||
gaps('g-med',[
|
||||
['GAP-042','PortfolioRiskManager has no account dimension'],
|
||||
['GAP-043','HFTAlgoBarsType is third-party with no in-repo fallback'],
|
||||
['GAP-051','MicroUpgradeThreshold fires every session at a $49k balance'],
|
||||
['GAP-052','Two independent hardcoded tick-value tables'],
|
||||
['GAP-053','executive_summary.md and roadmap.md Sprint 3 list are months stale'],
|
||||
['GAP-013','ContractRollHandler completion'],
|
||||
['GAP-015','Config JSON export / import'],
|
||||
['GAP-017','ParameterOptimizer → Strategy Analyzer']
|
||||
],'med');
|
||||
gaps('g-done',[
|
||||
['GAP-035','Rejection reasons to FileLog — working in production'],
|
||||
['GAP-036','risk_mode from intent.Metadata'],
|
||||
['GAP-037','MaxDailyTrades regression tests'],
|
||||
['GAP-038','ConfigHash includes BarsPeriod — verified: 5 bar types → 5 hashes'],
|
||||
['GAP-039','_dailyTradeCount realtime-only'],
|
||||
['GAP-040','Startup warnings for bar type and DaysToLoad — firing today'],
|
||||
['GAP-031/032/033','Provenance, MaxDailyTrades, session readiness — closed 08-03'],
|
||||
['GAP-001…011,019,022,024,029','Sprint 2 / 2.7 — closed July']
|
||||
],'done');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user