Table of Contents
- Accessing the Signal Bot
- Creating a Signal
- Configuring TradingView Alerts
- Setting Up the Signal Bot
- Monitoring and Managing Your Bot
- FAQs
- Appendices
1. Accessing the Signal Bot
- Log in to your OKX account.
- Navigate to Trade → Trading Bots → Marketplace.
- Select the Signal Bot subtab and click Create.
👉 Start trading with OKX's Signal Bot
2. Creating a Signal
- Click Add Custom Signal to configure your TradingView signal.
- Name your signal and add a description (up to 500 characters).
- Click Create Signal to generate a webhook URL and AlertMsg specifications.
Two Alert Configuration Methods:
- TradingView: For users leveraging
strategy.*()functions in Pine Script. - Custom: For indicators, chart alerts, or third-party programs.
3. Configuring TradingView Alerts
3.1 Pine Script Strategy Guide
- Use
strategy.*()functions to automate trades. Key Settings:
- Order Size: Define in USDT, contracts, or % of equity.
- Investment Type: Match OKX parameters (e.g.,
"amount": "{{strategy.order.contracts}}").
👉 Optimize your strategy with OKX
3.2 Indicator/Study Script Guide
- Configure alerts for technical signals (e.g., MACD crossovers).
- Supported Messages:
ENTER_LONG,EXIT_LONG,ENTER_SHORT,EXIT_SHORT.
3.3 Chart Analysis Guide
- Set alerts based on RSI, moving averages, etc.
3.4 Third-Party Program Guide
- Use Python or APIs to send signals.
4. Setting Up the Signal Bot
Basic Settings:
- Trading pair, leverage, margin allocation.
Advanced Customization:
- Order types (market/limit).
- Take-profit/stop-loss levels.
- Deploy: Click Confirm to activate the bot.
5. Monitoring and Managing Your Bot
- View Performance: Track ROI, open positions, and order history.
Manual Adjustments:
- Adjust margins.
- Place manual orders.
- Liquidate positions.
6. FAQs
Q1: How do I test my TradingView strategy with OKX?
- Backtest in TradingView, then sync parameters with OKX’s webhook.
Q2: Can I use custom indicators?
- Yes! Use the "Custom" alert method for non-strategy scripts.
Q3: What’s the minimum investment?
- Varies by trading pair. Start with 10 USDT for testing.
7. Appendices
A. Sample MACD Script
//@version=5
indicator('MACD Demo')
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
alertcondition(ta.crossover(macdLine, signalLine), "Golden 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"
}
response = requests.post("https://www.okx.com/join/BLOCKSTARalgo/signal/trigger", json=signal_data)