AI Automation

TradingView to Binance: 5-Checkpoint Debug Guide

2026-10-22·7 min read

Connect TradingView signals to Binance (TradingView to Binance) for automatic order execution, but your alert triggers, the webhook fires, and yet your account doesn't move. The problem usually isn't at either end — we've already checked the alert and API key (the credential exchanges use to verify your identity). It's in the middle chain: frequency, payload, authentication, error codes, and execution reports. Miss any of these five checkpoints, and orders will silently disappear. This article walks through the configuration for each checkpoint and where to look for errors. This article does not cover how to write Pine Script (TradingView's strategy programming language), how to apply for API keys, or rejection details for OKX, Bitget, and Bybit.

5 checkpoints
Debug checkpoints: frequency, payload, authentication, error codes, execution reports
60/60s
Webhook rate limit: 60 requests per 60 seconds per token; plus 30/30s per IP
60s
Dedup window: duplicate sends with the same strategy, symbol, and action within the window are dropped
1–125
Leverage range; ignored for spot; auto-reduced if it exceeds risk limits

Checkpoint 1: TradingView Alert Webhook Frequency — Three Interfaces Don't Share Settings

TradingView has three places where you can control alert frequency: the Create Alert dialog, alertcondition() in Pine Script (TradingView's strategy programming language), and alert() in Pine Script. The option names and defaults across these three interfaces are completely unrelated. Mixing them up is the prime suspect when "alerts appear to be running but signals arrive fewer than expected."

The UI dropdown offers four options: Once only, Once per bar, Once per bar close, and Once per minute or every time. Pine's alert() uses three constants for its freq parameter: alert.freq_all, alert.freq_once_per_bar, and alert.freq_once_per_bar_close. alertcondition() has no frequency parameter at all — it fires at most once per bar close.

The easiest thing to overlook is the default: if alert() is called without a freq argument, the code-level default is alert.freq_once_per_bar — not "fire every time." The same strategy can behave very differently depending on whether the alert was created via the UI or via Pine. We recommend confirming which interface your alert was built on before diving into debugging.

InterfaceFrequency OptionsDefault / Limits
Create Alert UIOnce only / Once per bar / Once per bar close / Once per minute or every timeDepends on your selection
Pine alertcondition()No frequency parameterFires once per bar close, at most once
Pine alert()freq_all / freq_once_per_bar / freq_once_per_bar_closeDefaults to freq_once_per_bar if no freq is provided

TradingView Help Center (Alerts) and Pine Script Reference (alert(), alertcondition()). Verified October 2026.

Checkpoint 2: Webhook Payload — Fields TVSBot Reads

A webhook is the mechanism by which TradingView POSTs a payload to a URL when an alert triggers. TVSBot gives each user a dedicated URL: /webhook/{user_webhook_token}, where the token is a random string generated at registration. The payload (the JSON being sent) also carries a secret field for a second layer of verification. Both layers must match, or the exchange will reject the request outright.

The message field in your TradingView alert settings is the raw JSON you send. TVSBot reads these required fields:

FieldValue / Meaning
secretSecond-layer verification, paired with the URL token
strategyStrategy slot name
actionbuy / sell / close
symbolBTCUSDT — no underscore
exchangebinance / okx / bitget / bybit
market_typespot / futures
order_typemarket / limit
qty_typeusdt / margin_usdt / base (explained next)
qtyQuantity

Required fields read by TVSBot. Verified 2026-10-14.

qty_type has five variants: fixed, usdt, percent, margin_pct, and margin_usdt. The most commonly misunderstood pair is usdt and margin_usdt — writing qty: 20 means a $20 position in one case, and $20 collateral multiplied by leverage in the other. A full breakdown is inthis qty_type trap article.

Two optional fields to watch: spot orders ignore leverage; futures margin_mode defaults to cross. Adding sl_pct / tp_pct to the payload will place stop-loss and take-profit orders on the exchange side — checkpoint 5 explains why this matters.

FieldValueDescription
secretStringSecond-layer verification, compared alongside the URL token
strategyStringTVSBot strategy slot name
actionbuy / sell / closeSignal direction
symbolBTCUSDT (no underscore)Trading pair
exchangebinance / okx / bitget / bybitTarget exchange
market_typespot / futuresSpot or futures
order_typemarket / limitMarket or limit order
qty_type + qtyfixed / usdt / percent / margin_pct / margin_usdtOrder quantity semantics, see body text
leverage1–125Futures only; ignored for spot; auto-reduced if exceeding risk limits
sl_pct / tp_pct0.1–50Exchange-side stop-loss / take-profit percentage

TVSBot official documentation (webhook payload specification) and database migration. Verified 2026-10-14.

Checkpoint 3: 401 and 400 — Authentication and Schema's First Line of Defense

After a request reaches TVSBot, the first checkpoint is dual verification: the URL token plus the payload secret, both must match. A wrong secret returns HTTP 401; missing fields or type mismatches in the payload return HTTP 400, along with detailed error descriptions — this is the most common cause of "silent failures." Many people only check whether the HTTP status is 200 and ignore the response body. If you can't even receive a 401 (meaning the alert never sent out), walk through the debugging flow inthis webhook not responding article first, then come back to this checkpoint.

After passing verification and schema checks, TVSBot returns 200 with queued — meaning "received and enqueued," not "order executed." The actual order result is found in Telegram notifications and the dashboard, not in the HTTP response.

We've identified two additional behaviors that are by design, not bugs: each user's webhook has a QPS (queries per second) cap — based on TVSBot's backend code, the default is 60 requests per 60 seconds (equivalent to 1 per second), and this is a per-token limit. There's also a per-IP cap of 30 requests per 30 seconds. Duplicate sends with the same strategy, symbol, and action within 60 seconds are treated as retries and dropped by TVSBot. So "sending twice results in only one order" is expected behavior.

json

        {
          "secret": "...",
          "strategy": "BTC Breakout",
          "action": "buy",
          "symbol": "BTCUSDT",
          "exchange": "binance",
          "market_type": "futures",
          "order_type": "market",
          "qty_type": "margin_usdt",
          "qty": 20,
          "leverage": 3,
          "sl_pct": 2,
          "tp_pct": 4
        }
        

Three possible outcomes after sending:

  • Wrong secret → HTTP 401
  • Missing field or type error → HTTP 400 (with detailed errors)
  • Passed verification → HTTP 200: {"received": true, "queued": true, "message": "..."}

Checkpoint 4: Binance Order Rejection — What the Error Codes Mean

TVSBot accepted it and the queue ran through, but Binance can still reject your order. We recommend checking API key permissions as the first suspect: the official message for error -2015 reads Invalid API-key, IP, or permissions for action — if your key doesn't have Spot/Futures Trading enabled, or if your IP whitelist doesn't include your server, you'll hit this code. For details on how to enable API key permissions and configure IP whitelists,this article covers it thoroughly; we won't repeat it here.

The second suspect is symbol filters: the Binance official API documentation lists three order validation filters — LOT_SIZE, MIN_NOTIONAL, and PRICE_FILTER (exchange-imposed rules for quantity precision, minimum notional value, and price precision per symbol). If qty precision is off, the notional value is too low, or the price has the wrong number of decimal places, the exchange will reject; specific error codes depend on the returned msg, and the official documentation doesn't tie each filter to a fixed code.

Error Code / MessageMeaningResolution
-2015 Invalid API-key, IP, or permissions for actionInsufficient key permissions or IP whitelist not configuredVerify the key has trading permissions enabled; ensure TVSBot server IP is whitelisted
LOT_SIZE / MIN_NOTIONAL / PRICE_FILTER rejectionQty precision, minimum notional value, or price precision doesn't match the symbol's rulesAdjust qty and price to match the filter parameters for that symbol, per the exchange's returned msg

Binance official API documentation (error codes and order validation filters sections). Verified October 2026; -2015 is official text; filter errors depend on exchange-returned msg.

Checkpoint 5: 200 + queued Is Not Execution — Where to Find Execution Reports

One more time: HTTP 200 with queued only means TVSBot accepted the signal into its queue. Order success, partial fill, rejection, and failure — these four statuses (filled, partial, rejected, failed) are visible in Telegram notifications and the dashboard.

Every signal on the Signals page has a processing_log (the step-by-step record from receiving the webhook to the final order result). When debugging, open it first — it's faster than guessing.

Futures traders should also know this default behavior: TVSBot assumes your Binance account is in One-way Mode (one position per direction at a time). If your account is set to Hedge Mode (two-way positions), Binance will reject the signal — not because of the payload, but because the account setting doesn't match the default. For details on the difference between the two modes,this article has you covered.

StatusMeaningWhere to Check
filledFully executedTelegram notification, Signals page
partialPartially filledSame as above; processing_log has details
rejectedRejected by exchange or TVSBot rulesprocessing_log records the rejection reason
failedOrder execution failedprocessing_log records the failure step

TVSBot backend and dashboard code (signals route and strategy page). Verified 2026-10-14.

What TVSBot Doesn't Do

Let's clarify two things upfront so you don't set expectations in the wrong place. First, Pine-side take-profit and stop-loss only work while your TradingView is running and alerts are triggering — if TradingView goes offline or the alert doesn't fire, Pine won't close your position for you.

Second, 200 + queued means "received," not "executed." Final execution is determined by the exchange; rejected orders stay rejected. The status is fully recorded in processing_log and there's no automatic retry until success.

Disconnect Protection
For a disconnect safety net, add sl_pct / tp_pct to your payload so stop-loss and take-profit orders sit on the exchange side — they work even when TradingView is down. Pine handles real-time triggers; the exchange side handles disconnect fallback. Layering both is the most robust configuration.

TradingView to Binance Five-Checkpoint Debug Checklist

When signals aren't reaching your account, check from top to bottom in order. Each row's "Where to Check" is that checkpoint's debugging entry point.

CheckpointTypical SymptomWhere to Check
1 Alert frequencyAlerts running but fewer signals than expectedTradingView alert settings (UI option or Pine freq)
2 Payload fields400 with detailed errorsHTTP response body error fields
3 Authentication401, or retries being droppedURL token and secret, 60s dedup window
4 Binance rejection200 queued then order rejected-2015 permission issues, filter msg
5 Execution reportsQueued but status isn't filledTelegram notifications, Signals page processing_log

Debug path mapping for the five checkpoints in this article.

Frequently Asked Questions

Webhook returned 200, so why didn't my account move?
200 + queued only means the signal was received and enqueued, not that the order executed. Open the processing_log on the Signals page or check Telegram notifications — the status (filled, partial, rejected, or failed) will be written there.
What's the difference between URL token and secret?
Two-layer verification: the token at the end of the URL is a random string generated at registration; the secret in the payload is the second layer. Both must match, or you'll get 401 — effectively splitting "knowing the URL" and "knowing the content" into two independent conditions.
If I send the same signal twice within 60 seconds, will it open two orders?
No. TVSBot has a 60-second dedup window for the same strategy, symbol, and action combination. Duplicate sends within the window are treated as retries and dropped, preventing double positions caused by TradingView retries or manual re-sends.
Futures orders keep getting rejected, but the payload looks correct?
First check if your account is in Hedge mode — TVSBot defaults to assuming One-way Mode, and Hedge mode signals get rejected. Then check whether leverage exceeds your risk limit (it'll be auto-reduced to the cap) and whether qty_type semantics match your expectations (usdt and margin_usdt differ by a leverage factor).
When TradingView goes offline, is the stop-loss still active?
Pine-side SL/TP won't be — it relies on alert triggers, and if TradingView isn't running, nothing fires. Add sl_pct / tp_pct to your payload so stop-loss and take-profit orders sit on the exchange side; they remain active even during disconnections.

Get started

Ready to ship what you just learned?

TVSBot connects TradingView alerts to Binance using your own API key. Verify signals with dry-run first, then go live.

Start Free