BingX Guide
Connect TradingView to BingX Swap (perpetual futures) using TradeAdapter’s direct API integration. This guide covers strategy-based alerts with the Message Generator.
Video walkthrough #
BingX + TradingView setup
1 — Create BingX API keys #
BingX uses API keys with Spot and Perpetual Futures trading. Create a key and add the TradeAdapter IP to the whitelist.
-
Open API Management
Log in to BingX and go to API Managed in the main menu.
-
Create API
Click Create API, choose a name for the API key, and complete two-factor authentication.
-
Configure the key
Enable Spot and Perpetual Futures Trading, and add the TradeAdapter IP
35.75.198.16to the whitelist so only TradeAdapter can use this key. -
Save your credentials
Copy and store your API Key and Secret. The Secret is shown only once. You will paste them into the alert message as
bingx_api_keyandbingx_secret.
2 — Select the BingX symbol in TradingView #
Open TradingView and search for the symbol using the BINGX prefix. This guide covers Swap (perpetual futures) only — use a BingX Swap symbol (e.g. BINGX:BTCUSDT, BINGX:ETHUSDT).
Important
The {{ticker}} placeholder sends this exact symbol to BingX. The symbol must exist in the Swap market and match the supported symbols list. Check BingX SWAP Symbols for QTY Precision, Price Precision, and Trade Min per symbol.
3 — Add your strategy #
This guide covers strategy alerts only. Load your Pine Script strategy onto the chart so it generates the trading signals.
Open Pine Editor, paste your strategy code, and click “Add to chart”. Open the Strategy Tester tab to confirm backtest results and that orders are generated.
Not sure if you have a strategy or an indicator? See Indicator vs Strategy.
4 — Configure order size #
BingX Swap enforces symbol-specific rules (QTY Precision, Price Precision, Trade Min). Configure your strategy’s position size so that {{strategy.order.contracts}} meets the symbol’s minimum and precision. For Limit orders, ensure {{strategy.order.price}} respects the price precision.
BingX SWAP Symbols — QTY Precision, Price Precision, Trade Min per symbol.
5 — Create the TradingView alert #
Press Alt + A (or the alarm clock icon) to create a new alert on your strategy.
Strategy → one alert
Under Condition, select your strategy and set trigger to “Order fills only”. TradingView fills action, size, and price via {{strategy.order.action}}, {{strategy.order.contracts}}, and {{strategy.order.price}}.
Required: Webhook URL + Message
In Notifications, enable Webhook URL and paste your personal webhook from your TradeAdapter profile. Paste the JSON message (below) in the Message field. You can build it with the BingX Message Generator.
Alert message (Strategy) #
Use this template for strategy-based alerts. Replace the placeholder values with your API key and secret. order_market must be Swap for BingX. Keep the TradingView placeholders as-is.
{
"bingx_api_key": "PUT YOUR BINGX API KEY HERE",
"bingx_secret": "PUT YOUR BINGX SECRET KEY HERE",
"real_order": "No",
"order_type": "Market",
"order_market": "Swap",
"exchange": "bingx",
"ticker": "{{ticker}}",
"time": "{{timenow}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.order.action}}",
"order_price": "{{strategy.order.price}}",
"market_position": "{{strategy.market_position}}",
"prev_market_position": "{{strategy.prev_market_position}}"
}
Message fields explained #
| Field | Description |
|---|---|
bingx_api_key |
Your BingX API Key from the API creation step. |
bingx_secret |
Your BingX Secret. Store it securely and never share it. |
real_order |
"Yes" sends real orders to BingX. "No" sends test orders via TradeAdapter only (no live trades). |
order_type |
"Market" or "Limit". For Limit orders, order_price is used as the limit price. |
order_market |
Must be "Swap" for BingX (this guide covers Swap only). |
exchange |
Must be "bingx" so TradeAdapter routes the order to BingX. |
ticker |
The TradingView symbol from {{ticker}} (e.g. BINGX:BTCUSDT). |
time |
Alert time from TradingView ({{timenow}}). |
order_contracts |
Position size from your strategy ({{strategy.order.contracts}}). |
order_action |
"BUY" or "SELL". Use {{strategy.order.action}} for strategies. |
order_price |
Price from the strategy ({{strategy.order.price}}), used for Limit orders. |
market_position |
Strategy position after the order ({{strategy.market_position}}). |
prev_market_position |
Strategy position before the order ({{strategy.prev_market_position}}). |
6 — Execute & monitor #
-
Start with test orders
Set
"real_order": "No"and trigger a few alerts. Check MyTrades to see how TradeAdapter interprets your signals. -
Verify on BingX
When you set
"real_order": "Yes", monitor your BingX Swap account to confirm orders execute as expected. -
Recreate alerts after changes
If you change strategy parameters or the message, delete and recreate the TradingView alert so the new values are applied.
Important notes #
API security — Never share your Secret. Use a key with trading permission only. Add IP
35.75.198.16 to the whitelist so only TradeAdapter can use the key.
Respect symbol specs — Check BingX SWAP Symbols for QTY/Price precision and Trade Min; test with small orders before scaling.
Recreate alerts after changes — If you change strategy parameters or message fields, delete and recreate the TradingView alert.
All setup guides