Signal trading bots have revolutionized the way traders execute strategies, and OKX’s Signal Bots now allow TradingView users and signal providers to deploy their custom bots based on TradingView signals. Follow this step-by-step guide to start trading with signals on OKX.
Step 1: Access the Signal Bot Page
- Log in to your OKX account.
- Navigate to Trade → Trading Bots → Marketplace.
- Select the Signal Bot tab and click Create.
Step 2: Create Your Custom Signal
- Click Add Custom Signal to configure your signal.
- Name your signal and add an optional description (max 500 characters).
- Select Create Signal to proceed.
Key Features:
- TradingView Mode: For users leveraging Pine Script™ "Strategy" scripts with
strategy.*()functions. - Custom Mode: For "Indicator" scripts, chart-based alerts, or third-party signal providers.
Understanding Pine Script™ Modes:
1. Strategy Mode
- Designed for backtesting and live trading with
strategy.*()functions. - Simulates order execution via TradingView’s broker emulator.
2. Indicator Mode
- Focuses on technical calculations without backtesting.
- Lighter on resources and faster than Strategy mode.
Step 3: Configure Signal Alerts
3.1 For Strategy Script Users:
- Save and add your script to the chart via Pine Editor.
- Set order parameters (e.g., size in USDT, contracts, or % equity).
- Create an alert with the condition set to your script and enable Order Fills Only.
- Paste the OKX alert template (from Alert Message Specifications) into TradingView’s alert message field.
- Enter your Webhook URL (copied from OKX) in TradingView’s Notifications tab.
3.2 For Indicator Script Users:
- Add your script to the chart.
- Set an
alertcondition()(e.g., MACD Golden Cross) and use OKX’s alert template. - Link the Webhook URL.
3.3 For Chart Analysis Users:
- Create an alert based on technical tools (e.g., RSI-14 crossing 30).
- Use OKX’s alert template and Webhook URL.
3.4 For Third-Party Providers:
- Send signals via Python or other APIs. Ensure IP whitelisting by contacting OKX support.
Step 4: Set Up Your Signal Bot
Click Create Bot and configure:
- Trading pairs.
- Leverage and investment amount.
- Order types (market/limit).
- Take-profit (TP) and stop-loss (SL) levels.
- Confirm settings to activate the bot.
Step 5: Monitor and Manage Your Bot
- Track performance via the Bot Details tab.
- Adjust collateral, manually place orders, or close positions.
- Stop the bot to cancel all open orders.
Frequently Asked Questions (FAQ)
Q1: What’s the difference between Strategy and Indicator modes?
- Strategy Mode: For backtesting and live execution with
strategy.*()functions. - Indicator Mode: For technical calculations without order execution.
Q2: How do I set up alerts for third-party tools?
- Use APIs to send signals to OKX’s Webhook URL. Contact support for IP whitelisting.
Q3: Can I modify alert templates?
- Yes, but ensure compliance with OKX’s Alert Message Specifications.
Q4: How do I troubleshoot signal delays?
- Check
maxLagsettings and ensure TradingView alerts are configured for real-time triggers.
Appendix
A. Example MACD Script for TradingView:
//@version=5
strategy("MACD Strategy", overlay=true)
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
goldenCross = ta.crossover(macdLine, signalLine)
deathCross = ta.crossunder(macdLine, signalLine)
alertcondition(goldenCross, "MACD Golden Cross", "")
alertcondition(deathCross, "MACD Death Cross", "")B. Python Webhook Example:
import requests
signal_data = {
"action": "ENTER_LONG",
"instrument": "BTC-USDT-SWAP",
"signalToken": "YOUR_TOKEN",
"timestamp": "2023-10-01T12:00:00.000Z",
"investmentType": "percentage_balance",
"amount": "100"
}
response = requests.post("https://www.okx.com/join/BLOCKSTARalgo/signal/trigger", json=signal_data)