15.05.2026
- C# SDK —
MT4V2SignalRClient(sibling toMT4V2Client) wraps/hubs/mt4/v2. SameMT4V2ClientOptionsshape (static token orClientId/ClientSecret/IdentityUrl); the OAuth2 token cache is shared via the newClientAccessTokenProviderhelper (mirrorsClientCredentialsHandlerbut exposes aFunc<bool, CancellationToken, Task<string>>for SignalR'sAccessTokenProviderhook). Pull-based consumption viaIAsyncEnumerable<T>(StreamTicksAsync(symbol?)/StreamMarginCallUpdatesAsync/StreamTradesAsync/StreamUserUpdatesAsync/StreamSymbolUpdatesAsync) and push-based viaOnTick(...)+SubscribeToTicksAsync(symbol)/UnsubscribeFromTicksAsync(symbol). ImplementsIAsyncDisposable— disposes both the underlyingHubConnectionand the dedicated token-endpointHttpClientit owns in OAuth2 mode.Microsoft.AspNetCore.SignalR.Client8.0.10 is a direct dependency on bothnetstandard2.1andnet8.0target frameworks. - TypeScript SDK —
MT4V2SignalRClientwraps the new/hubs/mt4/v2hub.@microsoft/signalris an optional peer dependency — install only if you need real-time streams. The hub client takes the same options shape as the REST client (tokenORclientId/clientSecret/identityUrl), shares the auth path, and exposes typed helpers:streamTicks(symbol?),streamMarginCallUpdates(),streamTrades(),streamUserUpdates(),streamSymbolUpdates()(all returnAsyncIterable<T>—for await … breakcancels the server stream cleanly),subscribeToTicks(symbol)/unsubscribeFromTicks(symbol)withonTick(...)callbacks, andonConnectionStatus(...). Auto-reconnect intervals and a custom hub URL are configurable. - MT4 v2 SignalR hub — added Users and Symbols streams:
StreamUserUpdates()(slim payload — passwords, OTP, MQID and reserved blobs are NEVER pushed over SignalR) andStreamSymbolUpdates()(trading-relevant fields only — sessions, swap-rollover internals and reserved blobs are excluded; subscribers needing them fall back to REST). - MT4 v2 — new SignalR hub at
/hubs/mt4/v2. The trade-platform GUID is bound at connection time via the?tradePlatform={guid}query parameter (alongside?signalr_token=...), so hub methods no longer require it as an argument. Access to the platform is verified once during the handshake; an unauthorized client is rejected with a clearHubExceptionrather than per-method silent denials. Three stream-first methods are exposed:StreamTicks(symbol?)returns anIAsyncEnumerable<TickPayload>(filtered to a symbol or all symbols);StreamMarginCallUpdates()returnsIAsyncEnumerable<MarginCallPayload>;StreamTrades()returnsIAsyncEnumerable<TradeUpdatePayload>(Kind=Added/Updated/Deleted). Callback-style ticks remain available viaSubscribeToTicks(symbol)/UnsubscribeFromTicks(symbol)+ theOnTickcallback. Right after the handshake the server pushes oneOnConnectionStatusmessage reflecting the current pump state. Payload records are flat (notradePlatformfield) and STJ-friendly. The v1 hub at/hubs/mt4/v1is unchanged and remains available; v2 is the recommended path for new clients. - All four v2 client SDKs (TypeScript, Python, C#, PowerShell) now manage OAuth2 access tokens internally. The constructor (or
Connect-CPluginWebAPIfor PowerShell) acceptsclientId/clientSecret/identityUrl/tradePlatformand the SDK handles OIDC discovery, token caching, expiry handling, and 401-driven refresh transparently — no more pre-fetching JWTs in caller code. A static-token constructor path remains for advanced cases (tests, short-lived integrations). The SDKs also gain automatic retry of transient HTTP failures (429,502,503,504) with exponential backoff, jitter, andRetry-Afterhonoring. C# addsservices.AddCPluginWebAPISDK(...)for DI consumers andMT4V2ClientBuilder.Create()...Build()for non-DI. Python adds anMT4V2AsyncClientsibling alongside the existing sync client. PowerShell addsConnect-CPluginWebAPI/Disconnect-CPluginWebAPIcmdlets; existing cmdlets accept-Session(legacy) as optional and otherwise pull state from the active connection. Each SDK exposes afromEnvironment()/FromEnvironment()/-FromEnvironmentfactory readingCPLUGIN_WEBAPI_BASE_URL/CPLUGIN_WEBAPI_TRADE_PLATFORM/CPLUGIN_WEBAPI_CLIENT_ID/CPLUGIN_WEBAPI_CLIENT_SECRET/CPLUGIN_WEBAPI_IDENTITY_URL.
14.05.2026
- MT4 v2 (x86 sidecar) — exposed 13 endpoints under
https://x86.<api-domain>/api/v2/MT4/{platform}/...that the main x64 API does not host. The sidecar is a separate hostname; clients call it directly for the listed operations:- Messaging —
POST NewsSend(push a news item to client terminals; body{ Topic, Category, Body, HighPriority });POST MailSend(broadcast email to logins; body{ SenderLogin, SenderName, Subject, Body, Logins[] }, batch cap 10000);GET MailsRequest(server-side mailbox store). - Plugins —
GET PluginsGet(configured plugins list);GET PluginParamGet/{pos}(single plugin parameters by index);POST PluginUpdate(apply plugin parameter overlay);GET CfgRequestPlugin(Manager-live plugin set);POST CfgUpdatePlugin(admin plugin write). - Batch reads —
GET UsersSnapshot?limit=NandGET TradesSnapshot?limit=N(atomic full-state snapshots;limit1..1000000 caps response, wrapper still loads the full array server-side);GET UsersSyncRead?limit=NandGET TradesSyncRead?limit=N(return records buffered by priorPOST UsersSyncStart/POST TradesSyncStarton the x64 main API — the two endpoints are on different hosts but talk to the same MT4 server). - ExternalCommand (binary) —
POST ExternalCommandBinary(free-form binary pass-through to the MT4 plugin pipeline; body{ Data: base64 }, response{ Data: base64 }; the first installed plugin returningRET_OKwins). TheICustomSerializervariant remains unsupported — it requires C# in-process serialization logic and is not REST-translatable.
- Messaging —
- MT4 v2 — added
POST /api/v2/MT4/{platform}/SrvRestart?confirm=true— admin soft-restart of the MT4 server process. Calls without the literal?confirm=truequery string are rejected witherrorCode=Validation. Returns a bare-bool envelope:truewhen the wrapper reports the restart command was accepted. The current manager connection is dropped during the restart cycle — clients should expect to reconnect. - MT4 v2 — added
POST /api/v2/MT4/{platform}/SrvChartsSync?confirm=true— admin force-resync of chart history across the plugin set. Same?confirm=trueguard. Idempotent: a second call against an already-synced state is a no-op. - MT4 v2 — added
POST /api/v2/MT4/{platform}/SrvLiveUpdateStart?confirm=true— admin kick of the LiveUpdate distributor. Same?confirm=trueguard. Connected terminals may receive an update prompt. - MT4 v2 — added
POST /api/v2/MT4/{platform}/SrvFeedsRestart?confirm=true— admin restart of all running quote/news feeders. Same?confirm=trueguard. May cause a brief gap in the tick stream. - MT4 v2 — added
POST /api/v2/MT4/{platform}/BackupRestoreUsers?confirm=true— admin disaster-recovery write of user records back into the live DB. Body isMT4UserRestoreInput[](narrow input: Login, Group, Name, Email, Country, Leverage, Balance, Credit, Enable, EnableReadOnly). Secrets, OTP, server-managed timestamps, and reserved blobs are NOT carried — restore those via separate secure flows. Batch cap 10000 records per call; over-limit rejects witherrorCode=Validation. Returns a bare-bool envelope. Idempotency-Key header is strongly recommended. - MT4 v2 — added
POST /api/v2/MT4/{platform}/BackupRestoreOrders?confirm=true— admin disaster-recovery write of trade records back into the live DB. Body isMT4TradeRestoreInput[](narrow input: Order, Login, Symbol, TradeCommand, Volume, OpenPrice, SL, TP, ClosePrice, Profit, Storage, Commission, OpenTime, CloseTime, Expiration, Magic, Comment). Gateway-routing details and server-derived fields are NOT part of the contract. Batch cap 10000. ReturnsMT4TradeRestoreResult[]— one entry per input trade with{ Order, Res }whereResis0= error,1= restored. Idempotency-Key header is strongly recommended. - MT4 v2 — added
GET /api/v2/MT4/{platform}/BackupInfoUsers/{mode}— admin-only listing of available user-data backup files for the requested mode (typical:0= daily,1= weekly — server-defined). Returns an array ofMT4BackupInfo{ file, size, time }. Read-only: does NOT touch the backup files. - MT4 v2 — added
GET /api/v2/MT4/{platform}/BackupInfoOrders/{mode}— order-side counterpart ofBackupInfoUsers, same shape and contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/BackupRequestUsers/{file}?request=...&limit=...— read user records out of a named backup file. Does NOT restore — restore is a separate (destructive) operation, not yet exposed. Optionalrequestis a server-defined filter string (empty = all users). Optionallimitcaps the JSON response size (1..100000, default 10000). The wrapper loads the full file server-side regardless oflimit;limitonly truncates the response. - MT4 v2 — added
GET /api/v2/MT4/{platform}/BackupRequestOrders/{file}?request=...&limit=...— order-side counterpart ofBackupRequestUsers. Same contract; payload type isMT4Trade[]. - MT4 v2 — added
GET /api/v2/MT4/{platform}/LicenseCheck/{licenseName}— admin-only verification of a license name against the MT4 server's license registry. Returns a bare-bool envelope:truewhen the wrapper reports a known license;falseotherwise (also covers "manager lacks permission"). - MT4 v2 — added
POST /api/v2/MT4/{platform}/NotificationsSend— admin push-notification dispatch to a list of account logins. Body is{ logins: int[], message: string }.Loginsmust contain at least one entry;Messagemust be non-empty and at most 1024 characters — out-of-bounds values are rejected witherrorCode=Validation. Returns a bare-bool envelope (trueon wrapper success). - MT4 v2 — added
GET /api/v2/MT4/{platform}/SrvFeeders— paged admin-only read of the runtime list of running data feeders on the MT4 server. Reuses theMT4Feedershape from theCfgRequestFeederendpoint. Sorted byName; cursor codec same as the rest of the paged endpoints. Returns the currently running feeders, which can differ from the static configuration returned byCfgRequestFeeder. - MT4 v2 — added
GET /api/v2/MT4/{platform}/SrvFeederLog/{name}— admin-only read of the server-side log buffer for a single feeder. Returns the raw log text as the payload (empty string when the feeder is unknown or has no recent log activity). - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateAccess/{pos}— Type 1 mutator for an IP firewall rule at the given list position. Body isMT4Access. The MT4 server identifies rules by their position in the list (no stable identifier), so the caller must read the current list viaCfgRequestAccessfirst and supply the index of the row to update.IpFrom/IpTomust fit in[0, 4294967295](uint range) — out-of-range values are rejected witherrorCode=Validation. Out-of-range positions yielderrorCode=NotFound. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateDataServer/{pos}— Type 1 mutator for a DataServer entry at the given list position. Body isMT4DataServer.Loading/IpInternalmust fit in[0, 4294967295]. Same position-based contract asCfgUpdateAccess. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateHoliday/{pos}— Type 1 mutator for a holiday-calendar entry at the given list position. Body isMT4Holiday. The wrapper storesEnableasint; the v2 contract surfaces it asbool. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateSymbolGroup/{pos}— Type 1 mutator for a symbol group at the given list position. Body isMT4SymbolGroup(Name,Description). - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateLiveUpdate— Type 1 mutator for a LiveUpdate service configuration. Body isMT4LiveUpdate; the entry to update is identified by itsCompanyfield (same cursor key the read endpoint uses). The wrapper's 128-elementFilesdescriptor table and the runtimeConnectionscounter are preserved server-side. ReturnserrorCode=NotFoundfor an unknown Company. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateManager— Type 1 mutator for a manager-account configuration. Body isMT4ManagerRights; identified byLogin. Bridges 19 boolean permission flags, the IP-filter triplet (IpFilter/IpFrom/IpTo),MailBox/Groups/InfoDepth.IpFrom/IpTo(long in DTO, uint on wrapper) must fit in[0, 4294967295]— out-of-range values are rejected witherrorCode=Validation. The wrapper'sName(read-only — server-controlled),SecGroups,ExpTime,Unused,Reservedare preserved. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateGatewayAccount— Type 1 mutator for an STP gateway-account entry. Body isMT4GatewayAccount; the entry to update is identified by its stable internalId. The wrapper'sPassword(STP MT4 credential to the external server) is preserved server-side. ReturnserrorCode=NotFoundfor an unknownId. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateGatewayMarkup— Type 1 mutator for a gateway markup rule. Body isMT4GatewayMarkup; identified by the composite key(Source, Symbol)(same cursor key the read endpoint uses). ReturnserrorCode=NotFoundwhen no matching markup row exists. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateGatewayRule— Type 1 mutator for an STP gateway-rule entry (execution-routing policy). Body isMT4GatewayRule; identified byName. ReturnserrorCode=NotFoundfor an unknown rule name. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateSync— Type 1 mutator for a chart-history synchronization rule. Body isMT4Sync; the entry to update is identified by the composite key(Server, Login). The replication credential (Password) and internal wrapper bookkeeping are preserved server-side. ReturnserrorCode=NotFoundif no matching rule exists. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateFeeder— Type 1 mutator for a quote/news feeder. Body isMT4Feeder; identified byName. The datafeed credential (Password) is preserved. ReturnserrorCode=NotFoundfor unknown feeder names. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateBackup— Type 1 mutator for server backup configuration. Body isMT4Backup(the same DTO returned byCfgRequestBackup). The slave-server credential (WatchPassword) and server-derived last-completion timestamps (FullBackupLastTime,ArchiveLastTime,ExportLastTime,WatchTimestamp) are preserved server-side — only the fields in the DTO are changed. Echoes the mergedMT4Backupin the response. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateTime— Type 1 mutator for the 7×24 access-hour matrix. Body isMT4ServerTimewithAccessHours[168](index =day*24 + hour, day 0 = Sunday;0denied /1allowed). The wrapper's internalDaysControl(server housekeeping) andReservedfields stay live across the round-trip.AccessHours.Lengthmust be exactly 168 — any other length is rejected witherrorCode=Validation. - MT4 v2 — added
POST /api/v2/MT4/{platform}/CfgUpdateCommon— Type 1 mutator for server-wide common settings. Body isMT4CommonUpdate(curated subset of the wrapper'sConCommon); the controller reads live state first, overlays the supplied fields, and writes back. Runtime counters, bind address arrays, demo subsystem, paths, and rollover/statement modes are preserved server-side — only the fields in the DTO are changed. Echoes the mergedMT4Commonin the response. - MT4 v2 — added
POST /api/v2/MT4/{platform}/UsersGroupOp— bulk user operation across a list of account logins. Body isMT4UsersGroupOpwithCommand(one of"Delete"/"Enable"/"Disable"/"Leverage"/"SetGroup"), the command-specific parameter (NewGroupfor SetGroup,Leveragefor Leverage; both ignored otherwise), andLogins[]. Returns a bare boolean envelope. Idempotency-Key strongly recommended on Delete / SetGroup — those are destructive on customer-visible state. - MT4 v2 — added
POST /api/v2/MT4/{platform}/TradeCheckStops?price=<double>— pump-side pre-flight that validates an order's SL/TP (and pending open price) against the symbol's administrator-definedstops_level. Body isMT4TradeTransaction(same DTO asTradeTransaction). Returns a bare bool —truewhen the wrapper'sResultCodeisOk. Saves a server round-trip when a client wants to verify an order before submitting it for real. - MT4 v2 — added
POST /api/v2/MT4/{platform}/TradeClearRollback/{order}— cancels an in-flight transaction that the MT4 server is still holding in the rollback buffer (e.g. an instant-execution requote awaiting confirmation). Idempotent on already-committed/already-rolled-back tickets. Zero/negative tickets are rejected at the routing layer (404). - MT4 v2 — added
POST /api/v2/MT4/{platform}/HistoryCorrect/{symbol}— administrative one-shot that asks the MT4 server to walk a symbol's chart history across every period and fix internal inconsistencies (gaps, broken OHLC relationships, mismatched aggregates). Payload is the integer count of corrected bars; zero means history was already consistent. Requires Administrator rights on the manager account. - MT4 v2 — added
POST /api/v2/MT4/{platform}/ExternalCommandJSON— opaque plugin-channel for custom commands. Body is forwarded verbatim to the MT4 server; the first installed plugin returningRET_OKwins and its response becomes the v2payload. The wrapper's two other variants (binary marshal, caller-supplied serializer) are deliberately not exposed — they need compile-time struct layouts that a REST surface cannot enforce. - MT4 v2 — added the chart-history mutator trio.
POST /api/v2/MT4/{platform}/ChartAdd/{symbol}?period={enum},POST .../ChartUpdate/{symbol},POST .../ChartDelete/{symbol}— JSON body{ rates: [{ time, open, high, low, close, volume }] }. The wrapper resolves the symbol's scale internally; the v2 layer carries it through so float OHLC values round-trip correctly. Emptyratesis rejected witherrorCode=Validation. Idempotency-Key is strongly recommended — duplicate writes can corrupt the historical data series. - MT4 v2 — added Manager (live) read endpoints for online sessions and trades.
GET /api/v2/MT4/{platform}/OnlineRequestreturns the same pagedMT4Onlineshape asOnlineGetbut bypasses the pump cache (use when freshness matters more than latency). - MT4 v2 — added
GET /api/v2/MT4/{platform}/TradeRecordRequest/{ticket}— single-ticket fresh-from-server fetch, complementing the pump-cachedTradeRecordGet. Returns a NotFound envelope when the ticket does not exist on the server. - MT4 v2 — added
GET /api/v2/MT4/{platform}/TradesRequest— broad Manager-live trade query, paged by ticket, with optional?group=filter (case-sensitive exact match, resolved server-side via the manager's user-record lookup). Heavier than the pump-cachedTradesGet*variants but returns the full server-side set. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestCommon— Manager-live server-wide common settings. Sibling endpoint toManagerCommonreturning the sameMT4Commonshape but via the wrapper's configuration-system entry point. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestHoliday— paged Manager-live read of the holiday calendar. Each entry carriesYear/Month/Day, the work-time windowFrom/To(minutes from midnight, both zero means full closure), the affectedSymbol(or"All"), aDescription, and anEnableflag. Ordered by(Year, Month, Day, From)ascending — cursor is opaque and stable across pages. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestManager— paged Manager-live read of manager-account configurations. Each entry surfacesLogin/Name/Groups/MailBox, 19 boolean permission flags (Manager, Money, Online, Broker, Admin, Trades, MarketWatch, Reports, Logs, Email, News, Plugins, UserDetails, SeeTrades, RiskMan, Market, Notifications, ServerReports, TechSupport), IP-filter range (IpFrom/IpTowidened tolongfor JSON safety), andInfoDepth. Sorted byLogin. InternalSecGroups/Unused/ExpTime/Reservedwrapper fields are not part of the v2 contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestTime— Manager-live read of the server's 7×24 access-hour matrix. ReturnsMT4ServerTimewith a flat 168-elementAccessHoursarray (index = day*24 + hour, day 0 = Sunday; values 0 = denied, 1 = allowed). - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestAccess— paged Manager-live read of IP firewall rules. Each entry:Action(raw int — FW_BLOCK / FW_PERMIT),IpFrom/IpTo(wideneduint → long),Comment. Ordered by(IpFrom, IpTo). - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestBackup— Manager-live read of server backup configuration. ReturnsMT4Backup(full/archive/export schedule enums and paths, last-completion timestamps, HA watchdog fields). The wrapper'sWatchPassword(slave-server credential) is intentionally excluded from the v2 contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestGatewayAccount— paged Manager-live read of STP gateway-account configurations. Each entry:Enable,Name,Id,Type,Login(external server login),Address(external host:port),NotifyLogins(fixed-size 8 broker recipients),Flags. The wrapper'sPassword(external STP MT4 credential) is intentionally excluded from the v2 contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestGatewayMarkup— paged Manager-live read of STP gateway markup rules (per-symbol bid/ask spread adjustments). Each entry:Enable,Source(external symbol/mask/group),Symbol(local),AccountName/AccountId(obsolete in modern builds),BidMarkup/AskMarkupin pips. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestGatewayRule— paged Manager-live read of STP execution-routing rules. Each entry:Enable,Name,RequestSymbol/RequestGroup(matching criteria),ExeAccountName/ExeAccountId(target execution gateway), plus per-rule slippage limits (ExeMaxProfitSlippage/ExeMaxLosingSlippagein pips, matching volume in lots), max deviation, account position, volume coverage percent, and execution-flags bitmap. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestDataServer— paged Manager-live read of access-server entries advertised to clients. Each entry:Server(host:port),Ip,Description,IsProxy,Priority,Loading(widened to long),IpInternal(widened to long),IsWitness. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestFeeder— paged Manager-live read of quote/news feeder configurations. Each entry:Name,File,Server,Login,Keywords,Enable,DataFeedMode, connection timeouts,NewsLangId. The wrapper'sPassword(datafeed credentials) is intentionally excluded from the v2 contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestLiveUpdate— paged Manager-live read of LiveUpdate service configurations. Each entry:Company,Path,Version/Build,MaxConnect, currentConnections,Type,Enable,TotalFiles. The 128-element per-file descriptor array is intentionally dropped from this payload; a dedicated per-file endpoint will follow. - MT4 v2 — added
GET /api/v2/MT4/{platform}/CfgRequestSync— paged Manager-live read of chart-history synchronization rules. Each entry:Server,Login,Enable,Mode,From/To(negative = whole chart),Securities,TimeCorrection(minutes). The wrapper'sPassword(replication credentials) is intentionally excluded from the v2 contract. - MT4 v2 — added
GET /api/v2/MT4/{platform}/PerformanceRequest?from=<utc>— Manager-live read of server resource snapshots (CPU, memory, network, sockets, connected-user count) collected at the server-defined cadence. Returns a flat array ofMT4Performancerows in ascendingCtmorder; an empty array when the window has no samples (not an error). - MT4 v2 — added
GET /api/v2/MT4/{platform}/ReportsRequest?from=<utc>&to=<utc>&logins=N&logins=M[&name=<template>]— Manager-live read of closed-trade reports for a batch of account logins within the time window. Returns a flat list ofMT4Traderows;?logins=accepts repeated values (batched in one Manager call). Optional?name=selects a server-defined report template (defaults toRTL_report; max 31 chars to fit the MT4 native fixed slot). Empty/inverted windows and missing logins are rejected witherrorCode=Validation. - MT4 v2 — added
GET /api/v2/MT4/{platform}/DailyReportsRequest?from=<utc>&to=<utc>&logins=N&logins=M[&name=<template>]— Manager-live read of end-of-day balance/equity/PnL snapshots for a batch of account logins. Returns a flat list ofMT4DailyReportrows (Login, Ctm, Group, Bank, BalancePrev/Balance/Deposit/Credit/ProfitClosed/Profit/Equity/Margin/MarginFree). Default report template isRTL_dailyreport. Note:Ctmis reported in MT4 server-local time, not UTC. - MT4 v2 — added
GET /api/v2/MT4/{platform}/DailyReportsRequestEx?from=<utc>&to=<utc>&logins=N[&name=<template>]— same daily-report data asDailyReportsRequest, server-side grouped by account login. Response shape is a JSON object keyed by stringified login:{ "1001": [...], "1002": [...] }. Identical billing cost toDailyReportsRequest(single Manager round-trip). - MT4 v2 — added
POST /api/v2/MT4/{platform}/DailySyncStart?timestamp=<unix-int>— opens a server-side incremental sync session for daily reports modified at or after the timestamp (server-local time, int32; pass 0 to request all records). Bare boolean envelope; follow up withDailySyncReadto drain the snapshot. - MT4 v2 — added
POST /api/v2/MT4/{platform}/DailySyncRead— drains the snapshot opened by the most recentDailySyncStart. Returns a flat list ofMT4DailyReportrows; an empty list is acceptable (not an error). - MT4 v2 — added
GET /api/v2/MT4/{platform}/AdmUsersRequestSafe/{group}— administrative read of all accounts in a given group. Returns a flat list ofMT4Userrows. Server-sideAdminrights are required; managers without that permission receive an error envelope rather than a dropped connection. - MT4 v2 — added
POST /api/v2/MT4/{platform}/UsersSyncStart?timestamp=<unix-int>— opens a server-side incremental sync session for user records modified at or after the timestamp (server-local time int32; pass 0 to request all). Bare boolean envelope. The companion read endpoint is not yet exposed — the wrapper's snapshot/drain implementation crashes under wine x64 with the current toolchain and is deferred to a future wrapper revision. - MT4 v2 — added
POST /api/v2/MT4/{platform}/TradesSyncStart?timestamp=<unix-int>— same shape asUsersSyncStartbut for trade records. The companion read endpoint is not yet exposed (same wine x64 deferral as the Users family). - MT4 v2 — added
POST /api/v2/MT4/{platform}/SymbolChangeaccepting a JSON body withsymbol,color,spread,spreadBalance,stopsLevel,smoothing,exeMode. Dealer-tier per-symbol adjustments (separate from the heavierCfgUpdateSymbolType 1 mutator). Symbol max length is 11 characters. - MT4 v2 — added
POST /api/v2/MT4/{platform}/SymbolSendTick?symbol=<sym>&bid=<price>&ask=<price>— injects a synthetic tick into the MT4 server. Bid/ask must be finite non-negative; inverted spreads are accepted to support broker test scenarios. - MT4 v2 — added
GET /api/v2/MT4/{platform}/EnsureGroupNameExist/{group}— boolean check for whether a trading group is configured on the server. Useful as a validation pre-flight before user provisioning or group moves. Case-sensitive. - MT4 v2 — added
POST /api/v2/MT4/{platform}/AdmTradesDelete?orders=N&orders=M— bulk-deletes trade tickets administratively. Repeat the?orders=query parameter for batch. Pair withIdempotency-Keyto make retries safe — the operation is destructive. - MT4 v2 — added 11 row-deletion endpoints under
POST /api/v2/MT4/{platform}/CfgDelete{Area}/{pos}:CfgDeleteAccess,CfgDeleteDataServer,CfgDeleteFeeder,CfgDeleteGatewayAccount,CfgDeleteGatewayMarkup,CfgDeleteGatewayRule,CfgDeleteHoliday,CfgDeleteLiveUpdate,CfgDeleteManager,CfgDeleteSymbol,CfgDeleteSync. Each accepts a zero-basedposrow index in the matchingCfgRequest{Area}read. Destructive — pair withIdempotency-Keyand verify the row identity (Server/Name/Login) from the read endpoint before translating to the position to avoid drift from concurrent edits. - MT4 v2 — added 13 row-reorder endpoints under
POST /api/v2/MT4/{platform}/CfgShift{Area}/{pos}?shift={int}:CfgShiftAccess,CfgShiftDataServer,CfgShiftFeeder,CfgShiftGatewayAccount,CfgShiftGatewayMarkup,CfgShiftGatewayRule,CfgShiftGroup,CfgShiftHoliday,CfgShiftLiveUpdate,CfgShiftManager,CfgShiftPlugin,CfgShiftSymbol,CfgShiftSync. Each moves the row atposbyshiftpositions (negative = up, positive = down). Indices may drift under concurrent admin edits — re-resolve by stable key from the matchingCfgRequest{Area}read just before issuing the shift. - Multi-language client SDKs (TypeScript, Python, C#, PowerShell). The v2 surface is now consumable from four languages. Each language (where the runtime supports static types) ships a DTO-only package — for integrations that bring their own HTTP layer — and a batteries-included client package: envelope unwrap, paginated iteration, idempotency-key headers, field selection. PowerShell is a single dynamic module of nine cmdlets (
New-MT4V2Session,Get-MT4ServerTime,Get-MT4UserRecord,Update-MT4UserRecord,Get-MT4Userswith pipeline output,Invoke-MT4V2for generic calls, …). All SDKs share/swagger/v2/swagger.jsonas the source of truth.
13.05.2026
- MT4 API v2 — alpha. New URL path
/api/v2/MT4/{tradePlatform}/...opens. v1 endpoints stay exactly as they are; nothing about v1 is changing, ever. v2 is a separate, additive surface designed for new integrations and high-volume use.- Structured response envelope. Every v2 call returns HTTP 200 with
{ isError, errorCode, errorDescription, activityId, managerAPICode, payload }.errorCodeis a stable enum (Ok/NoConnect/Validation/MT4Error/Forbidden/NotFound/Internal) — branch on it without parsing HTTP codes.activityIdis a W3C trace id, give it to support and we find your request in seconds. - Idempotency-Key HTTP header. Industry-standard (Stripe, AWS) header for safe retries.
Idempotency-Key: <any-string-up-to-255-chars>is the recommended form. Use any opaque value that makes sense in your system (order-12345-checkout, an internal request id, a UUID, etc.) — two requests sharing the same header value share the same cache slot, regardless of the string format. The legacy?cacheId=<guid>query parameter continues to work for callers that already integrated against it (Guid-only). A Guid sent in the header is interchangeable with the same Guid sent as?cacheId=— they resolve to one cache row. - Cache hits on v2 are free of charge. When you hit the same
Idempotency-KeywithincacheTimeoutseconds (default 60, max 86400), the cached response is returned and your billing is not charged. Retry-safe writes and frequent identical reads cost the same regardless of how many times you call. v1 retains its original billing model — no change for v1 customers. - v2 endpoints live (alpha, growing):
GET /api/v2/MT4/{tp}/ServerTime— trade server timeGET /api/v2/MT4/{tp}/ManagerCommon— server-wide settings (MT4Common DTO)- Pump-cached reads (fast, served from local pump):
GET /api/v2/MT4/{tp}/MarginsGet— list of margin levels per accountGET /api/v2/MT4/{tp}/MarginLevelGet/{login}— single account margin level (pump)GET /api/v2/MT4/{tp}/UserRecordGet/{login}— account profile (curated DTO; no passwords, no OTP secret, no API blob)GET /api/v2/MT4/{tp}/TickInfoLast/{symbol}— last bid/ask quote for one symbol (pump-cached)GET /api/v2/MT4/{tp}/TickInfoLast— last bid/ask quotes for all subscribed symbolsGET /api/v2/MT4/{tp}/GroupsGet— list of trading groups (curated DTO; no SMTP credentials, no template paths)GET /api/v2/MT4/{tp}/GroupRecordGet/{group}— single group by nameGET /api/v2/MT4/{tp}/GroupSecGroupsGet/{group}— security-group entries for one trading group (full 32-element array; placeholder slots have Show=0 Trade=0)GET /api/v2/MT4/{tp}/GroupSecMarginsGet/{group}— special-securities margin overrides for one trading group (trimmed tosecMarginsTotal— the wrapper's uninitialised padding is dropped)GET /api/v2/MT4/{tp}/OnlineGet— connected user sessionsGET /api/v2/MT4/{tp}/NewsTotal— count of cached news itemsGET /api/v2/MT4/{tp}/NewsGet— list of news topic headersGET /api/v2/MT4/{tp}/NewsTopicGet/{pos}— single news topic by indexGET /api/v2/MT4/{tp}/NewsBodyGet/{key}— news body by keyPOST /api/v2/MT4/{tp}/NewsBodyRequest/{key}— pre-fetch a news body so a follow-up NewsBodyGet hits cacheGET /api/v2/MT4/{tp}/MailLast— last received mail pathGET /api/v2/MT4/{tp}/TradesGetByMarket— all market-condition ordersGET /api/v2/MT4/{tp}/TradesGetBySymbol?symbol=XYZ— orders filtered by symbolGET /api/v2/MT4/{tp}/TradeRecordGet/{order}— single trade recordGET /api/v2/MT4/{tp}/SymbolInfoGet?symbol=XYZ— symbol quote + metadataGET /api/v2/MT4/{tp}/SymbolInfoUpdated— recently updated symbols (see caveat below)GET /api/v2/MT4/{tp}/SymbolsGroupsGet— symbol group catalog
- Manager (live) reads — round-trip to MT4 server, always fresh, billed per request like v1 Manager calls:
GET /api/v2/MT4/{tp}/MarginLevelRequest/{login}— single account margin level (live)GET /api/v2/MT4/{tp}/UserRecordRequest/{login}— single account profile (live, curated DTO)GET /api/v2/MT4/{tp}/UserRecordsRequest?logins=1001&logins=1002— batch account profiles (one billed request regardless of array size)GET /api/v2/MT4/{tp}/UsersRequest— every account on the platform (live, no filter). Heavy on large platforms; pair with Idempotency-Key on retries.GET /api/v2/MT4/{tp}/GroupsRequest— live group list (refreshed from MT4 server, bypasses pump cache)GET /api/v2/MT4/{tp}/TradesUserHistory/{login}?fromTime=...&toTime=...— closed trades history for an account (defaults to "everything" when range omitted)GET /api/v2/MT4/{tp}/JournalRequest?from=...&to=...&mode=...&filter=...— server journal entries for a date window.todefaults to current server time,modetoFull.GET /api/v2/MT4/{tp}/TicksRequest/{symbol}?start=...&end=...&flags=...— historical ticks for a symbol over a date range.flagsdefaults toAll(raw + normalised).GET /api/v2/MT4/{tp}/ChartRequest/{symbol}?period=H1&start=...&end=...&mode=...— OHLC chart bars for a symbol over a date range.periodis the bar interval enum (M1/M5/M15/M30/H1/H4/D1/W1/MN1).modedefaults toRangeInExcludeOutOfRage(bars whose time falls strictly inside the window).GET /api/v2/MT4/{tp}/TradeRecordsRequest?orders=12345&orders=67890— batch trade lookup by ticket list (Manager live). One billed request regardless of array length; missing tickets are silently omitted from the response.GET /api/v2/MT4/{tp}/CfgRequestSymbol— full server-side symbol catalogue (every symbol, fullConSymbol-equivalent config). Heavy response.GET /api/v2/MT4/{tp}/CfgRequestSymbol/{symbol}— full server-side configuration for one symbol.GET /api/v2/MT4/{tp}/AdmBalanceCheck/{login}— admin balance integrity check for a single account. Returns the diff between recorded balance and what the server recomputes; zero means clean.GET /api/v2/MT4/{tp}/AdmBalanceCheck?logins=1001&logins=1002— same check, batched. Clean accounts are silently omitted from the response (treat "missing" asdiff = 0).GET /api/v2/MT4/{tp}/SymbolSessionsGet/{symbol}— per-weekday trading session windows for one symbol. Returns a 7-element list (Sunday .. Saturday) each carrying up to three Quote (price) and three Trade (order acceptance) windows + overnight flags.GET /api/v2/MT4/{tp}/AdmTradesRequest/{group}?openOnly=true— all trades for accounts in the given group (admin scope).openOnlydefaults to true.GET /api/v2/MT4/{tp}/TradesGetByLogin/{login}/{group}— pump-cached open trades for one account, keyed by login + group (the wrapper organises trades by group internally, so the group is required).GET /api/v2/MT4/{tp}/TradesGet— every open trade in the pump cache (no filter). UseTradesGetBySymbol/TradesGetByMarketfor narrower scopes;TradesUserHistoryfor closed history.GET /api/v2/MT4/{tp}/TradesGet/{ticket}— open trade by ticket from the pump cache (dictionary lookup variant;TradeRecordGet/{order}uses a different wrapper call that can also resolve recently closed trades).
- Mutators (Type 1 — full-replace) — POST endpoints that submit the new state directly. Pair every retried call with an
Idempotency-Keyheader to avoid duplicate execution:POST /api/v2/MT4/{tp}/UserPasswordCheck/{login}— verify password (read-only, but POST to keep credential out of URL). Body: JSON-encoded password string.POST /api/v2/MT4/{tp}/UserPasswordSet/{login}?changeInvestor=&cleanPubkey=— set account password. Body: JSON-encoded new password.POST /api/v2/MT4/{tp}/UserRecordUpdate/{login}— update account profile. Body:MT4UserUpdateDTO (every non-secret, non-read-only field). Server reads the current record first, applies the DTO over it, and writes the merged structure back — so omitted-from-DTO fields (passwords, OTP secret, server-assigned timestamps) are preserved. Type 1 semantics from the client's perspective.POST /api/v2/MT4/{tp}/GroupRecordUpdate/{group}— update group configuration. Body:MT4GroupUpdateDTO. Same secret-preservation read pattern: SMTP credentials, file-path templates, the SecGroups/SecMargins nested arrays, and NewsLanguages are preserved from the current state because the DTO does not carry them.POST /api/v2/MT4/{tp}/CfgUpdateSymbol/{symbol}— update symbol configuration. Body:MT4SymbolConfigUpdateDTO. Same read-modify-write flow. Sessions nested array, reserved padding, and server-derived counters (count,countOriginal,filterCounter,point,multiply, tick-value pair) are preserved.POST /api/v2/MT4/{tp}/AdmBalanceFix?logins=1001&logins=1002— admin balance fix. Asks MT4 server to write the diffs reported byAdmBalanceCheckonto the accounts. Pair every retry with anIdempotency-Keyheader — without it, a retried fix can double-apply on accounts whose original fix landed but whose response was lost.POST /api/v2/MT4/{tp}/UserRecordNew— create a new account. Body:MT4UserCreateDTO (setlogin=0for server-assigned id, or>0to request a specific id; server rejects collisions). After creation the account has an empty password — follow up withPOST UserPasswordSet/{login}before the account is usable. Idempotency-Key strongly recommended: without it a retried create can burn a second login id from the broker's sequence if the original response was lost.POST /api/v2/MT4/{tp}/TradeTransaction— submit a trade operation: open / modify / close / balance op. Body is theMT4TradeTransactionDTO; the response echoes the wrapper's mutated struct with the server-assignedorderticket on Open operations. Idempotency-Key is essentially mandatory — without it a retried open can place two orders, a retried close can double-close, and a retried balance op can apply twice.POST /api/v2/MT4/{tp}/AdmTradeRecordModify/{ticket}— admin direct edit of a single trade record (back-office override for accounting fields: commission/storage/taxes/profit/comment/magic/SL/TP). For typical SL/TP edits preferTradeTransactionwithtradeTransactionType=ModifyTrade— that goes through the wrapper's audited path. This endpoint reads the current record first, patches the allow-listed fields, then writes back, so order id / login / symbol / volume / open price / open time / gateway internals are preserved automatically.POST /api/v2/MT4/{tp}/SymbolAdd/{symbol}— promote a configured symbol into the active set. (v1 exposes this as GET — v2 corrects to POST.)POST /api/v2/MT4/{tp}/SymbolHide/{symbol}— drop a symbol from the active set; ticks stop flowing. (v1 GET → v2 POST.)POST /api/v2/MT4/{tp}/SymbolsRefresh— force the wrapper to reload symbol catalogue from MT4 server. (v1 GET → v2 POST.)
- Mutators (Type 2 — single-field updates) are planned for a later release: WebAPI reads the entity from MT4 server, updates one field in-memory, and writes the whole structure back. Avoids the "I just wanted to flip Enable but rolled back a concurrent Balance update" footgun that pure Type 1 inflicts on clients without fresh state.
- More endpoints follow in subsequent releases. The full v2 endpoint set will eventually mirror v1 plus exclusive additions (Snapshot/Sync family, cursor-paginated collections, read batch endpoints).
- Caveat —
SymbolInfoUpdated: this method dequeues from the same pump buffer that drives SignalR tick streams (BidAskChanges). If you both poll this endpoint AND subscribe to the SignalR tick hub on the same trade platform, the SignalR stream may receive fewer events because each poll consumes them. If you need both — prefer the SignalR stream (it's push-based and lower latency) and poll only when no tick subscriber is active for that platform.
- v2 DTO contract. v2 responses use curated DTOs (e.g.
MT4Common— broker name, server name, version, build, time zone) instead of MetaTrader-internal struct shapes. This decouples your v2 integration from MetaQuotes server-side schema changes — when MT4 ships a new build with reorganized fields, v2 contract stays stable. v1 continues to return MetaTrader-shaped types as before, no change. - v2 JSON serialization. v2 responses are produced via
System.Text.Jsonwith source-generated type info — zero-reflection JSON path, faster and lower-allocation than the v1 serializer. Field naming is camelCase (e.g.isError,errorCode,managerAPICode,payload). JSON shape is otherwise unchanged from any other JSON consumer's perspective (Content-Type: application/json, UTF-8). v1 continues to use Newtonsoft.Json with its original casing — no v1 change.
- Structured response envelope. Every v2 call returns HTTP 200 with
- Cursor pagination + field selection (v2 list endpoints). Five high-volume v2 list endpoints (
UsersRequest,TradesGet,GroupsRequest,OnlineGet,SymbolInfoUpdated) now support cursor pagination and sparse field selection. This is a wire-format change for these specific endpoints —payloadis now an object withitemsandpaging, not a bare array. Backwards-incompatible for callers that already integrated against the early-alpha shape; alpha consumers should update accordingly.- Pagination.
?limit=Nbounds the page size (1..5000). Without?limit=the response contains the full set in one page. The response'spaging.nextCursor(opaque base64 string) drives the next call:?cursor=<token>.paging.hasMore: falsesignals end-of-collection. Garbage cursors are treated as "start from the beginning" — they don't fail, they just begin afresh. - Server-side cost note. Wrapper-side we still fetch the full collection from MT4. Paging trims only the wire payload (network + client parse), not MT4 server load.
- Stable sort. Items sort by their natural key (login int, ticket int, group/symbol string with ordinal compare). Pages are stable across concurrent inserts so long as new keys land after the last returned page's cursor.
- Field selection.
?fields=login,balance,equityreturns only the requested top-level properties per item. Unknown fields are silently dropped. An all-unknown set returns the full DTO (so a typo doesn't strip everything). Case-insensitive matching. Error envelopes pass through untouched. - New shape:
{ "isError": false, "errorCode": "Ok", "payload": { "items": [ ... ], "paging": { "nextCursor": "abc123", "hasMore": true } } } - Type 2 single-field mutators (
PATCH). Three new endpoints accept a partial JSON body containing only the fields you want to change. The server reads the current record live from MT4, overlays your patch, writes back, and echoes the merged record — you don't need a follow-up GET to confirm the new state.PATCH /api/v2/MT4/{tp}/UserRecord/{login}— partial update of an accountPATCH /api/v2/MT4/{tp}/GroupRecord/{group}— partial update of a trading groupPATCH /api/v2/MT4/{tp}/SymbolConfig/{symbol}— partial update of a symbol configuration- Body: a JSON object with any subset of the corresponding
MT4*UpdateDTO's properties (camelCase). Unknown keys are silently ignored (forward-compatibility for newly-added fields). - Identity is the path parameter and is immutable. Secret-preservation and computed-field protection match Type 1 (
POST UserRecordUpdate/{login}and siblings). Idempotency-Keyheader is honored, same contract as Type 1 mutators.- Use this when you want to change one or two fields without echoing the entire record back to the server.
- TypeScript SDK alpha —
@cplugin/saas-webapi-client. A typed client for v2, distributed as an npm package. Auto-generated types from our OpenAPI spec mean DTOs stay in sync with the server automatically. Built-in helpers for pagination (paginate()async iterable), field selection,Idempotency-Key, and structured error handling (MT4V2ErrorcarrieserrorCode/managerAPICode/activityId). Built with Bun, ships ESM. See the package's README for a quick start.
- Pagination.
28.03.2026
- Connection state monitoring: all 4 platform components (MT4 Manager, MT4 Pump, MT5 Manager, MT5 Pump) now correctly report Connected/Disconnected status. Previously only MT4 Pump transitions were tracked; disconnect notifications for the other 3 components were silently skipped.
27.03.2026
- Fixed RabbitMQ message deserialization failure. Messages compressed with GZip by upstream services are now correctly decompressed before processing. Both compressed and uncompressed messages are supported transparently.
17.03.2026
GET /api/TradePlatforms,GET /api/Organizations— server-side response caching (1s TTL). Repeated requests return cached data with significantly lower latency.
10.03.2026
- MT4 pumping: attempt to fix delays on User/Trade/MarginCall updates caused by native pump thread saturation. All event processing now offloaded from native pump thread immediately, preserving strict FIFO event ordering.
08.03.2026
- MT5 SDK updated from
4755to5660:UsersPasswordsenum: addedTraderpassword type (for separate trader password distinct from main login password)MT5DealDTO: addedPartyIDfield (counterparty identification for ECN/exchange deals)MT5OrderDTO: addedPartyIDfield (counterparty identification)
18.01.2026
- MT5 added:
- POST
DealerBalanceRaw- raw balance operation that bypasses standard credit/margin validation checks (for administrative corrections)
- POST
28.03.2025
- WebAPI runs on top of .NET v9.0
28.11.2024
- MT5 added:
- POST
OrderDeleteBatch - POST
DealDeleteBatch - POST
PositionDeleteBatch
- POST
13.08.2024
- added
MT5AccountMarginCallEventArgs StreamMarginCallUpdates(TradePlatformId)method toMT5hub to monitor MC/SO events. Every time something happen on server, you will receive structure which JS object has self-explanatory example below:
account: {
"login": 2009,
"currencyDigits": 2,
"balance": 3025.7,
"credit": 0,
"margin": 3279.67,
"marginFree": 6.03,
"marginLevel": 100.18385996152051,
"marginLeverage": 100,
"profit": 386,
"storage": 0,
"floating": 386,
"equity": 3285.7,
"soActivation": "None",
"soTime": null,
"soLevel": 0,
"soEquity": 0,
"soMargin": 0,
"blockedCommission": -126,
"blockedProfit": -185428,
"marginInitial": 0,
"marginMaintenance": 0,
"assets": 0,
"liabilities": 0
}
type: "MarginCall"
direction: "Leave"
Direction can be Enter or Leave, Type can be MarginCall or StopOut.
26.06.2024
- in MT5 user's
rightsenumerable, added missing values, so JSON parser will be ok;
03.06.2024
- MT5 added:
- GET
HistoryRequestByGroup - POST
HistoryRequestByTickets - POST
OrderRequestByTickets - POST
DealRequestByTickets
- GET
31.05.2024
- MT5 order's
ActivationFlagsfield type switched fromuinttoTradeActivationFlagstype;
03.05.2024
- js libs to reference (to match client's SignalR libs with server):
- https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js
- https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/6.0.25/signalr.min.js
- slightly reduced latency during SignalR events;
- added methods to MT5 controller:
DealRequestByGroupDealRequestByGroupSymbolOrderGetByGroupOrderGetBySymbolOrderRequestByGroupOrderRequestByGroupSymbolPositionGetByGroupPositionGetBySymbol
15.03.2024
SymbolUpdateadded toMT5controller;
15.03.2024
- all MT5 enums now serialized as string, instead of int/bitMask;
- including MT4's
AggregationType; - to
OrderFillingenumBoCadded,FOKandIOCrenamed toFoKandIoC; OrderTimeGTC->GtC;OrderActivationStoplimit->StopLimit,Stopout->StopOut;UsersRightsTechnicalandExcludeReportsenums added;- MT5 manager API b4230 support;
22.01.2024
- MT5 ManagerAPI b4150;
Retcodereplaced withRetCodewhere applicable;- added
DealUpdatemethod to MT5 controller;
24.11.2023
- fixed mistake in
SubscribeToTicks,SubscribeToAllTicks,UnsubscribeFromAllTicks.
22.11.2023
- added to MT5:
UserGetByLoginsPositionGetByTicketsGroupGetGroupRequestGroupRequestArrayOrderGetOrderGetByTicketsOrderGetByLoginsDealRequestByTicketsDealRequestByLoginsDealRequestByTicket
21.11.2023
- added to MT5:
ChartRequestSymbolGet- Instead of date
01.01.1970-nullwill be returned, where date time is nullable field; SymbolRequestArray
- MT5 Hub:
SubscribeToSymbolsOnSymbolandOnSymbolSynccallbacks;
UnsubscribeFromSymbolsSubscribeToTicks,SubscribeToAllTicksOnTickcallback;
UnsubscribeFromAllTicks
10.11.2023
- added streams to MT5 hub:
SubscribeToPositionsSubscribeToOrders
07.11.2023
- MT5
UserAdd: If any of passwords (PasswordorPasswordInvestor) is null or empty, both of them will be generated. We will generate passwords and call manager api method to create user. If MT5 does not like our password, we will try again with a new pair, a maximum of 10 times; - MT5
ManagerCurrentreturns updated structure signature;
07.11.2023
- MT5 methods added:
PositionGetByLogins
- reduced usage of MetaQuotes's
SMTTimein favor of default .NETDateTimeto/fromUnixTime/FILETIMEconverter;
30.10.2023
- Added methods to MT5 hub:
SubscribeToUsers, updates will be sent through callback(-s):OnUser
UnsubscribeFromUsersSubscribeToDeals, updates will be sent through callback(-s):OnDealOnDealClean
UnsubscribeFromDeals
28.10.2023
- MT5 API methods added:
UserDeleteClientDeleteUserGetByGroup
22.09.2023
- MT5 methods added:
TimeGetManagerCurrentUserAccountRequest
18.07.2023
- MT5
DealerSendresponse signature changed;
14.06.2023
- added
UserAccountGetmethod toMT5controller;
08.05.2023
UserUpdatenowPOSTmethod;- fixed problems with MT5 connectivity;
MT5ClientrequiresPersonName;
05.05.2023
MT5controller: addedTimeServermethod;- rewritten MT5 keep connection alive routine;
11.04.2023
- MT5 managerAPI used: b3661;
- added
UserUpdate,UserPasswordCheckandUserPasswordChangeMT5 methods.
21.03.2023
- added
ServerTimemethod to MT4 endpoint;
15.01.2023 SignalR MT4 HUB major update
- MT4 connection will stay alive after first access forever;
Connectmethod supportsConnectArgsstructure where you can specifyTimeoutMs, in milliseconds (30 seconds by default). You shall start your duties from this method;SetTicksAggregationSettings- not yet available;SubscribeToAllMarginUpdates- not yet available;UnsubscribeFromAllMarginUpdates- not yet available;UnsubscribeFromMarginUpdates- not yet available;SubscribeToMarginUpdates- not yet available;StreamMarginDiff- not yet available;Pingremoved, useConnectinstead;
MT4 Hub migration guide:
All methods awaits structure and send structures.
Because of guide
Old code:
connection.invoke("SubscribeToTicks", tradePlatform, "EURUSD")
New code:
connection.invoke("SubscribeToTicks", {tradePlatform, symbol: "EURUSD"})
All callbacks now return structures.
Old code:
connection.on("onTick", function (tradePlatform, tick) {
/* your code here */
});
New code:
connection.on("onTick", function (args) {
const {tradePlatform, tick} = args;
/* your code here */
});
Check CPlugin.WebAPI.Realtime.ts for further details.
28.12.2022
- [fix]
StreamTradessent updates for all platforms, regardless of chosen one; - [fix]
StreamUserUpdatessent updates for all platforms, regardless of chosen one;
20.12.2022
RefreshAPImethod removed from/TradePlatformscontroller.
14.12.2022
- added
TradesGetByLoginmethod to MT4 RESTful
14.12.2022 StreamMarginDiff
- IAsyncEnumerable -> ChannelReader;
- SamplingMs min is 0;
- added to MarginLevelDiff - Tm field;
- dont enqueue more records, until buffer completely flush;
24.11.2022
StreamUserUpdatesreturnsUserUpdatestructure which is
public class UserUpdate
{
public TransactionType Type;
public UserRecord User;
}
22.11.2022
- added
StreamMarginDiffto MT4 hub;
21.11.2022
- added
StreamUserUpdatesto MT4 hub;
16.11.2022
- [fix] when manager account does not hav enough right it will not throw exception anymore, but will return
{
"errorType": "MT4API",
"errorCode": "NotEnoughRights",
"errorDescription": "Not enough rights",
"requestId": "unique id"
}
JournalRequest,TradeRecordsRequest,TradesUserHistory,CfgRequestSymbol,AdmBalanceCheckfunctions will not throw exception but will returnBadRequestif manager account does not have enough rights;
13.10.2022
- fixed memory leakage during SignalR operations;
12.10.2022
- added method to MT4 hub:
IAsyncEnumerable<TradeExEventPayload> StreamTrades(Guid tradePlatform)
29.09.2022
- added method to MT4 hub:
bool Connect(Guid tradePlatform) - MT4 hub's callback
OnMT4ConnectionStatuswill only be run once status changed, and never during connect to hub;
23.09.2022
- [fix] problem with MT4::UserRecordNew
21.09.2022
Connectmethod removed from MT4 hub;- configurable
KeepConnectionAliveDuringparameter; - [fix] problem with disconnecting inactive trade platform even when signalR client still online;
15.09.2022
- added
DealerBalanceMT5 method - added
ClientRequestMT5 method - added
UserRequestMT5 method
13.08.2022
- SignalR
Tickstructure gotLastTimefield
08.08.2022
- added
StreamMarginCallUpdatesmethod to stream margin call updates. During subscription you get all accounts in M/C state. Then, only updates will be send (mc->normal and normal->mc). Code example is here
04.08.2022
- added auth support into swagger doc UI
- added
StreamAllTicksmethod to the MT4 hub, read more here
03.08.2022
- MT4 call added
CfgRequestSymbolGroup, more info here
21.07.2022
- MT5's call added
ClientAdd
20.07.2022
- MT5's calls
HistoryRequest,DealRequestreturn customized enums DealerSendcall now use customized enums, so call with parameters{"Login":2000, "Action": "TA_DEALER_POS_EXECUTE", "Symbol":"EURUSD", "Volume":100, "Type": "OP_BUY", "PriceOrder": 1.01}will not work, please convert arguments to the new format{"Login":2000, "Action": "DealerPosExecute", "Symbol":"EURUSD", "Volume":100, "Type": "Buy", "PriceOrder": 1.01}- Added
UserAddmethod
13.07.2022
- added
DealRequestMT5 method
13.07.2022
- all enums will be serialized as strings
11.07.2022
- added method
HistoryRequestto MT5 controller
01.03.2022
- API documentation augmented
28.02.2022
- added
TestController::TryParseDateTimeto test .NET DateTime parser values validity; - possible memory leakage fixes;
- added
/healthzURL endpoint to tell the status, possible values are (HTTP Code, string):[{200,Healthy}, {200,Degraded}, {503,Unhealthy}]; - V2 endpoint removed. There is a way to share error details even when we return 404 NOT FOUND (MT4/MT5 resource not found);
- Swagger/OpenAPI documentation updated: methods grouped by entity type, added description of 400,404 results, where applicable;
14.02.2022
- added 'CfgRequestSymbol', 'CfgRequestSymbol/{symbol}' methods to MT4 controller;
- fixed problem with
UserRecordsRequestmethod;
v1.3 (09.02.2022)
- migrated to .NET 6.0;
- if connection to MT4 was not used during past 15 minutes - it will disconnect from MT4 to reduce load;
v1.2 (17.11.2021)
- migrated to .NET 5.0;
api-versionpassed within query string not supported anymore, to specify api version. Use URL path instead;- added
v2api endpoint;
18.10.2021
- fixed problem when trade platform settings updated and WebAPI still used old credentials;
- use MT4 mtmanapi v1320
- performance optimization
28.06.2021
- added aggregation of price stream,
SignalR::MT4hub now have methodSetTicksAggregationSettings. Take a look to demo page source code to get example of use.
1.1.2
- WebAPI subscribed to updated ManagerAPI method
OnlineExChanges(OnlineExwere used before), which is now distinct against changes.
1.1.1.10
- added
void SubscribeToOnlineUpdates(Guid tradePlatform),void UnsubscribeFromOnlineUpdates(Guid tradePlatform)to MT4 hub and correspondingOnOnlineUpdate(Guid tpConnectionKey, TransactionType transactionType, int login)callback. - added signalr example links to main page
1.1.1.9
- added
UserRecordsRequestandUsersRequestmethods toMT4controller
1.1.1.7
- native MT4ManagerAPI updated to b1310
1.1.1.6
- minor update
1.1.1.5
- updated MT4 ManagerAPI wrapper to version 4.1260.1.8. If MT4 server DNS name cannot be resolved, it will try again using longer periods after each failed step, to avoid spamming journal.
1.1.1.2
- added "CfgUpdateSymbol" and "SymbolsRefresh" methods
1.1.1.1
- MT4 hub will notify SignalR consumers about current MT4 pumping status
1.1.1.0
- ManagerAPI pool ceased
1.1.0.24
- cached responses now in lower case, to match application standards
1.1.0.23
- added support for cached responses to make requests idempotent
at any URL it can be addedcacheIdofGuidtype,
andcacheTimeoutspecifying timout in seconds.
Example:/API/MT4/{mt4id}/JournalRequest/2020-08-01/2020-09-20/Full?cacheId=63cb3a5f-1bd6-445d-8da8-1b3d8a6ce70d&cacheTimeout=60
Next time ifcacheIdspecified, it will search in DB for cached record associated for this ID, if found - will return cached data instead.
AftercacheTimeoutseconds record will be deleted from DB permanently and will not be available.
1.1.0.21
- added API methods execution time logging
1.1.0.20
- performance optimization
1.1.0.19
- when there were no open trades, by mistake,
OnMarginUpdateHub method returned zero balance
1.1.0.18
- added
UnsubscribeFromMarginUpdatestoMT4Hub
1.1.0.17
- added method
MT4::JournalRequest
1.1.0.16
- minor updates
1.1.0.15
- [fix] mistake when
MT4HubcalledOnMarginUpdatecallback with empty list even client did not subscribe for it
1.1.0.14
- internal code optimization
1.1.0.13
Hubs:MT4margin level will be sent for all subscribed users, if subscribed explicitly, does not matter if there any open positions. Or if subscribed to all data, it will send for those accounts who have open positions.
1.1.0.12
- by default, MT platform connection timeout now 30 seconds. (previously was 1..5 in different places)
- added
MT4::ManagerCommonandMT4::ManagerCommonExmethods - x64 runtime
1.1.0.11
- SignalR endpoint rewritten to run under ASP.NET Core
- There is two example webpages: [simple test] and [MT4 demo], check their page source code to get the idea
- typescript example included
MT4::AdmBalanceChecklogin to be specified as ofAdmBalanceCheck/<login>MT4::AdmBalanceCheckalways return value of typeAdmBalanceCheck(in comparison to ManagerAPI which does not return anything, if balance is ok)MT4::AdmBalanceChecknow supports only single login specified within URIAdmBalanceCheck/{login:int:min(1)}MT4::AdmBalanceFixnow supports only single login specified within URIAdmBalanceCheck/{login:int:min(1)}
1.1.0.10
- fixed possible memory leaking problem making app crash unexpectedly
1.1.0.9
- fixed problem with
MT4::UserRecordNewcall result, passwords were suffixed with\0characters
v1.1.0.8
- slightly reduced memory usage
- performance significantly tuned up
MT4::UserPasswordSetnow requiresUpdatepermission, instead ofRequestMT4::UserRecordNewAPI method accept and return structure of typeUserRecordNewwhere password and password investor presented in plain text, and only once. Following requests of user settings will return both passwords stored in base64- Added
MT4::AdmTradeRecordModifymethod - added
MT4::AdmBalanceCheckandMT4::AdmBalanceFixmethods
v1.1.0.7
- added
GETmethod for MT4MarginLevelRequestwhich does not require pumping and does not need open trades to return a result (in comparison toMarginLevelGet)
v1.1.0.6
- significant request execution speed gain [link to our blog]
v1.1.0.5
- [fix] issue with applying new MT4 settings after update.
v1.1.0.4
- starting from now TickInfoLast will not make any calls to MT4, it will return internal buffer instead. But, if you want to collect prices you should add symbol to watch list by
making a very single call to
SymbolAdd. Then during whole WebAPI runtime it will collect prices for you into internal buffer. Keep in mind, this is not a history, only most recent prices for each explicitely monitored symbol. By default, symbol will be in market watch when there are open trades on it. Otherwise, you will not see prices until add symbol to watch list. - now there are two methods :
TickInfoLast/{symbol}- request prices for specified symbol onlyTickInfoLast- request prices for all monitored symbols
v1.1.0.3
- added
GET MT4/<id>/TickInfoLast - added
GET MT4/<id>/TicksRequest - added
GET MT4/<id>/ChartRequest
v1.1.0.2
- added
POST API/MT4/<id>/CfgUpdateGroup - added
POST API/MT4/<id>/UserRecordUpdate
v1.1.0.0
- source code migrated to asp.net core 2.1
- OData endpoint will not be served anymore. RESTful JSON WebAPI will take place
/odata/[controller]({id})should be redirected to `/api/[controller]/{?id}
v1.0.0.72
- fixed issue with wrtong error message returned while being not authenticated.
v1.0.0.71
- makes possible for: /odata/MT4Users(1000)/NS.MarginLevelGet()?`$select=Margin,Free
v1.0.0.67
- added very first support of MT5 platform
- added
POST /odata/TradePlatforms({Id})/NS.MT5DealerSendto send trade request to MT5 server - now it notice MT4/MT5 settings updates came from Admin portal to reconnect with new credentials