Skip to content

Webhook Payload Format

The payload is the JSON message that TradingView sends to your Amabit webhook when an alert fires. The format differs between Strategy Mode and Signal Mode.

Strategy Alert Payload

For TradingView strategies using strategy.entry() and strategy.close():

json
{
  "action": "{{strategy.order.action}}",
  "symbol": "{{ticker}}",
  "quantity": "{{strategy.order.contracts}}",
  "price": "{{close}}",
  "order_type": "market",
  "order_id": "{{strategy.order.id}}",
  "comment": "{{strategy.order.comment}}",
  "reduce_only": false
}

Manual Signal Payload

For custom indicators or manual alerts:

json
{
  "action": "buy",
  "symbol": "BTCUSDT",
  "quantity": 0.01,
  "price": "{{close}}",
  "order_type": "market",
  "reduce_only": false
}

Change "action" to "sell" for sell signals.

Field Reference

FieldRequiredValuesDescription
actionYes"buy", "sell"Trade direction. You can also use side as an alternative field name
symbolYese.g., "BTCUSDT"Trading pair in Binance format. Exchange prefixes like BINANCE:BTCUSDT are automatically stripped
quantityYes*NumberTrade quantity in base currency. *Not required if webhook uses "% of Balance" lot sizing
priceNoNumber or "{{close}}"Price for limit orders. Also used as entry price for TP/SL calculation in Signal Mode
order_typeNo"market", "limit"Defaults to the webhook's configured order type if omitted
order_idNoStringOptional identifier — logged for tracking purposes
commentNoStringOptional comment — saved in the execution log
reduce_onlyNotrue, falseIf true, only reduces an existing position (never opens a new one). Futures only
position_sideNo"LONG", "SHORT"Override the webhook's default position side. Futures Hedge Mode only

TradingView Placeholders

TradingView replaces these placeholders with actual values at the moment the alert fires:

PlaceholderValue
{{strategy.order.action}}"buy" or "sell"
{{strategy.order.contracts}}Number of contracts/units from the strategy
{{strategy.order.id}}Order ID assigned by the strategy
{{strategy.order.comment}}Comment set in strategy.entry() or strategy.close()
{{ticker}}Symbol of the chart (e.g., "BTCUSDT" or "BINANCE:BTCUSDT")
{{close}}Current closing price
{{open}}, {{high}}, {{low}}OHLC values of the current bar
{{volume}}Current bar volume
{{time}}Current bar timestamp

Symbol Format

Amabit expects the Binance symbol format — a pair name without separators:

AcceptedNot accepted
BTCUSDTBTC/USDT
ETHUSDTETH-USDT
BINANCE:BTCUSDTSOL/USDT

TIP

If your TradingView chart uses an exchange prefix (e.g., BINANCE:BTCUSDT), that's fine — Amabit automatically strips the prefix. But formats with slashes or dashes (BTC/USDT, BTC-USDT) are not supported.

If {{ticker}} produces an unsupported format, hardcode the symbol in the payload instead.

Examples

Limit Order

Execute at the alert price instead of market:

json
{
  "action": "buy",
  "symbol": "BTCUSDT",
  "quantity": 0.005,
  "price": "{{close}}",
  "order_type": "limit"
}

Reduce-Only (Futures)

Close an existing position without opening a new one:

json
{
  "action": "sell",
  "symbol": "BTCUSDT",
  "quantity": 0.01,
  "order_type": "market",
  "reduce_only": true
}

Hedge Mode — Close Long Position

json
{
  "action": "sell",
  "symbol": "BTCUSDT",
  "quantity": 0.01,
  "order_type": "market",
  "position_side": "LONG",
  "reduce_only": true
}

Using % of Balance (No Quantity Needed)

If your webhook is configured with Custom % of Balance lot sizing, the quantity field is ignored:

json
{
  "action": "buy",
  "symbol": "ETHUSDT",
  "order_type": "market"
}

Official Binance Broker