/ninjatrader:position-watchdogfrom NinjaTrader
Reports live health of open futures positions including P&L, stop distance, margin utilization, guardrail flags, what-if scenarios, and stop drift detection. Activates on queries about position status, P&L, stops, or trouble.
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.
Report the live health of the user's open futures positions. Cover how much room they have before the stop trips and how far the target is. Cover whether their plan drifted. Also report whether their exposure is a single concentrated bet across correlated index products. Never emit order payloads. That is scale-manager's job.
This skill reads only. It calls no tool that changes an account, an order, or an alert. It never calls place_order, modify_order, close_position, or create_alert. Every number and every proposal here is text for the user to read. The user approves any change, and a sibling skill composes it.
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.
my_portfolio — current positions, open P&L, used margin. Prune with fields=["account.netLiq","account.dailyLoss","account.openPnL","positions[]","workingOrders[]"].market_snapshot — last price, tickSize, valuePerPoint for every symbol with an open position. Prune with fields=["snapshots[].symbol","snapshots[].lastPrice","snapshots[].tickSize","snapshots[].valuePerPoint","snapshots[].bidPrice","snapshots[].askPrice"].order_history — order events for a symbol, used by stop-drift detection. Reports only the current stop price, not prior versions.risk_settings — daily loss limit, max netLiq.Call these tools in any order (or in parallel):
my_portfolio — current positions, open P&L, used margin, and working orders (the source of bracket stop/target prices). Prune with fields=["account.netLiq","account.dailyLoss","account.openPnL","positions[]","workingOrders[]"] — this skips balance/subscription detail the dashboard does not read.market_snapshot — last price, tickSize, valuePerPoint for every symbol with an open position. Prune with fields=["snapshots[].symbol","snapshots[].lastPrice","snapshots[].tickSize","snapshots[].valuePerPoint","snapshots[].bidPrice","snapshots[].askPrice"].risk_settings — daily loss limit, max netLiqSave each response to a temp file. The scripts take file paths.
python3 scripts/health.py \
--portfolio portfolio.json \
--snapshot snapshot.json \
--risk-settings risk.json
Output has two parts:
positions[] — per-position health (distance to stop, R-multiple, per-position flags)account_flags[] — account-wide flags (correlated exposure, high margin utilization)See references/guardrails.md for the flag taxonomy and triage templates.
When the user asks "what if I moved my stop to X?" or "what if I went breakeven?", feed one position's JSON to whatif_live.py. Save the relevant positions[] entry from health.py's output to a file, and pass its path with --file. Never re-type or inline a large JSON payload into the command (stdin still works as a fallback):
# Move stop to 7148
python3 scripts/whatif_live.py --file position.json --new-stop 7148
# Go breakeven
python3 scripts/whatif_live.py --file position.json --breakeven
# Extend target to 7170
python3 scripts/whatif_live.py --file position.json --new-target 7170
The script reports the new risk dollars and the new R-multiple, relative to the original risk as the denominator. For breakeven, it also reports how much risk the move removes from the current stop position.
This script is informational. It never emits modify_order payloads. If the user decides they actually want to move the stop, hand off to scale-manager.
When the user asks "has my stop been moved?", or you want to check before you narrate, pull the symbol's order history and run:
python3 scripts/stop_drift.py \
--orders order_history.json \
--symbol ESU6 \
--original-stop 7145 \
--entry-price 7150 --direction long \
--tick-size 0.25 --value-per-point 50 --net-pos 4
order_history reports only the current stop price, not its prior versions. Pass the stop price you know from bracket placement as --original-stop. Without it, the script reports the current stop only and skips the drift comparison.
Output classifies drift as toward_entry (trailing, less risk), away_from_entry (widening, more risk — a behavioral red flag), or unchanged. With --value-per-point and --net-pos, the output includes the exact dollar amount of risk added or removed.
This skill never calls create_alert. Emit the alert expression as a string, then hand off to alerts-composer. That skill composes the alert, and the user approves the submission there.
When the user wants an alert on a current position, propose an expression that uses the position's own levels. Examples:
lastPrice(ESU6) < 7148.75 (3 ticks before the stop — a heads-up before the trip)posOpenPLUsd(ESU6) < -300 (a hard PnL floor)Subjects must stay unquoted. The DSL parser rejects lastPrice("ESU6"). The subject regex [\$@]?[\w\s\-\+/|]+ excludes double-quotes: the server's rule parser accepts only unquoted subject strings. Submission via create_alert fails with errorText, not silently. alerts-composer/scripts/validate.py catches it offline, so always run the proposed expression through validate.py before you hand it off.
Emit the expression as a string. Never call create_alert from this skill.
Use references/guardrails.md narrative templates. Lead with dollars, then follow with R-multiples and ticks. A typical "how am I doing?" reply:
"Long 4 ES at 7150, mark 7158 (+$1,650, +4.1R). Stop 7148 is 41 ticks below — $2,050 at risk, 410% of daily budget — consider trimming or tightening if the trade isn't moving.
Also long 1 NQ at 18250 without a stop attached ⚠ — the market can gap through any price. Want a stop?
Account-level: ES + NQ long is one index-beta bet; combined 1% ES move ≈ $2,240 swing."
risk-coach: watchdog reports live numbers; coach judges plan quality ("are you tilting?", "is this idea well-shaped?"). These are different scopes.scale-manager: watchdog's what-if is informational ("risk becomes Y"); scale-manager converts intent into exact modify_order/place_order payloads.trade-replay: watchdog covers live open positions; replay covers closed positions with bar-level MFE/MAE.pretrade-risk: pretrade-risk sizes a new entry; watchdog runs after the position is live.This skill does not report MFE or MAE for a live position. It also does not compare either one against a historical median. Excursion math needs a market_history bar window per position, which costs one extra tool call per symbol. The dashboard stays fast instead. trade-replay covers the same excursion math for closed trades. A future enhancement adds health.py --market-history PATH per position, for users who explicitly want live excursion data. Until then, open_pl_dollars is the available live P&L signal.
scripts/health.py — distance/R/margin/flags dashboard (portfolio, snapshot, and risk-settings inputs required; fast, no market_history)scripts/whatif_live.py — informational alternate-exit math for one position (input: position dict; arg: one of --new-stop/--new-target/--breakeven)scripts/stop_drift.py — diffs the current bracket stop against a caller-known original, from order historyreferences/guardrails.md — flag taxonomy with triage templates — load when you narrate flags or explain what a flag meansreferences/guardrails.md (opens in a new tab)scripts/fixtures/order_history.json (opens in a new tab)scripts/fixtures/portfolio.json (opens in a new tab)scripts/fixtures/risk_settings.json (opens in a new tab)scripts/fixtures/snapshot.json (opens in a new tab)scripts/fixtures/whatif_live.json (opens in a new tab)scripts/health.py (opens in a new tab)scripts/stop_drift.py (opens in a new tab)scripts/whatif_live.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
futures, position-monitoring, risk-management, stop-loss, pnl, trading
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