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.

All endpoints require SESSION_CUSTOMER. The server validates account ownership from the session and never trusts customer_id from the request body.

Endpoints

Method Path Description
GET /copytrade/masters List available public masters and customer-owned masters
GET /copytrade/my Return customer-owned masters, followers and related subscriptions
POST /copytrade/master Create a master profile for a customer-owned account
PUT /copytrade/master/{id} Update a customer-owned master profile
DELETE /copytrade/master/{id} Delete a customer-owned master profile
POST /copytrade/follower Create follower settings for a customer-owned account
PUT /copytrade/follower/{id} Update customer-owned follower settings
DELETE /copytrade/follower/{id} Delete customer-owned follower settings
POST /copytrade/subscription Subscribe a customer-owned follower account to an available master
PUT /copytrade/subscription/{id} Update a customer-owned follower subscription
DELETE /copytrade/subscription/{id} Delete a customer-owned follower subscription
GET /copytrade/trade-links List trade links related to customer accounts
GET /copytrade/rewards List reward accruals related to customer accounts

Ownership Rules

  • Master create/update/delete is allowed only when master.login belongs to the authenticated customer.
  • 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.

Master Payload

{
  "login": 100001,
  "enabled": 1,
  "strategy_name": "Conservative FX",
  "description": "Low risk major pairs strategy",
  "visibility": "public",
  "allowed_follower_modes": 2
}

Follower Payload

{
  "login": 100002,
  "enabled": 1,
  "manual_trading_mode": 1,
  "max_master_count": 1
}

Subscription Payload

{
  "master_login": 100001,
  "follower_login": 100002,
  "enabled": 1,
  "status": 0,
  "copy_mode": 0,
  "volume_mode": 1,
  "risk_multiplier": 1,
  "fixed_volume": 0,
  "copy_sl": 1,
  "copy_tp": 1,
  "copy_partial_close": 1,
  "copy_pending_orders": 0,
  "copy_existing_positions": 0,
  "reverse_direction": 0,
  "max_volume": 0,
  "min_volume": 0,
  "max_positions": 0,
  "symbols_mode": 0,
  "symbols": ""
}

Common Errors

Error Description
INVALID_CUSTOMER_SESSION Customer session is missing or invalid
INVALID_ACCOUNT Account login does not belong to 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
FOLLOWER_NOT_FOUND follower_login does not have a copy follower profile
FOLLOWER_MODE_NOT_ALLOWED Master does not allow follower REAL/DEMO mode