> For the complete documentation index, see [llms.txt](https://docs.bigbeluga.org/llms.txt).
> Markdown versions of documentation pages are available by appending `.md` to page URLs; this page
> is available as [Markdown](https://docs.bigbeluga.org/automation-alerts/binance.md).

# Binance Automation Alerts

<mark style="color:$info;">Learn how to use placeholders and webhooks to send automated webhook
alerts from TradingView indicator and strategy alerts to Binance based on official Binance strategy
alert and webhook specifications.</mark>

## Overview

Binance automation alerts allow you to connect your TradingView indicators and strategy alerts
directly to Binance via webhooks. By utilizing dynamic placeholders and JSON payloads, you can pass
asset tickers, side, order size, and pricing parameters seamlessly for automated order execution.

Refer to the official
[Binance Webhook & FAQ Guide](https://www.binance.com/en-AE/support/faq/detail/3f57291b56474f5e900cc4b754f61ff3)
for complete platform specifications.

## Binance Webhook Configuration & Payload Structure

To set up TradingView webhook alerts with Binance, configure your alert message using valid JSON
format matching Binance's expected schema:

```json
{
  "symbol": "{{ticker}}",
  "side": "{{strategy.order.action}}",
  "investmentType": "notional_value",
  "positionMode": "one_way mode",
  "positionSide": "both",
  "qty": "{{strategy.order.contracts}}",
  "price": "{{close}}",
  "reduceOnly": "true",
  "signalId": "2b8aaf97-aafe-46",
  "uid": "xxxxxxxxxxxxxxxx"
}
```

### Payload Property Reference

| Property         | Value / Placeholder            | Explanation                                                                                                                          |
| ---------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `symbol`         | `{{ticker}}`                   | The active trading pair symbol (e.g., `BTCUSDT`).                                                                                    |
| `side`           | `{{strategy.order.action}}`    | Dynamic trade action (`BUY`, `SELL`, `ENTER_LONG`, etc.) from strategies. For indicator alerts, set manually to `"buy"` or `"sell"`. |
| `investmentType` | `"notional_value"`             | Defines how order size/capital calculation is evaluated.                                                                             |
| `positionMode`   | `"one_way mode"`               | Position mode setting (must match One-Way mode).                                                                                     |
| `positionSide`   | `"both"`                       | Position side configuration.                                                                                                         |
| `qty`            | `{{strategy.order.contracts}}` | Quantity of contracts or units for the order.                                                                                        |
| `price`          | `{{close}}`                    | The closing price at the moment the alert triggers.                                                                                  |
| `reduceOnly`     | `"true"`                       | Specifies whether the order is reduce-only.                                                                                          |
| `signalId`       | Unique string                  | Unique identifier for the webhook signal rule.                                                                                       |
| `uid`            | Unique string                  | Your account or webhook user identifier.                                                                                             |

### Supported Placeholders & Side Behavior

- `{{ticker}}` – The active symbol or trading pair (e.g., `BTCUSDT`).
- `{{strategy.order.action}}` – When using **BigBeluga Backtesters / Strategies**, use
  `{{strategy.order.action}}` to dynamically pass the trade action.
- **Indicator Alerts**: When using standard **BigBeluga Indicators** instead of strategies, you must
  manually set `"side"` to `"buy"` or `"sell"`.

#### Example Message Format for Indicators

```json
{
  "symbol": "{{ticker}}",
  "side": "buy",
  "qty": "1",
  "price": "{{close}}",
  "trigger_time": "{{timenow}}",
  "signal_id": "175cbc02-79eb-44ef-ac67-d0d818c6f928",
  "UID": "xxxxx"
}
```

- `{{close}}` – The closing price at the time the alert triggers.
- `{{size}}` or `{{volume}}` – Order quantity or contract size based on your strategy setup.

## Setting Up Webhook Alerts in TradingView

1. Navigate to your Binance account API management and retrieve your authorized webhook endpoint and
   signing credentials.
2. Open your chart on **TradingView** and open the **Create Alert** dialog on your BigBeluga
   indicator or strategy.
3. Check **Webhook URL** and paste your Binance webhook endpoint URL.
4. Paste the JSON template with placeholders into the alert message box.
5. Click **Create** to activate your automated webhook alert.

> Note: Always test your webhook configuration with small position sizes or on Binance testnet
> environments before executing live automated orders. Refer to the
> [Binance Webhook & FAQ Guide](https://www.binance.com/en-AE/support/faq/detail/3f57291b56474f5e900cc4b754f61ff3)
> for further details.

---
