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():
{
"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:
{
"action": "buy",
"symbol": "BTCUSDT",
"quantity": 0.01,
"price": "{{close}}",
"order_type": "market",
"reduce_only": false
}Change "action" to "sell" for sell signals.
Field Reference
| Field | Required | Values | Description |
|---|---|---|---|
action | Yes | "buy", "sell" | Trade direction. You can also use side as an alternative field name |
symbol | Yes | e.g., "BTCUSDT" | Trading pair in Binance format. Exchange prefixes like BINANCE:BTCUSDT are automatically stripped |
quantity | Yes* | Number | Trade quantity in base currency. *Not required if webhook uses "% of Balance" lot sizing |
price | No | Number or "{{close}}" | Price for limit orders. Also used as entry price for TP/SL calculation in Signal Mode |
order_type | No | "market", "limit" | Defaults to the webhook's configured order type if omitted |
order_id | No | String | Optional identifier — logged for tracking purposes |
comment | No | String | Optional comment — saved in the execution log |
reduce_only | No | true, false | If true, only reduces an existing position (never opens a new one). Futures only |
position_side | No | "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:
| Placeholder | Value |
|---|---|
{{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:
| Accepted | Not accepted |
|---|---|
BTCUSDT | BTC/USDT |
ETHUSDT | ETH-USDT |
BINANCE:BTCUSDT | SOL/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:
{
"action": "buy",
"symbol": "BTCUSDT",
"quantity": 0.005,
"price": "{{close}}",
"order_type": "limit"
}Reduce-Only (Futures)
Close an existing position without opening a new one:
{
"action": "sell",
"symbol": "BTCUSDT",
"quantity": 0.01,
"order_type": "market",
"reduce_only": true
}Hedge Mode — Close Long Position
{
"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:
{
"action": "buy",
"symbol": "ETHUSDT",
"order_type": "market"
}