Skip to content

short: Open a sell (short) market position

View as Markdown

Open a sell (short) market position.

Field Type Required Unit Description
license string Yes text Your license key. In examples it is written YOUR_LICENSE_KEY.
action string Yes text Always short. Case-sensitive.
symbol string Yes text Symbol as your broker names it in MT5 (for example EURUSD). The EA adds the Symbol prefix / Symbol suffix inputs if you set them.
volume number Yes lots Position size in lots. The EA rounds it to the symbol’s lot step and clamps it to the broker’s minimum and maximum volume. Allowed: greater than 0.
sl number No price level Stop loss. A price level by default. If the EA input Stop level mode is set to pips or ticks, it is a distance from the entry price in that unit. 0 or omitted means no stop loss. Allowed: 0 or more. Default: 0.
tp number No price level Take profit. Same unit rule as sl. 0 or omitted means no take profit. Allowed: 0 or more. Default: 0.
positionID string No text Your name for this position, stored as the MT5 order comment. Later commands use it to target the position. If omitted, the server sets one (CMD followed by a number).

The webhook rejects unknown fields, missing required fields and wrong types with HTTP 422 before anything is queued. Field names are case-sensitive.

Replace YOUR_LICENSE_KEY with your key. Send the body as the alert message in TradingView, or with any HTTP client.

Sell 0.10 lots of GBPUSD with a stop loss and a take profit

Section titled “Sell 0.10 lots of GBPUSD with a stop loss and a take profit”
{
"license": "YOUR_LICENSE_KEY",
"action": "short",
"symbol": "GBPUSD",
"volume": 0.1,
"sl": 1.275,
"tp": 1.255,
"positionID": "gbpusd_reversal_1"
}
{
"license": "YOUR_LICENSE_KEY",
"action": "short",
"symbol": "XAUUSD",
"volume": 0.01
}

After a successful run the MT5 Experts log shows:

✅ Trade placed successfully. Ticket=<ticket> | short <symbol> | Lot=<lots> | SL=<sl> | TP=<tp> | posID=<positionID>

In the dashboard, the command appears in Command History on the License Details page. What each status means.

Where you see it Message or code Cause Fix
MT5 Experts log ❌ handleCommand: "long/short" needs a non-empty symbol and volume>0 The command reached the EA without a symbol or with a volume of 0 or less. Send symbol and a volume greater than 0.
MT5 Experts log 🔒 Trade blocked — EA disabled via setEAStatus The EA’s remote switch is off. Turn the EA back on from the dashboard, or send setEAStatus with enabled true.
MT5 Experts log 🔒 Trade blocked — trading disabled: <reason> A profit/loss safeguard limit has tripped. Check the safeguard state in the dashboard and reset it when appropriate.
MT5 Experts log Max total open positions reached: <n> The account already holds the maximum number of positions set in the EA inputs. Close positions or raise Max open positions (account-wide) in the EA inputs.
MT5 Experts log Max open positions for symbol <symbol> reached: <n> The symbol already holds the maximum number of positions set in the EA inputs. Close positions on that symbol or raise Max open positions per symbol.
MT5 Experts log Failed to select symbol: <symbol> The symbol does not exist at your broker under that name. Use the exact MT5 symbol name, or set the Symbol prefix / suffix inputs.
Broker, MT5 return code 10016 Invalid stops in the request The stop loss or take profit is on the wrong side of the price or too close to it. Check the sl/tp values and the Stop level mode input.
Broker, MT5 return code 10014 Invalid volume in the request The volume is not allowed for this symbol. Check the symbol’s minimum volume and lot step in MT5.
Broker, MT5 return code 10019 Not enough money to complete the request Not enough free margin for this volume. Reduce volume or add funds (demo first).
Broker, MT5 return code 10027 Autotrading disabled by client terminal Algo Trading is switched off in the MT5 terminal. Turn on Algo Trading in the MT5 toolbar.
  • Opening is blocked while the EA is switched off or a safeguard limit is tripped.
  • The EA checks Max open positions (account-wide and per symbol) before opening.
  • With the EA input Close on reverse set to Hedging, open long positions on the same symbol are closed first. With Netting, they are reduced by this volume and only the remainder opens a new position.
  • Only positions in the EA’s trade scope count towards the limits (by default, trades opened by this EA).

Verified for EA v1.9 · dashboard 2026-10-05 · reviewed by Claude Code (owner review pending)

Report a problem with this page

Trading involves substantial risk of loss. ZB Connector is software only; it does not provide investment advice, signals or brokerage services.