With the launch of signal bots, TradingView users and signal providers can now publish and configure a signal bot using their TradingView signals. Follow the step-by-step guide below to start trading with signals on OKX.
Step 1: Access the Signal Bot
Log in to your OKX account, navigate to Trading -> Trading Bots -> Marketplace. Then, select the Signal Bot subsection and click "Create."
Step 2: Create Your Signal
- Click "Add Custom Signal" to begin.
- Name your signal and optionally add a description (up to 500 characters).
- Select "Create Signal" to proceed.
Key Configurations:
- TradingView: For users leveraging Pine Script™ strategy functions.
- Custom: Suitable for indicators, chart alerts, or third-party programs.
Pine Script™ Overview: Strategy vs. Indicator
- Strategy: Backtests historical data and forwards tests live markets using
strategy.*()functions. - Indicator: Focuses on calculations without backtesting, ideal for chart analysis.
Step 3: Configure TradingView Alerts
3.1 For Strategy Scripts:
- Save and add your script to the chart.
- Set order parameters (e.g., size in USDT, contracts, or equity percentage).
Use the OKX-provided alert message template in TradingView’s "Message" field.
Example template for USDT-based orders:
{ "action": "{{strategy.order.action}}", "instrument": "{{ticker}}", "investmentType": "base", "amount": "{{strategy.order.contracts}}" }
3.2 For Indicators/Study Scripts:
- Add the script to your chart.
- Configure alerts with OKX’s message template (e.g.,
ENTER_LONG,EXIT_SHORT).
3.3 For Chart Analysis:
- Set conditions (e.g., RSI crossing 30).
- Paste the OKX alert message template into TradingView.
3.4 For Third-Party Programs:
Use Python or similar tools to send webhook requests. Example:
import requests
signal_data = {
"action": "ENTER_LONG",
"instrument": "BTC-USDT-SWAP",
"signalToken": "YOUR_TOKEN",
"investmentType": "percentage_balance",
"amount": "100"
}
response = requests.post('https://www.okx.com/join/BLOCKSTARalgo/signal/trigger', json=signal_data)Step 4: Set Up Your Signal Bot
Select "Create Bot" and define:
- Trading Pairs
- Leverage Ratio
- Margin Allocation
Advanced settings:
- Order type (Limit/Market)
- Take Profit/Stop Loss levels
- Confirm to launch the bot.
Step 5: Monitor and Manage Your Bot
- View performance metrics under Bot Details.
- Manually adjust margin, place orders, or close positions.
- Stop the bot anytime to liquidate positions.
👉 Explore Advanced Signal Bot Strategies
Appendix
Example Scripts:
FAQ
Q: How do I align TradingView order settings with OKX?
A: Ensure investmentType and amount match your strategy (e.g., base for USDT, percentage_balance for equity %).
Q: Can I modify alert templates?
A: Yes, but adhere to OKX’s specifications to avoid errors.
Q: What if my third-party IP isn’t whitelisted?
A: Contact OKX support to validate external signals.