CPlugin

MT4 :: Prices

API v1 (stable) · MT4 · 6 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

Add to "Market Watch"

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

Add a symbol to the list of selected symbols in "Market Watch"

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
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: 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT4/$TRADE_PLATFORM_ID/SymbolAdd/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

Remove from "Market Watch"

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

Removes a symbol from the list of selected symbols in "Market Watch"

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
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: 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT4/$TRADE_PLATFORM_ID/SymbolHide/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

Recent ticks

GET /api/MT4/{tradePlatform}/TickInfoLast/{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/TickInfoLast/$SYMBOL" \
  -H "Authorization: Bearer $TOKEN"

All recent ticks

GET /api/MT4/{tradePlatform}/TickInfoLast

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/TickInfoLast" \
  -H "Authorization: Bearer $TOKEN"

Ticks history

GET /api/MT4/{tradePlatform}/TicksRequest/{symbol}/{start}/{end}/{flags}

Timeout: 30 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 The name of the symbol the data is requested for
start path string (date-time) yes Period start (ISO 8601)
end path string (date-time) yes Period end (ISO 8601)
flags path TickRequestFlags no Data request mode
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). 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/TicksRequest/$SYMBOL/$START/$END/$FLAGS" \
  -H "Authorization: Bearer $TOKEN"

Chart history

GET /api/MT4/{tradePlatform}/ChartRequest/{symbol}/{period}/{start}/{end}/{mode}

Timeout: 30 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 The name of the symbol the data is requested for
period path ChartPeriod yes The time-frame the data is requested for
start path string (date-time) yes Period start
end path string (date-time) yes Period end
mode path RequestMode no Data request mode
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). 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/ChartRequest/$SYMBOL/$PERIOD/$START/$END/$MODE" \
  -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.

TickInfo

PropertyTypeDescription
ctm string (date-time)
symbol string, nullable
bid number (double)
ask number (double)

TickRecord

PropertyTypeDescription
bid number (double)
ask number (double)
dataFeed integer (int32)
ctm string (date-time)
flags TickRequestFlags

TickRequestFlags

Flags: names of the set bits joined by ", " ("Raw, Normal"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Raw = 0x1, Normal = 0x2. Accepted on input, never written: All = Raw, Normal.

RateInfoEx

PropertyTypeDescription
close number (float)
high number (float)
low number (float)
open number (float)
time string (date-time)
volume number (double)

ChartPeriod

Values: M1, M5, M15, M30, H1, H4, D1, W1, Mn1

RequestMode

Values: RangeIn, RangeOut, RangeLast, RangeInExcludeOutOfRage