GAP-032: enforce session daily trade limit
- retain accepted-trade count after position-flat events - reject same-session entries with explicit MaxDailyTrades logging - verify next-session re-entry and update Gate 3 governance Build: clean | Tests: 500 passing | Dual-deployed: yes
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
**Owner:** Human operator
|
||||
**State:** Active; Gate 2 was contaminated and the Gate 3 clock has not started.
|
||||
|
||||
1. Start NinjaTrader and run the NinjaScript compile check for the provenance fix deployed on 2026-08-03.
|
||||
1. Start NinjaTrader and run the NinjaScript compile check for the Gate 3 provenance and daily-limit fixes deployed on 2026-08-03.
|
||||
2. In SimSimple ORB, set and triple-check:
|
||||
- `EnableDynamicStop=TRUE`
|
||||
- `RunnerActivationMode=Auto`
|
||||
|
||||
@@ -51,3 +51,8 @@ Record concise error fingerprints and verified fixes.
|
||||
- **Root cause:** The JSONL writer read confluence values from static strategy configuration and recomputed runner mode with quantity `1`, while the session logger used accepted intent metadata and the actual resolved submission mode.
|
||||
- **Fix:** Serialize from the accepted `StrategyIntent.Metadata` and pass the submission's `resolvedMode` into the provenance writer.
|
||||
- **Prevention:** Logging artifacts for a submitted trade must consume the same immutable decision/submission objects used by the human-readable session log.
|
||||
|
||||
## 2026-08-03 [GAP-032] — Position-flat event bypassed MaxDailyTrades
|
||||
- **Root cause:** Position closure cleared `_tradeTaken`, while the daily-limit guard required both `_tradeTaken` and a count at the limit.
|
||||
- **Fix:** Make `_dailyTradeCount >= MaxDailyTrades` authoritative and reset the count only in session rollover handling.
|
||||
- **Prevention:** Daily eligibility counters must be scoped to trading date, never position lifecycle.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
**Last Updated:** 2026-08-03
|
||||
|
||||
## Verified implementation state
|
||||
- **Last completed task:** GAP-031 — Trade Provenance Signal/Submission Wiring
|
||||
- **Last completed task:** GAP-032 — Session-Scoped MaxDailyTrades Enforcement
|
||||
- **Active task:** RB-4.1 — Gate Run #3 Configuration Freeze (human operator)
|
||||
- **Next code task:** GAP-025 — Runner No-Fill Anomaly Diagnosis (branch-only during the gate)
|
||||
- **Following code task:** GAP-022-FOLLOWUP — connection-state seam and the three deferred scenarios
|
||||
@@ -10,10 +10,11 @@
|
||||
## Build and test evidence
|
||||
- `verify-build.bat` is not executable under Windows `cmd.exe` because the tracked batch file uses LF-only line endings.
|
||||
- Release build: **0 errors**, **9 existing CS1998 warnings**.
|
||||
- Tests: **498 passed, 0 failed** — 410 Core, 78 Integration, 10 Performance.
|
||||
- Tests: **500 passed, 0 failed** — 412 Core, 78 Integration, 10 Performance.
|
||||
|
||||
## Gate readiness
|
||||
- Trade provenance now reads grade, weighted score, and ORB ticks from the accepted intent metadata and records the exact runner mode resolved for submission.
|
||||
- `MaxDailyTrades` now remains enforced after position-flat events and resets only when the trading session date rolls over.
|
||||
- Every real-time signal writes its `TEST MODE ACTIVE` or `LIVE MODE` status to the session file log.
|
||||
- GAP-022 has five real scenario assertions. Its remaining three requirements are deferred architecture work, not fabricated tests.
|
||||
- **Before Gate 3 start:** complete the pending NinjaTrader compile check, freeze the configuration, and enforce the no-deploy rule.
|
||||
|
||||
@@ -57,3 +57,7 @@ Capture recurring implementation patterns that impact compile stability.
|
||||
## 2026-08-03 [GAP-031] — Submission-sourced trade provenance
|
||||
- **DO:** Serialize grade, score, ORB range, and resolved mode from the accepted intent and the exact submission decision.
|
||||
- **DON'T:** Recompute trade facts later from configuration defaults or assumed quantities.
|
||||
|
||||
## 2026-08-03 [GAP-032] — Session-scoped daily trade limits
|
||||
- **DO:** Increment on accepted intent and reset only when the trading session date changes.
|
||||
- **DON'T:** Re-arm a daily trade allowance when a position returns flat.
|
||||
|
||||
Reference in New Issue
Block a user