TradingView to MetaTrader 5 Webhook Service

This webhook service allows you to execute trades on MetaTrader 5 directly from TradingView alerts. Connect your TradingView alerts to MT5 and automate your trading strategy.

Checking MT5 connection...

Server Webhook Endpoint

To use this service, set up a webhook alert in TradingView pointing to:

Key API Key Authentication

All webhook requests must include your API key in the JSON payload:

"api_key": "YOUR_API_KEY"

JSON Payload Format

Your TradingView alert message must be formatted as a valid JSON with the following structure:

{
  "api_key": "YOUR_UNIQUE_API_KEY",  // Required: For authentication
  "symbol": "EURUSD",               // Required: Trading pair
  "action": "BUY",                  // Required: "BUY", "SELL", or "CLOSE"
  "lots": 0.01,                     // Required: Trading volume
  "sl": 1.08000,                    // Optional: Stop Loss price (0 if not used)
  "tp": 1.09500,                    // Optional: Take Profit price (0 if not used)
  "magic_number": 12345,            // Optional: Magic Number for order identification
  "comment": "PineSignal"           // Optional: Comment for the order
}

Note: For CLOSE action, only "symbol" and "magic_number" are required. All orders matching these parameters will be closed.

TradingView Alert Setup

To set up alerts in TradingView:

  1. Create an alert in TradingView for your strategy
  2. In the "Alert actions" section, select "Webhook URL"
  3. Enter the webhook URL shown above
  4. In the "Message" field, insert your JSON payload
  5. Click "Create" to save the alert

Important: Make sure to format your JSON properly. Any syntax errors will cause the webhook to reject the alert.

Setup Instructions

Complete Setup Process:

  1. Create API Key: Create an API key from the API Key Management section.
  2. Install EA: Install the PineSignal EA in your MetaTrader 5 platform and configure it with your API key.
  3. Configure TradingView: Set up webhook alerts in TradingView with the proper JSON format including your API key.
  4. Test Connection: Send a test signal to verify that everything is working correctly.