CPlugin

MT5 v2 :: Symbols

API v2 (current) · MT5 · 3 operations · base URL https://cloud.mywebapi.com · OpenAPI v2 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token (scope webapi). The token server belongs to the environment: for the Sandbox call https://pre.mywebapi.com and take the token from https://pre.auth.cplugin.net/connect/token; for Production take it from https://auth.cplugin.net/connect/token. Clients and tokens of the two are separate — a token from one answers 401 on the other. $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox. A failed operation is also answered with HTTP 200: check error before using data. Access and transport failures use HTTP codes — see Errors.

Operations

Get a symbol by name

GET /api/v2/MT5/{tradePlatform}/SymbolGet/{symbol}

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
symbol path string yes Symbol name, e.g. "EURUSD".
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/SymbolGet/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

Partially update a symbol

PATCH /api/v2/MT5/{tradePlatform}/SymbolRecord/{symbol}

Send only the fields you want to change; omitted fields keep their current values and are not written back. An object with no fields, a field that is not part of the update record, an explicit null and a value of the wrong type are refused as validation errors — a mistyped key never becomes a silent no-op. Returns the updated record.

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
symbol path string yes Symbol name, e.g. "EURUSD".
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Request body

object (application/json, required) — Object with only the fields to change; unknown fields and nulls are refused.

Responses

Example

curl -X PATCH "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/SymbolRecord/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update a symbol

POST /api/v2/MT5/{tradePlatform}/SymbolUpdate/{symbol}

Changes the symbol record with the given name. Only the fields present in the body are written: the record is read from the trade server, the body is applied over it, and the merged record is written back. A field left out keeps its server value; for the description, omitting the key keeps the value while sending "" clears it. A body without any field is rejected, and an unknown value of an enum field is answered as a parameter error. The body must be the symbol update object — a full symbol record is not accepted.

The record is read from the trade server first, then written, then re-read, so the response carries the state actually stored by the server. An unknown symbol is answered with the trade server's error code instead of a record.

Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
symbol path string yes Symbol name, e.g. "EURUSD".
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Request body

MT5SymbolUpdate (application/json) — Fields to change; omitted fields keep their current value.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/SymbolUpdate/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "description": "", "digits": 0, "spread": 0, "stopsLevel": 0, "freezeLevel": 0, "contractSize": 0 }'

Schemas

Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.

MT5SymbolApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Symbol
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5SymbolUpdate

Editable surface of a symbol record: 15 fields that are safely writable, every one optional.

PropertyTypeDescription
description string, nullable Human-readable symbol description shown in the terminal.
digits integer (int32), nullable Number of decimal places in the price quote.
spread integer (int32), nullable Current spread in points (0 = floating spread).
stopsLevel integer (int32), nullable Minimum stop loss / take profit distance from current price, in points.
freezeLevel integer (int32), nullable Distance from current price at which orders are frozen before execution, in points.
contractSize number (double), nullable Contract size — units of base currency per standard lot.
marginInitial number (double), nullable Initial margin requirement per lot.
marginMaintenance number (double), nullable Maintenance margin requirement per lot (below this level triggers a margin call).
tickSize number (double), nullable Minimum price change step (pip size).
tickValue number (double), nullable Monetary value of one tick move for one standard lot.
volumeMin integer (int64), nullable Minimum trade volume, in MT5 volume units (1 lot = 10000 units).
volumeMax integer (int64), nullable Maximum trade volume, in MT5 volume units (1 lot = 10000 units).
tradeMode EnTradeMode Trade mode controlling which order types are allowed (full, close-only, no-trading, etc.).
calcMode EnCalcMode Margin calculation mode (forex, futures, CFD, etc.).
execMode EnExecutionMode Order execution mode (instant, market, exchange, request).

MT5Symbol

PropertyTypeDescription
symbol string, nullable name
path string, nullable hierarchical symbol path (including symbol name)
isin string, nullable ISIN
description string, nullable local description
international string, nullable internation description
basis string, nullable basic symbol name
source string, nullable source symbol name
page string, nullable symbol specification page URL
currencyBase string, nullable symbol base currency
currencyBaseDigits integer (int32), nullable Read-only: the trade server does not let this value be changed.
currencyProfit string, nullable symbol profit currency
currencyProfitDigits integer (int32), nullable Read-only: the trade server does not let this value be changed.
currencyMargin string, nullable symbol margin currency
currencyMarginDigits integer (int32), nullable Read-only: the trade server does not let this value be changed.
color integer (int32), nullable symbol color
colorBackground integer (int32), nullable symbol background color
digits integer (int32), nullable symbol digits
point number (double), nullable
multiply number (double), nullable Read-only: the trade server does not let this value be changed.
tickFlags EnTickFlags EnTickFlags
tickBookDepth integer (int32), nullable Depth of Market depth (both legs)
filterSoft integer (int32), nullable filtration soft level
filterSoftTicks integer (int32), nullable filtration soft level counter
filterHard integer (int32), nullable filtration hard level
filterHardTicks integer (int32), nullable filtration hard level counter
filterDiscard integer (int32), nullable filtration discard level
filterSpreadMax integer (int32), nullable spread max value
filterSpreadMin integer (int32), nullable spread min value
tradeMode EnTradeMode EnTradeMode
calcMode EnCalcMode EnCalcMode
execMode EnExecutionMode EnExecutionMode
gtcMode EnGtcMode EnGTCMode
fillFlags EnFillingFlags EnFillingFlags
expirFlags EnExpirationFlags EnExpirationFlags
spread integer (int32), nullable symbol spread (0-floating)
spreadBalance integer (int32), nullable spread balance
spreadDiff integer (int32), nullable spread difference
spreadDiffBalance integer (int32), nullable spread difference balance
tickValue number (double), nullable tick value
tickSize number (double), nullable tick size
contractSize number (double), nullable contract size
stopsLevel integer (int32), nullable stops level
freezeLevel integer (int32), nullable freeze level
quotesTimeout integer (int32), nullable The time to wait for quotes in seconds, after which trading is automatically disabled for the symbol.
volumeMin integer (int64), nullable minimal volume
volumeMax integer (int64), nullable maximal volume
volumeStep integer (int64), nullable volume step
volumeLimit integer (int64), nullable cumulative positions and orders limit
marginFlags EnMarginFlags EnMarginFlags
marginInitial number (double), nullable initial margin
marginMaintenance number (double), nullable maintenance margin
marginLong number (double), nullable long orders and positions margin rate
marginShort number (double), nullable short orders and positions margin rate
marginLimit number (double), nullable limit orders and positions margin rate
marginStop number (double), nullable stop orders and positions margin rate
marginStopLimit number (double), nullable stop-limit orders and positions margin rate
swapMode EnSwapMode EnSwapMode
swapLong number (double), nullable long positions swaps rate
swapShort number (double), nullable short positions swaps rate
swap3Day EnSwapDays 3 time swaps day, EnSwapDay
timeStart string (date-time), nullable trade start date
timeExpiration string (date-time), nullable The date of trading expiration for a symbol. It is considered that there is no time limitation for trading by a symbol if both TimeStart and TimeExpiration are equal to 0.
sessionQuote MT5SymbolSession[][] Returned when the symbol is read. It cannot be changed through this API: v2 update calls do not accept it, and v1 SymbolUpdate fails if it is set.
sessionTrade MT5SymbolSession[][] Returned when the symbol is read. It cannot be changed through this API: v2 update calls do not accept it, and v1 SymbolUpdate fails if it is set.
reFlags EnRequestFlags request execution flags
reTimeout integer (int32), nullable Time in seconds during which the price issued by a dealer in the request execution mode is valid.
ieCheckMode EnInstantMode instant execution check mode
ieTimeout integer (int32), nullable Get and set the maximum allowed difference between the time of arrival of the price, at which the client places an order, and the time of the last price.
ieSlipProfit integer (int32), nullable instant execution profit slippage
ieSlipLosing integer (int32), nullable instant execution losing slippage
ieVolumeMax integer (int64), nullable instant execution max volume
priceSettle number (double), nullable settle price (for futures)
priceLimitMax number (double), nullable price limit max (for futures)
priceLimitMin number (double), nullable price limit min (for futures)
tradeFlags EnTradeFlags EnTradeFlags
orderFlags EnOrderFlags EnOrderFlags
marginRateInitial object, nullable orders and positions margin rates
marginRateMaintenance object, nullable orders and positions margin rates
optionsMode EnOptionMode options mode EnOptionMode
priceStrike number (double), nullable option strike price value

ApiError

v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.

PropertyTypeDescription
code WebApiErrorCode Stable transport-level error code.
managerCode ResultCode Raw MT4 result code when ApiError.Code is MT4Error; null otherwise. On MT5 the result name is in ApiError.Message.
message string, nullable Human-readable error description.

ApiMeta

Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

PropertyTypeDescription
activityId string, nullable W3C trace id of the request. Quote it when you contact support: it finds this exact call in the server logs.
paging PagingMeta Pagination info; present only on list responses, omitted otherwise.

EnTradeMode

Values: Disabled, LongOnly, ShortOnly, CloseOnly, Full

EnCalcMode

Values: Forex, Futures, Cfd, CfdIndex, CfdLeverage, ForexNoLeverage, ExchStocks, ExchFutures, ExchFuturesForts, ExchOptions, ExchOptionsMargin, ExchBonds, ExchStocksMoex, ExchBondsMoex, ServCollateral

EnExecutionMode

Values: Request, Instant, Market, Exchange