Infy Trade Tech

    We use cookies to analyse traffic and improve the site. Cookie Policy

    HomeServicesMT5 Manager API
    MT5 Manager API

    MT5 Manager API integration.

    Every account created by hand, every balance operation typed from a payment report, every challenge moved between groups manually — that is platform administration doing work an interface can do reliably. We integrate the MT5 Manager API so onboarding, funding, challenge progression and reporting run as controlled operations.

    Secure infrastructure supporting MT5 Manager API integrations
    Manager API · Controlled server-side automation
    01 / Direct Answers/ 01

    What the MT5 Manager API is.

    Plain answers, before the detail.

    —

    What is the MT5 Manager API?

    The server-side administrative interface to an MT5 trading server. It lets an authorised back-office system create and configure accounts, assign groups, apply balance operations and read trading data programmatically.

    —

    Who uses it?

    Brokers and prop firms — through their CRM, back office or integration layer. It is not a client-facing trading API and is never exposed to a trader's browser.

    —

    What does it replace?

    Manual platform administration: account creation, group moves, balance posting and report pulls that would otherwise be performed by staff in the platform administrator.

    02 / Automation flow/ 02

    From a CRM event to an MT5 operation.

    Every automation follows the same path: a business event updates the CRM record, the integration layer queues a controlled job, the Manager API performs one operation, and the result is written back with an audit entry.

    1. 1EventKYC provider: verification passed
    2. 2CRM recordClient status → Approved; segment read
    3. 3Integration layerJob queued · idempotency key per client
    4. 4Manager APIUserAdd
    5. 5MT5 serverLive account created in segment group
    Write-backLogin written to client record · audit entry linked to the originating record

    Manual todaySupport creates each trading account after KYC approval.

    API-drivenKYC provider: verification passed → UserAdd → login written to client record.

    1. 1EventPSP callback: transaction settled
    2. 2CRM recordDeposit record matched to account
    3. 3Integration layerIdempotency key = PSP transaction ID
    4. 4Manager APIDealerBalance
    5. 5MT5 serverBalance operation with comment reference
    Write-backDeposit marked Posted · ticket stored · audit entry linked to the originating record

    Manual todayFinance posts balance operations from a PSP report.

    API-drivenPSP callback: transaction settled → DealerBalance → deposit marked posted · ticket stored.

    1. 1EventCheckout: challenge purchased
    2. 2CRM recordChallenge record with phase rules
    3. 3Integration layerProvisioning job · phase config attached
    4. 4Manager APIUserAdd
    5. 5MT5 serverEvaluation account in Phase 1 group
    Write-backCredentials sent · phase clock started · audit entry linked to the originating record

    Manual todayAn administrator creates the challenge account and sets the group.

    API-drivenCheckout: challenge purchased → UserAdd → credentials sent · phase clock started.

    1. 1EventRule engine: phase target met
    2. 2CRM recordChallenge state → Passed
    3. 3Integration layerState check before write
    4. 4Manager APIUserUpdate
    5. 5MT5 serverAccount moved to next-phase group
    Write-backPhase history appended · audit entry linked to the originating record

    Manual todayOperations moves the trader between groups by hand.

    API-drivenRule engine: phase target met → UserUpdate → phase history appended.

    1. 1EventTrader: payout requested
    2. 2CRM recordPayout record → Pending review
    3. 3Integration layerReads only until approved
    4. 4Manager APIUserGet · DealRequest
    5. 5MT5 serverEquity and deal history returned

    Human approval before any balance write

    Write-backSnapshot attached to payout record · audit entry linked to the originating record

    Manual todayEquity is checked by hand before approval.

    API-drivenTrader: payout requested → UserGet · DealRequest → snapshot attached to payout record.

    Method names are examples of MT5 Manager API operations; the exact calls depend on the server build and integration design. All calls run server-side only.

    Integration in code

    The actual Manager API calls.

    How an integration connects to MT5 and which CIMTManagerAPI methods it calls, shown in C# with the MetaQuotes .NET wrapper, followed by a masked replay of a demo session.

    Connection sequence · C# (.NET wrapper)

    1. 01

      Load the SDK and create a manager

      The MetaQuotes Manager API ships as native DLLs with a .NET wrapper. The factory loads the library and checks the API version before any manager interface is created.

      using MetaQuotes.MT5CommonAPI;
      using MetaQuotes.MT5ManagerAPI;
      
      MTRetCode res = SMTManagerAPIFactory.Initialize(sdkPath);
      if (res != MTRetCode.MT_RET_OK) throw new Exception($"Init: {res}");
      
      CIMTManagerAPI manager =
          SMTManagerAPIFactory.CreateManager(SMTManagerAPIFactory.ManagerAPIVersion, out res);
    2. 02

      Connect with a dedicated manager login

      Use a manager account created for the integration, with only the permissions it needs. Pump mode controls which data the server streams to the client.

      res = manager.Connect(
          server,            // "access.example:443"
          managerLogin,      // dedicated integration login
          password,          // from a secret store, never in code
          null,
          CIMTManagerAPI.EnPumpModes.PUMP_MODE_USERS
            | CIMTManagerAPI.EnPumpModes.PUMP_MODE_POSITIONS,
          30000);            // timeout, ms
    3. 03

      Run one controlled operation

      Each business event maps to one API call, wrapped with an idempotency key and a return-code check. Failures are retried or escalated, never silently ignored.

      if (res != MTRetCode.MT_RET_OK)
          logger.Error($"Connect failed: {res}");
    4. 04

      Write back, disconnect and release

      The resulting login, deal ticket or return code is written to the CRM record with an audit entry. Interfaces are released when the worker shuts down.

      manager.Disconnect();
      manager.Release();
      SMTManagerAPIFactory.Shutdown();

    Command reference · CIMTManagerAPI

    UserAdd

    Create a live or evaluation trading account after KYC approval or challenge purchase.

    CIMTUser user = manager.UserCreate();
    user.Group("real\\standard-usd");
    user.Name(client.FullName);
    user.Leverage(100);
    res = manager.UserAdd(user, masterPass, investorPass);
    ulong login = user.Login();      // write back to CRM

    UserRequest

    Read an account's current record from the server before an update or payout review.

    CIMTUser user = manager.UserCreate();
    res = manager.UserRequest(login, user);
    string group = user.Group();

    UserUpdate

    Move an account between groups, e.g. evaluation phase to funded, or change leverage.

    user.Group("prop\\phase-2");
    res = manager.UserUpdate(user);

    DealerBalance

    Post a deposit, withdrawal, credit or correction as a balance operation with a reference comment.

    res = manager.DealerBalance(
        login, 500.00,
        (uint)CIMTDeal.EnDealAction.DEAL_BALANCE,
        $"PSP:{pspTxnId}",           // reference for reconciliation
        out ulong dealTicket);

    UserAccountRequest

    Read balance, equity and margin for risk checks or payout eligibility.

    CIMTAccount acc = manager.UserCreateAccount();
    res = manager.UserAccountRequest(login, acc);
    double equity = acc.Equity();

    PositionRequest

    Read open positions for one account, e.g. before closing a breached evaluation.

    CIMTPositionArray positions = manager.PositionCreateArray();
    res = manager.PositionRequest(login, positions);

    DealRequest

    Read deal history for a period: statements, payout review, rule-breach checks.

    CIMTDealArray deals = manager.DealCreateArray();
    res = manager.DealRequest(login, fromUnix, toUnix, deals);

    Every call returns an MTRetCode; the integration checks it and records the result before the CRM is updated.

    Session replay

    Recorded in a controlled demo environment. Logins, passwords, server addresses and references are masked.

    # Controlled demo environment · credentials and server details masked
    > SMTManagerAPIFactory.Initialize(sdkPath)
    MT_RET_OK
    > manager.Connect("••••••••:443", ••••, "••••••", null, PUMP_MODE_USERS, 30000)
    MT_RET_OK · connected
    # Event: KYC approved for CRM client ••••21
    > manager.UserAdd(user{ Group="demo\standard", Leverage=100 }, ••••, ••••)
    MT_RET_OK · login ••••••47 → written to CRM record
    # Event: PSP callback, deposit settled
    > manager.DealerBalance(••••••47, 500.00, DEAL_BALANCE, "PSP:••••9c")
    MT_RET_REQUEST_DONE · deal ticket ••••12 → deposit marked Posted
    > manager.UserAccountRequest(••••••47, acc)
    MT_RET_OK · balance 500.00 · equity 500.00
    > manager.Disconnect(); manager.Release()
    session closed · 4 operations · audit log appended
    03 / Capabilities/ 03

    What we build against it.

    01

    Account Provisioning

    Create live, demo, challenge and funded accounts programmatically with the correct group, leverage, margin mode and symbol permissions applied at creation — not corrected by an administrator afterwards.

    02

    Group & Configuration Reads

    Read group definitions, symbol settings and account attributes so downstream systems make decisions against the platform's real configuration rather than a cached assumption.

    03

    Balance Operations

    Deposits, withdrawals, credit, corrections and profit adjustments applied as recorded operations with a reference back to the originating CRM or payment record.

    04

    Trade, Deal & Position Reads

    Open positions, closed deals and order history pulled for reporting, risk oversight, challenge rule evaluation and finance reconciliation.

    05

    State Synchronisation

    Balance, equity and account-state synchronisation between the platform and the CRM, built reconciliation-first so a mismatch is surfaced rather than silently overwritten.

    06

    Reporting Extracts

    Scheduled extracts for management reporting, IB commission calculation, dealing review and audit — delivered to your warehouse instead of exported by hand.

    04 / Controls/ 04

    A platform API is a privileged interface.

    Automation against a live trading server is only an improvement if the controls around it are stronger than the manual process it replaces.

    A manager connection can move money and change account permissions. Treating it like an ordinary application credential is the most common mistake we are asked to correct.

    Where a workflow needs judgement — a disputed payout, an unusual withdrawal, a suspected rule breach — the integration raises it for human approval instead of acting.

    1. 01Credentials held server-side only — never in a browser or mobile client
    2. 02Separate manager accounts per function with least-privilege rights
    3. 03Idempotency on every write so a retry cannot double-post a balance operation
    4. 04Full audit log of every operation with the originating business record
    5. 05Sandbox or staging environment for changes before production
    6. 06Rate and concurrency limits appropriate to the server
    7. 07Alerting on failed operations rather than silent retries
    8. 08Documented rollback procedure for bulk operations
    06 / Deliverables/ 06

    What an engagement produces.

    Operation catalogue: every platform action the integration performs
    Field mapping between CRM records and platform objects
    Manager account and permission plan
    Idempotency, retry and failure-handling specification
    Reconciliation routine for balances and account states
    Audit-log design linking every operation to a business record
    Staging validation before production cutover
    Engineering handover documentation for your team
    07 / FAQ/ 07

    MT5 Manager API — common questions.

    Get Started

    Discuss an Integration

    Tell us which platform workflows are still manual. We will come back with an operation catalogue and an integration scope.

    Infy Trade Tech Limited provides technology, software and consultancy services to businesses only. We do not offer trading, investment or brokerage services to the public, do not accept or hold client funds, and do not act as a liquidity provider or payment service provider.