SignalBee
All Guides
OKX10 minutes

How to Connect TradingView to OKX for Automated Trading

Automate your TradingView strategy on OKX in under 10 minutes. OKX is a major global exchange offering spot, futures, and options trading with advanced features for professional traders.

What You'll Need

Before starting, ensure you have:

  • TradingView Pro or higher - Webhooks require a paid TradingView subscription
  • Verified OKX account - Identity verification (KYC) completed
  • SignalBee account - Free to sign up at signalbee.trade
  • 5-10 minutes - Quick setup process

Step 1: Create Your OKX API Key

Create an API key on OKX with trading permissions.

  1. Log in to OKX
  2. Click your profile icon → API
  3. Click Create API Key
  4. Select API trading

Configure API Settings

SettingValue
API Key NameSignalBee Trading
PassphraseCreate a secure passphrase (you'll need this!)
PermissionsTrade

Required Permissions

PermissionEnable?
Read✅ Yes
Trade✅ Yes
WithdrawNever
  1. Complete 2FA verification
  2. Save your API Key, Secret Key, AND Passphrase

OKX Requirement: OKX requires a passphrase for API authentication. You must provide this to SignalBee along with your API key and secret.

Step 2: Connect OKX to SignalBee

Link your OKX credentials to SignalBee.

  1. Log in to SignalBee
  2. Go to Exchanges in the sidebar
  3. Click Add Exchange → Select OKX
  4. Enter your API Key
  5. Enter your Secret Key
  6. Enter your Passphrase (OKX-specific requirement)
  7. Click Save and Test Connection
  8. Verify you see ✅ "Connection successful"

Your OKX balances should now appear in SignalBee.

Step 3: Create Your SignalBee Webhook

SignalBee provides a unique webhook URL for your alerts.

  1. In SignalBee, go to Webhooks
  2. Click Create Webhook
  3. Select your OKX exchange connection
  4. Copy your webhook URL

Step 4: Configure Your Trading Settings

Set up safety limits before enabling trading.

  1. Go to Configuration in SignalBee
  2. Whitelist pairs you want to trade (e.g., BTC-USDT, ETH-USDT)
  3. Set Max order size to limit trade amounts
  4. Enable Trading when ready

OKX Ticker Format

OKX uses hyphenated ticker format:

TypeFormatExample
SpotBASE-QUOTEBTC-USDT, ETH-USDT
PerpetualBASE-USDT-SWAPBTC-USDT-SWAP

Use the appropriate format based on your trading type.

Step 5: Set Up Your TradingView Alert

Connect TradingView to SignalBee.

  1. Open TradingView and load your strategy
  2. Click Alert (clock icon)
  3. Configure your alert conditions
  4. In Notifications, enable Webhook URL
  5. Paste your SignalBee webhook URL
  6. In the Message field, enter your signal JSON:
{
  "action": "buy",
  "ticker": "BTC-USDT",
  "quantity_type": "percentage",
  "quantity": "50"
}

Signal Format Reference

FieldRequiredValues
actionYesbuy, sell, or close
tickerYesOKX pair (e.g., BTC-USDT)
quantity_typeYespercentage or fixed
quantityYesAmount to trade

Example signals:

Buy 40% of USDT balance:

{"action": "buy", "ticker": "BTC-USDT", "quantity_type": "percentage", "quantity": "40"}

Sell 2 ETH:

{"action": "sell", "ticker": "ETH-USDT", "quantity_type": "fixed", "quantity": "2"}

Step 6: Test Your Setup

Verify everything works.

  1. In TradingView, click Test on your alert
  2. In SignalBee, check Signals page
  3. Verify Orders shows the executed trade
  4. Confirm in OKX trade history

OKX-Specific Notes

Account Modes

OKX supports different account modes:

ModeDescription
SimpleSingle currency margin
Single-currency MarginOne margin currency
Multi-currency MarginMultiple margin currencies
Portfolio MarginCross-margin across products

Check your OKX account settings to understand your mode.

Trading Fees

TierMakerTaker
Lv 10.08%0.10%
Lv 20.07%0.09%
VIPLower rates

Fee discounts available with OKB holdings.

Minimum Order Sizes

PairMinimum
BTC-USDT0.00001 BTC
ETH-USDT0.0001 ETH
Most pairs~$5 USD equivalent

Passphrase Security

Your OKX API passphrase:

  • Is required for every API call
  • Should be unique and secure
  • Is stored encrypted in SignalBee
  • Cannot be recovered if lost (create new API key)

Troubleshooting

IssueSolution
Invalid passphraseVerify passphrase matches exactly (case-sensitive)
API key invalidCheck key hasn't expired or been revoked
Instrument not foundUse OKX format (BTC-USDT not BTCUSDT)
No trading permissionEnable Trade permission in OKX API settings

Summary

You've connected TradingView to OKX in 6 steps:

  1. ✅ Created OKX API key with passphrase
  2. ✅ Connected OKX to SignalBee (including passphrase)
  3. ✅ Created a SignalBee webhook
  4. ✅ Configured settings with OKX ticker format
  5. ✅ Set up TradingView alert with webhook
  6. ✅ Tested the complete flow

Your TradingView strategy now executes automatically on OKX.


Need help? Contact support@signalbee.trade or visit our Help Center.