Install
openclaw skills install @tltby12341/qc-order-forensicsForensic diagnosis engine for backtest order data — trade quality, ROI attribution, monthly cashflow, drawdown root-cause analysis, and LLM-readable reports.
openclaw skills install @tltby12341/qc-order-forensicsTurn raw backtest order data into actionable diagnostic reports. Feed the output directly to an LLM for strategy improvement decisions.
Use this skill when the user has completed a backtest and wants to understand why the strategy performed the way it did. Typical triggers:
The OrderForensics class takes an orders.csv (and optionally a result.json) and produces a multi-section diagnostic report:
from forensics import OrderForensics
forensics = OrderForensics("path/to/orders.csv", "path/to/result.json")
report = forensics.full_diagnosis()
print(report) # LLM-readable text report
Or from CLI:
python3 -c "
from forensics import OrderForensics
f = OrderForensics('orders.csv', 'result.json')
print(f.full_diagnosis())
"
Extracted from result.json: Net Profit, Sharpe Ratio, Drawdown, Win Rate, Expectancy, Alpha, Beta, Total Fees.
orders.csv columns (standard QC export):
orderId, symbol, type, direction, quantity, fillPrice, fillQty, fee, status, submitTime, fillTime, tag
The parser automatically separates options from equity (QQQ) orders by extracting the underlying from the symbol field.
A structured plain-text report using emoji markers for quick visual scanning. Designed to be directly consumed by LLMs for follow-up analysis and strategy iteration decisions.
| Metric | Healthy Range | Red Flag |
|---|---|---|
| Zero rate | < 50% | > 65% means most options expire worthless |
| Windfall > 400% | >= 2 per year | 0 means no tail wins to offset losses |
| Monthly cashflow | Mixed +/- | All negative = structural problem |
| Drawdown streaks | < 3 months | > 6 months = survival crisis |
orderId, symbol, type, direction, quantity, fillPrice, fillQty, fee, status, submitTime, fillTime, tag. Missing columns will cause silent misclassification.equity_symbol parameter (default "QQQ") must match your strategy's anchor equity. If your strategy holds SPY instead of QQQ, pass --equity-symbol SPY or the equity/options split will be wrong.