This commit is contained in:
@@ -1,7 +1,74 @@
|
||||
# Project Context — NT8 SDK (Production Hardening Phase)
|
||||
# Project Context — NT8 SDK (Sprint 2: SIM Validation)
|
||||
**Last Updated:** 2026-03-27
|
||||
|
||||
You are working on the **NT8 SDK** — an institutional-grade algorithmic trading framework for NinjaTrader 8.
|
||||
This is production trading software. Bugs cause real financial losses.
|
||||
You are working on the **NT8 SDK** — an institutional-grade algorithmic futures trading system for NinjaTrader 8.
|
||||
This is **production trading software**. Bugs cause real financial losses. Never take shortcuts.
|
||||
|
||||
---
|
||||
|
||||
## Critical Rules for Kilocode
|
||||
|
||||
1. **Only modify files listed in the task spec.** Never touch adjacent code.
|
||||
2. **C# 5.0 only.** No `$""`, no `?.`, no `=>` bodies, no `nameof()`, no async/await.
|
||||
3. **Never remove XML documentation or comments.**
|
||||
4. **Never change interface signatures** — IStrategy, IRiskManager, IPositionSizer, INT8ExecutionBridge are frozen.
|
||||
5. **Always build before deploying:** `dotnet build NT8-SDK.sln --configuration Release`
|
||||
6. **Always deploy to BOTH paths** after every code change:
|
||||
- Repo: `C:\dev\nt8-sdk\src\NT8.Adapters\Strategies\`
|
||||
- NT8: `C:\Users\billy\Documents\NinjaTrader 8\bin\Custom\Strategies\`
|
||||
7. **Never guess NT8 API signatures.** Verify at `https://developer.ninjatrader.com/docs/desktop`.
|
||||
|
||||
---
|
||||
|
||||
## Current State (2026-03-27)
|
||||
|
||||
**What works end-to-end:**
|
||||
- SimpleORBStrategy with 10-factor confluence scoring
|
||||
- NT8StrategyBase with session management, kill switch, connection recovery
|
||||
- Dual-leg scaler + runner architecture (EntriesPerDirection=2 restored)
|
||||
- PortfolioRiskManager singleton (kill switch, daily loss, contract cap)
|
||||
- File logging (session log + settings export)
|
||||
- Historical replay guard (_realtimeBarSeen)
|
||||
- Execution confirmed in SIM on 2026-03-27
|
||||
|
||||
**Pending validation:**
|
||||
- Runner leg dual-fill (Qty=2) — run backtest to confirm
|
||||
- Breakeven + trail in live multi-bar scenario
|
||||
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
SimpleORBNT8.cs NT8 entry point
|
||||
↓
|
||||
NT8StrategyBase.cs Abstract base: bar routing, kill switch, breakeven, runner trail
|
||||
↓
|
||||
SimpleORBStrategy.cs Signal: ORB detection, 10-factor confluence, _tradeTaken lock
|
||||
↓
|
||||
NT8OrderAdapter.cs INT8ExecutionBridge: EnterLong/EnterShort/SetStopLoss
|
||||
↓
|
||||
PortfolioRiskManager.cs Singleton: cross-strategy risk
|
||||
↓
|
||||
NinjaTrader 8
|
||||
```
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Path |
|
||||
|---|---|
|
||||
| NT8StrategyBase.cs | `src\NT8.Adapters\Strategies\` |
|
||||
| SimpleORBNT8.cs | `src\NT8.Adapters\Strategies\` |
|
||||
| SimpleORBStrategy.cs | `src\NT8.Strategies\Examples\` |
|
||||
| NT8OrderAdapter.cs | `src\NT8.Adapters\NinjaTrader\` |
|
||||
| PortfolioRiskManager.cs | `src\NT8.Core\Risk\` |
|
||||
| deploy-to-nt8.bat | `deployment\` |
|
||||
|
||||
## Active Sprint Tasks
|
||||
|
||||
See `SPRINT_BOARD.md` (at `docs\architecture\phase1_sprint_plan.md`) for full task list.
|
||||
|
||||
Immediate next action: Run Strategy Analyzer backtest (NQ JUN26, Jan 1 2026 → Mar 27 2026) and confirm `PNL_UPDATE Position=Short Qty=2` in session log to validate runner leg.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user