Quick start
Install the MetaTrader 5 Expert Advisor
- In MetaTrader 5, open
File → Open Data Folder, then go toMQL5 → Experts. - Copy the
TradeBridgeEA.ex5(or.mq5) file there and restart MT5, or refresh the Navigator. - In MT5, enable
Tools → Options → Expert Advisors → Allow WebRequest for listed URLand add your TradeBridge server URL. - Drag the EA onto any chart. In its inputs, paste your license key and confirm the server URL.
- Allow Algo Trading (the button in the toolbar). The account should show as connected on your dashboard within a few seconds.
EA inputs
When you attach the EA to a chart, set these inputs. Only the license key is strictly required; the rest have sensible defaults.
| Input | What it does | Default |
|---|---|---|
InpLicenseKey | Required. Links the terminal to your account/license | — |
InpApiBaseUrl | TradeBridge server URL (must be added under Allow WebRequest) | https://tradebridge.live |
InpMagic | Magic number stamped on EA orders (so it only manages its own trades) | 990099 |
InpSlippage | Max deviation/slippage allowed on fills (points) | 20 |
InpMaxSpreadPips | Skip an entry if the live spread is wider than this (pips). 0 = no limit — protects against news-spike fills | 0 |
InpTrailStartPips | Default profit (pips) before trailing activates | 20 |
InpTrailStepPips | Default trailing distance (pips) | 10 |
InpPollMs | How often the EA polls for new signals (ms) | 1000 |
InpHeartbeatSec | Heartbeat interval that keeps the account "online" (seconds) | 30 |
Create a TradingView alert
- Open your chart/strategy in TradingView and click Alert (the clock icon).
- Set your condition as usual.
- Under Notifications, enable Webhook URL and paste:
https://tradebridge.live/api/webhook/tradingview
- In the alert Message box, paste your command (from the Alert Builder), e.g.:
BUY,EURUSD,VOLUME=0.10,SL=50,TP=100,KEY=TB-XXXX-XXXX
- Click Create. Done — when the alert fires, the trade is placed automatically.
Alert syntax reference
An alert message is a comma-separated command. The first token is the action, the second is the symbol, followed by optional KEY=VALUE pairs. KEY= (your license) is always required.
| Parameter | Meaning | Example |
|---|---|---|
| symbol | TradingView ticker (mapped to your broker symbol) | EURUSD |
VOLUME= / LOT= | Fixed lot size (overrides risk-profile sizing) | VOLUME=0.55 |
RISK= | Size by % of balance/equity using the SL distance | RISK=1 |
SL= | Stop loss in pips | SL=50 |
TP= | Take profit in pips | TP=100 |
PRICE= | Entry price (required for pending orders) | PRICE=1.0850 |
TRAIL= | Trailing-stop distance in pips | TRAIL=20 |
TRAILSTART= | Profit in pips before trailing activates | TRAILSTART=30 |
ATR= | Size the stop loss from volatility (ATR × this multiplier) instead of a fixed SL= | ATR=1.5 |
TP1= | Partial take-profit distance (pips). At this profit the EA closes part of the trade and moves the stop to breakeven | TP1=20 |
PARTIAL= | % of the position to close when TP1= is hit (default 50) | PARTIAL=50 |
BE= | Lock the stop this many pips beyond entry after TP1= (0 = exact breakeven) | BE=1 |
COMMENT= | Free-text label — also used as the strategy name in Performance analytics | COMMENT=breakout |
KEY= | Required. Your license key | KEY=TB-XXXX-XXXX |
Actions
The first token is the action. Entries respect your risk profile and guardrails; close/management actions always go through (even when an account is paused).
| Action | What it does |
|---|---|
BUY / SELL | Open a market position in that direction |
BUYLIMIT / SELLLIMIT | Place a pending limit order (needs PRICE=) |
BUYSTOP / SELLSTOP | Place a pending stop order (needs PRICE=) |
CLOSE | Close all open positions for the symbol |
CLOSEBUY / CLOSESELL | Close only the long / only the short positions for the symbol |
CLOSEALL | Close every open position on the account |
PARTIALCLOSE | Close part of the position — VOLUME= is the fraction (e.g. 0.5 = half) |
BREAKEVEN | Move the stop on open positions to the entry price |
TRAILSTART / TRAILSTOP | Enable / disable trailing on existing positions for the symbol |
JSON format
Prefer JSON? The webhook accepts it too — handy if your TradingView strategy emits structured alerts. Keys mirror the parameters above (licenseKey, action, symbol, risk, sl, tp, volume, price, trail, trailStart, comment, accountId, nonce).
{
"licenseKey": "TB-XXXX-XXXX",
"action": "BUY",
"symbol": "EURUSD",
"risk": 1, "sl": 50, "tp": 100,
"comment": "breakout"
}
Examples
# Fixed-lot entry with SL/TP BUY,EURUSD,VOLUME=0.55,SL=50,TP=100,KEY=TB-XXXX # Risk 1% of balance with a trailing stop SELL,XAUUSD,RISK=1,SL=120,TRAIL=40,TRAILSTART=60,KEY=TB-XXXX # Pending buy-limit order BUYLIMIT,GBPUSD,PRICE=1.2500,SL=40,TP=120,KEY=TB-XXXX # Volatility stop (ATR×1.5) + auto take 50% at +20p and lock breakeven BUY,XAUUSD,RISK=1,ATR=1.5,TP1=20,PARTIAL=50,BE=1,KEY=TB-XXXX # Take half off the table, then close the rest PARTIALCLOSE,EURUSD,VOLUME=0.5,KEY=TB-XXXX CLOSE,EURUSD,KEY=TB-XXXX
Risk & sizing
Three ways to size, in priority order:
VOLUME=— an explicit fixed lot, overrides everything else.RISK=— a % of balance or equity; the lot is computed from your SL distance so the worst-case loss matches that %.- Risk profile default — if the alert omits sizing, the account's risk profile decides (Fixed lot, Balance %, or Equity %).
Set defaults and per-account multipliers under Risk Profiles and Accounts in the app.
Risk guardrails
A risk profile (assigned per account) enforces hard limits before any trade is sent. A blocked signal is recorded with the reason in your dashboard signal feed and triggers a notification.
| Guardrail | Effect when breached |
|---|---|
| Max open trades | New entries are rejected while you're at the cap |
| Max daily loss | New entries rejected once today's net realized loss hits the limit |
| Max drawdown % | New entries rejected when equity is down more than X% from balance |
| Max lot | Every computed lot is clamped to this ceiling |
| Kill switch on daily loss | On breach, all open positions are closed and the account is auto-paused until the next day |
Your dashboard shows a per-account daily-loss meter (today's P/L vs the limit) so you can see how close you are before the cap trips.
Trailing stops
Add TRAIL= to trail the stop by a fixed pip distance as price moves in your favour. Pair it with TRAILSTART= so trailing only begins after the trade is that many pips in profit. Trailing runs continuously on the EA between signals, respects your broker's minimum stop distance, and is breakeven-guarded — it never moves a stop to lock in a loss.
Protecting your stops
Three tools help a noisy market reversal avoid taking out your full stop loss. They compose — a volatility stop sets a sensible initial SL, TP1 neutralises the risk, then the remainder trails from breakeven.
ATR=(volatility stop) — sizes the SL from recent volatility (Average True Range × the multiplier) so it sits outside normal noise instead of a fixed pip count. Use it in place ofSL=. Your EA can also apply it automatically to any signal that arrives without an SL.TP1=+PARTIAL=(partial take-profit) — once price runsTP1=pips into profit, the EA closesPARTIAL=% of the position and moves the stop to breakeven. After that, the worst case on the rest is a scratch, not a full SL. If the lot is too small to split it still locks breakeven.BE=(breakeven+) — locks the post-TP1 stop a few pips beyond entry, banking a small profit rather than exact breakeven.
Trading hours
A risk profile can define a trading-hours window (start/end in IST) and allowed weekdays. Opening signals outside the window or on a disallowed day are rejected — but close/management actions still go through, so existing positions can always be managed. Leave the window blank for 24/7.
Symbol mapping
Brokers name symbols differently (EURUSD.m, XAUUSD vs GOLD, suffixes like .raw/+). TradeBridge handles this two ways:
- Per-account mappings — under Accounts → Symbols, map a TradingView symbol to your exact broker symbol. A Test button shows what MT5 will receive.
- Automatic resolution — for anything unmapped, the EA matches your broker's prefix/suffix conventions automatically.
Pause & kill switch
Stop trading instantly without deleting any setup:
- Pause an account (Accounts → Pause) — rejects new entries; closes still work. Resume any time.
- Daily-loss kill switch — automatic flatten + pause when the daily-loss cap is hit (see Guardrails).
- Global kill switch (admin) — pauses all trading platform-wide in one click.
Multi-account copy trading
Attach several MT5 accounts to one license and a single alert is mirrored to all of them. Each account can have its own lot multiplier, risk multiplier, and optional inverse (reverse-direction) setting — ideal for managing multiple accounts or hedging.
SMART AI EA — overview
SMART AI EA is an automated hedged grid Expert Advisor for MetaTrader 5. It is a separate product from the TradeBridge connector EA: the connector executes your TradingView alerts, while SMART AI EA trades its own strategy and reports the results back to TradeBridge.
How a cycle works
There are no indicators, filters or forecasts anywhere in the EA. Direction comes only from how far price has travelled and the configured grid distance.
Install & licence
- Copy
SMART_AI_EA.ex5intoMQL5 → Experts(viaFile → Open Data Folder) and refresh the Navigator. - Add
https://tradebridge.liveunderTools → Options → Expert Advisors → Allow WebRequest for listed URL. Without this the EA cannot validate its licence and will not trade. - Drag the EA onto an XAUUSD chart on a hedging account. It refuses to start on netting accounts.
- On the Inputs tab click Load and pick
SMART_AI_EA.setfor the documented defaults. - Set
InpTbLicenseKeyto your licence key — the preset ships it blank on purpose. - Enable Algo Trading and press OK.
On a healthy start the Experts journal shows:
# licence validated, cycle opened
SMART AI EA | Licence + trade reporting via TradeBridge: https://tradebridge.live
SMART AI EA | TradeBridge: connected. Account <id> (MT5 login 12345678). Licence OK.
SMART AI EA | CHECK THIS: grid mode = FIXED 1500 pips => grid step = 15.00 in price.
SMART AI EA | New cycle started @ 2650.15
SMART AI EA | Initial BUY opened: 0.01
SMART AI EA | Initial SELL opened: 0.01
grid step = … tells you
the real distance in price on your broker. If that is not the distance you intend, set
InpPipOverride or switch to percent mode before trading.Licensing
Licensing is server-verified and mandatory — there is no input that turns it off. The EA exchanges your licence key and MT5 login for a short-lived token, then re-validates on every heartbeat. A revoked licence or a lapsed subscription stops new trades within seconds. The only exempt context is the Strategy Tester, which cannot make web requests, so backtests run without a licence.
Without a valid licence the EA still manages and closes existing positions and honours every risk control — it simply opens nothing new, so an expiring licence can never strand an open trade.
Key settings
| Input | Default | What it does |
|---|---|---|
InpSymbol | XAUUSD | Symbol to trade. Attach the EA to that symbol's own chart. |
InpInitialBuyLot / InpInitialSellLot | 0.01 | The two positions that open each cycle. |
InpGridMode | Fixed pips | Grid step as a fixed pip distance, or as a percent of price so it scales as the instrument re-prices. |
InpGridDistancePips | 1500 | Distance between grid additions in fixed mode. |
InpSingleTradeProfitTargetMoney | 15.00 | Trend-side target, applied per position, in account currency. |
InpHoldProfitTargetMoney | 5.00 | Averaging-side target — the whole group closes together when it is reached. |
InpAveragingExitMode | Average per position | Whether the group target means the average per position or the combined total. |
InpMaxLotCap | 0.50 | Hard cap on any single position. 0 means only the broker's maximum applies — far too loose for a retail account. |
InpMaxAveragingPositions | 30 | Cap on how deep the averaging book may go — the side that carries the risk. |
InpUseEquityStopLoss | false | Drawdown shutdown: close everything, stop, and stay stopped until you clear the lock. |
InpUseGrossTrailingSL | false | Money-based basket trailing on total floating profit. |
InpEnableSession | false | Restrict new entries to an hour window in server time. Closing always continues. |
InpMagicNumber | 123456 | The EA only ever touches positions with this magic. Use a different value per instance. |
Choosing your protection
The exposure caps (InpMaxLotCap, InpMaxAveragingPositions)
cost very little in normal conditions and bound the worst case — we recommend leaving them on.
The equity stop is a genuine trade-off and deserves a deliberate decision. Set it too tight and it fires inside the strategy's ordinary working drawdown, halting the EA mid-recovery and turning a normal month into a loss. Set it too loose and it permits a very large loss before acting. Because the shutdown is permanent by design, test your chosen level before relying on it.
On-chart dashboard
A live panel is drawn on the chart. It is presentation only — it never opens, closes or modifies a position — and it is automatically disabled during non-visual backtests so it costs nothing there.
| Row | Shows |
|---|---|
| Status badge | RUNNING, SESSION CLOSED, NO LICENCE, or STOPPED after a shutdown. |
| Trend side | Which side is currently the trend, or a dash before the first grid step. |
| BUY / SELL | Position count and total lots per side. |
| Next avg lot | The next progression lot and step index for each side. |
| Floating P/L | This EA's own floating result, green or red. |
| Averaging | Live group progress — positions, the measured value now, the target, and which mode is in force. |
| Grid | The configured distance and the resolved price step — use it to sanity-check pip size. |
| Drawdown | Current percentage against the limit, or STOP OFF in red when the equity stop is disabled. |
| Gross trail | Armed state, the peak being protected, and how much give-back remains. |
| TradeBridge / License | Connection and licence state. |
Trades in your dashboard
Every position SMART AI EA opens and closes is reported to TradeBridge with realised profit, commission and swap, so it appears in your Trades list and flows into the performance reports alongside your signal-driven trades.
Running it alongside the connector EA
Both can run on the same terminal. Give SMART AI EA a magic number different from the connector EA's
(123456 and 990099 by default) and each will ignore the
other's positions. SMART AI EA never polls for TradingView signals — it only reports.
Notifications
TradeBridge keeps you informed in-app and on your preferred channels. The bell icon in the app is your inbox; add a phone number or Telegram chat id under Profile to also receive alerts by email, SMS, WhatsApp, or Telegram. Events include: trade closed, terminal offline, a signal blocked by a risk control, the daily-loss kill switch firing, and subscription/renewal notices. A weekly performance summary email lands every Monday.
Performance analytics
The Performance page turns your closed trades into insight: an equity curve and drawdown chart, plus win rate, profit factor, expectancy, payoff, win/loss streaks and P/L by strategy (grouped by your alert COMMENT=). The Reports page adds per-symbol / per-day / per-account breakdowns and CSV export.
Billing & plans
Pay with Razorpay or Cashfree — pick either at checkout. Plans are monthly or annual, with optional free trials and promo codes. Choose auto-renew (a recurring mandate/UPI Autopay) or a one-time payment. Every successful payment produces a sequential GST tax invoice (and a credit note on refund), downloadable from your Billing page.
Affiliate program
Resellers get a referral code/link. Anyone who signs up through it is attributed to you, and a commission accrues on their payments — track pending and paid earnings on the Affiliate page.
Security
- Two-factor authentication is mandatory — you enroll an authenticator app on first login; recovery codes are issued for backup.
- Webhook signing — set a webhook secret on your license and TradeBridge verifies an HMAC
X-TB-Signatureon every alert. An optional IP allow-list and short-lived nonce/timestamp anti-replay further lock it down. - Login activity — your Profile shows recent sign-ins (success and failed) with IP, so you can spot anything suspicious.
- We never store your MT5 password — the EA connects outbound with your license key only.
Troubleshooting
My account shows "offline" / not connected
The signal is "Rejected — Unknown license key"
KEY= value doesn't match an active license. Pick the correct license in the Alert Builder, or ask an admin to issue/activate one.Signal rejected — "Account paused" or "Trading is globally paused"
Signal rejected — "Outside trading hours" or a risk cap
Trade didn't open — "symbol not found" or "spread too wide"
EURUSD.m). "Spread too wide" means InpMaxSpreadPips blocked a news-spike fill — raise it or leave it 0 to disable. Also confirm the market is open and margin is sufficient.