/ninjatrader:risk-coachfrom NinjaTrader
Advisory behavioral-context check on recent fill history. Flags revenge-trading, consecutive-loss streaks, overtrading counts, size drift, and hour-of-day anti-edges. Does not evaluate trade quality — only surfaces behavioral context. Use when asking about tilt, revenge, or sanity checks.
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.
Coach, not cop. Review a proposed or current trade against common-sense risk hygiene and the user's own behavioral history. Flags, explains, leaves the decision to the user.
Demo (simulation) and live are two separate MCP servers. Account names are unique to one server. Once the workflow resolves an account on a server, every downstream call must go through that same server. Examples include my_portfolio, market_snapshot, place_order, create_alert, and the history tools. 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.
fill_history — recent fills for pairing
into round-trip trades.performance_summary — user's baseline win
rate / profit factor / trades-per-daymy_portfolio — correlated-exposure check.
Prune with fields=["positions[].symbol","positions[].netPos"] — the
detector only needs the symbol list + sign, not P&L or margin.risk_settings — daily loss limit context
(display only — this skill does not modify it)user_profile — discover available account names when the account
is unknowntrade-journal's streaks.py — produces the recent_trades[]
input for detect.py (FIFO round-trip pairing)pretrade-risk output — size + R:R + budget flagsposition-watchdog output — if the user already has a position open| User phrasing | Skill stance |
|---|---|
| "Am I on tilt?" | Run full checklist + all detectors |
| "Should I take this?" | Checklist + detectors with proposed trade |
| "Is this revenge?" | Run detect.py, surface revenge_trade flag |
| "Is this my Nth trade today?" | Read summary.trades_today from detect output |
| "Size feel right?" | Run detect.py with proposed.qty, surface size_drift |
| "Talk me out of this" | Full run + lean harder on negatives |
Account resolution. <acct> below must come from conversation context or user_profile().accounts[].name. The MCP requires account= and fails without it.
fill_history(
account=<acct>,
startDate="last 7 days",
endDate="today",
)
(startDate/endDate accept YYYY-MM-DD or natural terms.)
Run trade-journal's streaks.py on the fill_history result to get round-trip pairs. Save the tool result to a file. Pass its path with --file. Never re-type or inline a large JSON payload in the command.
python3 ../trade-journal/scripts/streaks.py --file fill_history.json \
--value-per-point-map ES:50 MES:5 NQ:20 MNQ:2
Take the trades-list from that output (each has pnl_usd, entry_time, exit_time, symbol, qty).
python3 scripts/detect.py --file detect_input.json
Input shape:
{
"now_iso": "<current ISO>",
"proposed": {"symbol": "ESU6", "qty": 4, "direction": "long"},
"recent_trades": [... paired trades ...]
}
Output: list of flags + session summary. See references/antipatterns.md for the 5 flags and how to narrate each. All detectors return null silently when inputs are insufficient — no flag means "nothing to say", not "all clear".
Read references/checklist.yml — 8 items ranging from "thesis stated?" to "are we past 50% of daily loss budget?". Walk through each, combining:
conversation items — ask the user directlypretrade-risk.output items — already computeddetect.py items — already in flagsmy_portfolio items — pull freshCombine checklist findings + detector flags into one short narrative. Lead with the HIGH severity flags. Suggest concrete actions: pause, halve size, skip this one, proceed with eyes open. Never tell the user to stop. Hard limits are server-side. The user configures them through update_risk_settings. The user's account already enforces its configured limits.
detect.py uses fixed thresholds
(tunable via flags) so the signal is consistent. False negatives
matter more than false positives here — better to miss a borderline
flag than to cry wolf.Multi-flag session (common when user asks on a red day):
"Three signals I'd want you to see before pulling the trigger:
- Revenge window — you're 4 min after a -$225 loss. Strong stats against taking the next one.
- Losing streak — last 3 all red (-$475 total). Either the regime shifted or the setups aren't clean today.
- Size drift — proposed 6 vs recent median 2 — 3× normal.
Options: (a) Step away 30 min, (b) Cut to 2 contracts and keep your stop at normal distance, (c) Skip today, document what the last 3 had in common.
Your daily P&L is -$295 — 59% of the $500 budget. One more -1R trade at 6 contracts ($900 risk) would blow the limit."
Clean session:
"No flags. Last 3 trades 2W/1L (+$220 net), proposed size matches your median, 10 min since last close. Your UTC-15 hour has 54% win rate over 21 samples — within range. Thesis check: what's the setup?"
Single-flag (subtle):
"One thing: UTC 18:00 hour has been rough for you — 33% win rate on 12 trades. Nothing structural about that, could be noise, but worth being a touch tighter than usual today."
pretrade-risk: pretrade sizes the trade (numbers). Coach
judges whether the sized plan is right for this user, right now
(behavior). Run pretrade first. Pipe its output into coach.position-watchdog: watchdog reports live P&L/R/distance.
Coach asks whether to keep trading at all. If the watchdog flags
a red streak and the user asks "should I add?", route to coach.trade-debrief: debrief is retrospective, whole-session,
LLM-prompt-driven rule mining. Coach is in-the-moment, deterministic
detector-driven, pre-trade advisory. Different temporal surface.scale-manager: scale-manager does the math on an adjustment
the user wants to make. Coach asks whether making the adjustment
right now is wise. For a pyramid-into-a-red-day proposal, run
both — coach flags the behavior, scale-manager computes the risk.update_risk_settings is available
for self-imposed hard limits.proposed in the input), size_drift
returns null. Do not invent a proposal.scripts/detect.py — 5 behavioral detectors (revenge_trade,
losing_streak, overtrade_count, size_drift, hour_edge). Stdin JSON:
now_iso, optional proposed, recent_trades[]. Thresholds all
tunable via CLI flags. Returns flags[] + session summary.scripts/fixtures/session_synthetic.json — 7-trade 2-day sample
designed to trigger 3 flags (revenge + streak + size_drift) while
keeping overtrade and hour_edge silent.references/checklist.yml — 8-item pre-trade checklist with
source mapping (conversation vs pretrade-risk vs detect output
vs my_portfolio). Load it when the user asks "should I take this".references/antipatterns.md — the 5 detectors explained with
narration templates, severity rules, and the patterns that are
intentionally NOT captured (averaging into a loser, stop-drift,
first-5-min FOMO, trend-fighting). Load it when you narrate a
detector flag.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