/ninjatrader:trade-debrieffrom NinjaTrader
Educational review of past trading sessions. Combines timeline, performance, fill, position, and market history into a structured report, then routes through 7 prompt templates for mistake identification, pattern extraction, trade scoring, correction rules, daily debrief, pattern clustering, and expectancy analysis.
Ships in NinjaTrader. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Synthesize session data into a coaching-grade debrief with the bundled prompt library. Descriptive TCA lives in trade-journal. This skill is prescriptive. It surfaces mistakes and patterns, and proposes rules and measurable improvements.
Demo (simulation) and live are two separate MCP servers. Account names are unique to one server. Once a workflow resolves an account on a server, every downstream call must go through that same server. This includes my_portfolio, market_snapshot, place_order, create_alert, history tools, etc. Cross-routing fails or hits the wrong environment.
Tool names below are bare. The NinjaTrader MCP server provides them. Your client adds its own prefix. See AGENTS.md at the repo root.
timeline_report — per-session event timeline
(single tool post-consolidation: account, date, optional endDate
for a range)performance_summary — arrays of {name, value} stat pairs under
extra.allTradeStats[] / extra.profitTradeStats[] /
extra.lossTradeStats[] (e.g. {name: "Total P/L", value: "$765.00"}),
plus extra.tradeLog[] and extra.hasTradesfill_history — fill-level timestampsposition_history — closed-position summariesmarket_history — bar OHLC for MFE/MAEsearch_contracts — contract metadata
(productName, tickSize, valuePerPoint)economic_calendar — event context (via
event-watch skill, not this one directly)user_profile — discover available account names when the account
is unknowntrade-journal's streaks.py — FIFO round-trip pairing over
fill_history, to produce the trades[] list. Reuse it. Do not
duplicate it.market-context — session VWAP, ATR, and regime narrative per
symbol, for the market_context block of each trade.references/prompt-selection.md has the full routing table. Rough mapping:
| Intent | Prompt |
|---|---|
| Quick wrap of today | 07_daily_debrief |
| "What mistakes" | 01_mistake_identification |
| "Find patterns" | 02_pattern_extraction |
| "Score my trades" | 03_trade_scoring |
| "What rules" | 06_correction_rules |
| Cross-day clustering | 08_pattern_clustering |
| Edge / expectancy | 09_expectancy_analysis |
Account resolution. All MCP calls below require account=<name>. If the account name is unknown, call user_profile() first. Its accounts[].name field lists every account on this MCP server.
timeline_report(account=..., date=<YYYY-MM-DD>, endDate=<YYYY-MM-DD>)
performance_summary(account=..., startDate=<YYYY-MM-DD>, endDate=<YYYY-MM-DD>)
fill_history(account=..., startDate=<YYYY-MM-DD>, endDate=<YYYY-MM-DD>)
position_history(account=..., startDate=<YYYY-MM-DD>, endDate=<YYYY-MM-DD>)
search_contracts(text=<each symbol>, includeFamilySiblings=false)
Date params are date-level. They use YYYY-MM-DD or a natural term like "last week", never a timestamp.
Then for each trade, fetch a bar window around its lifetime:
market_history(symbol=<sym>, barType="Minute",
barSize=1, from=<entry_ts - 1min>, to=<exit_ts + 1min>)
(from and to are full ISO-8601 timestamps. from requires to.)
Keep per-trade bar fetches bounded. Unless the user asks for per-minute pattern analysis, do not fetch 1-min bars for a full day (expensive).
Run trade-journal's streaks.py over the fill list. Use its output round-trips as the trade list. Attach each trade's corresponding bar window to it.
Save the trades-with-bars payload to a file. Pass its path with --file. Never re-type or inline a large JSON payload in the command.
python3 scripts/compute_derived.py --file trades_with_bars.json
Per trade, it produces realized_points/dollars/R, mfe_points/dollars/R, mae_points/dollars/R, giveback_from_mfe_pct, and realized_vs_mfe_pct.
Some fields are always null: scale_out_count, stop_modified_count, and minute-by-minute timeline volume features. The MCP cannot source them. See references/report-schema.md for the full provenance map.
python3 scripts/assemble_report.py --file combined_input.json
It takes account_id, trade_date, timeline_report, performance_summary, trades (post-compute_derived), a contracts map, and an optional market_context map. It emits the YAML shape that the prompts expect. See references/report-schema.md for details.
references/prompts/07_daily_debrief.md).## Trade Timeline Report header.references/report-schema.md
lists which fields are null today.Do not route this through an external LLM API. Claude Code IS the LLM. Just read the prompt and apply its constraints.
End with a 1-line pointer: "Full assembled report YAML available on request; source tools: timeline_report, performance_summary, fill_history, market_history, search_contracts." This gives the user transparency about where the numbers came from.
Prompt 07 example (daily_debrief), roughly 200 words:
Performance Summary Net +$765 / +1.2R across 2 trades on the E-Mini S&P 500 and E-Mini NASDAQ-100 (
summary.total_pnl_dollars = 765.00). Win rate 100% (2 of 2), but MFE capture lagged on both.Primary Pattern Systematic MFE giveback. ES gave back 47.5% from peak (
trades[0].derived.giveback_from_mfe_pct = 47.5); NQ gave back 40% (trades[1].derived.giveback_from_mfe_pct = 40.0). Combined $600 left on the table from peak.Top 3 Improvements
- Rule:
IF mfe_R >= 2.0 THEN scale_out_50pct
- Evidence:
trades[0].mfe_R = 2.5; exit at 1.3R (realized = $525, peak = $1,000, giveback = $475)- Expected impact: +$475 / +1.2R improvement on ES
- Rule:
IF mfe_R >= 0.5 AND time_in_trade > 10min THEN move_stop_to_breakeven
- Trades affected: both
- (Hypothesis; needs scale-out action data not yet in report.)
trade-journal: journal reports descriptive TCA and
streaks — what happened. Debrief mines prescriptive rules — what
to change.trade-replay: replay does one trade's deep dive, with
counterfactual exits. Debrief synthesizes cross-trade patterns at
the session level.risk-coach: coach handles live behavior, such as tilt,
revenge trading, and overtrading. Debrief handles retrospective
mechanics, such as giveback, scale discipline, and stop hygiene.market-context: debrief consumes it as input for the
market_context block of each trade. It is not a substitute for
debrief.timeline[n].participation_rate_vs_session,
poc_shift, scale_out_count, and stop_modified_count are null
today. Do not guess their values.scripts/compute_derived.py — per-trade MFE/MAE + giveback metrics
from bar scans. Shared pattern with trade-replay.scripts/assemble_report.py — combines compute-derived trades +
contracts + performance summary + market context → the assembled
report YAML.scripts/fixtures/trades_with_bars_synthetic.json — 2-trade
multi-symbol fixture (ES long winner, NQ short winner with
significant MFE giveback) for smoke tests.references/prompts/ — 7 prompt template files:
01_mistake_identification.md, 02_pattern_extraction.md,
03_trade_scoring.md, 06_correction_rules.md, 07_daily_debrief.md,
08_pattern_clustering.md, 09_expectancy_analysis.md. Load only
the one file that matches the chosen prompt.references/prompt-selection.md — intent-to-prompt routing +
combinations + how-to-run inside Claude Code. Load it when you
classify the intent and choose a prompt.references/report-schema.md — field provenance map (MCP-sourced
vs derived vs null-today), per-trade block reference, summary
block reference. Load it when you check which fields the chosen
prompt needs.references/prompt-selection.md (opens in a new tab)references/prompts/01_mistake_identification.md (opens in a new tab)references/prompts/02_pattern_extraction.md (opens in a new tab)references/prompts/03_trade_scoring.md (opens in a new tab)references/prompts/06_correction_rules.md (opens in a new tab)references/prompts/07_daily_debrief.md (opens in a new tab)references/prompts/08_pattern_clustering.md (opens in a new tab)references/prompts/09_expectancy_analysis.md (opens in a new tab)references/report-schema.md (opens in a new tab)scripts/assemble_report.py (opens in a new tab)scripts/compute_derived.py (opens in a new tab)scripts/fixtures/trades_with_bars_synthetic.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nt-ninjatrader/mcp-skills --plugin ninjatrader13 skills in this plugin
/alerts-composerTranslates natural-language alert intent into a validated Tradovate alert-DSL expression. Submits the expression via create_alert.expression. Covers 37 numeric functions across Account (netLiq, dollarOpenPL, dailyLossLimit, ...) and Contract (lastPrice, percentChange, settlementPrice, ...) entities. Also covers Position (netPos, posOpenPLUsd, posInitMarginUsd, ...) and Currency (currentRate) entities. Supports arithmetic (plus, minus, times, divide, parens), comparison (gt, gte, lt, lte, eq, neq), and top-level AND/OR/XOR logic. Validates the expression offline (subject syntax, function catalog, paren balance, flat-logic rule) before submission. Use when the user says "alert", "notify", "notify me", "watch for", "wake me when", "tell me when", "heads up when", "ping me if", "set a trigger", or "let me know if". Also use when the user asks about a sibling skill's proposed alert expression. position-watchdog, event-watch, and pretrade-risk also submit their proposed expressions through this skill./chart-renderThis skill renders three static PNG charts, with Matplotlib. Candlestick charts, with VWAP, fill-marker, and price-level overlays. Horizontal volume-profile histograms, with POC, VAH, and VAL lines. Cumulative-P&L equity curves, with optional drawdown shading. Chart data comes from market_history bars, fill_history fills, market-context analytics, and trade-journal round-trip trades. Use it when the user asks to "chart", "plot", "draw", "visualize", or "render". Also use it when the user wants a picture of the bars, fills, equity, or profile. Also use it for a qualified "show", such as "show the chart", "show me the bars", or "show my equity curve". A bare "show me my positions" is NOT a chart request. Route it to position-watchdog or my_portfolio. It produces PNG output at a specified path. It is never interactive. This skill requires matplotlib (install with `pip install matplotlib`)./contract-intelSymbol discovery, front-month resolution, rollover-imminence classification, and product-family awareness (full ↔ micro pairs like ES/MES) for futures contracts. Resolves bare product codes like "ES" or "NQ" to the actual tradeable front-month contract (e.g., ESU6) by open-interest rank across maturities. Classifies rollover status as not_imminent / approaching / imminent / rolled, with calendar-spread candidate flag when both legs are liquid. Use when the user asks "what symbol", "which contract to trade", "front month", "roll" or "rollover", "micro" or "full", or "calendar spread". Also use when the user gives a bare product code (ES, NQ, YM, CL, GC, etc.) without a maturity. Also handles product-family metadata via search_contracts includeFamilySiblings flag./correlation-hedgeCompute historical Pearson correlation and OLS regression beta between two futures symbols, on log-returns. Turn that result into a dollar-neutral hedge proposal for an open position. Covers cross-underlying relationships — ES vs NQ, CL vs NG, GC vs SI, bonds vs stocks, and currencies vs DX. For same-underlying siblings like ES/MES, use contract-intel instead. Produces sized hedge candidates with raw qty, rounded qty, residual exposure percentage, and coverage percentage. Always informational — never emits order payloads. Use when the user asks about "correlation between X and Y", "hedge this", "how do I hedge", "what could I short to offset", "beta", "X vs Y correlation", "cross-asset", "co-move", "correlated exposure", or "am I already long the market"./event-watchCovers a high-volatility economic event calendar — FOMC, CPI, NFP, EIA, and OPEC. Also covers earnings-season awareness and session-boundary context — globex open, NY cash open, settlement, and EIA release windows. Reports upcoming events and filters them by the user's current positions. Explains a move after it happens (for example, "ES +24pts in 8min matches the hot CPI print"). Computes historical reaction-size magnitudes from prior releases. Proposes reaction-window bracket alerts via alerts-composer. It is strictly reactive, with no timer-based push. Use when the user asks "what's coming up", "economic calendar", "why did it move", "NY cash open", or "session open". Also use when the user names a specific event — CPI, FOMC, NFP, EIA, OPEC, or earnings./market-contextComputes market metrics for futures from market_history output. Metrics include session VWAP, POC/VAH/VAL (value area), bar-level delta, cumulative delta, order-flow imbalance, ATR(N), realized volatility, and cross-symbol relative strength. It produces narrative summaries of market structure and the volatility regime. Use when the user asks about VWAP, POC, market profile, or value area. Also use for ATR, realized volatility, delta, cumulative delta, or order-flow imbalance. Also use for the volatility regime, or for intra-day relative strength between related symbols (e.g., ES vs NQ vs RTY). position-watchdog, pretrade-risk, scale-manager, chart-render, trade-replay, and trade-debrief consume this skill's output as input.Other plugins' skills for the same job