CreateCopyTradeSubscription¶
Endpoint¶
POST /copytrade/subscription
Authorization¶
Requires SESSION_CUSTOMER.
Description¶
Creates a subscription from a customer-owned trading account to an available master. A separate follower profile is not required: when the account has no follower profile, the server creates one with defaults (enabled = 1, manual_trading_mode = 1 / allow non-copied orders, and max_master_count = 1) as part of creating the subscription. The subscription response remains the subscription object; no additional response fields are introduced.
If the account already has an enabled follower profile, the server reuses it without changing its settings. An existing disabled follower profile cannot be used to create a subscription. The master must be enabled and public, or owned by the same customer. The master allowed_follower_modes must allow the follower account mode.
The follower profile and subscription are persisted atomically. If validation, the active-master limit, duplicate detection, or persistence fails, no new follower profile is left behind. A duplicate master/account subscription is rejected without overwriting existing follower settings. Existing standalone follower endpoints remain available for customers who want to configure follower settings before subscribing.
If copy_existing_positions = 1, the backend queues replay of currently open
master positions after creation. Pending orders are included when
copy_pending_orders = 1.
Runtime notes:
volume_mode = 0usesfixed_volume;volume_mode = 1usesmaster_volume * risk_multiplier;volume_mode = 2uses follower/master equity ratio;volume_mode = 3uses follower/master balance ratio;reverse_direction = 1opens the opposite market direction and swaps copied SL/TP meaning;
Runtime behavior, synchronization modes and follower write restrictions are detailed in the Copy Trading API overview.
Request¶
{
"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": ""
}
Request fields¶
| Field | Type | Required | Description |
|---|---|---|---|
master_login |
int | Yes | Login of the master account to follow |
follower_login |
int | Yes | Customer-owned trading account that will copy the master; a follower profile is created automatically if absent |
enabled |
int | No | 1 enabled, 0 disabled |
status |
int | No | 0 active, 1 paused, 2 disabled |
copy_mode |
int | No | 0 full sync, 1 open only, 2 close only |
volume_mode |
int | No | 0 fixed volume, 1 multiplier, 2 equity ratio, 3 balance ratio |
risk_multiplier |
double | No | Multiplier used by volume mode 1 |
fixed_volume |
int | No | Volume used by volume mode 0 |
copy_sl |
int | No | Whether to copy stop-loss changes |
copy_tp |
int | No | Whether to copy take-profit changes |
copy_partial_close |
int | No | Whether to copy partial closes |
copy_pending_orders |
int | No | Whether to copy pending orders |
copy_existing_positions |
int | No | Whether to replay existing master positions after subscription creation |
reverse_direction |
int | No | Whether to reverse copied trade direction |
max_volume |
int | No | Maximum copied volume; 0 means not configured |
min_volume |
int | No | Minimum copied volume; 0 means not configured |
max_positions |
int | No | Maximum copied positions; 0 means not configured |
symbols_mode |
int | No | 0 all symbols, 1 include listed symbols, 2 exclude listed symbols |
symbols |
string | No | Symbol filter payload |
Response¶
Returns the created subscription object. created_time and updated_time are saved timestamps:
{
"id": 10,
"master_login": 100001,
"follower_login": 100002,
"enabled": 1,
"status": 0,
"copy_mode": 0,
"volume_mode": 1,
"risk_multiplier": 1.0,
"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": "",
"created_time": 1780838400,
"updated_time": 1780838401
}
Errors¶
| HTTP | Error | Description |
|---|---|---|
409 |
RET_ERR_DUPLICATE |
The master/follower subscription already exists |
| HTTP | Error | Description |
|---|---|---|
400 |
INVALID_DATA |
Request validation failed |
403 |
INVALID_FOLLOWER_ACCOUNT |
Follower login does not belong to the customer |
403 |
MASTER_NOT_FOUND |
Master profile was not found |
403 |
MASTER_NOT_AVAILABLE |
Master is disabled/private and not owned by the customer |
403 |
FOLLOWER_MODE_NOT_ALLOWED |
Master does not allow follower account mode |
403 |
RET_TRADE_DISABLE |
An existing follower profile is disabled |
409 |
RET_TRADE_LIMIT_REACHED |
The subscription would exceed the follower's distinct active-master limit |
503 |
RET_TECH_PROBLEM |
The server could not persist the follower profile and subscription |