Chapter 1: Core Concepts

1.1 What is WebhookTrade?

WebhookTrade is a specialized service that functions as a robust and efficient bridge between your TradingView account and your brokerage accounts. Its primary purpose is to receive trading alerts generated by your strategies in TradingView and translate them into executable trade commands that are sent to your connected broker, such as MetaTrader (MT4/MT5) or Capital.com.

1.2 The Challenge of Trading Automation

Automating trades from TradingView, especially to the world's most popular platform, MetaTrader, has traditionally been a complex and technically demanding process. It required traders to:

  • Rent and maintain a Virtual Private Server (VPS) to ensure 24/7 uptime.
  • Install and configure a MetaTrader terminal on that server.
  • Find, purchase, and correctly set up a third-party Expert Advisor (EA) to interpret incoming signals.
  • Manage potential downtime, internet issues, software crashes, and security updates.

This technical overhead creates a significant barrier for many traders who simply want to execute their well-defined strategies automatically.

1.3 The WebhookTrade Solution

WebhookTrade is designed to completely remove these technical barriers, providing a streamlined path to automation.

  • For MetaTrader Users: We provide a fully managed, cloud-based service, eliminating the need for a VPS on your side. Instead of running your computer 24/7 or managing your own server, we handle the infrastructure for you. You simply provide your account details through our secure platform, and we establish a persistent connection for your account. This completely removes any need for software installation or EA configuration on your end.
  • For API Broker Users: For brokers like Capital.com, we provide a unified and simplified interface to securely connect your accounts, bypassing the need for you to write or manage any code for API integration.
  • For All Users: We provide a suite of tools to help you construct, test, and monitor your trading alerts, ensuring a smooth and reliable automation experience.

Chapter 2: Quick Start Guide

This guide provides the essential steps to configure your first automated trade.

  1. Register and Log In: Create your account at WebhookTrade.com.
  2. Connect Your Broker: Navigate to the "Connect to a broker or MetaTrader" page. Select your platform (e.g., MetaTrader) and provide your account details. Upon a successful connection, the system will generate your unique WebhookTrade API Key.
  3. Generate the Alert Message: Go to the "Set TradingView Alerts" page. Use the JSON Generator to build the command for your alert. Your `username` and `api_key` will be automatically included.
  4. Prepare Your Alert in TradingView:
    • In TradingView, select the chart, strategy, and timeframe you wish to automate.
    • Click the "Add alert" button. In the alert configuration window, ensure your strategy is selected as the "Condition".
    • Go to the "Message" box, delete all existing content, and paste the JSON message you generated in WebhookTrade.
  5. Configure the Notification Method: In the same TradingView alert window, go to the "Notifications" tab and choose one of these two methods:
    • Webhook URL (Recommended): Check this box. Copy the URL from the WebhookTrade "Set TradingView Alerts" page and paste it here. This method is available on all paid TradingView plans.
    • Send plain text: Check this box. Copy your unique, personalized email address from the WebhookTrade "Set TradingView Alerts" page and paste it here. This method works with any TradingView plan, including the free one. You will need to verify the email once by entering a code that we forward to your personal inbox.
  6. Activate: Save the alert in TradingView. The system is now live. The next time your strategy triggers an alert, the trade will be executed, and the result will be logged in your WebhookTrade Dashboard.

Chapter 3: Platform Guide

This chapter provides a detailed walkthrough of each page within your WebhookTrade account.

3.1 The Dashboard (`/account/dashboard`)

The Dashboard is your central monitoring hub. It displays a comprehensive, real-time log of every signal received by our system for your account.

  • Purpose: To provide a transparent and detailed record of all trading activity, allowing you to track performance, verify executions, and diagnose any potential issues with your alerts.
  • Key Elements: The main feature is the Signal Log Table, which details the Symbol, Action, Size, SL/TP levels, Broker, Account Type, Source (webhook or email), execution Status, a detailed Summary from the broker (including error messages or ticket numbers), and the Date of the event. Powerful filtering tools at the top of the table allow you to narrow down the results by any of these criteria.

3.2 Broker Connections

The Connect Page (`/account/connect`) is the gateway to linking your brokerage accounts. From here, you will choose your desired integration type.

3.2.1 MetaTrader (MT4/MT5) (`/account/setmetatrader`)

This page facilitates our signature "done-for-you" MetaTrader integration.

  • Purpose: To securely collect your MT4/MT5 account information, which our system uses to provision your dedicated, managed trading environment on our servers.
  • Process: You will be prompted for your Platform (MT4/MT5), Login Number, Master Password, and the exact Server name provided by your broker. Our automated system then connect your account on our platform. This process typically takes 1-2 minutes. Upon completion, your connection status is confirmed, and your WebhookTrade API Key is displayed.

3.2.2 Capital.com (API) (`/account/setcapital`)

This page is for establishing a direct API connection with Capital.com.

  • Purpose: To link your Capital.com account using their provided API keys, allowing for direct trade execution.
  • Process: You will enter the API Key and API Key Password that you generate from within your Capital.com account settings. Once saved and validated, your WebhookTrade API Key will be displayed.

3.3 Set TradingView Alerts Page (`/account/jsonmaker`)

This is your primary workspace for constructing and verifying your alert commands.

  • Purpose: To provide all the necessary tools and information for correctly configuring your TradingView alerts.
  • Key Sections:
    1. JSON Generator: An interactive form that builds a syntactically correct JSON message as you input your trade parameters. This is the recommended method for creating your messages to prevent errors.
    2. Alert Sending Methods: This section provides the two methods for sending alerts from TradingView, giving you the flexibility to choose based on your TradingView plan.
    3. Alert Simulator: A crucial testing tool. You can paste a complete JSON message and click "Test Alert" to send a live trade to your connected account immediately. This allows you to verify your syntax and connection without waiting for a strategy to trigger.
      Caution

      Trades sent from the simulator are real and will be executed on your connected account. It is strongly recommended to use a DEMO account for initial tests.

3.4 Telegram Notifications (`/account/notificationstelegram`)

This feature allows you to receive real-time execution status updates on your mobile device via Telegram.

  • Purpose: To stay informed about the outcome of every trade without needing to check the dashboard.
  • Process: The page provides clear, step-by-step instructions on how to create your own Telegram Bot using @BotFather to get a Bot Token, and how to find your personal Chat ID using @userinfobot. You must then enter both the Bot Token and the Chat ID into the provided fields on this page and save them. Once configured, our system will be able to send a message to your bot every time a trade is successfully executed or fails.

3.5 Subscription Page (`/account/plan`)

This page is for managing your access to WebhookTrade services.

  • Purpose: To view your trial status, subscribe to a plan, and manage your billing.
  • Features: You can see your active plan, view the next billing date, and access our secure billing portal via the "Manage Subscription" button to update payment details or cancel your service.

3.6 Account Settings & Support

  • Account Settings (`/account/user_settings`): A straightforward page to update your name and change your WebhookTrade account password.
  • Support (`/account/support`): Your portal for getting help, including access to this documentation, FAQs, and methods for contacting our support team.

Chapter 4: Alert Message Specification

The JSON (JavaScript Object Notation) message is the core of your command. A precise understanding of its structure and parameters is key to leveraging the full power of WebhookTrade.

4.1 Basic Structure

Every alert must be a valid JSON object. The basic structure for a WebhookTrade alert is as follows:

{
  "username": "your_username",
  "api_key": "your_api_key",
  "broker": "metatrader",
  "symbol": "EURUSD",
  "action": "buy",
  "size": 0.1,
  ...
}

4.2 Parameter Reference

The following table details all available parameters.

Parameter Required? Description Example Value
Mandatory Parameters
username Yes Your WebhookTrade account username. "mytrader123"
api_key Yes Your unique WebhookTrade API Key. "b56288742380dd7e"
broker Yes The target platform. Must be "capital.com" or "metatrader". "metatrader"
symbol Yes The instrument to trade. See detailed explanation below. "EURUSD.pro"
action Yes The trade action to perform. See detailed explanation below. "buy"
size Yes, for open/pending orders The trade size. Not required for close actions (e.g., close_all). 0.5
account_type Yes, for capital.com Specify "demo" or "real" (not mandatory for MetaTrader) "demo"
Common Optional Parameters
execution_mode No Controls order handling. Can be "flip" (MetaTrader & Capital.com), "close_opposite" (MetaTrader only) or "mt_native" (MetaTrader only). "flip"
size_percentage No Calculates trade size as a % of account equity. Replaces/Overrides size. 2.5
tp_percentage No (MetaTrader Only) TP as a percentage of the entry price. 2.0
sl_percentage No (MetaTrader Only) SL as a percentage of the entry price. 1.0
tp_distance_price No TP distance as a direct price value (e.g., 25.5 for an index). 25.5
sl_distance_price No SL distance as a direct price value. 15.0
tp_distance No The Take Profit distance from the entry price (in Points for MetaTrader). 100
sl_distance No The Stop Loss distance from the entry price (in Points for MetaTrader). 100
take_profit No The absolute price level for Take Profit. 1.07500
stop_loss No The absolute price level for Stop Loss. 1.06500
trailing_stop No Set to true to enable a trailing stop. Requires an SL distance parameter. true
breakeven_distance_price No (MetaTrader Only) Breakeven trigger distance as a direct price value. 30.0
breakeven_percentage No (MetaTrader Only) Breakeven trigger as a percentage move from entry. 0.5
breakeven_distance No (MetaTrader Only) Breakeven trigger distance in Points. 300
breakeven_price No (MetaTrader Only) The price at which to move the SL to the entry price. 1.07800
Others
strategy No (MetaTrader Only) An identifier to isolate trades for specific strategies. "ABC"
comment No (MetaTrader Only) A custom note for the order's comment field. "Breakout trade"
Pending Order Parameters (MetaTrader Only)
price Yes, for pending orders The entry price for a limit or stop order. 1.25000
expiration No Time in minutes for a pending order to expire, must be greater than 10. 240

4.3 In-Depth: `action`

The action parameter determines the operation to be performed. The following values are supported:

  • "buy": Opens a new long position. Requires the size parameter.
  • "sell": Opens a new short position. Requires the size parameter.
  • "close_buy": Closes all open long positions for the specified symbol. The size parameter is ignored.
  • "close_sell": Closes all open short positions for the specified symbol. The size parameter is ignored.
  • "close_all": Closes all open positions (both long and short) for the specified symbol. For MetaTrader, this also deletes any pending orders for that same symbol. The size parameter is ignored.
  • "buy_limit" (MetaTrader Only, Pending Orders): Places a pending order to buy below the current market price. Requires size and price.
  • "sell_limit" (MetaTrader Only, Pending Orders): Places a pending order to sell above the current market price. Requires size and price.
  • "buy_stop" (MetaTrader Only, Pending Orders): Places a pending order to buy above the current market price. Requires size and price.
  • "sell_stop" (MetaTrader Only, Pending Orders): Places a pending order to sell below the current market price. Requires size and price.

4.4 In-Depth: `size`

The size parameter specifies the volume of your trade and is interpreted differently by each platform.

  • For MetaTrader: The size corresponds to Lots. A size of 1.0 on EURUSD is 1 standard lot (100,000 units). The minimum lot size for MetaTrader is 0.01; lower quantities will result in a size error. Only two decimal places will be considered. You should consult your broker's specifications to understand the contract size for each lot on different instruments (e.g., forex, indices, commodities).
  • For Capital.com: The size corresponds to the number of contracts or units as defined by Capital.com for that specific instrument.
Important Note on Size

Always ensure you have sufficient capital in your brokerage account to open a position of the specified size. An order may be rejected by the broker due to insufficient margin, regardless of whether the alert syntax is correct.

Dynamic Sizing with `size_percentage`

As an alternative to a fixed size, you can use the size_percentage parameter to automatically calculate the trade volume based on your account's equity.

  • How it works: The system calculates the trade size required for the position's notional value (total market exposure) to equal the specified percentage of your current account equity. For example, if your equity is $10,000 and you set "size_percentage": 5, the system will open a trade with a notional value of $500.
  • Note: This calculation does not take into account leverage or risk — it’s a simple percentage of your equity. Therefore, it doesn’t represent the maximum possible trade size. If you wish to include leverage in the calculation, multiply your percentage by your leverage factor. For example, with a 1:30 leverage and "size_percentage": 5, the effective notional exposure would be approximately 5% × 30 = 150% of your equity (i.e., $15,000 on a $10,000 account).

4.5 In-Depth: Stop Loss & Take Profit

You can define your exit points using several distinct methods. The system uses a clear priority order to determine which method to apply if multiple are provided in the same alert.

Advanced SL/TP Methods and Priority

You have a powerful hierarchy of methods to define your SL and TP levels. The system will use the first valid parameter it finds in the following order of priority:

  1. By Price Distance (tp_distance_price, sl_distance_price): Defines the exit point by a direct price difference. This is ideal for indices or commodities. Example: "sl_distance_price": 20.5 on US30 sets the SL exactly 20.5 points below the entry price.
  2. By Percentage (tp_percentage, sl_percentage) (MetaTrader Only): Defines the exit point as a percentage of the entry price. Example: "sl_percentage": 10 on a buy at $1500 sets the SL at $1350.
  3. By Points Distance (tp_distance, sl_distance) (MetaTrader Only): The standard method, defining the exit point in Points (the smallest price increment).
  4. By Absolute Price Level (take_profit, stop_loss): The classic method of specifying an exact price level. For this option, the alert message must include the exact price values generated dynamically from your Pine Script. You will need to build this string inside your script and send it through the alert — see Chapter 4.8 for implementation details.
Trailing Stops

To use a trailing stop, you must set "trailing_stop": true and provide the trail distance. For MetaTrader, the distance is determined by the same priority hierarchy as a regular Stop Loss (sl_percentage, sl_distance_price, or sl_distance). For Capital.com, you must use sl_distance or sl_distance_price.

Automated Breakeven Management (MetaTrader Only)

This feature automatically moves your Stop Loss to your entry price once the trade has moved a specified distance in your favor, effectively eliminating theoretical risk (if the market then reverses, the position will close at the same entry price, resulting in a profit/loss of approximately zero).

  • How it works: You define a trigger condition in your alert. The trigger is the condition that activates breakeven — it can be a price distance, points distance, percentage or an absolute price level. While the position is open the system monitors the market; when price reaches your trigger value, the Stop Loss is moved to the open price (breakeven).
  • Configuration (choose one):
    • "breakeven_distance_price": Price distance from entry (e.g. 0.005).
    • "breakeven_percentage": Percentage move from entry (e.g. 2 = 2%).
    • "breakeven_distance": Points distance from entry (e.g. 20).
    • "breakeven_price": Absolute price level to be reached (e.g. 1.2050). See Chapter 4.8 for implementation details.
  • Example: Buy at 1.2000 with "breakeven_distance_price": 0.005. When price reaches 1.2050, the system will move the SL to 1.2000 (breakeven).
  • Interaction with Trailing Stop: If you set both a trailing stop and a breakeven, the breakeven trigger must be smaller (closer to entry) than the trailing trigger for both to function correctly. Otherwise, the trailing may activate first and the breakeven will never move the SL to entry.
Important: Distance vs. Absolute Price for Stops

It's crucial to understand when and how to use different stop methods.

  • Distance-based stops (e.g., sl_distance, sl_distance_price, sl_percentage) are easy to use directly in the TradingView alert message box. They are calculated relative to the entry price, which our system determines at the moment of execution.
  • Absolute price-level stops (e.g., stop_loss, take_profit, breakeven_price) depend on the market price at the exact moment an alert triggers. For these to be accurate, they must be calculated dynamically. Therefore, the most reliable way to use absolute price levels is to calculate them within your Pine Script code and send the complete, calculated JSON message using the alert() function. Simply typing a fixed price into the alert message box is not recommended for a dynamic strategy. Refer to section 4.8.

4.6 In-Depth: `execution_mode`

This powerful, optional parameter allows you to control how new orders interact with existing positions for the same symbol.

Supported Values:
  • "close_opposite" (MetaTrader Only): This activates a smart netting logic based on a FIFO (First-In, First-Out) principle. When a new order is received, the system first closes the oldest opposing positions until the volume of the new order is accounted for.
    1. Scenario A (New order is SMALLER): A new BUY 0.5 lot arrives, and an existing SELL of 1.0 lot is open. The system will close the 1.0 lot SELL position. Since the closed volume (1.0) is greater than the new order's volume (0.5), the process is complete, and no new order is opened.
    2. Scenario B (New order is LARGER): A new BUY 1.0 lot arrives, and an existing SELL of 0.3 lots is open. The system will close the 0.3 lot SELL completely and then open a new BUY order for the remaining difference of 0.7 lots.
  • "flip" (MetaTrader & Capital.com): This mode is designed for complete position reversals. When a flip order arrives, the system closes all existing positions in the opposite direction of the new order and then opens a new position in the direction of the incoming order. All opposing positions are closed first, and the new order uses the full, specified size.

    Example: You have one/two SELL positions totaling 0.8 lots. A new BUY alert with "size": 0.5 and "execution_mode": "flip" arrives. The system will first close the/both SELL positions (0.8 lots total) and then open a new BUY position for 0.5 lots.

  • "mt_native" (MetaTrader Only): This is the default behavior for MetaTrader if the execution_mode field is omitted. The order is sent as-is, and your terminal will behave according to its native configuration (usually hedging).

4.7 In-Depth: Strategy & Comment Tags (MetaTrader Only)

For MetaTrader users, you can use tags to organize and manage trades from different strategies, even on the same symbol.

strategy

This parameter allows you to operate multiple, independent trading systems on the same symbol without them interfering with each other.

  • How it works: Add "strategy": "your_id" to your JSON (max. 3 chars, such as "ABC"). The system will tag the order internally. Any future actions (like close_opposite, flip or any close action like close_buy, close_sell, etc.) using the same strategy ID will only affect orders with that specific tag.
  • The "all" Wildcard: If you want an action to affect all positions on a symbol, regardless of their strategy tag, use "strategy": "all". This is perfect for a master "close everything" command.
  • If omitted: The action will only affect other orders that were also opened without a strategy tag.
comment

This parameter allows you to add a custom note to the order's comment field in MetaTrader. It does not perform a specific function but is useful for your own tracking and analysis within the MetaTrader platform.

Comment Field Limits

Our system uses the MetaTrader comment field to manage advanced features like Trailing Stops and Breakeven. If you also provide a custom comment and/or strategy, the combined text might exceed MetaTrader's character limit, causing your custom tags to be truncated or ignored. Although rare, very long calculated Trailing Stop or Breakeven settings may also be affected, potentially preventing them from being applied correctly.

To confirm that your tags were passed correctly, check the order's comment in your MetaTrader terminal. You should see identifiers like s (strategy), c (commnent), b, t if they were successfully applied.

4.8 Using Dynamic Variables (Placeholders)

To create fully automated strategies, you can use TradingView's built-in placeholders, also known as dynamic variables, in your JSON message. These are special text snippets enclosed in double curly braces, like {{ticker}}. When an alert triggers, TradingView's system replaces these placeholders with the relevant real-time values from your strategy or chart before sending the final message to WebhookTrade.

For many standard strategies, you do not need to modify any Pine Script code for the most basic placeholders to work. TradingView is designed to handle their replacement automatically when you create an alert from a strategy script.

The most common placeholders include:

  • {{ticker}}: The symbol of the chart the alert is on.
  • {{strategy.order.action}}: The action (buy or sell) from a strategy order.
  • {{strategy.order.contracts}}: The position size from a strategy order.

Beyond these standard variables, it is also possible to send dynamic values for other parameters, such as tp_distance or sl_distance, based on calculations within your strategy. However, it is crucial to understand that for all placeholders, the replacement is a function handled entirely by TradingView. WebhookTrade only accepts final, real values (like "buy" or 0.5). If a placeholder is not correctly replaced by TradingView, our system will receive the literal placeholder string (e.g., "action": "{{strategy.order.action}}"), which is not a valid command and will cause the trade to fail.

In cases where a standard placeholder is not being replaced, or for sending custom values like dynamic stops, you will likely need to use the alert() function directly within your Pine Script code. This is the most robust and reliable method for advanced automation.

Advanced Use Case: The `alert()` Function in Pine Script

In Pine Script, the alert() function gives you complete control over the alert message. Instead of relying on TradingView's automatic placeholders, you build the entire JSON message as a string inside your code and trigger it based on your own logic.

When should I use this?

For most strategies, you do not need this. The standard placeholders are sufficient. You should only consider using the alert() function for advanced scenarios, such as:

  • Dynamic Stops & Take Profits: When you need to send SL/TP values that are calculated dynamically (e.g., based on ATR or pivot points).
  • Custom Actions: When you want to use actions that are not standard in TradingView but are supported by WebhookTrade, such as close_buy, close_sell, or close_all.
  • Complex Alert Logic: When your alert needs to include multiple pieces of calculated data from your script in one message.
How to implement it (a quick guide):
  1. In your Pine Script code:

    First, your Pine Script code must contain the alert() function. You need to construct the full JSON message as a string. Use str.tostring() to convert any numbers (like calculated prices) to text. Then, call the function where your logic dictates. For example: if (longCondition) { float slPrice = close - ta.atr(14) * 2; string jsonMessage = '{"username": "...", "action": "buy", "stop_loss": "' + str.tostring(slPrice) + '"}'; alert(jsonMessage, alert.freq_once_per_bar); }

  2. In your TradingView Alert Settings:

    This is the crucial step. In the alert configuration window:

    • In the "Condition" dropdown, select your script. A second dropdown will appear below it.
    • In that second dropdown, you must select the option named "alert() function calls only".
      • (Note: This option will only be visible if your script actually contains the alert() function. If you don't see it, check your code.)
    • Once you select that option, you can proceed with the normal steps to generate the alert (In this case, it will not be necessary to use the message box.), so you can continue to "Notifications" and "Create Alert".

This method is more advanced but offers maximum reliability and flexibility for complex automation needs.

For a comprehensive understanding of all Pine Script functionalities, including the alert() function and managing dynamic variables, please refer to the official Pine Script documentation.

4.9 JSON Examples

Example 1: Hybrid Alert (Dynamic Action, Fixed Parameters)

This common setup uses a fixed symbol, size, and stop levels, but allows the strategy to determine whether to buy or sell.

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "metatrader",
  "symbol": "EURUSD",
  "action": "{{strategy.order.action}}",
  "size": "0.1",
  "tp_distance": "400",
  "sl_distance": "200",
  "execution_mode": "close_opposite"
}

Example 2: Comprehensive MetaTrader Strategy Alert

This example uses TradingView's dynamic variables for a fully automated strategy.

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "metatrader",
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "size": "{{strategy.order.contracts}}",
  "tp_distance": "400",
  "sl_distance": "200",
  "execution_mode": "close_opposite"
}

Example 3: Capital.com Market Sell with Fixed Price Stops

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "capital.com",
  "account_type": "demo",
  "symbol": "US30",
  "action": "sell",
  "size": "1",
  "take_profit": "39000",
  "stop_loss": "39500"
}

Example 4: MetaTrader Trailing Stop

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "metatrader",
  "symbol": "XAUUSD",
  "action": "buy",
  "size": "0.05",
  "trailing_stop": true,
  "sl_distance": "1500"
}

Example 5: MetaTrader Pending Order with Expiration and Strategy Tag

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "metatrader",
  "symbol": "GBPUSD",
  "action": "buy_limit",
  "price": 1.25000,
  "size": 0.1,
  "expiration": 480,
  "sl_percentage": 0.5,
  "tp_percentage": 1.5,
  "strategy": "123",
  "comment": "Buy at daily support"
}

Example 6: Capital.com Flip Strategy with Sizing by Percentage

{
  "username": "mytrader123",
  "api_key": "YOUR_API_KEY",
  "broker": "capital.com",
  "account_type": "demo",
  "symbol": "NAS100",
  "action": "sell",
  "size_percentage": 2,
  "execution_mode": "flip",
  "sl_distance_price": 50
}

Chapter 5: FAQ & Troubleshooting

What should I do first to start automating?

Once you have the TradingView strategy that you want to automate, the fastest way to get started is to follow our Quick Start Guide. The essential steps are: 1) Register at WebhookTrade, 2) Connect your broker account, 3) Use our JSON Generator to create your alert message, and 4) Paste that message into a new alert in TradingView, pointing it to our system via Webhook URL or email.

For the MetaTrader connection, do I need a VPS or to install an EA?

No. This is a core benefit of our service. You do not need to rent a Virtual Private Server (VPS), keep your computer running, or install any Expert Advisor (EA) software. WebhookTrade provides a fully managed, cloud-based service that handles the connection to your MetaTrader account 24/7.

Do I need to pay for a TradingView subscription?

Not necessarily. We offer two ways to send alerts from TradingView:

  • Webhook URL: This method is faster and recommended, but it requires any paid TradingView plan (Pro, Pro+, or Premium).
  • Send Plain Text: This method works with any TradingView plan, including the free one. You simply send the alert to your unique WebhookTrade email address.

Is it safe to provide my MetaTrader / Capital.com API details?

Yes. We prioritize your security. Sensitive information like passwords and API keys are encrypted before being stored.

Can I manage multiple MetaTrader accounts with one WebhookTrade account?

A single WebhookTrade account is designed to connect to one MetaTrader account. If you need to manage multiple MetaTrader accounts, you must create a separate WebhookTrade account for each one.

However, it is possible to combine different connection types. A single WebhookTrade account can simultaneously support:

  • One (1) MetaTrader (MT4 or MT5) connection.
  • And one (1) API-based broker connection (currently Capital.com).

This setup allows you to automate trades on two different platforms using a single WebhookTrade account and subscription.

I created an alert in TradingView, but I don't see it on the WebhookTrade dashboard.

If a signal doesn't appear in your dashboard, it likely means our system never received it. The most common reasons are:

  • Incorrect JSON Format: The message in your TradingView alert is not valid JSON. Even a missing comma or quote will cause it to fail. Always use the JSON Generator on our "Set TradingView Alerts" page to create your message. An incorrect username will also cause this.
  • Strategy Not Firing: Your strategy's conditions may not have been met, so TradingView never triggered the alert. Check the "Logs" tab (next to the "Alerts" tab) in your TradingView panel to confirm if an alert was actually sent.
  • Incorrect Notification Method: The notification method in TradingView (either 'Send Plain Text' or 'Webhook URL') is not configured correctly.

My signals are received but fail to execute on my broker. What's wrong?

Check your WebhookTrade dashboard. The "Summary" column will provide a specific error message from the broker. The most common errors are:

  • Inactive: Your trial period has ended, or your subscription was canceled or failed to renew. Please visit the Subscription page to activate your plan.
  • Invalid Action: This error is triggered if the action command received is not one of the supported values (e.g., buy, sell, buy_limit, close_all, etc.). Additionally, the error can occur if the system receives an unresolved placeholder from TradingView (like {{strategy.order.action}}), indicating the alert was fired without a specific trade action to execute.
  • Invalid Symbol: The symbol you sent does not exactly match what your broker uses. Check your broker's platform or the Market Watch in MetaTrader for the correct name. For example, some brokers use different symbols, such as XAUUSD.s instead of XAUUSD.
  • Invalid Stops: Your Take Profit or Stop Loss is too close to the current market price. Brokers have a minimum distance requirement. For MetaTrader, ensure your sl_distance or tp_distance is in Points and is large enough to be outside the broker's minimum stop level. For Capital.com, ensure the value is a valid price difference.
  • Not Enough Money / Size Too Large: You do not have enough margin in your account to cover the trade size. Try a smaller size and ensure you understand the lot/contract value for the asset.
  • User Not Logged In (MetaTrader): Your MetaTrader account is disconnected. Go to the "Connect to MetaTrader" page and re-establish the connection.

I'm receiving duplicate signals for a single trade.

This is almost always caused by your TradingView setup. Check for these two issues:

  • You have a duplicate alert in TradingView that you forgot to disable.
  • You have enabled both the "Webhook URL" and "Send plain text" notification methods within the *same* alert. You must only use one method per alert.

To diagnose, check the "Logs" tab in your TradingView panel. It will show you exactly how many alerts are being triggered.

My MetaTrader account connection failed.

This is usually due to incorrect credentials or an expired account. To troubleshoot:

  • Verify Credentials Manually: The best test is to try logging into the MetaTrader desktop terminal on your computer with the exact same credentials. This will confirm if they are correct.
  • Check the Server Name: Do not use a generic name like "Exness". You must use the precise server name provided by your broker, which looks like Exness-MT5Trial7.
  • Use the Master Password: Ensure you are using the master/trading password provided by your broker, not the investor (read-only) password. It often has a random format like A+k7X38rr4.
  • We currently do not support direct connections to MetaQuotes servers (e.g., MetaQuotes-Demo accounts) due to instability. You must use a demo or real account from a broker. Creating a broker demo account is fast and free.

If you can log in successfully on your desktop but still can't connect on our platform, please contact our support team.

New MetaTrader signals are not closing my old positions.

By default, MetaTrader operates in "Hedge Mode," meaning a new SELL order will open as a separate position instead of closing an existing BUY order. To change this, use our smart netting feature by adding "execution_mode": "close_opposite" to your JSON message. This will first close any positions in the opposite direction before opening a new one. See Section 4.6 for a full explanation.

How can I implement a "reversal" or "flip" strategy?

The most direct and powerful way is to use the "execution_mode": "flip" parameter in your JSON message. This command is available for both MetaTrader and Capital.com. It instructs the system to first close all positions in the opposite direction for that symbol, and then open the new trade with its full size. This ensures a clean and complete reversal of your market exposure. See Section 4.6 for a detailed example.

Can I close only part of my position (partial close)?

  • On Capital.com: Yes. Because it operates in netting mode, sending an opposing trade for a smaller size will partially reduce your existing position.
  • On MetaTrader: Not directly on a single trade. While you can close one whole position if you have several open, you cannot partially close a single position (e.g., close 0.5 lots of a 1.0 lot trade). The best workaround is to open your initial trade as multiple smaller positions (e.g., three 0.1 lot trades instead of one 0.3 lot trade). This allows you to close them one by one.

My MetaTrader account got disconnected.

This can happen if your demo account expired or if there was temporary instability with your broker's server. The first step is to go to the "Connect with MetaTrader" page and reconnect your account. If this happens frequently, you may need to create another MetaTrader account or consider a broker with more stable servers.

My alert has a placeholder like `{{...}}` and it's failing. Why?

WebhookTrade only accepts final values (like "buy" or a number for size), not the placeholder text itself. The replacement of placeholders like {{strategy.order.action}} is handled entirely by TradingView before the alert is sent. If our system receives the placeholder, it means TradingView did not replace it. Normally, TradingView replaces standard placeholders correctly without any code changes. However, if you want to send more complex dynamic variables (like a calculated stop loss) or if the standard placeholders are not being replaced, you will likely need to use the alert() function within your Pine Script code to build the JSON message manually. For detailed guidance, please refer to the official Pine Script documentation.

Appendix: Subscription Plans

We offer a free trial to all new users. After the trial, you can choose from the following plans on the "Subscription" page.

Plan Category Plan Name Price (USD) Billing Cycle Best For
MetaTrader MT Monthly $14.99 Monthly Users who want our fully managed MT4/MT5 service with monthly flexibility.
MetaTrader MT Quarterly $29.97 Every 3 Months Users committed to the MT service who want to save money.
API Broker API Monthly $10.00 Monthly Users connecting to Capital.com or other future API brokers.
API Broker API Annual $57.60 Annually Power users of API brokers looking for the best annual value.