MT5 EA Webhook JSON Reference for TradingView Automation with AlgoWay

This page originally described AlgoWay-MT5 EA v1.90. That version documented MT5 Inputs, supported webhook JSON fields, SL/TP models, trailing logic, risk mode, sessions and modify actions. The current AlgoWay MT5 workflow has moved forward to AlgoWayWS-MT5 EA 2.10, so this URL should now work as a current reference hub, not as a frozen v1.90 manual.
The URL is still valuable because traders search for MT5 EA JSON fields, TradingView to MT5 webhook JSON, MetaTrader 5 Expert Advisor inputs, MT5 webhook automation, TradingView alert SL TP MT5, and MT5 EA trailing stop JSON. Instead of losing that indexed traffic, AlgoWay now uses this page to explain the webhook message structure and send users to the current AlgoWayWS-MT5 guides.
The current route is:
TradingView alert → AlgoWay webhook → AlgoWayWS-MT5 EA → MetaTrader 5 broker account
Last updated: 2026-05-12 • Author: AlgoWay
Start Here: Current AlgoWayWS-MT5 EA Guides
If you arrived from Google looking for the old v1.90 user guide, use these current pages first:
| Need | Current guide |
|---|---|
| Install the current MT5 Expert Advisor | How to install an MT5 Expert Advisor for AlgoWay automation |
| Connect TradingView alerts to MetaTrader 5 | How to connect TradingView to MetaTrader 5 with AlgoWay EA |
| Understand current WebSocket EA architecture | AlgoWayWS-MT5 WebSocket EA overview |
| Build a correct AlgoWay webhook message | AlgoWay JSON schema guide |
| Understand SL/TP, trailing and risk controls | Advanced risk management and trade automation |
| Choose Hedge, Reverse or Opposite execution mode | How AlgoWay handles opposite trading signals |
| Fix MT5 execution errors | MetaTrader 5 common errors in AlgoWay |
What This Legacy v1.90 Page Is Now
The old v1.90 page was a detailed user guide for a specific EA version. It listed Inputs EA items, WebRequest requirements, trade modes, JSON fields, SL/TP models, risk percent mode, modify action, trade limits, sessions and auto-flat behavior.
The current page keeps that knowledge but changes the purpose:
- it explains the core webhook JSON concepts that still matter;
- it separates legacy v1.90 behavior from current AlgoWayWS-MT5 EA setup;
- it gives users a practical JSON field map;
- it links old indexed traffic to current AlgoWay documentation;
- it helps users debug TradingView-to-MT5 automation without relying on outdated version notes.
How AlgoWay MT5 Webhook Automation Works
AlgoWay does not replace your trading strategy. TradingView, Telegram, Pine Script, a manual test, or another signal source creates the instruction. AlgoWay receives that instruction and routes it to the destination platform. For MetaTrader 5, the current execution component is AlgoWayWS-MT5 EA.
The EA acts as the execution bridge inside MetaTrader 5:
- TradingView sends a webhook alert to AlgoWay.
- AlgoWay validates and routes the JSON message.
- AlgoWayWS-MT5 EA receives the command through the current connection flow.
- The EA maps the symbol, size, action, SL/TP and optional fields.
- MetaTrader 5 sends the final request to the broker server.
- AlgoWay and MT5 logs help you confirm what happened.
Core JSON Fields for MT5 Webhook Automation
A basic AlgoWay MT5 webhook message usually includes four fields:
| Field | Example | Purpose |
|---|---|---|
platform_name | metatrader5 | Tells AlgoWay to route the command to MetaTrader 5. |
ticker | EURUSD | Defines the instrument. It may need symbol mapping if the broker uses suffixes. |
order_contracts | 0.10 | Defines the size before final EA/broker conversion rules. |
order_action | buy | Defines the action: buy, sell, flat, modify or supported directional value. |
Example:
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_contracts": 0.10,
"order_action": "buy"
}
TradingView Strategy Alert JSON Example
For TradingView strategy alerts, the JSON message can use TradingView placeholders. TradingView replaces them when the alert fires.
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.market_position}}",
"price": "{{close}}"
}
This is the common bridge pattern used by TradingView-to-MT5 automation tools: TradingView creates the alert, the bridge validates the message, and the MT5 EA executes the command through MetaTrader.
Supported Actions: Buy, Sell, Flat and Modify
The most important action field is order_action. It tells AlgoWay what the signal wants to do.
| Action | Meaning | Typical use |
|---|---|---|
buy | Open or manage a BUY-side command | Long entry signal |
sell | Open or manage a SELL-side command | Short entry signal |
flat | Close position logic | Exit signal, close side, close symbol |
modify | Modify an existing position | Update SL/TP by comment or identifier |
Some strategy outputs use values such as long, short, flat or custom action names. Always confirm how your current AlgoWay route maps those values before live trading.
SL/TP Fields: Exact Price vs Distance
The old v1.90 guide emphasized two SL/TP models. That concept still matters in current automation.
Exact Price Fields
Use exact price fields when your signal already knows the precise Stop Loss or Take Profit level.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_contracts": 0.10,
"order_action": "buy",
"sl_price": 1.08400,
"tp_price": 1.09000
}
Distance Fields
Use distance fields when your signal sends stop and target distances instead of absolute price levels.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_contracts": 0.10,
"order_action": "sell",
"stop_loss": 200,
"take_profit": 300
}
If both exact price fields and distance fields are present, exact price fields should be treated as the clearer instruction:
sl_priceshould win overstop_loss.tp_priceshould win overtake_profit.
More detail: How to automate MT5 Stop Loss and Take Profit from TradingView alerts.
Trailing Stop Field
Trailing stop automation can be defined globally in the EA or per trade through a JSON field, depending on current route behavior.
{
"platform_name": "metatrader5",
"ticker": "GBPUSD",
"order_contracts": 0.10,
"order_action": "buy",
"stop_loss": 120,
"trailing_pips": 80
}
Trailing stop logic depends on the current EA build, terminal connection and broker rules. If trailing is managed by the terminal or EA, MetaTrader 5 must remain connected for local trailing logic to continue.
Position Identifier: Comment and tv_order_id
For modify operations, the system needs to know which position should be changed. The legacy v1.90 guide used comment as the primary identifier and tv_order_id as a fallback when the comment was empty.
{
"platform_name": "metatrader5",
"order_action": "modify",
"ticker": "EURUSD",
"comment": "TV#12345",
"sl_price": 1.08300,
"tp_price": 1.09200
}
In current usage, always check the current JSON schema and EA behavior before relying on identifiers for live position modification.
close_side for Hedge Logic
When hedging is supported, close_side can be used with a flat-style command to close only one side of the symbol.
{
"platform_name": "metatrader5",
"order_action": "flat",
"ticker": "EURUSD",
"close_side": "long"
}
Typical meanings:
long— close BUY-side positions.short— close SELL-side positions.
This behavior must match the selected AlgoWay mode and the broker account type. If the destination account is netting or one-way, hedge-side behavior may not apply the same way.
Execution Modes: Reverse, Hedge and Opposite
The old v1.90 page documented execution modes. The current explanation should focus on what happens when an opposite signal arrives.
| Mode | Practical meaning | When to use |
|---|---|---|
| Hedge | BUY and SELL can exist separately if the platform/account supports it. | Strategies that intentionally allow both directions. |
| Reverse | Opposite signal closes the current position and waits for another entry. | Opposite signal means exit, not instant flip. |
| Opposite | Opposite signal closes the current position and immediately opens the other side. | Strategies that must flip direction immediately. |
Full guide: How AlgoWay handles opposite trading signals.
Risk Mode and order_contracts
The legacy v1.90 guide included a risk-percent mode where order_contracts could be interpreted as percent risk of equity. This is a powerful concept, but it must be used only with the current EA documentation and current dashboard settings.
Risk-based sizing usually requires a valid Stop Loss, because the system needs a stop distance to calculate position size from risk. If risk mode is enabled and no usable Stop Loss exists, the route should block execution instead of guessing.
Sessions, Trade Limits and Auto-Flat
Execution is not only about receiving a signal. The EA and AlgoWay configuration may also apply time and safety filters:
- maximum daily loss;
- maximum drawdown per trade;
- maximum open positions;
- London, New York or Tokyo session filters;
- daily trade window;
- end-of-day or end-of-week auto-flat behavior.
If a signal is rejected by a schedule or risk rule, that is not a TradingView failure. It means the automation layer followed the configured safety rules.
Symbol Mapping: TradingView Ticker vs MT5 Broker Symbol
One of the most common MT5 automation problems is symbol mismatch. TradingView may send XAUUSD, while the broker requires XAUUSDm, XAUUSD.r or another exact symbol name.
| TradingView ticker | MT5 broker symbol |
|---|---|
EURUSD | EURUSD.a |
XAUUSD | XAUUSDm |
BTCUSDTPERP | BTCUSDT.r |
Always check the exact symbol in MetaTrader 5 Market Watch before testing live order execution.
Common JSON and MT5 Execution Problems
Invalid JSON
If TradingView sends plain text or broken JSON, AlgoWay may reject the webhook before MT5 receives anything. See: How to fix AlgoWay webhook Error 415.
EA Does Not Receive Commands
Check the AlgoWay webhook UUID, current EA connection status, MT5 Experts log and the current AlgoWayWS-MT5 installation guide.
Symbol Not Found
Check Market Watch and symbol mapping. The broker symbol must match exactly.
Invalid Stops
Check Stop Loss side, Take Profit side, stop level, freeze level, symbol digits and points/pips interpretation.
Unsupported Filling Mode
Test the supported order filling policy for the broker and symbol. Unsupported filling mode often appears together with MT5 Error 4756.
Trading Disabled
If MT5 returns Error 4752, enable Algo Trading and EA permissions. See: How to fix MT5 Error 4752.
Safe Testing Procedure for JSON Changes
When changing webhook JSON, test in layers:
- Send a simple market order without SL/TP.
- Confirm that AlgoWay receives the message.
- Confirm that AlgoWayWS-MT5 receives the command.
- Confirm that MT5 sends the order without permission errors.
- Add exact
sl_priceandtp_price. - Test distance fields only after exact price fields work.
- Add trailing logic only after base execution is stable.
- Check both AlgoWay logs and MT5 Experts/Journal logs after every test.
Why This v1.90 Page Still Exists
This page remains online because it is already indexed and still attracts users looking for MT5 EA inputs, webhook JSON fields and TradingView-to-MT5 automation. Removing it would lose traffic and send old links to a dead end.
Keeping it online lets AlgoWay turn old version-specific traffic into current documentation traffic:
- old v1.90 users understand that the page is legacy context;
- new users find the current AlgoWayWS-MT5 EA workflow;
- Google sees a useful MT5 webhook JSON reference instead of a thin outdated release page;
- internal links move users to setup, JSON, risk and troubleshooting guides.
Related AlgoWay Guides
- How to connect TradingView to MetaTrader 5 with AlgoWay EA
- How to install an MT5 Expert Advisor for AlgoWay automation
- AlgoWay JSON schema guide
- Advanced risk management and trade automation
- How AlgoWay handles opposite trading signals
- MetaTrader 5 common errors in AlgoWay
- How to fix MT5 Error 4752
- How to fix MT5 Error 4756
- How to fix AlgoWay webhook Error 415
Final Summary
AlgoWay-MT5 EA v1.90 was a useful version-specific manual, but this URL now has a better role. It should act as a current MT5 EA webhook JSON reference and migration hub for AlgoWayWS-MT5 EA 2.10.
If you are building TradingView-to-MT5 automation today, start with the current AlgoWayWS-MT5 installation guide, send valid webhook JSON, test a simple order first, then add SL/TP, trailing, modify, hedge-side close and risk logic step by step.