How auto trading works

Updated

Auto trading lets your OptiTrade signals place the trades for you. You connect your broker account once, then create one alert in TradingView. After that, every signal becomes a trade.

What auto trading looks like on your platform

Open your access page, pick your platform, then open Auto trading. This is what each platform shows.

PlatformWhat you do
TradingViewConnect your broker account. When your indicator gives a signal, the trade is placed for you.
WebullWebull can't be connected here yet. Trade from your TradingView chart: Trading Panel → Webull. You can still connect your other brokers.
MetaTrader 5Let MetaTrader place the trades for you. You get auto-trading files to put in MetaTrader (see below).
MetaTrader 4Auto trading for MetaTrader 4 is not ready yet. Until then, use it on MetaTrader 5 or through TradingView.
cTraderLet cTrader place the trades for you. You get auto-trading files to install in cTrader (see below).
NinjaTrader 8Let NinjaTrader 8 place the trades for you. The strategies are in your download (see below).
TradovateConnect your Tradovate account. TradingView alerts place the trades.
thinkorswimthinkorswim can't place trades automatically from a study. To trade automatically, use the indicator on TradingView and connect your broker.

MetaTrader 5

  1. Download the auto-trading files.
  2. In MetaTrader, click File → Open Data Folder → MQL5 → Experts and put the files there. Then right-click Expert Advisors in the Navigator and click Refresh.
  3. Drag one onto a chart, paste the same key as your indicators into Licence key (Inputs tab) and tick Allow Algo Trading.
  4. Try it on a demo account first. It trades a real account only if Allow real account is switched on.

It trades while MetaTrader is open. To keep it running with your computer off, use a MetaTrader VPS (MetaTrader: Navigator → right-click your account → Register a Virtual Server).

cTrader

  1. Download the auto-trading files.
  2. Double-click each file. cTrader installs it.
  3. In cTrader, open Algo → cBots, add one to a chart, type your order email into Order email and click Start.
  4. Try it on a demo account first. It trades a real account only if Allow live account (real money) is switched on.

To keep it running with your computer off, start it in the cloud: click Start in cloud in cTrader. Then you can start and stop it from the cTrader phone app. Not every broker allows this.

NinjaTrader 8

  1. Download the files.
  2. In a chart, click Strategies, add the OptiTrade ... Strategy you want, type your order email into Order email and set Enabled.
  3. Try it on the Sim account first. It trades a real account only if Allow live account (real money) is switched on.

It trades while NinjaTrader is open (a Windows VPS keeps it running).

TradingView, Webull, Tradovate and thinkorswim use your broker connection and a TradingView alert. The rest of this page is about that.

Before you start

  • A paid TradingView plan with 2-factor login turned on. TradingView alerts need both to send orders.
  • A trading account at one of the brokers below. Most have fake money (practice) accounts, which are free. Test there first.
  • A strategy on your chart: OptiTrade 2.0 – TP-SL, OptiTrade 2.0 – HWR, OptiTrade 2.0 – Buy-Sell or OptiTrade V1.0. The bonus indicators don't place orders.

Not on a paid plan yet? You can connect your broker now and add the alert after you upgrade.

Where is your trading account?

In Auto trading, pick your broker from the list. Brokers are grouped as Forex and CFDs, Crypto, Stocks and Futures. Pick the one where you trade.

Fake money (practice) or real money

Switch between Fake money (practice) and Real money. Start with fake money to see it work. If the page says real money is coming soon, practice with fake money now.

Get your broker keys

After you pick a broker, the page shows Get your OANDA keys (with your broker's name) and an Open OANDA button. It opens your broker's own page in a new tab. Follow the steps there, then come back and paste the keys. Stuck? Click Where are these? next to the key fields: the same steps open right there.

In the steps below, "above" and "below" mean the Auto trading screen on your access page: the Open button is above, the key fields are below.

Steps for each broker

Find your broker. Each one lists where it is open, whether it has fake money, and the exact clicks.

Forex and CFDs

Capital.com

Where Capital.com is open. It has fake money (practice).

  1. Click Open Capital.com above and log in. Turn on 2-step verification in your settings.
  2. For fake money, switch to your Demo account.
  3. Open Settings, then API integrations, and click Generate new key.
  4. Name the key, set a key password and confirm with your 2-step code.
  5. Paste the API key, your login email and the key password below.

We only use this login to place the trades your signals send and to check your open positions. We never move or withdraw money.

Biggest trade allowed: Any trade bigger than this is skipped. 1,000 = the smallest trade (0.01 lot).

IG

Where IG is open. It has fake money (practice).

  1. Click Open IG above and log in. Open My Account, then API key.
  2. Type a name and click Generate new key.
  3. For fake money, switch to your IG demo account and make a key there too.
  4. Your CFD account number is in the account switcher.
  5. Paste the API key, your IG username and password and the CFD account number below.

We only use this login to place the trades your signals send and to check your open positions. We never move or withdraw money.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in contracts.

OANDA

Forex and CFDs. It has fake money (practice).

  1. Click Open OANDA above and log in. For fake money, log in with your practice account.
  2. Click Generate (or Show) and copy your API token.
  3. Copy your Account ID. It looks like 101-004-1234567-001.
  4. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. 1,000 = the smallest trade (0.01 lot).

Crypto

Binance

Worldwide except US. It has fake money (practice).

Fake money (practice)

  1. Click Open Binance above. This is Binance's practice site, it only has fake money. Click Log In with GitHub.
  2. Click Generate HMAC_SHA256 Key and give it any name.
  3. Copy the API Key and the Secret Key now. The Secret Key shows only once.
  4. Paste both below.

Real money

  1. Click Open Binance above and log in.
  2. Click Create API, then choose Self-generated.
  3. Click Make my key pair below. Copy the public key it shows and paste it into Binance.
  4. Tick Enable Spot & Margin Trading. Leave Withdrawals switched off. Don't limit the key to certain IP addresses.
  5. Copy the API Key Binance shows and paste it below. We fill in the private key for you.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Binance Futures

Worldwide except US. It has fake money (practice).

  1. Open a USDT-M Futures account in Binance first. Then click Open Binance Futures above and log in. For fake money, it opens Binance's demo site.
  2. Click Create API, then choose Self-generated.
  3. Click Make my key pair below. Copy the public key it shows and paste it into Binance.
  4. Tick Enable Futures. Leave Withdrawals switched off. Don't limit the key to certain IP addresses.
  5. Copy the API Key Binance shows and paste it below. We fill in the private key for you.
  6. In your Binance Futures settings, set Position Mode to One-way.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Binance.US

US residents only. It has real money only.

  1. Click Open Binance.US above and log in.
  2. Click Create API, then choose Self generated.
  3. Click Make my key pair below. Copy the public key it shows and paste it into Binance.US.
  4. Tick Enable Spot Trading. Leave Withdrawals switched off.
  5. Copy the API Key and paste it below. We fill in the private key for you.
  6. Binance.US wants at least one trade every 90 days.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

BingX

Worldwide, region limits apply. It has fake money (practice).

  1. Click Open BingX above and log in.
  2. Click Create API Key and give it a name.
  3. Tick Spot trading and Futures trading. Leave Withdrawals switched off.
  4. Copy the API Key and the Secret Key.
  5. Paste both below, then pick fake or real money above.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Bitfinex

Most countries, not the US. It has real money only.

  1. Click Open Bitfinex above, log in and click Create Key. Make a new key just for this and use it nowhere else.
  2. Tick Orders (read and write), Wallets (read) and Account (read). Leave withdraw off.
  3. Confirm the link Bitfinex emails you, then copy the API Key and the Secret.
  4. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Bitget

Most countries. It has fake money (practice).

Fake money (practice)

  1. Click Open Bitget above and log in. Then switch to Demo Trading.
  2. Click Create API Key. Choose a passphrase and System-generated API Key.
  3. Tick Read and Trade for Spot and Futures. Leave withdrawals switched off.
  4. Copy the API Key and the Secret Key now. The Secret shows only once.
  5. Use one-way position mode, then paste the key, the secret and the passphrase below.

Real money

  1. Click Open Bitget above and log in.
  2. Click Create API Key. Choose a passphrase and System-generated API Key.
  3. Tick Read and Trade for Spot and Futures. Leave withdrawals switched off.
  4. Copy the API Key and the Secret Key now. The Secret shows only once.
  5. Use one-way position mode, then paste the key, the secret and the passphrase below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Bybit

Worldwide except US and China. It has fake money (practice).

Fake money (practice)

  1. Click Open Bybit above and log in. Then switch to Demo Trading.
  2. Hover your profile picture and click API.
  3. Create a System-generated API Key with Read-Write permission.
  4. Tick Spot and Contracts trading. Leave Withdrawals switched off.
  5. Copy the API Key and the Secret now. The Secret shows only once.
  6. Set Position Mode to One-way, then paste both below.

Real money

  1. Click Open Bybit above and log in.
  2. Click Create New Key and choose a System-generated API Key with Read-Write permission.
  3. Tick Spot and Contracts trading. Leave Withdrawals switched off.
  4. Copy the API Key and the Secret now. The Secret shows only once.
  5. Set Position Mode to One-way, then paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Coinbase

Where Coinbase Advanced is open. It has real money only.

  1. Click Open Coinbase above, log in and go to Secret API Keys.
  2. Click Create API key.
  3. Choose ECDSA as the signature type. Don't pick the other one.
  4. Turn Trade on. Leave Transfer off.
  5. Copy the API key name and the private key now. The private key shows only once.
  6. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Gate.io

Most countries, not the US. It has fake money (practice).

  1. Click Open Gate.io above, log in and click Create API Key. For fake money, use Gate's practice site.
  2. Choose key type API v4 Key and account type Classic Account.
  3. Choose Read and Write for Spot and Futures. Leave withdrawals off and leave IP binding empty.
  4. Copy the API Key and the Secret now. The Secret shows only once.
  5. In Futures, set the position mode to one-way, then paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Kraken

Wherever Kraken accepts you. It has real money only.

  1. Click Open Kraken above and log in.
  2. Click Create API key.
  3. Under Nonce window, type 5000.
  4. Tick Query Funds and the order permissions. Leave every Withdraw permission switched off.
  5. Copy the API Key and the Private Key now. The Private Key shows only once.
  6. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Kraken Futures

Where Kraken Futures is open. It has real money only.

  1. Click Open Kraken Futures above and log in. Use your Kraken Futures login, not your normal Kraken login.
  2. Open Settings, then API, then the Create Key tab.
  3. Under General API, choose Full Access. Leave the Withdrawal API off.
  4. Copy the Public Key and the Private Key now. The Private Key shows only once.
  5. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

KuCoin

Most countries. It has real money only.

  1. Click Open KuCoin above and log in.
  2. Click Create API. Name it and choose a passphrase you will remember.
  3. Keep General, Spot and Futures switched on. Leave Withdrawal and Transfer switched off.
  4. Copy the API Key and the Secret now. The Secret shows only once.
  5. In KuCoin Futures, use one-way position mode and cross margin.
  6. Paste the key, the secret and the passphrase below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

MEXC

Most countries, not US. It has real money only.

  1. Click Open MEXC above and log in.
  2. Click Create API Key and choose Spot.
  3. Tick Spot account: read and Spot trade: place orders. Leave withdrawals switched off.
  4. Copy the Access Key and the Secret Key now. The Secret shows only once.
  5. Paste both below. A key without a linked IP address stops working after 90 days, so make a new one then.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

OKX

Global, EU, US and AU accounts. It has fake money (practice).

Fake money (practice)

  1. Click Open OKX above and log in. Then switch to Demo Trading.
  2. Click Create API key and name it. Choose a passphrase you will remember.
  3. Set the permission to Trade. Leave Withdraw switched off.
  4. Copy the API Key and the Secret Key.
  5. Paste the key, the secret and the passphrase below. Type your region too.

Real money

  1. Click Open OKX above and log in.
  2. Click Create API key and name it. Choose a passphrase you will remember.
  3. Set the permission to Trade. Leave Withdraw switched off.
  4. Copy the API Key and the Secret Key.
  5. Paste the key, the secret and the passphrase below. Type your region too.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in coins.

Stocks

Alpaca

US stocks and crypto. It has fake money (practice).

  1. Click Open Alpaca above and log in. For fake money, use your paper (practice) account.
  2. In the API Keys box, click Generate New Keys.
  3. Copy the API key and the Secret now. The Secret shows only once.
  4. Paste both below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in shares, or coins for crypto.

tastytrade

US accounts only. It has fake money (practice).

  1. Click Open tastytrade above and log in. Turn on two-factor login under Manage → My Profile → Security.
  2. Under Manage → My Profile → API, click New OAuth client.
  3. Choose the read and trade scopes and copy the Client Secret.
  4. Click Manage, then Create Grant, and copy the Refresh Token.
  5. Paste both and your Account Number below.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in shares.

Tradier

US accounts only. It has fake money (practice).

  1. Click Open Tradier above and log in.
  2. Copy the Sandbox Access Token for fake money, or the Live one for real money.
  3. Copy your Account Number. Fake-money ones start with VA.
  4. Paste both below. If you make a new token later, paste it here again.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in shares.

Futures

Tradovate

CME futures, mainly US traders. It has fake money (practice).

  1. Tradovate needs its API add-on and a funded account for this. Click Open Tradovate above and log in.
  2. Open Application Settings, then API Access.
  3. Click Generate API Key and allow trading.
  4. Copy the key ID and the secret now.
  5. Paste both below, with your Tradovate username, password and account name.

We only use this login to place the trades your signals send and to check your open positions. We never move or withdraw money.

Biggest trade allowed: Any trade bigger than this is skipped. Counted in contracts.

When it works you see Connected with your account. If your broker refuses the keys, the page says why right there.

Create the alert in TradingView

After you connect, Auto trading shows Create the alert in TradingView with a webhook URL and an alert message, each with a copy button. The URL shows in full only once, right after you connect: copy it then. Keep it private: anyone with it can send orders to your account. If you lose it, click Make a new URL (the old one stops working). The alert message is the same for every indicator.

The alert, step by step

  1. On a computer, open your chart with the OptiTrade strategy on it.
  2. Click Alert in the top toolbar (the alarm clock), then Create manually.
  3. Under Condition, pick your strategy. Choose Order fills only.
  4. Click Message, delete everything in the box, paste the alert message and click Apply.
  5. Click Notifications, tick Webhook URL, paste your webhook URL and click Apply.
  6. Click Create.

Check that it works

With fake money, click Send a test order above Recent orders. It buys the smallest size and closes it again. You should see a Test: line for the buy and one for the sell. After that, every signal your alert fires shows up in the same list. Click Refresh to load new lines.

Biggest trade allowed

The strategy decides the size from its own settings. Biggest trade allowed is your limit: a bigger order is skipped, never shrunk. Each broker above says what it counts in. Start small, and use a separate account for auto trading, so its trades don't mix with your own.

If no order was sent

Open Recent orders in Auto trading. Each alert has one line that says what happened to it.

Nothing in Recent orders
The alert didn't reach us. Click Refresh. In TradingView, open the Alerts window → Log and check that it fired. If not, create it again from the updated chart and check the webhook URL.
Ignored: not an order message
The Message box doesn't hold the alert message. Delete everything in it and paste the message from Auto trading again.
Refused by broker
Your broker said no to the keys or the order. The line says why. Make new keys at your broker, click Remove, then connect again with the new keys and put the new webhook URL in your alert.
Skipped: 90 is above your max of 5
The order is bigger than Biggest trade allowed. Click Change next to Biggest trade to raise it, or lower the size in the strategy's settings.
Skipped: plan not active
Your OptiTrade access has ended. Renew it, then the next signal goes through.
Skipped: market closed, entry skipped
Stock brokers trade only while the market is open. Closing orders still go through.
Skipped: alert arrived late
TradingView delivered it more than 2 minutes after the signal, so the entry was skipped. The next signal works as usual.

Turning it off

Click Pause in Auto trading: new entries are skipped, closing orders still go through. Resume turns it back on. Remove deletes your keys and stops the webhook URL. Open positions stay open at your broker: close them there. After you update an indicator, delete the alert and create it again from the updated chart.

© 2026 OptiTrade. All rights reserved.