All Help Center topics

HELP CENTER · STEP-BY-STEP GUIDE

Trade with TradingView alerts

From a free sandbox test to Pine strategies, trade verification, and troubleshooting. The screenshots highlight the controls you need.

QATS account or sandbox Same risk rules Separate signal log
01 / BEFORE YOU BEGIN

TradingView sends a signal; QATS decides whether it can execute on the selected account. This connection is separate from TradingView broker-panel buttons. A triggered alert is not a confirmed trade: check the QATS log and positions.

Test in the free sandbox first

Open sandbox TradingView setup

Sign up for QATS and open Sandbox account → Keys & connections → TradingView alerts. If you have no sandbox yet, choose Crypto or TradFi and a Binance or Bybit pricing source, then create a test account. It has $100,000 in virtual funds; its trades do not affect your challenge, payouts, or live orders.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Actual local virtual-account screen, with the API tab selected. Switch to TradingView alerts to create its personal webhook URL; the API base URL and API-key button shown here are for bots and scripts.
The Sandbox API base URL is for bots and scripts. A TradingView alert needs its own personal URL, issued after Create webhook on the TradingView alerts tab.
  1. If you already have a sandbox, select TradingView alerts on its Keys & connections page. API keys and webhooks use the same virtual account.
  2. After resetting the sandbox, create a new webhook because old sandbox keys are revoked.

Create a webhook for the right account

Select Create webhook in the sandbox or main TradingView section. For a main-account webhook, also select the trading account: each key belongs to one account. Give it a clear name, choose a 30-, 60-, or 90-day expiry, and keep the TradingView-servers-only restriction enabled.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Illustrative QATS setup screen. Any example balance is virtual; keep issued webhook secrets private.
ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Illustrative QATS setup screen. Any example balance is virtual; keep issued webhook secrets private.
ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Illustrative QATS setup screen. Any example balance is virtual; keep issued webhook secrets private.
Your personal webhook URL appears once. It ends with your key, so it is the only thing TradingView needs. Do not publish it or send it to support: anyone with the URL can trade on this account.

Create an alert in TradingView

  1. Open the chart of your instrument, such as BINANCE:BTCUSDT.P, and select Alert.
  2. Choose a trigger. A price crossing works for a simple test; for Pine, select your strategy and Order fills.
  3. Under Notifications, enable Webhook URL and paste your personal QATS webhook URL.
  4. Under Message, replace the default text with a QATS message (Buy, Sell, Close or Pine strategy); with QATS Ticket leave it as it is. Save the TradingView alert.
ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

TradingView setup reference. Its interface can change; the webhook URL and secret belong in separate fields.
ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

TradingView setup reference. Its interface can change; the webhook URL and secret belong in separate fields.
TradingView requires two-factor authentication and plan access for webhooks. Your personal URL delivers the alert and identifies the account; Message says what to do. QATS Ticket writes the message itself. TradingView requirements

Verify the trading outcome, not just delivery

Start in the sandbox. Save a TradingView alert with the QATS message and wait for its condition to fire. Creating an alert does not send a signal by itself.

1TradingViewThe alert is active; its history shows the trigger and webhook delivery.
2QATS → Alerts → RefreshA row shows time, symbol, and Done, Nothing to do, or Refused.
3Terminal → Orders and PositionsThe actual position and requested protective orders match your expectation.
If QATS has no row, use the delivery checks. If it has a row but the trade differs, inspect every command result and the current position before resending.

Buy, sell, and add protection

QATS provides ready-made Buy alert and Sell alert templates. One signal places a market order for the stated amount. For a short, change "action": "buy" to "sell". The unmodified example uses $1,000, a 1% stop, and a 2% target. Adjust these to your strategy and plan limits.

Buy exampleFor a real alert, use the QATS template with its key already inserted.
{
  "symbol": "{{ticker}}",
  "action": "buy",
  "notionalUsd": 1000,
  "stopLossPercent": 1,
  "takeProfitPercent": 2
}

notionalUsd is converted into lots at the current price and rounded down to the instrument step. After the entry fills, QATS submits the stop and target separately based on the fill price. Check both results in the log and the working protection on the position.

Add "price": "{{close}}" to a market entry and QATS checks it against its own price: if they are more than 0.25% apart (your chart shows another market, or the price ran while the alert was on its way), the entry is refused with PRICE_REFERENCE_MISMATCH and nothing fills. Set "maxDeviationPct" (0.01 to 2) to change the tolerance. A close never carries this check, so a late exit alert still closes.

Each instrument has one net position. A sell against an open long can reduce or reverse it. To exit without reversing, use close below.

Limit orders, stop entries, and size

Set "type": "limit" or "type": "stop" and the required price. A pending entry with protection needs both a stop loss and take profit; QATS creates a bracket. For a market entry, protection is submitted after the fill.

Limit buy example80000 is only an example. Enter a valid price for your instrument.
{
  "symbol": "{{ticker}}",
  "action": "buy",
  "type": "limit",
  "price": 80000,
  "notionalUsd": 1000,
  "stopLossPercent": 1,
  "takeProfitPercent": 2
}
Size fieldMeaning
notionalUsdPosition value in US dollars.
quantityAmount of the base asset, such as BTC.
lotsQATS lots for this instrument.

Use only one size field per message. An entry is refused if rounding produces less than one valid lot. An off-market price, unavailable instrument, insufficient margin, or risk limit can also cause refusal.

Synchronize a Pine strategy

Create an alert on your strategy for Order fills and paste the Pine strategy template. TradingView supplies the target long, short, or flat state and size. QATS compares it with the selected account position and trades only the difference; flat closes that instrument.

Strategy messageTradingView must replace these placeholders when the alert fires.
{
  "symbol": "{{ticker}}",
  "position": "{{strategy.market_position}}",
  "positionSize": "{{strategy.market_position_size}}",
  "id": "{{strategy.order.id}}-{{timenow}}"
}
Test size in the sandbox first. positionSize comes from TradingView, while QATS converts base-asset quantity into its own lots. Different strategy contract units can produce an unexpected size. The retained id prevents duplicate execution of the same event.

Buy and sell on the chart with QATS Trade for Chrome

QATS Trade is a Chrome extension that puts a ticket over your TradingView chart: Buy / Long and Sell / Short, market, limit and stop entries, size in coins, US dollars or risk at the stop, take profit and stop loss, your position with Close and Reverse, and your working orders. It follows the chart: switch the chart to ETHUSDT.P and the ticket trades ETHUSDT.

  1. In QATS, open Profile → External connections → Trade from charts → QATS Trade for Chrome and press Download QATS Trade.
  2. In Chrome open chrome://extensions, turn on Developer mode and drag the downloaded file onto the page (every step with screenshots). Edge and Brave work the same way.
  3. Back on the QATS page, which notices the extension by itself, a QATS window opens (or press Connect with QATS): choose the accounts and press Approve. No key to copy or paste.
  4. Open a TradingView chart: the ticket appears top right; drag it by its bar or fold it into a pill. The full QATS Trade guide covers every control; installing and connecting, with screenshots.

Every order goes through the same rules and risk checks as the QATS terminal, always on the live QATS server; a refusal says why in the ticket. An order against your position only reduces it; a larger one closes it and opens the rest the other way, as in the terminal. A limit or stop entry carries its take profit and stop loss as a bracket; a market entry gets them as soon as it fills.

On the chart. Your QATS position, its stop loss and take profit, and your working orders are drawn on the TradingView chart as broker lines. Drag the stop loss, the take profit or an order to move it; press × on a line to remove the stop or target or cancel the order; Close and Reverse sit on the position line. Whatever you do on the chart, the ticket asks you to confirm it with a click, even with one-click trading on. A position without a stop loss or take profit shows a dotted + SL / + TP handle: drag it to the price you want to set one (× hides it). The ◎ buttons next to the price, TP and SL fields take the price from your next click on the chart. QATS lines are not saved with your TradingView drawings or layouts.

Size and position tools. Size in coins, in US dollars, or by Risk $: the dollars you lose if the stop loss is hit, so the size follows the distance to your stop. On an open position, Close ½ closes half and Breakeven moves the stop loss to your entry price once the position is in profit.

Leverage and max slippage. On a crypto instrument the ticket sends the same leverage and max slippage as the QATS terminal. Leverage goes from 1× up to the instrument’s maximum on your account; with a position open or entries working on that instrument it is fixed to theirs and the ticket says so. Max slippage (0.1%, 0.25%, 0.5%, 1% or Off; 0.5% at first) applies to a market order that opens or adds; closing is never held back by it.

Your loss limits. Under the account line the ticket shows what is left before your account’s loss limits, as QATS counts them: the daily loss limit, the maximum loss and, if you set one, your own daily stop. Each confirmation says what the order loses at its stop loss and what share of that room it is; without a stop loss, how small a move against you uses the room up. An order whose stop loss would go past a limit always asks first, even with one-click trading on.

More than one account. Choose them all in the QATS window when you connect (or press Change accounts later). The account name at the top of the ticket becomes a switch; each ticket trades the account it shows, every confirmation names it, and new tickets open on the account you used last.

Chart price check. Under the QATS price the ticket compares it with the chart’s, for example Chart 76,712.4 · QATS 76,710.1 · 0.01% apart. The tolerance is fixed at 0.1%; you do not set it. Further apart, the line turns amber and an order at market asks first, naming both prices. A chart of another market (the stock instead of its perpetual, another coin) stops Buy and Sell until you switch the chart or pick the instrument in the ticket. An order at market also tells QATS the price you saw, and QATS refuses to fill it more than 0.1% away from that price (PRICE_REFERENCE_MISMATCH).

Layout and appearance. The gear in the ticket’s bar chooses a layout: Minimal (size and Buy / Sell only), Standard or Full, or your own mix with a tick per block (account, loss limit room, instrument, price check line, order type, take profit / stop loss, leverage, max slippage, position, working orders, Close everything). The same menu sets its size (Compact, Normal, Large), width, where it docks (right, left, or floating where you drag it) and its theme (the chart’s, dark or light); Reset to defaults brings back the standard ticket. The ticket never fades or turns see-through, and a layout never hides a confirmation, a refusal or a price warning.

Each order asks for one more click by default; keyboard shortcuts (Alt+Shift+B / S) are off until you turn them on in the extension’s settings. The connection stays in the extension: TradingView and every other page you trade from never see it. To disconnect, press Disconnect in the extension’s settings or Revoke under Profile → External connections → Connected browsers; positions and orders stay as they are. On Binance, Bybit, Coinglass or any other chart site, press the toolbar button and choose Show the panel here. The ticket shows QATS prices, which can differ slightly from the chart’s exchange.

Plan the trade on the chart with QATS Ticket

QATS Ticket is a Pine indicator: you click the entry, the stop loss and the take profit on the chart, as with TradingView’s Long/Short position tool, and it shows the size, the risk and the reward. One alert sends the trade to QATS.

  1. In QATS, open Profile → External connections → Trade from charts → TradingView alerts and press Copy Pine script. The script carries no key: there is nothing to type in its settings.
  2. In TradingView, open Pine Editor, create a new indicator, replace its text with the script and press Add to chart on a Binance perpetual chart (for example BINANCE:BTCUSDT.P).
  3. Click the entry, then the stop loss, then the take profit. In the settings choose the entry order (Limit, Stop, Market now, or Market on candle close beyond the entry) and the size: risk in USD, coins or USD value.
  4. When the panel says READY, create an alert: condition QATS Ticket → Any alert() function call, and your personal QATS webhook URL under Notifications. That is the only thing you paste: the indicator writes the message.

A limit or stop entry rests on QATS with its stop loss and take profit as a bracket. A market entry is protected once it fills. Every ticket carries its own id, so TradingView delivering the same alert twice places one order.

An alert keeps the levels it was created with. To change the trade, move the levels and create a new alert, then cancel the old order in QATS.

Signals from LuxAlgo and other indicators

Any TradingView indicator that offers alerts can trade through the webhook: LuxAlgo’s toolkits, public community scripts and your own. QATS needs its own message in the alert, so build the alert on the indicator’s named condition, where you write the message yourself.

  1. Add the indicator to a Binance perpetual chart and open Create alert. Under Condition choose the indicator, then its buy or long signal (for example a bullish confirmation).
  2. In Message paste the Buy alert from QATS; set the size and the stop loss and take profit you want. Under Notifications tick Webhook URL and paste the QATS webhook URL.
  3. Create a second alert on the sell or short signal with the Sell alert, and one on the exit signal with the Close alert if the indicator has one.

When the indicator comes as a strategy (a backtester), create one alert on the strategy for Order fills with the Pine strategy message instead: QATS then holds the same position as the strategy, long, short or flat.

An alert built on “Any alert() function call” sends the indicator’s own text, which QATS cannot read as an order; use the named conditions. Try new signals in the free sandbox first. LuxAlgo is a third-party product; QATS is not affiliated with it and does not vouch for any indicator’s signals.

Close a position or cancel orders

For a regular chart, use the ready-made Close alert to close the entire position in that symbol. If none exists, the log says Nothing to do. Other commands can be entered manually:

Close the chart symbol position
{ "symbol": "{{ticker}}", "action": "close" }
Close all positions and cancel all orders
{ "action": "flatten" }
Cancel working entry orders
{ "action": "cancel_all" }

cancel_all does not remove protective stops and targets on active positions. To reduce a position partly, use action: "close" with one size field. QATS submits a reduce-only order and will not reverse it.

Choose the right chart

TradingViewQATS
BINANCE:BTCUSDT.PBTCUSDT, if your plan allows it.
BYBIT:BTCUSDT.PBTCUSDT, if your plan allows it.
OANDA:XAUUSDXAUUSDT, if that TradFi perpetual is in the catalog and your plan.
NASDAQ:NVDANVDAUSDT under the same condition.
CL1!Not converted automatically; it is a different contract.

{{ticker}} uses the chart symbol, not an active ticker in another window. Check the account, market, and chart together before saving an alert. A TradFi account will refuse BTC unless its plan includes it.

Check the log after every signal

In QATS, open Profile → External connections → Trade from charts → TradingView alerts → Alerts → Refresh. Done means commands were accepted; Nothing to do means the target state already existed; Refused includes a reason. The log shows the latest 50 processed signals over 14 days, including requests refused after key validation. Also check Orders and Positions in the terminal to confirm the trade.

What you seeWhat to check
No log row at allCheck TradingView alert history for a trigger and webhook delivery. Verify the URL, expiry, and key. QATS may reject an invalid key before logging.
PLACEHOLDER_NOT_REPLACEDA strategy template was used in a regular alert, or TradingView did not fill a field. Select Order fills and check Message.
UNKNOWN_SYMBOLThe chart symbol did not match the QATS catalog; choose a supported perpetual.
SIZE_BELOW_ONE_LOTThe amount fell below the instrument step after rounding down.
Margin, risk, or plan refusalCheck Risk center, allowed instruments, market data, and size. Do not resend blindly.
Entry filled without protectionInspect the position and set SL/TP in the terminal; market protection is a separate command after the fill.
Quick diagnosisChoose what you see now
  1. Check TradingView alert history to see whether the condition fired and a webhook was sent.
  2. Check the Webhook URL, key validity, and account. A request with an invalid key can be rejected before it reaches the log.
  3. For Pine, confirm Order fills is selected and the alert is active.
If execution is uncertain, check the log, orders, and positions first. Recreating an alert can send another command.

Keys, expiry, and Bybit

The key is the last part of your personal webhook URL and works only at that webhook address. Older webhooks carry it in the message instead; both keep working. A regular trading API key will not work here. By default QATS accepts these signals only from TradingView servers. If the key leaks or an alert is no longer needed, select Revoke and create a new webhook. Open positions and working orders remain; close them separately if needed.

An account in Bybit native / Bybit Demo mode does not receive a QATS webhook: trades go directly through Bybit. Use a QATS account or sandbox for alert trading. The Buy/Sell buttons in the TradingView broker panel are also separate from this connection.

Replace a webhook without confusion

A webhook lasts 30, 60, or 90 days. Once expired or revoked, old alerts cannot trade. A different account needs a separate webhook; renaming an alert does not change the account linked to its key.

  1. For a sandbox, open Sandbox → Keys & connections → TradingView alerts. For a purchased account, use Profile → External connections → TradingView alerts. Create a new webhook for the intended account.
  2. For every active TradingView alert, replace the Webhook URL with the new personal URL. An older alert whose message still has a "token" line: delete that line or replace the message with a new one, since a URL and a message with different keys are refused.
  3. Save the alerts, wait for a test trigger, and check it under Alerts for the new connection.
  4. Once confirmed, revoke the old webhook if it is still active. This does not close positions or cancel working orders.
READY FOR A FIRST TEST?

Create a sandbox alert

After it fires, compare the log row with the position and protective orders.

Open sandbox connections
More guidesExplore every QATS topic in one place.
Open Help Center
Screenshots come from QATS dev and TradingView. Prices and available TradingView controls may change.