Skip to content

Copy Trading

Client REST API for the desktop/web trading terminal copy trading flow.

This API uses the new copy trading model:

  • CopyMaster is a strategy profile attached to a normal trading account.
  • CopyFollower is copy settings for a normal trading account.
  • CopySubscription links a follower account to a master account.
  • Trading accounts remain normal AccountRecord records. The legacy MASTER/SLAVE account model is deprecated.
  • The master marketplace endpoint returns calculated statistics for discovery and ranking for the requested period: ROI, PNL, win rate, max drawdown, average PNL per trade and trade counts.
  • Masters can explicitly allow public trade-history viewing with show_trade_history and public follower statistics with show_followers. When disabled, these public endpoints do not expose the corresponding data.
  • A master can be created only from a REAL account. DEMO accounts can be followers only when the master policy allows demo followers.
  • Master creation requires choosing a reward policy in the same request.

Most customer management endpoints require SESSION_CUSTOMER. The public master trade-history endpoint accepts any authenticated terminal/CRM/manager session, but returns data only when the master enabled the corresponding public flag (show_trade_history or show_followers). The server validates account ownership from the session and never trusts customer_id from the request body.

Endpoints

Method Path Description
GET /copytrade/masters GetCopyTradeMasters
GET /copytrade/master/stats GetCopyTradeMasterStats
GET /copytrade/master/trades GetCopyTradeMasterTradesByFilter
GET /copytrade/master/followers GetCopyTradeMasterFollowersByFilter
GET /copytrade/my GetCopyTradeMy
GET /copytrade/subscriptions GetCustomerSubscriptionsByFilter
POST /copytrade/master CreateCopyTradeMaster
PUT /copytrade/master/{id} UpdateCopyTradeMaster
DELETE /copytrade/master/{id} DeleteCopyTradeMaster
POST /copytrade/follower CreateCopyTradeFollower
PUT /copytrade/follower/{id} UpdateCopyTradeFollower
DELETE /copytrade/follower/{id} DeleteCopyTradeFollower
POST /copytrade/subscription CreateCopyTradeSubscription
PUT /copytrade/subscription/{id} UpdateCopyTradeSubscription
DELETE /copytrade/subscription/{id} DeleteCopyTradeSubscription
GET /copytrade/trade-links GetCopyTradeLinks
GET /copytrade/rewards GetCopyTradeRewards

Ownership Rules

  • Master create/update/delete is allowed only when master.login belongs to the authenticated customer.
  • Master login must belong to a REAL account group.
  • Follower create/update/delete is allowed only when follower.login belongs to the authenticated customer.
  • Subscription create/update/delete is allowed only when follower_login belongs to the authenticated customer.
  • The master must be enabled and either public or owned by the same customer.
  • The master allowed_follower_modes must allow the follower account mode (REAL or DEMO) derived from the follower account group.

Enum Values

allowed_follower_modes

Value Name Description
0 REAL_ONLY Only REAL followers
1 DEMO_ONLY Only DEMO followers
2 REAL_AND_DEMO REAL and DEMO followers

show_trade_history

Value Description
0 Master trade history is private
1 Master trade history can be viewed through GET /copytrade/master/trades

show_followers

Value Description
0 Master follower list and follower statistics are private
1 Master followers can be viewed through GET /copytrade/master/followers

manual_trading_mode

Value Name Description
0 DISABLED Manual trading is disabled
1 ALLOW_NON_COPIED Manual trading is allowed except copied positions
2 ALLOW_ALL Manual trading is allowed

subscription status

Value Name
0 ACTIVE
1 PAUSED
2 DISABLED

copy_mode

Value Name
0 FULL_SYNC
1 OPEN_ONLY
2 CLOSE_ONLY

volume_mode

Value Name
0 FIXED
1 MULTIPLIER
2 EQUITY_RATIO
3 BALANCE_RATIO

symbols_mode

Value Name
0 ALL
1 INCLUDE
2 EXCLUDE

reward_type

Value Name
0 SUBSCRIPTION_FEE
1 PERFORMANCE_FEE_HWM
2 VOLUME_REBATE
3 PROFIT_SHARE_PER_TRADE
4 MANAGEMENT_FEE

Detailed UI field behavior for each reward type is documented in CreateCopyTradeMaster.

Runtime Execution

Copying is executed by CopyTradeManager from server-side trade events. The client creates masters, followers and subscriptions; follower positions are then opened and closed by the backend through the normal trading flow.

Supported in the first runtime implementation:

  • market open and close copy;
  • partial close copy by master partial-close ratio;
  • fixed, multiplier, equity-ratio and balance-ratio volume modes;
  • min/max volume and max positions limits;
  • symbol include/exclude filters;
  • optional SL/TP copy;
  • reverse direction for market trades;
  • copy existing positions on subscription create/update;
  • active trade-link reconcile;
  • profit-share-per-trade reward accrual and settlement;
  • open-only, close-only and normal open+close subscription modes.

Not supported yet:

  • pending order copy;
  • SL/TP modification copy;
  • subscription fee, HWM performance fee, volume rebate and management fee execution;
  • manual trading restrictions enforcement.

Reward settlement uses two balance operations with TR_REASON_COPY_REWARD: OP_BALANCE_OUT from the follower and OP_BALANCE_IN to the master payout account. Both operations carry copy_reward_accrual_id in api_data.

Common Errors

Error Description
INVALID_CUSTOMER_SESSION Customer session is missing or invalid
INVALID_ACCOUNT Account login does not belong to the customer
MASTER_ACCOUNT_MUST_BE_REAL Master profile can be created only on a REAL account
REWARD_POLICY_REQUIRED Master creation request does not contain reward_policy
INVALID_REWARD_POLICY Reward policy payload is invalid
INVALID_PAYOUT_ACCOUNT Reward payout account is missing or not owned by the customer
PERMISSION_DENIED Record exists but is not owned by this customer
MASTER_NOT_FOUND master_login does not have a copy master profile
MASTER_NOT_AVAILABLE Master is disabled/private and not owned by the customer
TRADE_HISTORY_NOT_PUBLIC Master disabled public trade-history viewing
FOLLOWERS_NOT_PUBLIC Master disabled public follower-statistics viewing
FOLLOWER_NOT_FOUND follower_login does not have a copy follower profile
FOLLOWER_MODE_NOT_ALLOWED Master does not allow follower REAL/DEMO mode