Trade-Karne — Deterministic Trading Scorecard
What This Does
Trade-Karne grades your trading operation with a single weekly score — not just
"did equity go up," but did you trade well. It computes a 3-axis Karne (report
card) from your equity curve and trade log:
- Result (40%) — Risk-adjusted return: Sharpe, Sortino, Calmar, max drawdown,
alpha vs benchmark
- Growth (30%) — Realized trade quality: equity change, profit factor, win rate,
expectancy, average R-multiple from actual fills
- Process (30%) — Discipline: R:R logging rate, capability progress, lessons
written — minus penalties for idle cash, blind runs, and consecutive losses
The score is pure math — zero LLM tokens, zero API calls, zero external
dependencies. It reads your existing ledger (SQLite, CSV, or in-memory dicts)
and produces a JSON payload and a human-readable English report.
When to Use It
Use this skill when you want to:
- Build a trading quality-control system with measurable weekly grades
- Set up anti-stall guardrails that detect "standing still" (idle cash piling up)
- Implement a weekly scorecard across multiple trader books or personas
- Run post-trade analysis with deterministic MAE/MFE and behavioral tagging
- Get an honest assessment of whether your returns are luck or skill
When NOT to Use
This skill does NOT handle:
- Live order execution or broker integration — it's read-only analysis
- Real-time risk management — it's a weekly/periodic score
- Portfolio optimization or allocation decisions — it measures, doesn't prescribe
How to Use
Quick Start (Python API)
from trade_karne import DictDataSource, load_book_input, compute_book_karne, render_report_en
ds = DictDataSource({
"equity_series": [10000, 10100, 10250, 10400],
"cash": 1000,
"hwm": 10400,
"trade_pnls": [120, -50, 200],
"trade_rs": [2.0, -1.0, 2.5],
})
inp = load_book_input(ds, "momentum", lessons_count=3)
karne = compute_book_karne(inp)
print(render_report_en(karne, [karne], week="2026-W26", generated_at="today"))
CLI
trade-karne score --db trades.db --book momentum
trade-karne postmortem --db trades.db --book momentum --out-dir ./reports
trade-karne metrics --list
Plug Into Your Existing System
Implement TradeDataSource (7 methods) and pass it to load_book_input(). The
Karne never touches your files or DB directly — it only calls those 7 methods.
See workflows/integration.md for a step-by-step guide.
Validation
After running a score:
- Verify the Process axis — if it's below 40, idle cash or blind runs are dragging
you down
- Check the rolling Sharpe trends — a declining trend means skill is degrading
- Run the postmortem and look for tag clusters (e.g., many
premature_entry tags
mean entries need tightening)
- Compare Result axis across books — large variance means some personas need
rebalancing or rethinking
1---2name: trade-karne3description: Trade quality-control scorecard and postmortem analysis. Deterministic, zero-token, zero external dependencies. Computes a 3-axis weekly grade (Result 40%, Growth 30%, Process 30%) from equity curves and trade logs. Includes 16 risk-adjusted performance metrics (Sharpe, Sortino, Calmar, MAR, Ulcer Index, Profit Factor, Expectancy), idle-cash penalty detection, and 8-tag deterministic trade postmortems (thesis verification, regime violation, sizing errors, premature entries, perfect exits). Pure Python stdlib — works with any broker, any ledger format via pluggable data adapter. Use when: building a trading quality-control system, setting up anti-stall guardrails for a trading pod, implementing a weekly trader scorecard, running post-trade analysis, detecting "standing still" (idle cash accumulation) in a systematic trading operation, or replacing self-reported P&L with broker-verified fill reconciliation. DO NOT USE FOR: live order execution, broker integration, real-time risk management, or portfolio optimiz4license: MIT5---67# Trade-Karne — Deterministic Trading Scorecard89## What This Does1011Trade-Karne grades your trading operation with a single weekly score — not just12"did equity go up," but *did you trade well*. It computes a 3-axis Karne (report13card) from your equity curve and trade log:14151. **Result (40%)** — Risk-adjusted return: Sharpe, Sortino, Calmar, max drawdown,16 alpha vs benchmark172. **Growth (30%)** — Realized trade quality: equity change, profit factor, win rate,18 expectancy, average R-multiple from actual fills193. **Process (30%)** — Discipline: R:R logging rate, capability progress, lessons20 written — minus penalties for idle cash, blind runs, and consecutive losses2122The score is pure math — zero LLM tokens, zero API calls, zero external23dependencies. It reads your existing ledger (SQLite, CSV, or in-memory dicts)24and produces a JSON payload and a human-readable English report.2526## When to Use It2728Use this skill when you want to:29- Build a trading quality-control system with measurable weekly grades30- Set up anti-stall guardrails that detect "standing still" (idle cash piling up)31- Implement a weekly scorecard across multiple trader books or personas32- Run post-trade analysis with deterministic MAE/MFE and behavioral tagging33- Get an honest assessment of whether your returns are luck or skill3435## When NOT to Use3637This skill does NOT handle:38- Live order execution or broker integration — it's read-only analysis39- Real-time risk management — it's a weekly/periodic score40- Portfolio optimization or allocation decisions — it measures, doesn't prescribe4142## How to Use4344### Quick Start (Python API)4546```python47from trade_karne import DictDataSource, load_book_input, compute_book_karne, render_report_en4849ds = DictDataSource({50 "equity_series": [10000, 10100, 10250, 10400],51 "cash": 1000,52 "hwm": 10400,53 "trade_pnls": [120, -50, 200],54 "trade_rs": [2.0, -1.0, 2.5],55})56inp = load_book_input(ds, "momentum", lessons_count=3)57karne = compute_book_karne(inp)58print(render_report_en(karne, [karne], week="2026-W26", generated_at="today"))59```6061### CLI6263```bash64trade-karne score --db trades.db --book momentum65trade-karne postmortem --db trades.db --book momentum --out-dir ./reports66trade-karne metrics --list67```6869### Plug Into Your Existing System7071Implement `TradeDataSource` (7 methods) and pass it to `load_book_input()`. The72Karne never touches your files or DB directly — it only calls those 7 methods.73See `workflows/integration.md` for a step-by-step guide.7475## Validation7677After running a score:781. Verify the Process axis — if it's below 40, idle cash or blind runs are dragging79 you down802. Check the rolling Sharpe trends — a declining trend means skill is degrading813. Run the postmortem and look for tag clusters (e.g., many `premature_entry` tags82 mean entries need tightening)834. Compare Result axis across books — large variance means some personas need84 rebalancing or rethinking