Skip to content

Build Cross-Platform Copy Trading with Real-Time Streaming

Create copy trading systems that work across MT4, MT5, cTrader, and B2Trader. WebAPI's real-time streaming and unified position management make cross-platform trade copying possible.

Get Started

The Challenge

Copy trading platforms must monitor master accounts in real-time and replicate trades to follower accounts — often across different trading platforms. Each platform has different APIs, data models, and event systems.

The WebAPI Solution

The Realtime Service streams position, order, and deal events with consistent data models. The Position Service enables opening and closing trades across any platform. A master trader on MT4 can have followers on MT5, cTrader, and B2Trader.

Code example

copy_engine.tsTypeScript
// Subscribe to master trader's positions
const stream = webapi.realtimeService.Subscribe({
  subject: Subject.POSITIONS,
  selectors: [Selector.CREATE],
  platform: Platform.MT5,
  logins: [masterLogin]
});

for await (const event of stream) {
  const masterPos = event.position;

  // Copy trade to all followers across platforms
  for (const follower of followers) {
    await webapi.positionService.Open({
      platform: follower.platform,
      login: follower.login,
      symbol: masterPos.symbol,
      action: masterPos.action,
      volume: calculateVolume(masterPos.volume, follower.ratio)
    });
  }
}

How it works

1

Master Trades

Master trader opens position on any platform

2

Stream Detects

WebAPI Realtime Service detects the new position

3

WebAPI Copies

Copy engine sends orders to follower accounts

4

Followers Updated

Positions opened across MT4, MT5, cTrader, B2Trader

Performance metrics

<50msCopy execution latency
10,000+Daily copied trades (B2Copy)
4Platforms supported simultaneously
Follower accounts per master

Cross-platform topology

MasterMT4
WebAPI
MT4(3)
MT5(12)
cTrader(5)
B2Trader(2)

Followers on each platform

Copy allocation modes

Proportional

Volume proportional to follower's equity vs master's equity

vol = masterVol × (followerEquity / masterEquity)

Fixed Lot

Same lot size on all followers regardless of equity

vol = fixedLot (e.g. 0.1)

Equity-based

Volume scaled by follower's equity

vol = baseVol × (followerEquity / baseEquity)

Relevant API Services

Realtime Service

stream positions, orders, deals

Position Service

open, close, batch operations

Deal Service

trade history and execution details

Account Service

follower account management

Real-world example

B2Copy processes over 10,000 copied trades daily across MT4, MT5, cTrader, and B2Trader through a single WebAPI integration.

Ready to build?

Build cross-platform copy trading with real-time streaming and unified position management across MT4, MT5, cTrader, and B2Trader.

Get Started