AlgoWayWS-MT5 EA v2.06 — Detailed User Guide (MT5)

AlgoWayWS-MT5 EA v2.06

This guide explains how to use AlgoWayWS-MT5 EA v2.06 in MetaTrader 5: which settings exist in Inputs EA, and which fields are allowed in the webhook message (JSON). Internal implementation details are not covered.

This page does not repeat installation steps. For installation and MT5-side setup, use the dedicated setup guide: AlgoWayWS-MT5 — Setup Guide.

Download Here
Contents

1) What the EA does and its boundaries

The EA (Expert Advisor) is an MT5 executor: it receives commands via AlgoWay and executes trade actions (open / close / modify / management actions) on your MT5 account.

The EA is not responsible for:

  • strategy / indicator quality and signal logic;
  • differences between brokers (spread, commission, slippage, execution rules);
  • correctness of your alerts (what exactly they send).

Version 2.06 is the WS-only version of the EA.

2) Required MT5 conditions

Installation is documented on the separate setup page. Here we mention only the runtime conditions.

  • Attach the EA to a chart in MT5.
  • Enable algorithmic trading in the terminal and for the EA.
  • Use the correct webhook UUID in the Inputs.

3) Connecting the EA to the AlgoWay webhook

Inputs EA items: InputWebhook, MAGIC_NUMBER, RefreshRate

  • InputWebhook = "" — your AlgoWay webhook UUID
  • MAGIC_NUMBER = 1973 — magic number for EA positions
  • RefreshRate = 1 — timer frequency in seconds

What to enter:

  • correct option: webhook UUID (ID);
  • do not paste a full URL when the field expects UUID only.

v2.06 also contains a single-instance guard for the same webhook inside the same terminal environment.

4) Key setting for position behavior

Inputs EA item: TradeMode = Reverse

This is the main logic switch.

Available modes
  • Reverse = 0
  • Hedge = 1
  • Opposite = 2
  • Inverse = 3
Reverse
  • Default mode.
  • One side per symbol model.
  • BUY → opens / keeps BUY.
  • SELL → closes the current opposite side and opens SELL.
  • FLAT → closes positions for the symbol within EA logic.
Hedge
  • BUY and SELL can exist simultaneously.
  • BUY and SELL can be opened in parallel.
  • FLAT closes positions for the symbol.
  • JSON field close_side is additionally supported to close only one side.
Opposite
  • Position follows the latest signal.
  • A new signal closes the current position and opens the new side.
  • long / short are additionally allowed and treated as buy / sell.
Inverse
  • Incoming direction is inverted before normal execution logic.
  • BUY becomes SELL.
  • SELL becomes BUY.
  • long becomes short, and short becomes long.
  • If close_side is used, its side is inverted too.

5) Trade size and execution

Inputs EA items: OrderSizeCoefficient = 1, OrderFillingType = AUTO

5.1 OrderSizeCoefficient

This is a multiplier applied to the final size derived from order_contracts.

  • 1 — keep the computed / provided size as is
  • 0.5 — half the size
  • 2 — double the size
5.2 OrderFillingType
  • AUTO — automatic filling mode
  • FOK — Fill or Kill
  • IOC — Immediate or Cancel

6) Symbols: how the EA knows what to trade

Inputs EA items: TV_Ticker1..5, Broker_Ticker1..5

If TradingView uses one ticker but the broker’s MT5 uses another, fill the pairs:

  • TV_Ticker N — as received in ticker from TradingView
  • Broker_Ticker N — exact symbol name in the broker’s MT5

Default values:

  • TV_Ticker1 = "" / Broker_Ticker1 = ""
  • TV_Ticker2 = "" / Broker_Ticker2 = ""
  • TV_Ticker3 = "" / Broker_Ticker3 = ""
  • TV_Ticker4 = "" / Broker_Ticker4 = ""
  • TV_Ticker5 = "" / Broker_Ticker5 = ""

If the symbol is not found, the trade will not open.

7) IMPORTANT: two different SL/TP/Trailing models — do not mix them

Model A — levels come in the webhook message (JSON)
  • stop_loss, take_profit — distance
  • sl_price, tp_price — absolute price
  • trailing_pips — per-trade trailing
Model B — levels are set inside Inputs EA
  • UseInternalSLTP, InternalSLPips, InternalTPPips
  • EnableTrailingStop, TrailingStep
  • EnableBreakeven, BreakevenAfterPips
  • EnableProfitLock, ProfitLockPips, ProfitLockDeltaTrigger

8) PIP type: how distances are interpreted

Inputs EA item: PipCalcMode = PIP_TRADINGVIEW

  • PIP_AUTO — pip calculation follows broker rules (digits / point)
  • PIP_TRADINGVIEW — Forex: 1 pip = 10 × Point; others: 1 pip = Point
  • PIP_PERCENTstop_loss / take_profit are treated as a percent of entry price

9) Webhook JSON fields: supported and meaning

9.1 Required to open a trade
  • order_action — action (buy, sell, flat, modify, plus mode-specific management actions)
  • ticker — instrument ticker
  • order_contracts — size (or percent, depending on Position Size Mode)
9.2 SL/TP from JSON (Model A)
  • sl_price / tp_price — SL/TP as absolute price
  • stop_loss / take_profit — SL/TP as distance (pips or % depends on PIP type)

Priority rule: if sl_price / tp_price are set and non-zero, price levels are used; otherwise stop_loss / take_profit are used as distances.

9.3 Trailing from JSON (Model A)

trailing_pips forces trailing for that trade even if global trailing is disabled in the EA.

9.4 close_side (FLAT only)

close_side is allowed only together with order_action="flat".

  • long / buy — close only BUY positions
  • short / sell — close only SELL positions

If close_side is sent with buy / sell / modify, the EA treats it as an error.

9.5 comment / tv_order_id (position identifier)
  • comment — primary identifier
  • tv_order_id — fallback identifier if comment is empty
9.6 Wrapper forms are also accepted

v2.06 normalizes wrapped values such as stop_loss=100, take_profit=200, sl_price=1.2345, tp_price=1.2400, and trailing_pips=80.

10) EA-based SL/TP (Model B)

Inputs EA items: UseInternalSLTP, InternalSLPips, InternalTPPips

  • UseInternalSLTP = false
  • InternalSLPips = 0
  • InternalTPPips = 0

Hard rule: if UseInternalSLTP = true, then on trade entry the EA applies internal SL/TP and ignores SL/TP values from JSON.

11) EA-based trailing vs JSON trailing

Inputs EA items: EnableTrailingStop, TrailingStep

  • EnableTrailingStop = false
  • TrailingStep = 20
  • If JSON has trailing_pips → trailing is enabled for that trade and the step comes from trailing_pips.
  • If trailing_pips is absent and EnableTrailingStop = true → uses TrailingStep.
  • If trailing_pips is absent and EnableTrailingStop = false → no trailing.

12) Position size mode (Lots / Risk% / Balance%)

Inputs EA items: PositionSizeModeInput = SIZE_LOTS, UseRiskPercent = false

12.1 SIZE_LOTS

order_contracts is treated as lots.

12.2 SIZE_RISK_PERCENT

order_contracts is treated as percent risk of equity.

Important: this mode requires stop_loss. Without stop_loss, the EA cannot calculate risk-based volume correctly.

12.3 SIZE_BALANCE_PERCENT

order_contracts is treated as percent of balance. This is not risk-by-stop-loss mode; lot size is calculated by margin.

12.4 Legacy switch

UseRiskPercent is kept for old .set files. In new setups, use PositionSizeModeInput.

13) Breakeven

Inputs EA items: EnableBreakeven, BreakevenAfterPips

  • EnableBreakeven = false
  • BreakevenAfterPips = 20

When enabled, the EA moves SL to breakeven after the trade reaches the configured profit distance.

14) Profit Lock

Inputs EA items: EnableProfitLock, ProfitLockPips, ProfitLockDeltaTrigger

  • EnableProfitLock = false
  • ProfitLockPips = 100
  • ProfitLockDeltaTrigger = 20
14.1 What Profit LockPips means

This is how much profit the EA tries to lock once the feature is activated.

14.2 What ProfitLockDeltaTrigger means

This is the profit threshold that activates the Profit Lock logic.

14.3 How the two inputs work together

Profit Lock is a two-part model:

  • first the trade must reach ProfitLockDeltaTrigger;
  • then the EA moves SL so that ProfitLockPips of profit is protected.

15) Martingale

Inputs EA items: EnableMartingale, MartingaleMultiplier

  • EnableMartingale = false
  • MartingaleMultiplier = 1.50

When enabled, the lot can be increased after a losing trade according to the multiplier.

16) Trade limits

Inputs EA items: DailyLossLimitPercent, MaxDrawdownPerTradePercent, MaxOpenPositions

  • DailyLossLimitPercent = 0.0 — max daily loss in %
  • MaxDrawdownPerTradePercent = 0.0 — max drawdown per trade in %
  • MaxOpenPositions = 0 — max positions; if 0 = no limit

17) Sessions (UTC) + Daily Trade Window

Inputs EA items: NewYorkSeason, Trade_London, Trade_NewYork, Trade_Tokyo, DailyTimeWindowUTC

  • NewYorkSeason = WINTER
  • Trade_London = true — London (07:00-16:00)
  • Trade_NewYork = true — New York (12:00-22:00)
  • Trade_Tokyo = true — Tokyo (22:00-07:00)
  • DailyTimeWindowUTC = "00:00-23:59"

New York season logic:

  • SUMMER → daily reset at 21:00 UTC
  • WINTER → daily reset at 22:00 UTC

18) Auto-close (Auto-Flat)

Inputs EA items: AutoClose, AutoCloseLeadMinutes

  • AutoClose = AUTOFLAT_NONE
  • AutoCloseLeadMinutes = 30

Available modes:

  • AUTOFLAT_NONE — disabled
  • AUTOFLAT_END_OF_DAY — close positions before end of day
  • AUTOFLAT_END_OF_WEEK — close positions before end of week

19) Telegram notifications

Inputs EA items: EnableTelegramNotifications, TelegramChatId, TelegramBotToken

  • EnableTelegramNotifications = false
  • TelegramChatId = ""
  • TelegramBotToken = ""

When enabled and configured, the EA can notify you about disconnect / reconnect related events.

20) JSON examples (supported fields only)

20.1 Open BUY (Reverse), SL/TP by distance
{
  "platform_name": "binance",
  "order_action": "buy",
  "ticker": "BTCUSDT.P",
  "order_contracts": "0.10",
  "stop_loss": "150",
  "take_profit": "300"
}
20.2 Open SELL, SL/TP by absolute prices
{
  "platform_name": "tradelocker",
  "order_action": "sell",
  "ticker": "XAUUSD",
  "order_contracts": "0.05",
  "sl_price": "2055.50",
  "tp_price": "2038.00"
}
20.3 Open BUY with per-trade trailing
{
  "platform_name": "metatrader5",
  "order_action": "buy",
  "ticker": "GBPUSD",
  "order_contracts": "0.10",
  "stop_loss": "120",
  "trailing_pips": "80"
}
20.4 Hedge: close only long positions
{
  "platform_name": "matchtrader",
  "order_action": "flat",
  "ticker": "EURUSD",
  "order_contracts": "0.10",
  "close_side": "long"
}
20.5 Opposite: use LONG/SHORT
{
  "platform_name": "ctrader",
  "order_action": "long",
  "ticker": "USDJPY",
  "order_contracts": "0.10",
  "stop_loss": "100"
}
20.6 Modify: change SL/TP via comment
{
  "platform_name": "okx",
  "order_action": "modify",
  "ticker": "ETHUSDT",
  "comment": "TV#12345",
  "stop_loss": "140",
  "take_profit": "280"
}
20.7 Risk % mode example
{
  "platform_name": "metatrader5",
  "order_action": "buy",
  "ticker": "EURUSD",
  "order_contracts": "1.0",
  "stop_loss": "100"
}

If PositionSizeModeInput = SIZE_RISK_PERCENT, the value in order_contracts is treated as risk percent.

20.8 Balance % mode example
{
  "platform_name": "metatrader5",
  "order_action": "buy",
  "ticker": "EURUSD",
  "order_contracts": "5.0",
  "stop_loss": "100"
}

If PositionSizeModeInput = SIZE_BALANCE_PERCENT, the value in order_contracts is treated as balance percent, not lots.

20.9 Wrapped values example
{
  "platform_name": "metatrader5",
  "order_action": "buy",
  "ticker": "EURUSD",
  "order_contracts": "0.10",
  "stop_loss": "stop_loss=100",
  "take_profit": "take_profit=200",
  "trailing_pips": "trailing_pips=80"
}

21) Common issues

  • Wrong UUID in InputWebhook → EA will not receive commands.
  • Symbol not found → fill Symbols Mapping.
  • close_side used with non-flat action → error.
  • Risk % mode without stop_loss → size cannot be calculated correctly.
  • modify without valid comment / tv_order_id → position may not be identified.
  • Trade blocked by session filters or daily time window.
  • Algo Trading disabled in terminal / EA settings → commands will not execute.
  • Another active instance for the same webhook → current instance may stay passive.

22) Scope (strict)

This guide covers:

  • Inputs EA items and their meaning;
  • supported webhook JSON fields;
  • runtime behavior visible to the user.

This guide does not cover:

  • source code internals;
  • server-side implementation details;
  • strategy design and indicator logic.