Integrations

MT4 / MT5 Affiliate Tracking Integration: 2026 Technical Guide

How to connect affiliate and IB tracking to MetaTrader 4 and 5: manager API, trade-level event ingestion, rebate by lots/volume/spread, and attribution that survives reconciliation.

Ronen BuchholzCo-Founder, Track360
May 31, 2026
13 min read

MT4 affiliate tracking is the integration problem at the centre of every forex IB network and rebate business. MetaTrader 4 and MetaTrader 5 are the trading platforms where the actual trades happen, and the affiliate or IB only earns when those trades generate volume, spread or commission. Connecting the affiliate-tracking layer to the MetaTrader server so that each executed lot is correctly attributed to the right referrer — and survives reconciliation — is what turns a marketing dashboard into a payable commission system. This guide is for the integration and operations teams on the affiliate side who have to make that connection work.

The challenge is that MetaTrader was built for brokers, not affiliates. The trade data lives on the broker trading server, exposed through the manager API, and the affiliate platform has to consume it, map each trading account back to the referral click that acquired it, and translate raw trades into commissionable events. Done right, the operator gets trade-level real-time reporting and deterministic rebate math. Done wrong, the operator reconciles by spreadsheet and argues with sub-IBs every settlement. We will walk through the manager API, the event model, the attribution mapping, and the rebate-unit conversion in turn.

Why MetaTrader integration is different from web tracking

Standard web affiliate tracking fires a pixel or a server-to-server postback when a conversion happens on a website. Forex is not like that. The conversion the affiliate cares about — a trade executing on a real-money account — happens inside the MetaTrader terminal and is recorded on the broker trading server, not in a browser. There is no pixel on a trade. The affiliate platform therefore cannot wait for a postback from a web page; it has to actively read the trading server, identify which trades belong to which referred account, and compute commission from the trade economics.

This is why forex affiliate integrations are fundamentally server-side. The click and the registration still happen on the web (and are tracked the usual way), but the money event lives in MetaTrader. The integration has to bridge the two worlds: a web click identifies the referrer, account opening links a MetaTrader login to that referral, and from then on every deal on that login is attributed automatically. The bridge is the login-to-affiliate mapping, and getting it established cleanly at account-opening time is the single most important step.

The data that lives on the MetaTrader server

For MT4 affiliate tracking and MT5 affiliate tracking, the relevant data on the trading server is: the account (login) record with its group and balance, the deals or trades executed by that login, and the per-deal fields — symbol, volume in lots, open and close prices, commission charged, swap, and profit. MT5 exposes a richer deal-based model than MT4 order-based reporting, but both surface enough for rebate calculation. The affiliate platform consumes these records, not the broker back office, which is why the connection method — the manager API or a gateway — is the first technical decision.

The manager API: how the connection works

MetaTrader exposes a manager-level API that authorised manager accounts use to read account and deal data from the server. According to the MetaQuotes Manager API documentation, the MT5 Manager API provides programmatic access to accounts, deals, positions and orders, with an event-subscription model so a connected manager can receive notifications as deals are executed. The affiliate platform connects as a manager (with read-scoped permissions agreed with the broker) and either polls for new deals or subscribes to the deal feed.

There are three common connection patterns. The first is a direct manager-API connection from the affiliate platform to the broker MT5 server, used when the affiliate operator and broker have a close technical relationship. The second is a gateway or plugin running alongside the trading server that pushes deal events outward to the affiliate platform via webhook or server-to-server postback. The third is a periodic statement export (CSV or API report) that the broker shares, which the platform ingests in batches — the least real-time but the most common in arms-length IB relationships where the broker will not grant manager access.

MetaTrader affiliate integration patterns compared
PatternLatencyAccess requiredBest for
Direct manager APINear real-timeManager credentials on broker serverOwned/close-partner brokers
Gateway / plugin pushReal-time (event-driven)Plugin install on trade serverBrokers allowing server-side plugins
Periodic statement importBatch (daily/weekly)Report export onlyArms-length IB relationships
Hybrid (feed + reconciliation)Real-time + batch truthAPI feed plus statementProduction rebate networks

Manager API access is a broker decision

The affiliate platform cannot grant itself manager access — the broker controls it. As an IB or rebate operator, scope the access request to read-only account and deal data, agree the data-sharing terms in writing, and confirm whether the broker runs MT4, MT5, or both. Many brokers will only share a periodic statement, in which case design the integration around reconcilable batch import rather than waiting for real-time deal events.

Trade-level event ingestion and the affiliate event model

Once connected, the platform ingests deals and maps them onto an affiliate event model. The minimum event set for forex affiliate tracking is: account opened (links the MetaTrader login to the referral), first deposit (the funding event many CPA programs key on), and trade executed (the volume event rebates and lot-based commissions accrue on). MT5 deal records carry the fields needed to derive each: symbol, lot volume, commission, swap and profit. The platform converts each ingested deal into one or more affiliate events and writes them to an immutable per-trade ledger.

Mapping deals to lots, volume and spread

The rebate or commission can attach to three different facets of a deal: traded volume in lots (for per-lot rebates), the spread realised on the deal (for spread-share rebates), or the commission the broker charged (for commission-share rebates). The platform reads the relevant fields from each deal and feeds them into the commission-management engine, which applies the program rules. The detailed mechanics of per-lot, spread and commission rebate math are covered in the companion forex rebate software guide; the integration concern here is ensuring the ingested deal carries every field those calculations need.

  • Volume (lots): read directly from the deal volume field — the basis for per-lot rebates and lot-based IB commission.
  • Spread: derive from the open/close prices or a contracted fixed-pip equivalent per symbol — the basis for spread-share rebates.
  • Commission: read from the per-deal commission field — the basis for commission-share rebates on ECN/raw accounts.
  • Swap and corrections: capture so the reconciled rebate matches the adjusted broker statement, not the raw open volume.
  • Symbol and account group: capture so symbol- and group-specific rate tables apply correctly.
See how Track360 ingests MT4/MT5 trade events in real time

Explore how Track360 fits your partner program structure.

Attribution: linking a MetaTrader login to a referral

Attribution is the make-or-break step. The web click and registration are tracked through the usual server-to-server postback flow, producing a referral record tied to a tracking parameter. When the trader opens a live MetaTrader account, the platform must associate the new login with that referral. There are three reliable mechanisms: passing the affiliate/IB code into the account-opening form so the broker stamps it on the MT5 account, mapping by email or client ID shared between the broker CRM and the affiliate platform, or using a broker-side IB-group assignment where accounts opened under an IB are placed in a designated MetaTrader group.

Whichever mechanism is used, the mapping has to be established at account opening, because retrofitting attribution after the trader has been trading for weeks is error-prone and disputed. Once the login-to-affiliate map exists, attribution is automatic: every subsequent deal on that login is attributed to the mapped referrer and flows into their commission. The attribution window concept from web tracking still applies to the click-to-account-opening step, but once the account is mapped, the relationship is durable for the life of the account or per the program terms.

Handling multi-account and re-attribution edge cases

Traders open multiple accounts, switch IBs, and occasionally appear under more than one referral. The platform needs deterministic tie-breaking rules: typically the first valid referral wins, IB transfers require an explicit re-assignment event, and duplicate accounts are flagged to the fraud-detection layer rather than silently double-paid. Self-trading and wash-trading to manufacture rebate volume are the dominant abuse patterns in forex affiliate programs, so the integration should surface accounts whose deal patterns (immediate open/close at zero net P&L, round-turn churning of a single instrument) indicate volume manufactured purely to harvest rebates.

Wash trading is the main MetaTrader rebate fraud

Because rebates pay on volume regardless of profit, the dominant abuse is wash trading — opening and immediately closing positions to generate lot volume with minimal market risk, purely to harvest cashback. The integration must capture enough deal detail (open/close timing, instrument, net P&L) for the fraud engine to flag it. Rebating on unreviewed raw volume is how rebate networks lose money to their own affiliates.

Reconciliation: the integration is not done until it balances

A MetaTrader integration is only complete when the volume the platform attributed reconciles against the volume the broker reports. Real-time deal feeds are excellent for live dashboards and trader engagement, but the periodic broker statement is the source of truth for settlement, because it incorporates corrections, swaps and adjustments the live feed may not. The recommended production pattern is hybrid: ingest deals in real time for reporting and accrual, then reconcile against the official statement before each payout run, surfacing any deltas for review.

Common reconciliation deltas in MetaTrader integrations include deals that arrived late on the feed but appear on the statement, trades that were corrected or cancelled server-side after the feed event, swap and rollover lines that the feed did not classify, and currency-conversion timing differences. A platform that treats the real-time feed as gospel will over- or under-accrue; a platform that reconciles to the adjusted statement pays correctly. For the buyer, the test of a serious integration is whether it can show, for any settlement period, the attributed volume next to the broker-reported volume with every delta itemised.

MT4 vs MT5: what changes for the affiliate platform

MT4 and MT5 differ in their data models, and the affiliate platform has to handle both because many brokers still run MT4 alongside MT5. MT4 is order-centric: an order opens and closes, and reporting is structured around orders. MT5 is deal-centric and netting/hedging aware: each market action generates a deal, and positions aggregate deals. For per-lot rebates the difference is mostly cosmetic — both expose traded volume — but for spread and commission detail, MT5 deals carry richer per-action fields. A platform that only supports one of the two trading servers cannot serve a multi-platform broker, which is increasingly the norm.

MT4 vs MT5 for affiliate tracking integration
AspectMT4MT5
Data modelOrder-basedDeal-based (netting/hedging)
Manager API maturityMature, widely deployedRicher event subscription
Commission detail per actionCoarserPer-deal commission field
Best rebate fitPer-lot volumePer-lot, spread and commission share
Multi-asset supportFX/CFD focusedFX, CFD, exchange-traded

Frequently asked questions

Integrate MT4/MT5 affiliate tracking with Track360

Explore how Track360 fits your partner program structure.

Related Articles

In-depth articles on closely related topics. Build a deeper understanding of the operational mechanics behind affiliate programs in this vertical.

Browse all articles
integrations7 min read

MetaTrader Affiliate Tracking: How Forex Brokers Connect MT4/MT5 to Partner Attribution

Operational guide for forex brokers integrating MetaTrader 4 and MetaTrader 5 with affiliate tracking systems. Covers trade-to-commission data flow, lot-based attribution, IB hierarchy mapping, reconciliation gaps, and how S2S postback architecture bridges MT platforms with partner management.

Read article →
integrations8 min read

cTrader Integration for IB Affiliate Tracking: How Forex Brokers Connect Trading Data to Partner Commissions

A technical guide to integrating cTrader with IB affiliate management systems. Covers how forex brokers connect cTrader trading data to lot-based commissions, attribute client activity to introducing brokers, and build accurate payout workflows from platform-level trade events.

Read article →
integrations5 min read

How Forex Brokers Integrate CRM and Affiliate Platforms for Accurate IB Attribution

A practical guide to connecting CRM systems and affiliate tracking platforms for Forex brokers. Learn how integration gaps break IB attribution, commission accuracy, and partner trust.

Read article →
forex6 min read

Forex Affiliate Software: Stack Components, Integration Patterns, and Vendor Evaluation

A technical guide for forex brokers evaluating affiliate software. Covers MetaTrader integration, IB hierarchy management, lot-based commission engines, CRM bridging, and the architecture decisions that determine whether a broker's partner program scales or stalls.

Read article →
forex6 min read

Forex IB Management Platform: What Brokers Need to Scale Introducing Broker Networks

Technical guide for Forex brokers evaluating IB management platforms. Multi-tier commissions, MetaTrader integration, lot-based tracking, sub-IB networks, and regulatory compliance.

Read article →