Files
nt8-sdk/docs/02-runbooks/chart_diagnostics_training.md

99 lines
5.1 KiB
Markdown

# Chart Diagnostics Training
**Created:** 2026-08-16
**Scope:** NinjaTrader chart drawings emitted by `SimpleORBNT8` when `EnableChartDiagnostics=True`
## What This Is
The chart diagnostics overlay is a NinjaTrader chart-only visual aid. It is separate from the browser dashboard under `tools/dashboard/`.
The overlay is made from NinjaScript `Draw.*` objects and fixed text labels. It does not add indicators through `AddChartIndicator`, and it does not create a separate panel.
## How To Turn It On
1. Open the chart running `Simple ORB NT8`.
2. Open the strategy settings.
3. Find the `Diagnostics` section.
4. Set `Enable Chart Diagnostics=True`.
5. Apply or reload the strategy.
Default state: `EnableChartDiagnostics=False`.
## Why The Top Left Can Be Hard To Read
The top-left chart area can contain multiple things at once:
- NinjaTrader's built-in strategy label, for example `Simple ORB NT8(...)`.
- `RUNNER: <mode>` from the SDK diagnostics.
- `REGIME: BULLISH` or `REGIME: BEARISH` when regime data is available.
- `DAILY TRADES: <count>` once the strategy records a daily trade count.
- `TRADE TAKEN (TestMode)` if `TestMode=True` and a test trade has been marked.
These are fixed-position NT8 labels, so they can overlap. If the text is unreadable, that is a chart-layout limitation of the current diagnostics, not proof that the strategy is malfunctioning.
## What Each Visual Means
| Visual | Location | Meaning | When It Appears |
|---|---|---|---|
| `SESSION: RTH` / `SESSION: ETH` | Top right | Current session classification used by the strategy context | When session context exists |
| `RUNNER: <mode>` | Top left | Current runner activation mode, such as `Auto` | When runner is enabled |
| `REGIME: BULLISH` / `REGIME: BEARISH` | Top left | AVWAP slope regime from strategy parameters | When `avwap_slope` is available |
| `TEST MODE ACTIVE` | Center | Strategy is in test mode | Only when `TestMode=True` |
| `Prov: settings_<name>_<date>` | Bottom right | Reminder that settings/provenance files are being produced | When chart diagnostics run |
| Blue ORB box | Around latest bar range | Opening range high/low diagnostic box | After opening range is ready |
| Green dashed line | Chart price level | Long breakout trigger | After opening range is ready |
| Red dashed line | Chart price level | Short breakout trigger | After opening range is ready |
| Breakout arrow | Near ORB high/low | Breakout bar seen by strategy state | After breakout bar is detected |
| `ORB: <ticks> ticks | Mult: <n>` | Bottom left | Opening range size in ticks and standard-deviation multiplier | After opening range is ready |
| `BREAKOUT: LONG` / `BREAKOUT: SHORT` | Bottom left | Pending breakout direction | After breakout bar is detected |
| Cyan dashed line | Price level | Dynamic ATR stop diagnostic | When dynamic stop is enabled and ATR is warmed up |
| Lime dotted line | Price level | Breakeven diagnostic line | After breakeven has moved |
| `DAILY TRADES: <count>` | Top left | Strategy daily trade count | After daily trade count is greater than zero |
## Reading The Screenshot Pattern
If you see text like this in the top left:
```text
Simple ORB NT8(...)
RUNNER: AUTO
DAILY TRADES: 1
```
Interpret it as:
- The built-in NT8 strategy label is drawing first and may be long because it includes many strategy parameter values.
- `RUNNER: AUTO` means the runner subsystem is enabled and set to automatic activation.
- `DAILY TRADES: 1` means the strategy state has counted one accepted daily trade for the session.
The labels overlapping does not change order behavior. For audit-quality evidence, use the session log and dashboard; use the chart overlay only as a quick visual aid.
## Recommended Operator Use
For normal gate operation:
1. Keep `EnableChartDiagnostics=False` unless you are intentionally inspecting chart state.
2. Use session logs and preflight output as the authoritative record.
3. Use the browser dashboard for readable live/session summaries.
4. Turn chart diagnostics on only when you need visual confirmation of ORB/triggers/breakeven state.
For training or debugging:
1. Turn `EnableChartDiagnostics=True`.
2. Expand the chart horizontally so price bars and labels have room.
3. If top-left text is unreadable, focus on the individual colors and fixed positions in the table above.
4. Cross-check with the session file log under `C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk`.
## Important Limits
- The chart diagnostics are not the dashboard.
- The chart diagnostics do not show every risk decision.
- The chart diagnostics are not the source of truth for Gate Run evidence.
- A missing ORB box before the ORB window completes is normal.
- A missing breakout arrow before a breakout is detected is normal.
- Overlap with the NinjaTrader strategy label is currently expected.
## Source References
- `src/NT8.Adapters/Strategies/NT8StrategyBase.cs` — base diagnostics: session, runner, regime, test mode, ATR stop, breakeven, provenance label.
- `src/NT8.Adapters/Strategies/SimpleORBNT8.cs` — ORB diagnostics: ORB box, trigger lines, breakout arrow, ORB range text, breakout direction, daily trade count.