MT5 order types
The type field of Place Order is an integer from 0 to 7, matching MetaTrader 5's order types.
| type | Name | Behaviour |
|---|---|---|
0 |
Buy | Market buy at the current Ask price. |
1 |
Sell | Market sell at the current Bid price. |
2 |
Buy Limit | Buy when price falls to price or lower. |
3 |
Sell Limit | Sell when price rises to price or higher. |
4 |
Buy Stop | Buy when price rises to price. |
5 |
Sell Stop | Sell when price falls to price. |
6 |
Buy Stop Limit | When price rises to price, place a Buy Limit at stop_limit. |
7 |
Sell Stop Limit | When price falls to price, place a Sell Limit at stop_limit. |
Which fields each type needs#
| Type | price |
stop_limit |
|---|---|---|
0 Buy, 1 Sell |
not used (market) | not used |
2–5 Limit and Stop |
required | not used |
6 Buy Stop Limit, 7 Sell Stop Limit |
required: the stop (trigger) price | required: the limit price |
Limit vs stop, in one sentence each#
- A limit order waits for a better price: Buy Limit below the market, Sell Limit above it.
- A stop order waits for a breakout: Buy Stop above the market, Sell Stop below it.
- A stop limit waits for the stop price, then places a limit order at
stop_limitinstead of filling at market. MT4 has no equivalent.
Examples#
{ "symbol": "EURUSD", "type": 0, "volume": 0.1 }{ "symbol": "EURUSD", "type": 3, "volume": 0.1, "price": 1.0950, "sl": 1.1000, "tp": 1.0850 }{ "symbol": "XAUUSD", "type": 6, "volume": 0.05, "price": 2350.0, "stop_limit": 2348.5 }Last updated 2026-11-04