Main clusters and core pages.
This page originally described AlgoWay-MT5 v1.6 and its first advanced SL/TP logic. That release was important because it introduced a clearer way to send Stop Loss and Take Profit values through automated alerts. The current AlgoWay platform has moved forward, and the modern MT5 execution path is based on AlgoWayWS-MT5 EA 2.10.
The URL still matters because traders search for MT5 Stop Loss automation, TradingView to MT5 Take Profit, TradingView alert with SL and TP, MetaTrader 5 webhook risk management, automated trading SL/TP, and MT5 trailing stop automation. Instead of deleting this indexed release note, AlgoWay now uses it as a current guide for SL/TP automation in the TradingView-to-MT5 workflow.
The current execution route is:
TradingView alert → AlgoWay webhook → AlgoWayWS-MT5 EA → MetaTrader 5 order with SL/TP and risk rules
Last updated: 2026-05-12 • Author: AlgoWay
If you arrived from an old v1.6 search result, use these current AlgoWay guides first:
| What you need | Current guide |
|---|---|
| Connect TradingView alerts to MetaTrader 5 | How to connect TradingView to MetaTrader 5 with AlgoWay EA |
| Install the current AlgoWayWS-MT5 Expert Advisor | How to install an MT5 Expert Advisor for AlgoWay automation |
| Build the correct webhook JSON message | AlgoWay JSON schema guide |
| Understand current risk management, SL/TP and trailing behavior | Advanced risk management and trade automation |
| Fix MT5 invalid stops, rejected requests and broker execution errors | How to fix MT5 Error 4756 |
| Fix invalid TradingView webhook JSON | How to fix AlgoWay webhook Error 415 |
Automating entry signals without Stop Loss and Take Profit control is incomplete automation. The trade may open, but the risk model is not fully defined. A serious TradingView-to-MT5 workflow should answer these questions before the order reaches the broker:
AlgoWay exists to make this execution layer predictable. The signal source sends the instruction. AlgoWay validates and routes it. AlgoWayWS-MT5 EA sends the final order to MetaTrader 5 according to the current configuration and broker rules.
The old v1.6 release introduced two important SL/TP concepts:
That logic is still important conceptually, but this page should no longer be read as a current v1.6 release note. The current implementation and setup should follow the latest AlgoWayWS-MT5 EA documentation.
Exact price fields are useful when your strategy already knows the precise Stop Loss and Take Profit levels. In AlgoWay JSON, this is usually represented with sl_price and tp_price.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_contracts": 0.10,
"order_action": "buy",
"sl_price": 1.08400,
"tp_price": 1.09000
}
For a BUY trade, Stop Loss must be below the entry area and Take Profit must be above it. For a SELL trade, Stop Loss must be above the entry area and Take Profit must be below it.
Distance fields are useful when the strategy sends Stop Loss or Take Profit as a fixed offset. Depending on the route and current EA behavior, these values may be interpreted as pips, points or a configured distance model.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_contracts": 0.10,
"order_action": "sell",
"stop_loss": 200,
"take_profit": 300
}
Distance-based SL/TP requires special attention on 5-digit Forex symbols, metals and crypto CFDs. For many 5-digit Forex symbols, one pip is often represented as ten points. This is one of the most common reasons for invalid stops and rejected MT5 orders.
If a signal contains both exact price fields and distance fields, the safest logic is to treat exact price values as the more explicit instruction:
sl_price should take priority over stop_loss.tp_price should take priority over take_profit.This prevents ambiguity. If the alert says both “place SL at this exact price” and “place SL this many pips away,” AlgoWay should not guess. Exact price is the clearer instruction when present.
A trailing stop moves the Stop Loss after the position moves in profit. In an automated TradingView-to-MT5 setup, trailing logic is useful when the strategy should protect profit without sending manual modifications after every market move.
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_contracts": 0.05,
"order_action": "buy",
"sl_price": 2330.00,
"tp_price": 2380.00,
"trailing_pips": 150
}
Trailing behavior depends on the EA, the MT5 terminal, broker rules and symbol conditions. If trailing is managed locally by the terminal or EA, the terminal must remain connected for that logic to continue working.
Even if the JSON is valid, MetaTrader 5 and the broker can reject the final order. SL/TP automation must respect broker rules:
If Stop Loss or Take Profit is too close to the current price, the broker can reject the order with an invalid stops message. In AlgoWay troubleshooting, this often appears together with MT5 Error 4756 or a trade server return code.
Related guide: How to fix MT5 Error 4756.
For a BUY order, Stop Loss should be below the entry area. For a SELL order, Stop Loss should be above the entry area. If the values are reversed, MT5 can reject the request.
For a BUY order, Take Profit should be above the entry area. For a SELL order, Take Profit should be below the entry area.
If the stop is closer than the broker allows, the order can fail. Check Market Watch → Symbol → Specification for stop level and freeze level.
A distance value that looks correct in pips may be too small in points. Always confirm how your current route interprets stop_loss, take_profit and trailing_pips.
TradingView may send XAUUSD, while the broker uses XAUUSDm, XAUUSD.r or another exact symbol. Wrong symbol mapping can break execution even if SL/TP values are correct.
A TradingView strategy can use placeholders for ticker, order size and position direction. SL/TP values may be fixed, calculated by Pine Script, or inserted manually depending on the strategy design.
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.market_position}}",
"price": "{{close}}",
"sl_price": 1.08400,
"tp_price": 1.09000
}
If the SL/TP values must come from Pine Script, make sure the final alert message is valid JSON and that the generated values match the broker's symbol precision.
Before using SL/TP automation live, test in layers:
sl_price and tp_price.| Check | Where | Why it matters |
|---|---|---|
| Valid JSON | TradingView alert message / AlgoWay logs | AlgoWay must receive structured fields. |
| Correct symbol | MT5 Market Watch | SL/TP validation uses the broker's actual symbol. |
| Correct direction | JSON order_action |
SL/TP side depends on BUY or SELL. |
| Stop level and freeze level | Symbol Specification | Stops too close can be rejected. |
| Lot size | Symbol Specification / EA sizing | Invalid volume can hide the real SL/TP test. |
| Filling mode | EA settings / broker rules | Unsupported filling mode can reject valid SL/TP orders. |
| EA connection | MT5 Experts log | AlgoWayWS-MT5 must be connected before execution. |
This URL is already indexed and may still receive traffic from old search results. Removing it would waste useful traffic from users looking for MT5 SL/TP automation. Keeping it online lets AlgoWay redirect that search intent into current documentation:
AlgoWay-MT5 v1.6 was an early step toward precise SL/TP automation. The current value of this page is broader: it explains how to think about Stop Loss, Take Profit, exact price fields, distance fields, trailing stop, broker validation and MT5 execution errors in the current AlgoWayWS-MT5 EA 2.10 workflow.
If you want to automate TradingView alerts to MetaTrader 5 with reliable risk control, start with current AlgoWayWS-MT5 setup, send valid JSON, test a simple order first, then add SL/TP and trailing logic step by step.