Copy TradingView Strategies is a game-changer for traders. You've built a profitable Pine Script strategy in TradingView. The backtests look great. Now the question: how do you copy TradingView strategies to MetaTrader 5 for live execution? This step-by-step guide shows you the exact process — from writing your Pine Script strategy to watching it trade live in MT5.
🎯 Goal: By the end of this guide, your TradingView Pine Script strategy will be automatically executing live trades in MetaTrader 5 via TradingView Copier Pro — with no manual intervention required.
Copy Tradingview: Understanding How Pine Script Strategies Connect to MT5
TradingView strategies (using the strategy() function in Pine Script v5) have a built-in mechanism to send alerts when orders are filled. These alerts can be configured to trigger webhooks — which is the bridge to MT5.
The flow is:
- Your Pine Script calls
strategy.entry("BUY", strategy.long) - This fires an alert with a configurable message
- TradingView sends the message as a webhook POST to your URL
- TradingView Copier Pro receives it, parses the JSON, and places the trade in MT5
Step 1: Prepare Your Pine Script Strategy for Webhooks
Your strategy needs to output alert messages that TradingView Copier Pro can read. The simplest approach is to use alertcondition() calls, or use the built-in alert() function within your strategy logic.
Here's a minimal example of a moving average crossover strategy with webhook-ready alerts:
//@version=5
strategy("MA Cross Webhook", overlay=true)
fast = ta.sma(close, 20)
slow = ta.sma(close, 50)
longEntry = ta.crossover(fast, slow)
shortEntry = ta.crossunder(fast, slow)
if longEntry
strategy.entry("BUY", strategy.long)
alert('{"action":"BUY","symbol":"' + syminfo.ticker + '","lot":0.1}', alert.freq_once_per_bar)
if shortEntry
strategy.entry("SELL", strategy.short)
alert('{"action":"SELL","symbol":"' + syminfo.ticker + '","lot":0.1}', alert.freq_once_per_bar)Step 2: Install TradingView Copier Pro
Download and install from tradingviewcopier.com. Connect your MT5 account using the Auto-Detect MT5 feature. The EA is installed automatically. See the full 5-minute automation guide for detailed steps.
Step 3: Get Your Webhook URL
Copy your webhook URL from the Accounts tab in TradingView Copier Pro. It will look like: https://abc-def-123.trycloudflare.com/webhook
Step 4: Create the Strategy Alert in TradingView
- Add your Pine Script strategy to a TradingView chart
- Click the Clock+ icon (Create Alert) in the top toolbar
- In the Condition dropdown, select your strategy name
- Set condition to "Order fills only" — this fires when entries/exits occur
- In the Notifications tab, enable Webhook URL
- Paste your webhook URL
- In the Message field, put:
{{strategy.order.alert_message}} - Click Create
📌 Key point: The {{strategy.order.alert_message}} placeholder tells TradingView to use whatever message you passed in your alert() call inside the Pine Script. This lets you send dynamic JSON with real-time values.
Step 5: Test in Demo Before Going Live
Always test your strategy-to-MT5 pipeline with a demo account first:
- In TradingView Copier Pro, add a demo MT5 account
- Wait for your strategy to fire a signal naturally, or temporarily lower the condition threshold
- Check the Logs tab for webhook received, parsed, and trade executed
- Verify the trade appears in MT5 demo trade history
- Once confident, switch to your live account
Advanced: Dynamic Lot Sizing in Your Strategy
You can pass strategy-calculated position sizes to the webhook. For example, if your strategy calculates optimal lot size based on equity:
lotSize = math.round(strategy.equity * 0.01 / 10, 2)
alert('{"action":"BUY","symbol":"' + syminfo.ticker + '","lot":' + str.tostring(lotSize) + '}', alert.freq_once_per_bar)Multiple Strategies, One Webhook
You can run multiple TradingView strategies simultaneously, all pointing to the same webhook URL. Since each alert message contains the action and symbol, TradingView Copier Pro routes each signal to the correct trade independently. This means you can run a portfolio of automated strategies from a single TradingView Copier Pro instance.
Copy Your TradingView Strategy to MT5 — Today
No coding beyond your Pine Script needed. TradingView Copier Pro handles all the infrastructure.
Get TradingView Copier Pro →Common Issues When Copying TradingView Strategies
- Alert fires but no webhook sent: Ensure WebHook is enabled in the alert's Notifications tab, not just email/pop-up
- Duplicate orders: Change alert frequency to "Once per bar close" to prevent multiple triggers per bar
- Wrong lot size: Double-check the lot value in your JSON is a number, not a string (no quotes around numbers)
- Strategy doesn't fire in live trading: Some strategies behave differently in real-time vs backtesting due to bar confirmation — read TradingView's docs on bar states