CPlugin

MT4 :: Symbols

API v1 (stable) · MT4 · 7 operations · base URL https://cloud.mywebapi.com · OpenAPI v1 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token from https://auth.cplugin.net/connect/token (scope webapi). $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.

Operations

All symbols (pumping)

GET /api/MT4/{tradePlatform}/SymbolsGetAll

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 id
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/MT4/$TRADE_PLATFORM_ID/SymbolsGetAll" \
  -H "Authorization: Bearer $TOKEN"

Symbol (pumping)

GET /api/MT4/{tradePlatform}/SymbolsGetAll/{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 id
symbol path string yes
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/MT4/$TRADE_PLATFORM_ID/SymbolsGetAll/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

All symbols (admin)

GET /api/MT4/{tradePlatform}/CfgRequestSymbol

CfgRequestSymbol

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 id
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/MT4/$TRADE_PLATFORM_ID/CfgRequestSymbol" \
  -H "Authorization: Bearer $TOKEN"

Symbol (admin)

GET /api/MT4/{tradePlatform}/CfgRequestSymbol/{symbol}

CfgRequestSymbol

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 id
symbol path string yes
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/MT4/$TRADE_PLATFORM_ID/CfgRequestSymbol/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

Update (admin)

POST /api/MT4/{tradePlatform}/CfgUpdateSymbol

Update symbol settings

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 id
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

ConSymbol (application/json)

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT4/$TRADE_PLATFORM_ID/CfgUpdateSymbol" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "symbol": "", "description": "", "source": "", "currency": "", "type": 0, "digits": 0 }'

Force synchronize

GET /api/MT4/{tradePlatform}/SymbolsRefresh

Fetch symbol settings from server to local cache

Timeout: 60 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 id
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). 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/MT4/$TRADE_PLATFORM_ID/SymbolsRefresh" \
  -H "Authorization: Bearer $TOKEN"

Get symbol groups (admin)

GET /api/MT4/{tradePlatform}/CfgRequestSymbolGroup

Fetch symbol (security) groups settings

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 id
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/MT4/$TRADE_PLATFORM_ID/CfgRequestSymbolGroup" \
  -H "Authorization: Bearer $TOKEN"

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.

ConSymbol

PropertyTypeDescription
symbol string, nullable
description string, nullable
source string, nullable
currency string, nullable
type integer (int32)
digits integer (int32)
tradeMode TradeMode
backgroundColor integer (int32)
count integer (int32)
countOriginal integer (int32)
realtime integer (int32)
starting string (date-time)
expiration string (date-time)
sessions ConSessions[]
profitCalculationMode ProfitCalculationMode
profitReserved integer (int32)
filter integer (int32)
filterCounter integer (int32)
filterLimit number (double)
filterSmoothing integer (int32)
filterReserved number (float)
logging integer (int32)
spread integer (int32)
spreadBalance integer (int32)
symbolExecMode SymbolExecMode
swapEnable integer (int32)
swapType SwapType
swapLong number (double)
swapShort number (double)
swapRollover3Days integer (int32)
contractSize number (double)
tickValue number (double)
tickSize number (double)
stopsLevel integer (int32)
gtcMode GTCMode
marginCalculationMode MarginCalculationMode
marginInitial number (double)
marginMaintenance number (double)
marginHedged number (double)
marginDivider number (double)
percentage number (double)
point number (double)
multiply number (double)
bidTickValue number (double)
askTickValue number (double)
longOnly integer (int32)
instantMaxVolume integer (int32)
marginCurrency string, nullable
freezeLevel integer (int32)
marginHedgedStrong integer (int32)
valueDate string (date-time)
quotesDelay integer (int32)
swapOpenPrice integer (int32)
swapVariationMargin integer (int32)

HTTPError

PropertyTypeDescription
errorType HttpStatusCodeType type of error described here
errorCode HttpStatusCode If ErrorType is MT4API, it contains MT4 ManagerAPI response code. If ErrorType is MT5API, it contains MT5 ManagerAPI response code.
errorDescription string, nullable If ErrorType is MT4API, it contains MT4 ManagerAPI response code description. If ErrorType is MT5API, it contains MT5 ManagerAPI response code description.
requestId string (uuid) Unique request tracking ID

ConSymbolGroup

PropertyTypeDescription
name string, nullable
description string, nullable

TradeMode

Values: No, Close, Full

ConSessions

PropertyTypeDescription
quoteOvernight integer (int32)
tradeOvernight integer (int32)
quote ConSession[]
trade ConSession[]

ProfitCalculationMode

Values: Forex, CFD, Futures

SymbolExecMode

Values: Request, Instant, Market

SwapType

Values: Points, Dollars, Interest, MarginCurrency

GTCMode

Values: Daily, GTC, DailyNoStops

MarginCalculationMode

Values: Forex, CFD, Futures, CFDIndex, CFDLeverage

HttpStatusCodeType

type of error described here

Values: HTTP, MT4API, MT5API

HttpStatusCode

Values: Continue, SwitchingProtocols, Processing, EarlyHints, OK, Created, Accepted, NonAuthoritativeInformation, NoContent, ResetContent, PartialContent, MultiStatus, AlreadyReported, IMUsed, MultipleChoices, MovedPermanently, Found, SeeOther, NotModified, UseProxy, Unused, RedirectKeepVerb, PermanentRedirect, BadRequest, Unauthorized, PaymentRequired, Forbidden, NotFound, MethodNotAllowed, NotAcceptable, ProxyAuthenticationRequired, RequestTimeout, Conflict, Gone, LengthRequired, PreconditionFailed, RequestEntityTooLarge, RequestUriTooLong, UnsupportedMediaType, RequestedRangeNotSatisfiable, ExpectationFailed, MisdirectedRequest, UnprocessableEntity, Locked, FailedDependency, UpgradeRequired, PreconditionRequired, TooManyRequests, RequestHeaderFieldsTooLarge, UnavailableForLegalReasons, InternalServerError, NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout, HttpVersionNotSupported, VariantAlsoNegotiates, InsufficientStorage, LoopDetected, NotExtended, NetworkAuthenticationRequired