Capital.com Guide
Connect TradingView to Capital.com (stocks, forex, crypto, commodities, indices) using TradeAdapter’s direct API integration. This guide covers strategy alerts with the Message Generator.
Video walkthrough #
Capital.com + TradingView setup
1 — Create Capital.com API keys #
Capital.com uses API keys with a dedicated API password (different from your account password). Generate the key from your profile.
-
Go to your Profile
Log in to Capital.com and open your Profile page. Press Generate API Key.
-
Create API key and password
Name your API key and create an API Password — use a dedicated password for the API, not your account password. Save both the API Key and API Password; you will use them in the alert message as
broker_api_keyandbroker_pass. Yourbroker_emailis your Capital.com login email.
2 — Select the Capital.com symbol in TradingView #
Open TradingView and search for the symbol that matches the instrument you trade on Capital.com (stocks, forex, crypto, commodities, indices). The {{ticker}} placeholder will send this symbol to TradeAdapter.
Important
The symbol must exist on Capital.com. Use order_market": "stock_forex" in your message. Check supported symbols for lot size and precision.
Capital.com Supported Symbols — Shares (and other tabs: Crypto, Commodities, Currencies, Indices on the same page).
3 — Add your strategy #
Capital.com supports strategy alerts. Load your Pine Script strategy onto the chart so it generates the trading signals.
Strategy
Use the Capital.com Message Generator. One alert with trigger “Order fills only”. TradingView fills action, size, and price via {{strategy.order.action}}, {{strategy.order.contracts}}, {{strategy.order.price}}.
Not sure if you have a strategy or an indicator? See Indicator vs Strategy.
4 — Configure order size #
Set your strategy’s position size so that {{strategy.order.contracts}} meets the symbol’s rules on Capital.com (lot size, tick size). For Limit orders, ensure {{strategy.order.price}} respects the symbol’s precision. Check the supported symbol lists for details.
5 — Create the TradingView alert #
Press Alt + A (or the alarm clock icon) to create a new alert.
Strategy → one alert
Under Condition, select your strategy and set trigger to “Order fills only”. TradingView fills action, size, and price via the strategy placeholders.
Required: Webhook URL + Message
In Notifications, enable Webhook URL and paste your personal webhook: https://tradeadapter.com/api/v3/YOUR_TRADEADAPTER_KEY. Your TradeAdapter key is in your TradeAdapter profile. Paste the JSON message in the Message field — build it with the Capital.com Message Generator.
You can also use Email Alert (plain text) if you’re on TradingView Basic; see the connect page for email setup.
Important: Recreate the TradingView alert each time you change your Pine Script strategy parameters.
Alert message (Strategy) #
Use this template for strategy-based alerts. Replace the placeholder values with your Capital.com email, API key, and API password. Keep order_market as stock_forex. Keep the TradingView placeholders as-is.
{
"broker_email": "PUT YOUR CAPITAL.COM EMAIL HERE",
"broker_api_key": "PUT YOUR CAPITAL.COM API KEY HERE",
"broker_pass": "PUT YOUR CAPITAL.COM API PASSWORD HERE",
"real_order": "No",
"order_type": "Market",
"order_market": "stock_forex",
"exchange": "capital_com",
"account_id": "default",
"ticker": "{{ticker}}",
"time": "{{timenow}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.order.action}}",
"order_price": "{{strategy.order.price}}"
}
Message fields explained #
| Field | Description |
|---|---|
broker_email |
Your Capital.com account email (login email). |
broker_api_key |
Your Capital.com API Key from the profile (Generate API Key step). |
broker_pass |
The API Password you set when creating the API key (not your account password). |
real_order |
"Yes" sends real orders to Capital.com. "No" sends test orders via TradeAdapter only. |
order_type |
"Market" or "Limit". For Limit orders, order_price is used as the limit price. |
order_market |
Use "stock_forex" for Capital.com. |
exchange |
Must be "capital_com" so TradeAdapter routes the order to Capital.com. |
account_id |
Use "default" unless you have a specific account ID. |
ticker |
The TradingView symbol from {{ticker}}. |
order_contracts |
Position size from your strategy ({{strategy.order.contracts}}). |
order_action |
"buy" or "sell". Use {{strategy.order.action}} for strategies. |
order_price |
Price from the strategy ({{strategy.order.price}}), used for Limit orders. |
6 — Execute & monitor #
-
Start with test orders
Set
"real_order": "No"and trigger a few alerts. Check MyTrades to see how TradeAdapter interprets your signals. -
Verify on Capital.com
When you set
"real_order": "Yes", monitor your Capital.com account to confirm orders execute as expected. -
Recreate alerts after changes
If you change strategy parameters or the message, delete and recreate the TradingView alert so the new values are applied.
Important notes #
API password — Use a dedicated API password for TradeAdapter, not your Capital.com account password.
Webhook URL — Use
https://tradeadapter.com/api/v3/YOUR_KEY. Your key is in your TradeAdapter profile.
Recreate alerts after changes — If you change strategy parameters or message fields, delete and recreate the TradingView alert.
All setup guides