With the launch of signal bots, users and signal providers can now publish and configure signal bots using their custom TradingView signals. To start trading on OKX with signals, follow this detailed guide.
Step 1: Access the Signal Bot
- Log in to your OKX account.
- Navigate to Trade > Trading Bots > Marketplace.
- Select the Signal Bot subtab and click Create.
Step 2: Create a Signal
- Click Add Custom Signal.
- Name your signal and add an optional description (up to 500 characters).
- Click Create Signal to proceed.
Key Specifications:
- TradingView: For users leveraging TradingView strategy scripts (
strategy.*()functions). - Custom: For users using TradingView indicators, chart alerts, or third-party programs.
👉 Explore Advanced Signal Configurations
Step 3: Configure TradingView Alerts
For Strategy Script Users (strategy.*()):
- Configure your Pine Script strategy in the Pine Editor.
- Set order parameters (USDT, contracts, or % equity).
- Generate alerts using
strategy.ordertemplates.
Example Alert Message:
{
"id": "{{strategy.order.id}}",
"action": "{{strategy.order.action}}",
"instrument": "{{ticker}}",
"signalToken": "YOUR_TOKEN",
"investmentType": "base",
"amount": "{{strategy.order.contracts}}"
}For Indicator Script Users:
- Define conditions (e.g., MACD Golden Cross).
- Use OKX’s
ENTER_LONG/EXIT_SHORTtemplates for alerts.
For Chart Analysis Users:
- Set alerts based on technical conditions (e.g., RSI-14 crosses 30).
- Insert OKX’s
AlertMsgspecifications in the alert message.
Step 4: Signal Bot Setup
- Click Create Bot.
Configure:
- Tradable pairs
- Leverage ratio
- Margin allocation
Advanced settings:
- Order type (Market/Limit)
- Take-profit/Stop-loss levels
Step 5: Monitor and Manage Your Bot
- Track performance via Bot Details.
- Manually adjust margins or close positions.
- Stop the bot to cancel pending orders.
FAQ
Q: How do I ensure TradingView alerts match OKX orders?
A: Use the investmentType: "base" and amount: "{{strategy.order.contracts}}" settings in your alert template.
Q: Can I use third-party programs to send signals?
A: Yes, but whitelist your IP with OKX support for live trading.
Q: What if my bot stops unexpectedly?
A: Check the Signal Logs in Bot Details for error resolution.
👉 Learn More About Signal Trading
Appendix
A. Sample MACD Script with Alerts
//@version=5
indicator("MACD Alert Example")
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
alertcondition(ta.crossover(macdLine, signalLine), "Golden Cross", "")B. Python Webhook Request Example
import requests
signal_data = {
"action": "ENTER_LONG",
"instrument": "BTC-USDT-SWAP",
"signalToken": "YOUR_TOKEN",
"investmentType": "percentage_balance",
"amount": "100"
}
requests.post("https://www.okx.com/join/BLOCKSTARalgo/signal/trigger", json=signal_data)C. Recommended Scripts
- RSI Strategy: TradingView Link
- Turtle Trading Rules: TradingView Link