Documentation
Everything you need to connect TradingView to MetaTrader 5 and start automating your trading signals.
Quick Start
Get up and running in under 5 minutes. Synnectra bridges your TradingView alerts directly to your MetaTrader 5 terminal with sub-16ms execution latency.
Create a Synnectra account
Sign up at synnectra.com/register. You get a 14-day free trial with full access. A unique License ID and Secret Key are generated automatically for your account.
Download and install the EA
Download Synnectra.ex5 from your dashboard. Place it in your MT5 Experts folder (File → Open Data Folder → MQL5/Experts). Compile if needed, then drag it onto any chart.
Configure the EA inputs
Set your Account ID (License ID) from the dashboard. Optionally set your Webhook Secret for signal authentication. See EA Setup for details.
Create a TradingView alert
Set the webhook URL to your Synnectra endpoint and write the alert message using PineConnector syntax. See Syntax Reference for all supported parameters.
Done!
When the alert fires, TradingView sends the signal to Synnectra, which forwards it to your MT5 EA via ZeroMQ. The trade executes automatically.
EA Setup
The Synnectra Expert Advisor runs inside MetaTrader 5 and listens for trade signals from the Synnectra cloud via ZeroMQ.
Installation
- Download
Synnectra.ex5from the Active Accounts page in your dashboard. - Open MT5 and go to File → Open Data Folder.
- Navigate to
MQL5/Experts/and copy theSynnectra.ex5file there. - Restart MT5 or refresh the Navigator panel (right-click → Refresh).
- Drag Synnectra from the Navigator onto any chart. Ensure Allow Algo Trading is enabled.
EA Input Parameters
| Parameter | Description | Required |
|---|---|---|
| Account ID | Your unique License ID from the Synnectra dashboard. The EA uses this to subscribe to your signal stream via ZeroMQ topic filtering. | Yes |
| Webhook Secret | Your Signal Authentication secret key from the dashboard. When set, the EA rejects any signal that doesn't include this secret. Leave empty to accept all signals (less secure). | Recommended |
The EA automatically maintains a persistent ZeroMQ connection to the Synnectra cloud. It reconnects on disconnection and has built-in deduplication to ignore duplicate signals within a 5-second window.
Dashboard Overview
The Synnectra dashboard is where you manage your account, view trades, configure settings, and monitor performance.
Active Accounts
View your connected trading accounts, see connection status (online/offline based on EA heartbeat), current balance, and last seen timestamp. You can rename accounts or delete them.
Signal Authentication
Located on the Active Accounts page. A Secret Key is automatically generated when you register. This key must be included in your TradingView alert messages to authenticate signals. See Signal Authentication for full details.
Symbol Mapping
Map TradingView symbol names to your broker's symbol names. For example, map EURUSD to EURUSDm if your broker uses a suffix. See Symbol Mapping.
Trades
View your complete trade history including entry/exit prices, lot sizes, P&L, execution latency, and signal IDs. Filter by date range.
Security
Manage your password, two-factor authentication (2FA), and active sessions.
Full Syntax Reference
TradingView alert messages use a comma-separated format (PineConnector syntax). The signal is sent as the body of a POST request to your webhook URL.
Basic Format
LicenseID,Action,Symbol[,key=value,...]
Required Fields
| Position | Field | Description |
|---|---|---|
| 1 | License ID | Your unique account ID from the dashboard (e.g., abc12345) |
| 2 | Action | Trade direction: BUY, SELL, CLOSE, or CLOSEALL |
| 3 | Symbol | The trading instrument (e.g., EURUSD, XAUUSD). Case-insensitive. |
Optional Key=Value Parameters
| Key | Aliases | Description |
|---|---|---|
| vol_lots | — | Fixed lot size. Example: vol_lots=0.1 |
| vol_percent | risk, vol_pct_bal_loss | Risk percentage of account balance. Example: vol_percent=2 risks 2% of balance. When used with sl_pips, calculates lot size to risk exactly that percentage. |
| vol_dollar | — | Fixed dollar amount to risk. Example: vol_dollar=50 |
| sl_pips | sl | Stop loss distance in pips. Example: sl_pips=20. The EA converts pips to an absolute price at execution time. |
| tp_pips | tp | Take profit distance in pips. Example: tp_pips=40 |
| sl_price | — | Absolute stop loss price. Example: sl_price=1.08500 |
| tp_price | — | Absolute take profit price. Example: tp_price=1.09500 |
| secret | — | Your Signal Authentication secret key. Required if signal auth is enabled on your account. Example: secret=a1b2c3d4e5... |
| comment | — | Custom comment attached to the trade in MT5. Example: comment=my_strategy |
| magic | — | Custom magic number for the trade. Example: magic=12345 |
| betrigger | — | Break-even trigger distance in pips. When price moves this many pips in your favor, the EA moves the stop loss to break-even. Example: betrigger=15 |
Default Behavior
If no sizing parameter (vol_lots, vol_percent, or vol_dollar) is specified, the system defaults to 1% risk of your account balance.
If no SL/TP is specified, the trade opens without stop loss or take profit levels. You can manage these manually or through your MT5 platform.
Webhook URL
Set your TradingView alert webhook URL to your Synnectra endpoint. The alert message body should contain the PineConnector-formatted signal.
Syntax Examples
Simple Buy
abc12345,BUY,EURUSD,secret=your_secret_key
Opens a BUY on EURUSD with 1% balance risk (default). Includes the secret key for authentication.
Buy with Fixed Lots and SL/TP in Pips
abc12345,BUY,GBPUSD,vol_lots=0.5,sl_pips=30,tp_pips=60,secret=your_secret_key
Opens a 0.5 lot BUY on GBPUSD with a 30-pip stop loss and 60-pip take profit.
Sell with Risk Percentage and Pips
abc12345,SELL,XAUUSD,vol_percent=2,sl_pips=50,tp_pips=100,secret=your_secret_key
Risks 2% of your account balance on a SELL for XAUUSD. The system calculates the exact lot size based on your balance, SL distance, and pip value.
Buy with Dollar Risk
abc12345,BUY,USDJPY,vol_dollar=100,sl_pips=25,secret=your_secret_key
Risks exactly $100 on this trade. Lot size is calculated from the SL pip distance and pip value.
Absolute SL/TP Prices
abc12345,BUY,EURUSD,vol_lots=0.1,sl_price=1.08500,tp_price=1.09500,secret=your_secret_key
Uses absolute price levels for stop loss and take profit instead of pip distances.
With Break-Even Trigger
abc12345,BUY,EURUSD,vol_lots=0.2,sl_pips=20,tp_pips=40,betrigger=10,secret=your_secret_key
When price moves 10 pips in your favor, the EA automatically moves your stop loss to the entry price (break-even).
Close a Position
abc12345,CLOSE,EURUSD,secret=your_secret_key
Closes the open position on EURUSD.
Close All Positions
abc12345,CLOSEALL,secret=your_secret_key
Closes all open positions on your account.
With Custom Comment and Magic
abc12345,BUY,EURUSD,vol_lots=0.1,comment=strat_a,magic=55555,secret=your_secret_key
Attaches a custom comment and magic number for trade identification and strategy tracking.
Pine Script Dynamic Alert Example
// Signal in Pine Script
if (buyCondition)
strategy.entry("Long", strategy.long)
// Alert message (set in alert creator):
// {{strategy.order.action}} {{ticker}},vol_lots=0.1,sl_pips=20,tp_pips=40,secret=your_secret_key
// Or with dynamic values:
// abc12345,{{strategy.order.action}},{{ticker}},vol_lots={{strategy.order.contracts}},sl_pips=20,secret=your_secret_key
Position Sizing
Synnectra offers three methods for position sizing. You can specify them directly in the alert message or configure defaults in your dashboard account settings.
1. Fixed Lots (vol_lots)
Trade with an exact lot size regardless of account balance.
LicenseID,BUY,EURUSD,vol_lots=0.25,secret=your_secret_key
2. Percentage Risk (vol_percent)
Risk a percentage of your account balance. When combined with sl_pips, the system calculates the exact lot size so that if your stop loss is hit, you lose exactly that percentage.
LicenseID,BUY,EURUSD,vol_percent=1.5,sl_pips=30,secret=your_secret_key
Calculation: Lot Size = (Balance × Risk%) ÷ (SL Pips × Pip Value)
3. Dollar Risk (vol_dollar)
Risk a fixed dollar amount. Same calculation as percentage but with an absolute dollar value.
LicenseID,BUY,EURUSD,vol_dollar=75,sl_pips=25,secret=your_secret_key
Dashboard Default Sizing
If your alert doesn't specify any sizing parameter, the system uses your dashboard account settings:
- Fixed lot size — uses the configured lot value
- Percentage — uses the configured percentage of balance
- Dollar — uses the configured dollar amount
If no dashboard sizing is configured either, the system defaults to 1% risk.
Stop Loss & Take Profit
You can set SL and TP using either pip distances or absolute prices.
Pip-Based (Recommended)
Set SL/TP as a number of pips from the entry price. The EA calculates the absolute price at execution time using the live market price.
LicenseID,BUY,EURUSD,sl_pips=20,tp_pips=40,secret=your_secret_key
Aliases: sl_pips = sl, tp_pips = tp
Absolute Price
Set SL/TP as exact price levels.
LicenseID,BUY,EURUSD,sl_price=1.08500,tp_price=1.09500,secret=your_secret_key
Pip-based SL/TP takes priority. If both sl_pips and sl_price are provided, only sl_pips is used.
Signal Authentication
Signal authentication prevents unauthorized trading by requiring a secret key in every alert message. A secret key is automatically generated when you create your account.
How It Works
- Your account has a unique webhook secret (visible in the dashboard under Signal Authentication).
- Include
secret=YOUR_KEYin your TradingView alert message. - Synnectra validates the secret before processing the signal. If it doesn't match, the signal is rejected.
Adding the Secret to Alerts
LicenseID,BUY,EURUSD,vol_lots=0.1,secret=your_secret_key_here
The secret parameter can appear anywhere after the symbol — order of optional parameters doesn't matter.
Managing Your Secret
- View: Click the eye icon next to the secret key in the dashboard to reveal it.
- Copy: Click the copy icon to copy the key to your clipboard.
- Recycle: Click "Recycle Key" to generate a new key. The old key stops working immediately — you must update all TradingView alerts with the new key.
- Disable: Toggle off signal authentication. Warning: anyone with your License ID can send trades to your account when disabled.
EA-Side Validation
When you enter the secret in the EA's Webhook Secret input parameter, the EA also validates the secret locally before executing any trade. This provides a second layer of security.
If signal auth is disabled (no secret configured) and no secret is provided in the alert, the signal is accepted without authentication. Only disable this if you understand the risks.
Symbol Mapping
TradingView and your MT5 broker may use different symbol names. Symbol mapping translates TradingView symbols to your broker's symbols automatically.
Example
| TradingView Symbol | Broker Symbol (MT5) |
|---|---|
| EURUSD | EURUSDm |
| XAUUSD | XAUUSD.raw |
| BTCUSDT | BTCUSD |
Setup
- Go to Symbol Mapping in the dashboard sidebar.
- Click Add Mapping.
- Enter the TradingView symbol and your broker's MT5 symbol.
- Optionally set a custom pip value (if your broker uses non-standard pip sizes).
Symbol mapping is applied server-side before the signal reaches your EA. Your TradingView alerts always use the TradingView symbol name.
News Protection
News protection automatically pauses trading around high-impact economic events to protect you from volatile, unpredictable market conditions.
How It Works
- The EA periodically checks with the Synnectra server for upcoming high-impact news events.
- When a high-impact event is approaching, the EA enters a "news paused" state.
- Any incoming trade signals are rejected during this period.
- Trading resumes automatically after the news event has passed.
Configuration
News protection can be enabled or disabled per account in the dashboard settings. The check interval and buffer time around events are managed by the platform.
Risk Management
Synnectra includes server-side risk management checks that are applied before a signal is forwarded to your EA. These are configured per account in the dashboard.
Available Risk Controls
| Setting | Description |
|---|---|
| Max Open Positions | Maximum number of simultaneous open positions. New signals are rejected when the limit is reached. Does not apply to CLOSE or CLOSEALL actions. |
| Max Positions Per Symbol | Maximum number of open positions for a single symbol. Prevents over-concentration on one instrument. |
| Max Daily Profit | Stops opening new trades once your daily profit reaches this dollar amount. Helps lock in gains. |
| Max Daily Loss (%) | Stops opening new trades once your daily loss exceeds this percentage of your start-of-day balance. Protects against drawdowns. |
Risk management checks are applied server-side. Signals that violate your limits are rejected with a descriptive error before reaching your EA.
Trading Time Windows
You can restrict trading to specific hours of the day. Signals received outside your configured trading window are automatically rejected.
Use Cases
- Avoid low-liquidity sessions (e.g., Asian session for EUR/USD)
- Trade only during London or New York sessions
- Prevent overnight trades
Configure trading windows per account in the dashboard settings.
Copy Trading
Synnectra supports master-subscriber copy trading. A master account can automatically replicate its trades to one or more subscriber accounts.
How It Works
- A signal arrives for the master account and is executed.
- Synnectra automatically copies the same trade to all subscriber accounts.
- Each subscriber can have its own sizing mode (fixed, percentage, or dollar).
Subscriber Sizing Modes
| Mode | Description |
|---|---|
| Fixed | Use a fixed lot size for all copied trades |
| Percentage | Risk a percentage of the subscriber's balance |
| Dollar | Risk a fixed dollar amount per trade |
HMAC Authentication
HMAC authentication secures the communication between your EA and the Synnectra server for heartbeat and trade report API calls.
How It Works
- Every request from the EA includes an
X-Timestampheader (Unix timestamp) and anX-Signatureheader (HMAC-SHA256 of the request payload). - The server validates the signature using your webhook secret as the signing key.
- Requests with expired timestamps (>5 minutes old) are rejected.
HMAC authentication is handled automatically by the EA. No manual configuration is required beyond setting your Account ID and Webhook Secret in the EA inputs.
Troubleshooting
EA Not Receiving Signals
- Verify the EA is attached to a chart and algo trading is enabled (button in toolbar is green).
- Check the MT5 Experts tab in the terminal for connection logs and errors.
- Ensure your License ID is entered correctly in the EA inputs.
- If using signal auth, make sure the secret matches between the dashboard and EA.
Signals Rejected — "Invalid webhook secret"
- Your alert message must include
secret=YOUR_KEYif signal auth is enabled. - Check that the secret in your alert matches the one shown in your dashboard.
- If you recycled your key recently, update all TradingView alerts with the new key.
Signals Rejected — "Max open positions reached"
- You've reached the maximum open positions limit configured in your account risk settings.
- Close some positions or increase the limit in the dashboard.
Signals Rejected — "Trading is currently disabled"
- You're outside your configured trading time window.
- Adjust your trading window settings or wait for the next trading session.
Signals Rejected — "Trading paused due to upcoming news event"
- News protection is active. Trading will resume automatically after the event.
- Disable news protection in dashboard settings if you want to trade during news events.
Wrong Symbol Executed
- Check your Symbol Mapping settings. A mapping may be translating the symbol to a different one.
- Ensure the symbol is available in your MT5 Market Watch.
Incorrect Lot Size
- If using
vol_percentorvol_dollarwithsl_pips, the lot size is calculated from your account balance and pip value. Check your account balance and pip value settings. - Verify your dashboard account sizing settings (fixed/percent/dollar and the value).
Frequently Asked Questions
Is signal authentication required?
A secret key is automatically generated when you register. It's strongly recommended to include it in your alerts. If you disable signal auth, anyone who knows your License ID can send trades to your account.
What happens if I don't include a sizing parameter?
The system defaults to risking 1% of your account balance. You can change the default in your dashboard account settings.
Can I use multiple TradingView alerts with the same License ID?
Yes. All alerts sent to your webhook endpoint with the correct License ID (and secret, if enabled) will be processed. The EA handles deduplication within a 5-second window.
Does the EA need to be on a specific chart?
No. The EA subscribes to your signal stream via ZeroMQ using your License ID as a topic filter. It can be attached to any chart — the symbol in the alert message determines which instrument is traded.
What's the execution latency?
Typical end-to-end latency from TradingView webhook to MT5 order execution is under 16ms (server-side). The total latency depends on TradingView's webhook delivery time and your network connection to the broker.
Can I use this with MT4?
The current EA is built for MT5. Contact support if you need MT4 compatibility.
What brokers are supported?
Any broker that supports MT5 is compatible. The EA executes trades through your broker's MT5 server using the standard MQL5 trade API.
Is there a free trial?
Yes. Every new account gets a 14-day free trial with full access to all features. No credit card required.