ApeX Pro is a non-custodial perpetuals exchange — your funds stay in your own wallet rather than sitting on an exchange’s balance sheet, while you still get cross-margined perpetual contracts and CEX-like order execution. That’s a real advantage if you’re wary of custodial risk, but it doesn’t change the core problem every TradingView trader runs into: an alert tells you when to trade, it doesn’t place the order for you.
This guide closes that gap. By the end, your TradingView alerts will open, manage, and close positions on ApeX Pro automatically — no manual entry, and no browser extension or always-on script required on your end.
What you’ll need
- A TradingView account with alerts enabled on your plan
- An ApeX Pro (apex.exchange) account, funded or on testnet
- A webhook from TradingView to Anywhere (TTA) connected to ApeX Pro
Step 1: Set up your ApeX Pro webhook
Head to TradingView to Anywhere and connect your ApeX Pro account.
Once connected, TTA gives you a unique webhook URL — the address TradingView sends your alert to. It follows this pattern:
https://tradingview.to/apex/{your-unique-id}
Keep this URL private. Anyone with it could send trade commands to your connected account.
Step 2: Build your alert message
TTA reads plain-text commands from your TradingView alert message, in the format action symbol param=value. A few formatting rules to keep in mind:
- The symbol must match ApeX’s exact format, with a slash —
BTC/USDT, notBTCUSDT. You can copy the correct format straight from the trading pair’s URL on ApeX. - Symbols are case-sensitive.
- No spaces around the
=—Quantity=50%is valid,Quantity = 50%is not. - Parameters can be written in full or abbreviated to their first letter (
QuantityorQ— same result). - You can stack up to 5 commands in one alert by putting each on its own line.
Opening a position — use Buy/Long/1 or Sell/Short/-1:
- Quantity (Q) — fixed size or a percentage of your balance; can also be sent as
OQ. Default:Q=100% - Leverage (L) —
L=5andL=5xboth apply 5× cross leverage - Price (P) — an absolute entry price, or a percentage deviation from the current market price (
P=2%,P=0.256,P=-3%) - Type (T) —
MARKET,LIMIT,STOP,STOP_LIMIT,Stop_Market, orTake_Profit_Market - Reduce (R) —
R=truerestricts the order to closing existing positions only. Default:R=false
Long APEX/USDT Q=50%
Opens a long position with 50% of your account balance.
Sell BTC/USDT Q=25% P=1.5% T=Stop_Market
Places a stop market order that triggers 1.5% away from the current price, executing at market once hit — this is how you’d attach a stop-loss-style exit to a position.
Long ETH/USDT Q=2 P=2500 T=Take_Profit_Market
Places a take-profit order for 2 ETH that triggers and executes at market once price hits 2,500.
Because stop-loss and take-profit exits are separate stop/limit orders rather than parameters on the entry itself, a common pattern is to send the opening trade and its protective exit as two stacked commands in the same alert — for example, a Long on one line and a Sell ... T=Stop_Market on the next.
Closing a position — use Close/Flat/0:
- Quantity (Q or CQ) — size to close, in tokens or as a percentage. Default:
CQ=100%
Close DOGE/USDT
Closes all DOGE/USDT positions.
Flat APEX/USDT Q=50%
Closes 50% of your APEX/USDT position.
Cancelling a pending order — use Cancel/Exit:
Cancel HYPE/USDT
Cancels all pending HYPE/USDT orders.
Checking your balance — use Balance/Bal/Funds:
- Balance (B) —
Free(funds not committed to open positions) orTotal. Default:Total
Balance B=FREE
Returns your free balance.
Strategy alerts work the same way with dynamic placeholders — for example, {{strategy.order.action}} DOGE/USDT q=50% opens a trade sized at 50% of your balance in whichever direction the strategy fires.
Step 3: Wire the alert into TradingView
- Set your alert condition as usual — price crossing a level, an indicator signal, or a full Pine Script strategy alert.
- Paste the TTA webhook URL from Step 1 into the alert’s Webhook URL field.
- Enter your BUY/SELL command in the Message field using the format above.
If you’re alerting from a Pine Script strategy rather than a manual alert, use the placeholder that matches your setup — {{strategy.order.alert_message}}, {{strategy.order.action}}, or {{strategy.market_position}} depending on what your script needs to pass through. Using the wrong one is a common reason alerts fire on TradingView’s side but never reach TTA correctly.
Step 4: Test before you trust it
Before going live:
- Trigger a test alert manually from TradingView.
- Confirm the position appears on ApeX Pro within a few seconds, with the correct size, stop loss, and take profit.
Common mistakes
- Missing the slash in the symbol —
BTCUSDTis rejected; it has to beBTC/USDT, copied exactly as it appears in the pair’s URL on ApeX. - Spacing around the
=—Quantity = 50%is invalid; it must beQuantity=50%with no spaces on either side. - Wrong alert placeholder — sending an empty or malformed message when alerting from a strategy script because the wrong placeholder variable was used.
- Expecting SL/TP as parameters on the entry order — ApeX doesn’t support that; a stop-loss or take-profit is a separate
Stop_Market/Take_Profit_Marketorder, usually stacked as a second command line in the same alert. - More than 5 commands in one alert — TTA only reads the first 5 lines; anything beyond that is ignored.
- Order size below the market minimum — like most perpetuals exchanges, ApeX enforces a minimum contract size per market; a
Q=value below it gets rejected silently. - Alert firing on every tick instead of bar close — causes duplicate or premature trade commands. Set your alert frequency to “Once Per Bar Close” unless your strategy needs tick-level triggers.
- Webhook URL typos — even one missing character means the alert never reaches TTA. Copy-paste it rather than retyping.
You’re set up — what’s next
The same setup works for TTA’s other supported platforms like Aster, Binance, Bybit, Coinbase, Kraken, KuCoin, OKX, Bitget, BingX, MEXC, Hyperliquid, MetaTrader 4/5, TradeLocker, Tradovate, Deriv, Capital.com, and several others — plus non-broker destinations like Telegram, Discord, and Google Sheets.
Ready to connect your own account? Start today →