Automate TradingView Strategy is a game-changer for traders. A common post across r/algotrading and r/TradingView: "Looking to Automate My TradingView Strategy — Need Advice." The answers usually involve complex Python code, broker APIs, and cloud servers. But there's a much simpler path.
If you already have a working Pine Script strategy on TradingView and you trade prop firm accounts on MT5, here's how to fully automate it — no coding required.
Automate TradingView Strategy: What You Need
- TradingView account (Essential plan or higher for webhook alerts)
- A Pine Script strategy that generates buy/sell signals
- MetaTrader 5 logged into your prop firm account(s)
- TradingView Copier Pro installed on the same machine
Step 1: Prepare Your Pine Script
Your strategy needs to generate alert messages that include the trade details. Here's a minimal example using Pine Script:
//@version=6
strategy("My Strategy", overlay=true)
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if longCondition
strategy.entry("Long", strategy.long)
alert('{"action":"BUY","ticker":"' + syminfo.ticker + '","qty":0.1}')
if shortCondition
strategy.entry("Short", strategy.short)
alert('{"action":"SELL","ticker":"' + syminfo.ticker + '","qty":0.1}')
if strategy.position_size > 0 and shortCondition
strategy.close("Long")
alert('{"action":"CLOSE","ticker":"' + syminfo.ticker + '"}')
if strategy.position_size < 0 and longCondition
strategy.close("Short")
alert('{"action":"CLOSE","ticker":"' + syminfo.ticker + '"}')
The key fields are action (BUY, SELL, or CLOSE), ticker, and qty (lot size).
Step 2: Configure TradingView Copier Pro
- Launch TradingView Copier Pro
- Copy the webhook URL from the dashboard (auto-generated via Cloudflare Tunnel)
- In the Copier Setup tab, configure symbol remapping if needed (e.g.,
GOLD → XAUUSD) - Set risk parameters: max lot size, max daily loss, max open positions
Step 3: Set Up the TradingView Alert
- On TradingView, open the chart with your strategy
- Click the Alerts button → Create Alert
- Set the condition to your strategy's entry/exit signals
- Enable "Webhook URL" and paste your Copier Pro URL
- In the Message field, use TradingView's built-in placeholders:
{ "action": "{{strategy.order.action}}", "ticker": "{{ticker}}", "qty": {{strategy.order.contracts}} } - Click Create
Step 4: Attach the EA to MT5
- Copy
TV_Copier.mq5to your MT5'sMQL5/Experts/folder - In MetaEditor, compile the EA
- Drag the EA onto any chart
- Enable AutoTrading in MT5's toolbar
- The EA will poll the copier for new trade signals every second
That's it. When your Pine Script strategy fires a signal → TradingView sends a webhook → TradingView Copier Pro receives it → the EA executes on MT5. Fully automated. No Python. No API keys. No cloud servers.
Prop Firm-Specific Considerations
Risk Limits
Prop firms have strict drawdown rules. Configure TradingView Copier Pro's risk settings to enforce:
- Max daily loss: Set to your prop firm's daily loss limit (e.g., 5% for FTMO)
- Max lot size: Cap lots to prevent a runaway strategy from blowing your account
- Max open trades: Limit concurrent positions to manage drawdown
Weekend and Holiday Handling
If your strategy is designed for 24/5 markets, ensure alerts don't fire on weekends. Most Pine Script strategies handle this naturally since there's no price data on weekends.
News Events
During high-impact news (NFP, FOMC, CPI), spreads widen dramatically. Consider pausing automation during these events, or use wider stop losses to account for the volatility.
Partial Closes and Multi-TP
Advanced strategies take partial profits. TradingView Copier Pro supports partial close actions:
{"action":"CLOSE_PARTIAL","ticker":"EURUSD","qty":"50%"}
This closes 50% of the position at TP1, letting the rest ride to TP2. Your Pine Script can fire this alert at the first take-profit level and a full CLOSE at the second.
Monitoring Your Automation
Don't just "set and forget" — at least initially:
- Check the TradingView Copier Pro Trade Log daily
- Verify that every TradingView signal has a corresponding MT5 trade
- Monitor P&L alignment between TradingView paper and MT5 live
- Watch for symbol mapping issues (trades failing on specific instruments)
Automate Your TradingView Strategy Today
TradingView Copier Pro connects your Pine Script to MT5 prop firm accounts. No coding. No monthly fees.
Get TradingView Copier Pro →