AlgoWay JSON Schema Definition

AlgoWay JSON Schema Definition

This document defines required and optional fields used in AlgoWay webhook alerts. The schema ensures consistent interpretation of TradingView and external integrations.


Required Fields (4)

  • platform_name — text identifier defining which trading platform handles the order. Example values: metatrader5, dxtrade, matchtrader, binance, bybit, capitalcom, bitget, okx.
  • ticker — trading symbol such as EURUSD, BTCUSDT, or XAUUSD. Defines the market instrument. Always mandatory.
  • order_action — defines order direction or management action. Allowed keywords: buy, sell, flat, breakeven, modify. Normalization rules:
    • longbuy
    • shortsell
    • closeflat
  • order_contracts — numeric value for trade size or volume. Must be convertible to a floating-point number. Typically derived from upstream fields like qty, Q, risk, or volume.

order_action=modify — updates an existing open position or order without opening a new trade. Typically used to change stop_loss, take_profit, sl_price, or tp_price. On platforms that support identification, it may be used together with comment or another position reference.

order_action=breakeven — moves the stop loss of an existing open position to the entry price. It is a position management action and does not open a new trade.


Optional Fields

  • stop_loss — numeric distance (points or pips). Usually a small integer < 1000.
  • take_profit — numeric distance (points or pips), same interpretation as stop_loss.
  • sl_price — absolute price level for stop loss (for example 1.0845 or any value > 1000).
  • tp_price — absolute price level for take profit.
  • price — explicit execution price if present in alert.
  • trailing_pips — numeric trailing-step value for trailing stop logic. Extracted from fields such as trailstep or TS.
  • comment — free text field for user notes, labels, or EA magic number.
  • close_side — used in hedge mode together with order_action=flat to specify which side must be closed. Allowed values: long or short. If omitted, the platform handler may close all matching positions on the symbol.

All optional fields are omitted if not provided. Empty strings are converted to null and ignored. Any value that cannot be parsed as a number in numeric fields triggers a validation failure.


Platforms Supporting trailing_pips

  • Binance Futures — trailing value sent directly to API at order creation.
  • Bybit Futures — supports native trailing-stop parameter.
  • Bitget Futures — native trailing stop supported; handler sends trailing_pips with order.
  • Capital.com — field interpreted and added to order options.
  • DxTrade — supports dynamic trailing, field parsed and transmitted.
  • Match-Trader — accepts trailing distance; passed when non-zero.

Platforms Ignoring trailing_pips

  • cTrader — no webhook-level trailing; handled on broker side.
  • OKX, MEXC, BitMart — trailing not implemented in current handlers.

JSON examples (supported fields only)

17.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"
}
17.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"
}
17.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"
}
17.4 Hedge: close only long positions
{
  "platform_name": "matchtrader",
  "order_action": "flat",
  "ticker": "EURUSD",
  "order_contracts": "0.10",
  "close_side": "long"
}
17.5 Opposite: use LONG/SHORT
{
  "platform_name": "ctrader",
  "order_action": "long",
  "ticker": "USDJPY",
  "order_contracts": "0.10",
  "stop_loss": "100"
}
17.6 Modify: change SL/TP via comment
{
  "platform_name": "okx",
  "order_action": "modify",
  "ticker": "ETHUSDT",
  "comment": "TV#12345",
  "stop_loss": "140",
  "take_profit": "280"
}
17.7 Breakeven: move SL to entry price
{
  "platform_name": "metatrader5",
  "order_action": "breakeven",
  "ticker": "GBPUSD",
  "order_contracts": "0.10"
}
17.8 Hedge: close only short positions
{
  "platform_name": "metatrader5",
  "order_action": "flat",
  "ticker": "EURUSD",
  "order_contracts": "0.10",
  "close_side": "short"
}

Summary: only crypto and CFD connectors (binance, bybit, bitget, capitalcom, dxtrade, matchtrader) process trailing_pips. Others either delegate trailing to EA or safely ignore the field.