Skip to main content

How to Debug TradingView Webhook Signals with AI in NinjaTrader 8

A TradingView alert fired. NinjaTrader did not produce the expected trade. The broker UI shows nothing rejected. With CrossTrade MCP, an AI agent reads the webhook signal history, the CrossTrade Add-On activity log, the order list, and the executions in a single conversation and points at the gap.

Direct answer

Authenticate with mcp:read. Run this prompt with the time window you care about:

Pull TradingView webhook signals on <account> between <start> and <end>. For
each signal, find the matching add-on activity entry and any order or
execution. Tell me which signals filled, which were rejected, which produced
no order. Group non-fills by likely cause.

The agent calls GetSignalHistory, GetActivityLog, ListOrders, and ListExecutions. The response is a chain-by-chain analysis.

Common reasons signals do not fill

PatternCause
Signal present, no add-on activityAccount mismatch in payload
Signal present, activity warns "missing instrument"Payload sent root symbol instead of contract month (MES vs MES 06-26)
Signal present, order created, broker rejectedMax contracts, daily loss lockout, instrument expired
Signal present, position-state mismatchPayload assumed flat but account already holds the position
Duplicate signals within secondsTrigger logic in Pine Script firing repeatedly
Signal present, no order, no activityWebhook URL wrong or payload malformed

Prerequisites

RequirementDetail
CrossTrade subscriptionElite
CrossTrade Add-Onv1.13.0 or higher
MCP clientAny
Scopemcp:read

Step 1: Pinpoint the time window

A 5-minute window around the alert is usually enough.

Step 2: Run the diagnostic prompt

For account <account>, between <start> and <end>:
1. GetSignalHistory.
2. GetActivityLog for the same window.
3. ListOrders and ListExecutions for the same window.
4. Build a chronological timeline.
5. For each signal, tell me whether it produced an order, whether the order
filled, and the verbatim rejection reason if any.
Do not place or modify anything.

Step 3: Read the timeline

The agent returns events in time order. Look for the gap: signal → no activity, or signal → activity → no order, or order → rejection.

Step 4: Fix the underlying problem in TradingView or CrossTrade

CauseFix
Payload missing instrument monthUpdate the Pine Script alert message to include the contract month
Account mismatchCorrect the account name in the alert message
Position-state mismatchAdd a position-aware action (flatten_and_reverse vs reverse)
Broker rejection (max contracts, daily loss)Reduce size or stop trading for the session
Duplicate signalsAdd a "once per bar" guard in Pine Script

Step 5: Verify the next alert

Fire a test alert from TradingView's "Send test webhook" action and re-pull the signal history. The agent should report it as filled (or correctly rejected for a stated reason).