dashboard
dashboard is a standalone read-only dashboard for TOOL-001 JSON output and live local NT8 SDK log artifacts.
Implementation choice: static HTML + vanilla JavaScript plus an optional dependency-free Python localhost server. The server reads files only, binds to 127.0.0.1, has no write/POST endpoints, and can optionally send outbound notifications through Apprise.
Safety Properties
- Read-only browser UI
- No NinjaTrader assembly references
- No writes to any NinjaTrader directory
- No network dependency or CDN usage
- No package install required
- Can run directly from disk or on localhost only
- Server binds only to
127.0.0.1;0.0.0.0is rejected in code - Server implements only
GET,HEAD, andOPTIONS;POST,PUT,PATCH, andDELETEreturn405 Method Not Allowed - Runtime state is written only to
tools/dashboard/dashboard_state.jsonby default to avoid duplicate notifications after restart
Generate Input JSON
From the repo root:
python tools/logtriage/logtriage.py --json | Out-File -Encoding utf8 triage.json
For an archive directory:
python tools/logtriage/logtriage.py "C:\logs\nt8-sdk-archive" --json | Out-File -Encoding utf8 triage.json
PowerShell 5.1 > redirection writes UTF-16LE by default. Use Out-File -Encoding utf8 so the browser can parse the JSON file.
Launch
Direct file launch:
Start-Process .\tools\dashboard\index.html
Static localhost-only launch:
python -m http.server 8765 --bind 127.0.0.1 --directory tools/dashboard
Then open:
http://127.0.0.1:8765/
Live read-only server launch:
Copy-Item .\tools\dashboard\config.example.json .\tools\dashboard\config.json
python .\tools\dashboard\server.py --config .\tools\dashboard\config.json
Then open:
http://127.0.0.1:8765/
Usage
- Generate
triage.jsonfrom TOOL-001. - Open the dashboard.
- Click
Select triage.jsonand choose the generated file. - Review the five views.
For live mode, launch server.py; the browser polls /api/state automatically every 5 seconds.
Live Server Config
config.example.json:
{
"host": "127.0.0.1",
"port": 8765,
"log_dir": "%USERPROFILE%\\Documents\\NinjaTrader 8\\log\\nt8-sdk",
"state_file": "dashboard_state.json",
"polling": {
"session_log_seconds": 2,
"trades_seconds": 10,
"provenance_seconds": 10
},
"notifications": {
"enabled": false,
"targets": [],
"events": {
"submit": true,
"fill": true,
"breakeven": true,
"connection": true,
"daily_pnl_milestones": true
},
"daily_pnl_milestones": [100, 250, 500, -100, -250, -500]
}
}
%USERPROFILE% is expanded with Python environment-variable expansion, not a hardcoded username.
Polling defaults:
- newest session log tail:
2seconds - trades JSONL table:
10seconds - provenance/settings panel:
10seconds
Notifications
Install optional Apprise support:
python -m pip install -r .\tools\dashboard\requirements.txt
Add Apprise URLs to config.json:
"notifications": {
"enabled": true,
"targets": [
"discord://webhook_id/webhook_token",
"ntfy://ntfy.sh/your-topic"
]
}
Notification triggers:
SUBMITFILLBREAKEVENCONNECTION LOSTCONNECTION RESTOREDPNL_UPDATEcrossing configured daily P&L milestones
Daily P&L milestone tracking resets only on session rollover via SESSION START, not on position-flat. This intentionally mirrors the corrected MaxDailyTrades behavior: position-flat does not re-arm daily state.
Offset and dedup state persist to tools/dashboard/dashboard_state.json by default. This prevents a mid-day server restart from re-firing the entire day’s notification history. If that file is deleted, the server starts at the current end of the already-existing newest session log to avoid historical notification replay.
Webhook/notification failures are logged to stderr and never crash or block the dashboard poller.
Views
- Gate progress: trades banked against the 20-trade minimum, elapsed session days, current traded-session streak, and diagnostic count.
- Daily timeline: one row per session, color-coded as traded, silent, or config violation.
- Trade detail: grade, score, entry/exit fields, and scaler versus runner P&L attribution when present in TOOL-001 trade records.
- Provenance health: sentinel/default-value counts per provenance field across trade records.
- Config integrity:
ConfigHashandCodeVersiontimeline with drift markers.
Data Contract
The dashboard consumes TOOL-001 JSON with these top-level fields:
rows: session summariesdiagnostics: diagnostics emitted by TOOL-001trade_records: per-trade JSONL records enriched withdate,path, andline
The UI is tolerant of missing fields and displays - when a requested value is absent.