Guides, manuals and platform references.
AlgoWay uses JSON messages to understand trading alerts from TradingView, TrendSpider, custom bots and external webhook systems. The JSON tells AlgoWay which platform should receive the order, which symbol to trade, which action to perform, what size to use, whether the entry is a market, limit or stop order, which entry price should be used for pending orders, and whether optional management fields such as Stop Loss, Take Profit, trailing stop, trade mode override, modify, breakeven, closeall or hedge-side closing should be applied.
This reference explains the complete AlgoWay webhook structure, including required fields, order actions, market and pending orders, per-signal trade mode, leverage, percentage-based position sizing and percentage-based partial closing with order_size_type, Stop Loss and Take Profit formats, trailing stops, position modification, breakeven and hedge-side closing.
The basic route is:
TradingView / TrendSpider / custom alert → AlgoWay webhook URL → AlgoWay JSON parser → selected broker, exchange or trading platform
If the JSON is valid and the route is configured correctly, AlgoWay can normalize the signal and send it to the selected destination. If the JSON is invalid or required fields are missing, the request is rejected before execution.
Last updated: 2026-08-31 • Author: AlgoWay
The minimal JSON for opening a trade usually contains four required fields:
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "buy",
"order_contracts": "0.10"
}
For TradingView strategy alerts, the same structure can use TradingView placeholders:
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_action": "{{strategy.market_position}}",
"order_contracts": "{{strategy.order.contracts}}",
"price": "{{close}}"
}
For pending entries, add order_type and price. If order_type is missing, AlgoWay treats the order as market by default.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "buy",
"order_contracts": "0.10",
"order_type": "limit",
"price": "1.0800",
"sl_price": "1.0750",
"tp_price": "1.0950"
}
To close all open positions for one symbol, use order_action as closeall. This action does not require order_contracts.
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "closeall"
}
If one specific alert must use another position behavior than the webhook default, add trade_type. If trade_type is missing, AlgoWay uses the required Trade Type configured in the webhook dashboard.
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "sell",
"order_contracts": "0.05",
"trade_type": "hedge"
}
For TrendSpider alerts, the structure can use TrendSpider placeholders:
{
"platform_name": "metatrader5",
"ticker": "%alert_symbol%",
"order_action": "buy",
"order_contracts": 1,
"price": "%last_price%",
"comment": "TS:%alert_name%"
}
A webhook URL only delivers a message. The JSON body tells AlgoWay what the message means. Without a clear schema, the receiving system cannot reliably know whether the alert is a buy, sell, close, closeall, modify, breakeven or another action.
Good JSON makes automation safer because it defines:
If the alert message is valid JSON, webhook receivers can parse it consistently. If it is broken text, missing quotes or incomplete JSON, AlgoWay cannot safely treat it as an execution command.
AlgoWay's core schema expects these fields for normal order routing.
| Field | Required | Example | Purpose |
|---|---|---|---|
platform_name |
Yes | metatrader5 |
Defines which platform handler should process the alert. |
ticker |
Yes | EURUSD, BTCUSDT, XAUUSD |
Defines the market instrument. |
order_action |
Yes | buy, sell, flat, closeall |
Defines order direction or management action. |
order_contracts |
Yes for normal entry orders. No for closeall. |
0.10, 1, 0.001 |
Defines trade size, lot, contracts or quantity depending on platform. |
order_type |
No | market, limit, stop |
Defines entry order type. If missing, AlgoWay treats the order as market. |
price |
Required when order_type is limit or stop |
1.0800, {{close}} |
Defines the entry price for limit and stop orders. For market orders it can still be used for logs. |
order_contracts in every normal entry alert. Do not include order_contracts when using order_action as closeall.
order_action tells AlgoWay what the alert is trying to do.
| Value | Meaning | Typical use |
|---|---|---|
buy |
Buy-side entry. | Long entry, spot buy, futures long. |
sell |
Sell-side entry or short-side entry depending on platform. | Short entry, sell order, futures short. |
flat |
Close or flatten matching exposure. | Exit signal, close position, strategy goes flat. |
close |
Close instruction. AlgoWay normalizes it to flat. |
Exit signal, close command from external tools, pending-order cleanup where supported. |
closeall |
Close all open positions for the specified ticker without sending order_contracts. |
Close all active exposure on one symbol with one command. |
modify |
Update an existing position or pending order. | Change SL/TP on a position, or modify the entry price of an existing LIMIT/STOP pending order where supported. |
breakeven |
Move Stop Loss to entry price where supported. | Position protection after price moves in favor. |
AlgoWay can normalize common directional words into the internal action model:
| Incoming value | Normalized value |
|---|---|
long | buy |
short | sell |
close | flat |
closelong, closeshort, closeall | flat with route-specific close behavior |
This allows TradingView messages like {{strategy.market_position}} to be used in many workflows, but you should still test exactly how your destination route handles the normalized action.
closeall is a close-only action that closes all open positions for the specified ticker with one command. It does not open a new trade and does not require order_contracts.
This action is useful when a user wants to exit all active exposure on one symbol without calculating the current lot size, contract amount or remaining position volume.
order_action is closeall, do not send order_contracts. AlgoWay will send a close-all instruction for the specified symbol where the destination route supports this action.
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "closeall"
}
Use closeall when the alert must close every open position on the selected symbol. The JSON must include platform_name, ticker and order_action. The order_contracts, order_type and price fields are not required for this action.
For MetaTrader 5 users, closeall requires AlgoWay EA version 2.10b or newer.
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_action": "closeall"
}
order_type defines how AlgoWay should treat an entry alert. Supported values are market, limit and stop.
| order_type | price required? | Meaning | Typical use |
|---|---|---|---|
market |
No | Execute immediately at available market price. | Standard TradingView strategy entry, fast webhook execution, default mode. |
limit |
Yes | Create a limit entry at the specified price. |
Buy below market, sell above market, pullback entries. |
stop |
Yes | Create a stop entry at the specified price. |
Breakout entries, momentum confirmation, stop-market style triggers where supported. |
order_type is not included, AlgoWay treats the entry as market. This keeps old TradingView webhook JSON messages backward compatible.
When order_type is limit or stop, include price. In this context, price is not only a log value; it is the requested entry price for the pending order.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "buy",
"order_contracts": "0.10",
"order_type": "market"
}
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "buy",
"order_contracts": "0.10",
"order_type": "limit",
"price": "1.0800",
"sl_price": "1.0750",
"tp_price": "1.0950"
}
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "buy",
"order_contracts": "0.05",
"order_type": "stop",
"price": "2365.00",
"sl_price": "2352.00",
"tp_price": "2395.00"
}
sl_price and tp_price can be used together with market, limit or stop entries where the selected destination supports absolute Stop Loss and Take Profit prices. For distance-style SL/TP, use stop_loss and take_profit.
To close a position or send a close command, use order_action as flat or close. close is normalized to flat. For close-only messages, order_type and price are normally not required.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "flat",
"order_contracts": "0.10"
}
If the route supports pending-order cleanup, a flat or close command can also be used to remove pending entries connected with the same symbol, route, comment or order identifier. Exact behavior depends on the destination handler and route settings.
trade_type lets one JSON message override the Trade Type configured in the webhook dashboard. Supported values are hedge, netting, opposite and inverse.
| trade_type | Meaning | Typical use |
|---|---|---|
hedge |
Allow separate long and short exposure where the destination supports it. | Strategy legs, multi-signal workflows, independent long/short handling. |
netting |
Use net-position behavior for this order. | One net exposure per symbol, no separate long/short stacking. |
opposite |
Send the opposite side of the incoming signal. | Inverse execution strategy, copy opposite behavior. |
inverse |
Invert the incoming direction where the route supports inverse mode. | Contrarian mirroring, inverse copy-trading logic. |
If trade_type is missing, AlgoWay uses the Trade Type selected in the webhook settings. In the webhook creation form this setting is required, so the route always has a default behavior. Use trade_type in JSON only when this exact alert must behave differently from the webhook default.
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "buy",
"order_contracts": "0.05",
"trade_type": "hedge"
}
{
"platform_name": "metatrader5",
"ticker": "NAS100",
"order_action": "sell",
"order_contracts": "1",
"order_type": "limit",
"price": "18350.0",
"sl_price": "18430.0",
"tp_price": "18100.0",
"trade_type": "netting"
}
For a full explanation of hedge, netting, opposite and inverse behavior, read How AlgoWay handles opposite trading signals.
leverage allows a webhook signal to set leverage for the current order without changing the leverage stored in the AlgoWay platform connection settings.
The parameter is supported for the following cryptocurrency exchange connections:
If leverage is omitted, AlgoWay uses the leverage saved in the connected platform settings.
{
"platform_name": "mexc",
"ticker": "BTCUSDT",
"order_contracts": "0.01",
"order_action": "buy",
"leverage": "5"
}
This signal opens a BTCUSDT position using 5x leverage.
order_size_type changes how AlgoWay interprets order_contracts. The parameter is optional. If it is omitted, order_contracts keeps its normal platform-specific meaning such as lots, contracts or quantity.
The percentage-based sizing modes are:
| order_size_type | Used with | Meaning of order_contracts | Additional requirement |
|---|---|---|---|
balance_percent |
buy, sell |
order_contracts is the percentage of current account equity used as the target position notional. |
No Stop Loss is required. |
risk_percent |
buy, sell |
order_contracts is the percentage of current account equity that may be lost if Stop Loss is reached. |
sl_price or stop_loss is required. |
position_percent |
flat |
order_contracts is the percentage of the currently open position that should be closed. |
Value must be greater than 0 and not greater than 100. |
balance_percent and risk_percent use live account equity for entry sizing. position_percent uses the actual open position size for partial closing and does not require an equity or Stop Loss calculation.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "buy",
"order_contracts": "0.05",
"order_size_type": "balance_percent",
"leverage": "50"
}
In this example, 0.05 means 0.05% of current account equity. AlgoWay reads the live account equity and calculates 0.05% of that equity as the target position notional. The destination handler then converts that target size into the quantity or contract format required by the platform.
leverage is handled separately. It does not multiply the percentage used by balance_percent. The percentage defines the target position notional, while leverage controls the leverage setting used by the destination handler where leverage control is supported.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "buy",
"order_contracts": "0.05",
"order_size_type": "risk_percent",
"sl_price": "0.29000",
"leverage": "50"
}
Here 0.05 means that the loss at the specified Stop Loss should equal approximately 0.05% of current account equity. AlgoWay calculates the distance between the entry reference price and sl_price, converts the permitted account risk into position size, and the destination handler converts that size into the quantity or contract format required by the platform.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "sell",
"order_contracts": "0.05",
"order_size_type": "risk_percent",
"sltp_type": "percent",
"stop_loss": "1",
"leverage": "50"
}
In this example, order_contracts: 0.05 means 0.05% account risk and stop_loss: 1 means a Stop Loss distance of 1% from the entry reference price.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "flat",
"order_contracts": "50",
"order_size_type": "position_percent"
}
Here 50 means close 50% of the currently open TRXUSDT position. AlgoWay reads the actual open position size and calculates the close volume from that position. It does not recalculate the original balance_percent or risk_percent used to open the trade.
For example, if the current position contains 322 contracts, position_percent: 50 closes 161 contracts. The destination handler applies the platform-specific quantity step, lot step or contract-size rules when converting the percentage to an executable close size.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "flat",
"order_contracts": "25",
"order_size_type": "position_percent",
"close_side": "long"
}
In hedge mode, close_side can be long or short. The percentage is calculated from the selected hedge leg. If close_side is omitted and both long and short positions exist, AlgoWay calculates the requested percentage separately for each open leg.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "flat",
"order_contracts": "100",
"order_size_type": "position_percent"
}
position_percent: 100 closes 100% of the matching current position. For a simpler full-close instruction that does not require order_contracts, you can also use closeall.
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "closeall"
}
balance_percent and risk_percent are entry-sizing modes. For percentage-based partial closes, use position_percent. To close every matching open position without calculating a percentage, use closeall.
Optional fields add execution context, risk controls, management actions or logging labels.
| Field | Example | Purpose |
|---|---|---|
order_type |
market, limit, stop |
Optional entry type. If missing, default is market. If limit or stop, price is required. |
trade_type |
hedge, netting, opposite, inverse |
Overrides the webhook Trade Type for this specific order. If missing, webhook settings are used. |
leverage |
5 |
Sets leverage for the current signal. Supported for MEXC, KuCoin Futures, BitMart Futures, Coinbase Futures and BingX. If omitted, AlgoWay uses the leverage saved in the connected platform settings. |
order_size_type |
balance_percent, risk_percent, position_percent |
Changes how order_contracts is interpreted. balance_percent sizes a new position by account equity, risk_percent sizes a new position by equity risk at Stop Loss, and position_percent closes a percentage of the current position with flat. |
sltp_type |
pips, percent |
Defines how stop_loss and take_profit are interpreted. If omitted, AlgoWay uses pips by default. Percentage mode is available only for supported cryptocurrency exchange connections. |
stop_loss |
100 |
Distance-style Stop Loss value. Usually interpreted as points, pips or route-specific distance. |
take_profit |
200 |
Distance-style Take Profit value. Usually interpreted in the same model as stop_loss. |
sl_price |
1.0845 |
Absolute Stop Loss price level. |
tp_price |
1.0950 |
Absolute Take Profit price level. |
price |
{{close}}, %last_price% |
Tracking price from the alert source. Useful for logs and comparison. |
trailing_pips |
80 |
Trailing stop value where supported by the platform route. |
comment |
TV#12345 |
User label, alert label, EA comment, magic-like reference or debug tag. |
close_side |
long, short |
Used with flat in hedge mode to close only one side. |
tv_order_id |
order-12345 |
Stable TradingView-side identifier used to find the same position or pending order later. For pending-order modification, use the same value that was sent with the original order. |
order_id |
Long Entry 1 |
Optional route-specific position leg or strategy signal identifier where supported. |
Empty strings are treated as missing values and ignored. Numeric fields must be parseable as numbers. A non-numeric value in a numeric field can trigger validation failure.
AlgoWay supports three SL/TP calculation methods:
sltp_type: percent;sltp_type: pips;sl_price and tp_price.To interpret stop_loss and take_profit as percentages of the current market price, add:
{
"sltp_type": "percent"
}
The signal must also contain at least one of these fields:
stop_loss;take_profit.{
"platform_name": "bybit",
"ticker": "BTCUSDT",
"order_contracts": "0.01",
"order_action": "buy",
"sltp_type": "percent",
"stop_loss": "1",
"take_profit": "2.5"
}
In this example, Stop Loss is placed 1% away from the current market price and Take Profit is placed 2.5% away.
{
"platform_name": "binance",
"ticker": "ETHUSDT",
"order_contracts": "0.1",
"order_action": "buy",
"sltp_type": "percent",
"stop_loss": "1.5"
}
{
"platform_name": "okx",
"ticker": "BTC-USDT-SWAP",
"order_contracts": "1",
"order_action": "sell",
"sltp_type": "percent",
"take_profit": "3"
}
Use sl_price and tp_price when the alert contains exact price levels.
{
"platform_name": "bybit",
"ticker": "BTCUSDT",
"order_contracts": "0.01",
"order_action": "buy",
"sl_price": "98000",
"tp_price": "105000"
}
Absolute sl_price and tp_price values always have priority over relative stop_loss and take_profit values.
{
"sltp_type": "percent",
"stop_loss": "1",
"sl_price": "98000"
}
In this example, AlgoWay uses sl_price: 98000 and ignores stop_loss: 1.
To explicitly use the existing price-step calculation, set sltp_type to pips.
{
"platform_name": "binance",
"ticker": "BTCUSDT",
"order_contracts": "0.01",
"order_action": "sell",
"sltp_type": "pips",
"stop_loss": "500",
"take_profit": "1000"
}
If sltp_type is omitted, AlgoWay uses pips by default. Existing webhook alerts remain compatible.
trailing_pips is a route-dependent field. Some destinations support native trailing-stop behavior. Others ignore the field or delegate trailing logic to an EA, broker-side feature or separate management workflow.
trailing_pips. The EA manages trailing by modifying SL, so the EA must be running and connected. Broker stop-level and freeze-level rules may affect SL movement.trailing_pips creates a trailing stop on every platform. Check the route documentation and test with small size.
order_action: "modify" can update an existing open position without opening a new trade. It is commonly used to change Stop Loss, Take Profit or absolute SL/TP fields.
{
"platform_name": "metatrader5",
"order_action": "modify",
"ticker": "EURUSD",
"comment": "TV#12345",
"sl_price": "1.0845",
"tp_price": "1.0950"
}
Use a stable comment or tv_order_id when the route needs to identify one specific position.
MetaTrader 5 and cTrader can modify the entry price of an existing resting LIMIT or STOP order with one webhook request. Send order_action: "modify", the existing pending order type in order_type, the new entry level in price, and the same stable tv_order_id or comment that was used when the pending order was created.
order_contracts is not required for this price-modification request.
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "modify",
"order_type": "limit",
"price": "1.16500",
"tv_order_id": "order-12345"
}
{
"platform_name": "ctrader",
"ticker": "EURUSD",
"order_action": "modify",
"order_type": "stop",
"price": "1.16500",
"tv_order_id": "order-12345"
}
price is the new pending entry price. If both comment and tv_order_id are sent, comment is used as the primary identifier. The identifier must match the original pending order so AlgoWay can locate exactly one resting order to modify.
breakeven is a position management action. It moves Stop Loss to the entry price where the route and platform support that behavior.
{
"platform_name": "metatrader5",
"order_action": "breakeven",
"ticker": "GBPUSD",
"order_contracts": "0.10"
}
breakeven does not open a new trade. It manages an existing position.
In hedge mode, a symbol can have long-side and short-side exposure. A generic flat command can close all matching exposure depending on the platform handler. Use close_side when you want to close only one side.
{
"platform_name": "metatrader5",
"order_action": "flat",
"ticker": "EURUSD",
"order_contracts": "0.10",
"close_side": "long"
}
{
"platform_name": "metatrader5",
"order_action": "flat",
"ticker": "EURUSD",
"order_contracts": "0.10",
"close_side": "short"
}
If close_side is omitted, the platform handler may close all matching positions on the symbol. Test the behavior on your destination route before live use.
platform_name must match the destination route configured in AlgoWay.
| Platform | platform_name |
|---|---|
| MetaTrader 5 | metatrader5 |
| TradeLocker | tradelocker |
| Match-Trader | matchtrader |
| DxTrade | dxtrade |
| cTrader | ctrader |
| cTrader Open API | ctrader_oapi |
| Capital.com | capitalcom |
| Alpaca | alpaca |
| Tradovate | tradovate |
| ProjectX | projectx |
| Binance | binance |
| Bybit | bybit |
| OKX | okx |
| BitMEX | bitmex |
| Bitget | bitget |
| BitMart | bitmart |
| BingX | bingx |
| Coinbase | coinbase |
| HyperLiquid | hyperliquid |
| Kraken | kraken |
| KuCoin | kucoin |
If order_type is missing, AlgoWay treats this as a market order.
{
"platform_name": "metatrader5",
"order_action": "buy",
"ticker": "EURUSD",
"order_contracts": "0.10"
}
{
"platform_name": "metatrader5",
"order_action": "buy",
"ticker": "EURUSD",
"order_contracts": "0.10",
"order_type": "limit",
"price": "1.0800",
"sl_price": "1.0750",
"tp_price": "1.0950"
}
{
"platform_name": "metatrader5",
"order_action": "sell",
"ticker": "XAUUSD",
"order_contracts": "0.05",
"order_type": "stop",
"price": "2338.00",
"sl_price": "2350.00",
"tp_price": "2310.00",
"trade_type": "inverse"
}
{
"platform_name": "metatrader5",
"order_action": "close",
"ticker": "EURUSD",
"order_contracts": "0.10"
}
{
"platform_name": "metatrader5",
"ticker": "XAUUSD",
"order_action": "closeall"
}
{
"platform_name": "binance",
"order_action": "buy",
"ticker": "BTCUSDT.P",
"order_contracts": "0.10",
"stop_loss": "150",
"take_profit": "300"
}
{
"platform_name": "tradelocker",
"order_action": "sell",
"ticker": "XAUUSD",
"order_contracts": "0.05",
"sl_price": "2055.50",
"tp_price": "2038.00"
}
{
"platform_name": "bybit",
"order_action": "buy",
"ticker": "BTCUSDT",
"order_contracts": "0.10",
"stop_loss": "120",
"trailing_pips": "80"
}
{
"platform_name": "matchtrader",
"order_action": "flat",
"ticker": "EURUSD",
"order_contracts": "0.10",
"close_side": "long"
}
{
"platform_name": "ctrader",
"order_action": "long",
"ticker": "USDJPY",
"order_contracts": "0.10",
"stop_loss": "100"
}
{
"platform_name": "okx",
"order_action": "modify",
"ticker": "ETHUSDT",
"comment": "TV#12345",
"stop_loss": "140",
"take_profit": "280"
}
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "modify",
"order_type": "limit",
"price": "1.16500",
"tv_order_id": "order-12345"
}
{
"platform_name": "ctrader",
"ticker": "EURUSD",
"order_action": "modify",
"order_type": "stop",
"price": "1.16500",
"comment": "TV#12345"
}
{
"platform_name": "metatrader5",
"order_action": "breakeven",
"ticker": "GBPUSD",
"order_contracts": "0.10"
}
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_action": "{{strategy.market_position}}",
"order_contracts": "{{strategy.order.contracts}}",
"price": "{{close}}"
}
{
"platform_name": "metatrader5",
"ticker": "{{ticker}}",
"order_action": "closeall"
}
{
"platform_name": "metatrader5",
"ticker": "%alert_symbol%",
"order_action": "buy",
"order_contracts": 1,
"price": "%last_price%",
"comment": "TS:%alert_name%"
}
{
"platform_name": "metatrader5",
"ticker": "EURUSD",
"order_action": "flat",
"order_contracts": "0.10"
}
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "buy",
"order_contracts": "0.05",
"order_size_type": "balance_percent",
"leverage": "50"
}
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "buy",
"order_contracts": "0.05",
"order_size_type": "risk_percent",
"sltp_type": "percent",
"stop_loss": "1",
"leverage": "50"
}
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "flat",
"order_contracts": "50",
"order_size_type": "position_percent"
}
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "flat",
"order_contracts": "25",
"order_size_type": "position_percent",
"close_side": "long"
}
{
"platform_name": "mexc",
"ticker": "TRXUSDT",
"order_action": "closeall"
}
Before using live size, check:
platform_name matches your AlgoWay route;ticker matches or maps to the destination symbol;order_action is valid;order_contracts is valid for entry alerts;order_contracts is omitted when order_action is closeall;order_type, when present, is one of market, limit or stop;price is present and numeric when order_type is limit or stop;order_action: "modify", order_type, the new price, and a stable tv_order_id or comment matching the original pending order;trade_type, when present, is one of hedge, netting, opposite or inverse;order_size_type, when present, is balance_percent, risk_percent or position_percent;risk_percent includes sl_price or stop_loss;position_percent is used with flat and order_contracts is greater than 0 and not greater than 100;trailing_pips is supported by the destination route;close_side is used only when hedge-side close behavior is required;closeall;Use double quotes and remove trailing commas. A missing quote or extra comma can stop the webhook before AlgoWay routes the command. See: How to fix AlgoWay webhook Error 415.
If the AlgoWay route is ProjectX but the JSON says metatrader5, the message can be rejected or routed incorrectly.
Entry actions should include order_contracts. The value must be convertible to a floating-point number.
Do not send order_contracts with order_action set to closeall. This action closes all open positions for the specified symbol and does not need lot, contract or quantity size.
MetaTrader 5 users must update AlgoWay EA to version 2.10b or newer before using closeall.
{{ticker}}, %alert_symbol% or a fixed ticker may not match the broker or exchange symbol. Use the exact symbol or configure mapping.
Do not use stop_loss when you mean an absolute price. Use sl_price for exact price levels.
If order_type is limit or stop, the alert must include price. Without price, AlgoWay does not know the requested entry level for the pending order.
When changing the entry price of an existing LIMIT or STOP order, send the same tv_order_id or comment that was used for the original pending order. AlgoWay must be able to identify exactly one matching resting order before it can modify the price.
trade_type must be hedge, netting, opposite or inverse. If you omit it, AlgoWay uses the Trade Type configured in the webhook dashboard.
risk_percent requires a Stop Loss reference because AlgoWay must know the loss distance before it can calculate position size. Use either sl_price or stop_loss. If stop_loss is percentage-based, also send sltp_type: "percent".
position_percent is a close-sizing mode. Use it with order_action: "flat" to close a percentage of the current position. Do not use it with buy or sell.
balance_percent and risk_percent are entry-sizing modes. For percentage-based partial closing, use position_percent. For a complete close without a percentage, use closeall.
Percentage sizing does not bypass destination sizing rules. If the calculated amount is below the platform minimum or cannot be represented by its quantity, lot or contract step, the handler may reject the order.
For flat, close or closeall messages, the important field is order_action. order_type is normally not needed for closing exposure or cleaning supported pending entries.
The destination route may not support webhook-level trailing. Test the route and check platform logs.
In hedge mode, use close_side when you want only one side closed. Without it, the handler may close all matching symbol exposure.
AlgoWay JSON schema is the language that turns webhook alerts into executable trading commands. The core fields are platform_name, ticker, order_action and order_contracts for normal entry orders. order_type adds support for market, limit and stop entries, while price becomes required for pending limit and stop orders. trade_type can override the webhook Trade Type for one specific alert. order_size_type can reinterpret order_contracts as a percentage of live account equity used for position notional size, a percentage of equity risked at Stop Loss, or a percentage of the current open position to close with flat.
Use order_action as closeall when the alert must close all open positions for one symbol without sending order_contracts. MetaTrader 5 users must update AlgoWay EA to version 2.10b or newer before using this action.
Optional fields such as stop_loss, take_profit, sl_price, tp_price, trailing_pips, comment, tv_order_id, order_id and close_side add risk control, logs and position management. For MetaTrader 5 and cTrader pending LIMIT/STOP orders, order_action: "modify" with order_type, a new price and the original stable identifier can modify the resting entry directly without a separate cancel-and-replace webhook. Start with the minimal JSON, test it with small size, check AlgoWay Webhook Logs, then add pending orders, SL/TP, trailing, modify, breakeven, closeall or hedge-side behavior only after the basic route works.