Skip to content

CreateCopyTradeSubscription

Endpoint

POST /copytrade/subscription

Authorization

Requires SESSION_CUSTOMER.

Description

Creates a subscription from a customer-owned follower account to an available master.

The follower profile must already exist. The master must be enabled and public, or owned by the same customer. The master allowed_follower_modes must allow the follower account mode.

If copy_existing_positions = 1, the backend queues copy execution for the master's currently open market positions after the subscription is created.

Runtime notes:

  • volume_mode = 0 uses fixed_volume;
  • volume_mode = 1 uses master_volume * risk_multiplier;
  • volume_mode = 2 uses follower/master equity ratio;
  • volume_mode = 3 uses follower/master balance ratio;
  • reverse_direction = 1 opens the opposite market direction and swaps copied SL/TP meaning;
  • copy_pending_orders is accepted by the model but pending order copy is not executed yet.

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": ""
}

Response

Returns the created subscription object.

Errors

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_NOT_FOUND Follower profile was not found
403 FOLLOWER_MODE_NOT_ALLOWED Master does not allow follower account mode