Copy TradingView Strategies to MetaTrader 5 — Step by Step (2026)

Copy TradingView Pine Script strategy to MT5 live trading

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:

  1. Your Pine Script calls strategy.entry("BUY", strategy.long)
  2. This fires an alert with a configurable message
  3. TradingView sends the message as a webhook POST to your URL
  4. 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

  1. Add your Pine Script strategy to a TradingView chart
  2. Click the Clock+ icon (Create Alert) in the top toolbar
  3. In the Condition dropdown, select your strategy name
  4. Set condition to "Order fills only" — this fires when entries/exits occur
  5. In the Notifications tab, enable Webhook URL
  6. Paste your webhook URL
  7. In the Message field, put: {{strategy.order.alert_message}}
  8. 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:

  1. In TradingView Copier Pro, add a demo MT5 account
  2. Wait for your strategy to fire a signal naturally, or temporarily lower the condition threshold
  3. Check the Logs tab for webhook received, parsed, and trade executed
  4. Verify the trade appears in MT5 demo trade history
  5. 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