2.1 KiB
logtriage
logtriage is a standalone Python CLI for triaging NT8 SDK runtime artifacts without referencing any NinjaTrader assembly or changing deployed NT8 output.
Python was chosen instead of a .NET console app because it keeps the tool fully outside NT8-SDK.sln, requires no solution or publish changes, and avoids any chance of being pulled into NinjaTrader.Custom.dll deployment.
Inputs
The script reads these files from a directory:
session_*.logtrades_*.jsonlprovenance_*.jsonsettings_*.txt
Default input directory:
%USERPROFILE%\Documents\NinjaTrader 8\log\nt8-sdk
Output
Text mode prints:
- A per-day table with:
Date | Account | Instrument | BarType | DaysToLoad | DailyBars | WarmupOK | Signals | Submits | Fills | NetPnL | KillSwitch | VerboseLog | ConfigHash(8) | TestMode - A
DIAGNOSTICSsection flagging:SILENT DAY,PARALLEL INSTANCE,NO CONFIG CAPTURE,GATE CONFIG VIOLATION,CONFIG DRIFT, andPROVENANCE DEFECT
--json emits machine-readable output for dashboard ingestion, including session rows, diagnostics, and per-trade records enriched with source file and line metadata.
Usage
Run against the default NT8 SDK log directory:
python tools/logtriage/logtriage.py
Run against a specific archive directory:
python tools/logtriage/logtriage.py "C:\logs\nt8-sdk-archive"
Emit JSON for another tool or dashboard:
python tools/logtriage/logtriage.py --json | Out-File -Encoding utf8 triage.json
Notes
- The tool is read-only.
- It does not import or reference any NinjaTrader or NT8 SDK assembly.
- Session rows are built from
session_*.logand enriched with nearest same-daysettings_*.txtandprovenance_*.jsonsnapshots. - JSON session rows include
config_hash,config_hash_8, andcode_versionwhen present in settings or provenance artifacts. - JSON output includes
trade_recordscopied fromtrades_*.jsonlwith addeddate,path, andlinefields for dashboard traceability. - Trade provenance defects are scanned directly from
trades_*.jsonlrows.