Guides, manuals and platform references.
This guide shows how to connect TradingView alerts to WEEX through AlgoWay. The setup uses a regular WEEX API key with Futures trading permission, an AlgoWay WEEX webhook, and a TradingView alert containing valid AlgoWay JSON.
You do not need to build or host your own WEEX trading bot. TradingView generates the signal, AlgoWay receives the webhook and applies the selected trading logic, and WEEX executes the order on the connected Futures account.
The basic route is:
TradingView alert -> AlgoWay webhook -> WEEX Futures account
This manual covers the complete setup: creating the WEEX API key, securing it with the AlgoWay server IP, creating the webhook from the AlgoWay Store, configuring the connection, finding the webhook and JSON examples in Trade Webhooks, creating the TradingView alert, and choosing between Hedge, Reverse, Opposite and Inverse execution modes.
Prepare the following before creating the connection:
The current AlgoWay WEEX integration is for Futures/Perpetual trading. For this connection, enable the WEEX Futures trading permission. Spot permission is not required for the AlgoWay WEEX Futures route.
Log in to the WEEX website and open Account >> API Management. Click Create new API.
For the AlgoWay connection, fill in the API form as follows:
algoway;WEEX recommends binding an IP allowlist to API keys. In the screenshots below, the AlgoWay server IP is 103.241.67.174. Always use the IP currently displayed in your own AlgoWay dashboard in case the infrastructure changes later.
Important: WEEX recommends using an alphanumeric passphrase without special characters. Save the passphrase exactly as entered. If you lose it, WEEX does not provide a way to recover it and you will need to create a new API key.
After the API settings are filled in, WEEX asks you to complete the account security verification. Depending on your security setup, this can include an email verification code and Google Authenticator code.
Enter the requested verification codes and click Save.
If WEEX refuses API access because the account does not have the required security method attached, enable mobile verification or Google Authenticator in WEEX Security settings and try again.
When the API is created, WEEX displays the new API key and Secret key. Save them immediately together with the Passphrase you entered in Step 1.
AlgoWay needs all three values:
The Secret key is shown only when the API is created. If you close the window without saving it, create a new WEEX API key.
AlgoWay now has a Store page where you can create the connection directly.
After the webhook is created, the connection appears in the left-side Trade Webhooks section of the AlgoWay dashboard.
Open the new WEEX webhook and fill in the connection settings.
Main WEEX fields:
The Margin Mode selected here is used by the WEEX connection. You do not need to send Cross or Isolated in every TradingView JSON message.
The Leverage saved here is the default leverage. A different leverage can also be sent in a specific TradingView alert when needed.
After the connection is saved, open Trade Webhooks from the AlgoWay left menu.
Your WEEX row contains the unique webhook UUID used by TradingView. Click the webhook entry to copy the URL when needed. The WEEX webhook page also provides JSON examples that you can use as a starting point for TradingView alerts.
If you use a TradingView strategy, open the alert and place a valid AlgoWay JSON message in the Message field.
A basic WEEX strategy alert can use TradingView placeholders:
{"platform_name":"weex","ticker":"{{ticker}}","order_contracts":"{{strategy.order.contracts}}","order_action":"{{strategy.market_position}}","price":"{{close}}"}
TradingView replaces the placeholders when the alert fires:
{{ticker}} - chart ticker;{{strategy.order.contracts}} - strategy order size;{{strategy.market_position}} - strategy direction;{{close}} - current close price.You can also include trade_type directly in the JSON. When it is present, that signal uses the specified mode.
In the TradingView alert window, open Notifications, enable Webhook URL, and paste the unique AlgoWay WEEX webhook URL from Trade Webhooks.
Click Apply and save the alert. When the TradingView condition triggers, TradingView sends the JSON message to AlgoWay and AlgoWay routes the command to the connected WEEX account.
The WEEX integration supports four trading modes: Hedge, Reverse, Opposite and Inverse. All four use the same webhook. The mode can be selected in the WEEX connection settings and can also be passed directly in JSON with trade_type.
Hedge keeps LONG and SHORT positions independent. A buy signal opens or increases LONG. A sell signal opens or increases SHORT.
Open or increase LONG:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge"}
Open or increase SHORT:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"sell","trade_type":"hedge"}
To close a specific side in Hedge mode, use flat together with close_side.
Close 1 contract from LONG:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":1,"order_action":"flat","trade_type":"hedge","close_side":"long"}
Close 50% of the current LONG position:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":50,"order_action":"flat","trade_type":"hedge","close_side":"long","order_size_type":"position_percent"}
Reverse uses netting logic. An opposite signal first reduces the existing position. If the new size is equal to the current position, the position is closed. If the new size is larger, AlgoWay closes the old position and opens the remaining difference in the new direction.
Example: LONG 3 is open and SELL 2 arrives:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"sell","trade_type":"reverse"}
The result is LONG 1.
If LONG 3 is open and SELL 5 arrives:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":5,"order_action":"sell","trade_type":"reverse"}
The LONG 3 is closed and SHORT 2 is opened.
Opposite fully closes the current position and then opens a new position using exactly the size of the new signal. The size of the existing position does not change the size of the new entry.
Example:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"opposite"}
If the next signal is:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":1,"order_action":"sell","trade_type":"opposite"}
AlgoWay fully closes the existing position and opens SHORT 1.
flat is not used with Opposite mode. For a complete close, use closeall.
Inverse reverses the direction of the incoming signal first and then applies Reverse logic.
buy >> executed as sell
sell >> executed as buy
This signal:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"inverse"}
opens SHORT 2 from a flat state.
This signal:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"sell","trade_type":"inverse"}
opens LONG 2 from a flat state.
flat and closeall are not inverted.
To fully close all open positions for the specified symbol and remove its pending orders, use closeall:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":0,"order_action":"closeall","trade_type":"hedge"}
closeall does not depend on order_contracts. The trading mode does not change the close-all operation.
WEEX alerts can use either buy / sell or long / short.
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"long","trade_type":"hedge"}
If order_type is not specified, the signal uses normal market execution.
Absolute Stop Loss and Take Profit prices:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","sl_price":0.105,"tp_price":0.13}
Stop Loss and Take Profit in percent:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","stop_loss":1,"take_profit":2,"sltp_type":"percent"}
Stop Loss and Take Profit in pips:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","stop_loss":100,"take_profit":200,"sltp_type":"pips"}
For a Limit order, set order_type to limit. The price field is required.
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","order_type":"limit","price":0.09}
A Limit order can also include Stop Loss and Take Profit:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","order_type":"limit","price":0.09,"stop_loss":1,"take_profit":2,"sltp_type":"percent"}
For a conditional Stop entry, set order_type to stop. The price field is required.
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","order_type":"stop","price":0.14}
With order_size_type set to balance_percent, order_contracts becomes a percentage of account equity.
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":1,"order_action":"buy","trade_type":"hedge","order_size_type":"balance_percent"}
In this example, 1 means 1% of account equity.
With order_size_type set to risk_percent, AlgoWay calculates the position size from the selected percentage of equity and the distance to the Stop Loss.
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":0.5,"order_action":"buy","trade_type":"hedge","order_size_type":"risk_percent","stop_loss":2,"sltp_type":"percent"}
Here, 0.5 means a target risk of 0.5% of equity with a Stop Loss 2% away.
The leverage saved in the WEEX connection is used by default. You can override it for a specific signal by adding leverage:
{"platform_name":"weex","ticker":"ARBUSDT.P","order_contracts":2,"order_action":"buy","trade_type":"hedge","leverage":5}
If leverage is not present in the alert, AlgoWay uses the leverage configured in the WEEX webhook.
Choose Cross or Isolated in the WEEX connection settings. You do not need to send mgn_mode in TradingView JSON.
AlgoWay checks the current WEEX margin configuration and applies the webhook setting when possible. If changing the margin configuration would be unsafe because the symbol already has an open position or pending order, the operation is blocked instead of forcing a risky account-mode change.
Trailing Stop is currently not available for the WEEX integration.
Do not add trailing_pips to WEEX alerts. A WEEX signal containing this parameter is rejected instead of being silently emulated by AlgoWay.
The current AlgoWay WEEX connection supports:
If the ticker sent by TradingView is different from the symbol expected by WEEX, use the optional Symbol Mapping field in the WEEX webhook.
Example:
BTCUSDT.P:BTCUSDT
This lets the TradingView alert keep using its chart ticker while AlgoWay sends the mapped symbol to WEEX.
All three values must belong to the same WEEX API key. The Passphrase is case-sensitive and must match the value entered during API creation.
A read-only API key cannot place Futures orders. Edit or recreate the API key with Trade futures permission enabled.
If the API key is restricted by IP, the AlgoWay server IP shown in your dashboard must be included in the WEEX API configuration.
WEEX notes that newly created or modified API keys may need some time before the updated permissions are available across the platform. If the settings are correct but the first request is rejected, wait a short time and test again.
The alert message must be valid JSON. Use double quotes and make sure the commas and brackets are correct.
Check the trade_type in the alert and the default Trade Type selected in the WEEX webhook. Hedge, Reverse, Opposite and Inverse intentionally produce different behavior when an opposite signal arrives.
Both limit and stop entry orders require the price field.
Trailing Stop is not currently supported for WEEX. Remove trailing_pips from the alert.
To connect TradingView to WEEX, create a WEEX API key with Futures trading permission, bind the AlgoWay server IP, save the API Key, Secret Key and Passphrase, create the TradingView-to-WEEX webhook from the AlgoWay Store, configure the WEEX connection, and paste the webhook URL and JSON message into TradingView.
One WEEX webhook can handle Hedge, Reverse, Opposite and Inverse trading logic, together with Market, Limit, Stop entry, SL/TP, leverage and percentage-based position sizing.