Skip to content

TradingAccount

About

Trading account model

Fields

Name Type Required Description
_id string Yes Unique account id
login string Yes Trading account number. Only digits are allowed
name string Yes Human-readable account name
server string Yes Trading server name to connect to
provisioningProfileId string Id of the provisioning profile that was used as the basis for creating this account
magic number Yes Magic value the trades should be performed using
connectionStatus string Yes Connection status of the trading terminal to the application, enum: CONNECTED, DISCONNECTED, DISCONNECTED_FROM_BROKER
state string Yes Current account state, enum: CREATED, DEPLOYING, DEPLOYED, DEPLOY_FAILED, UNDEPLOYING, UNDEPLOYED, UNDEPLOY_FAILED, DELETING, DELETE_FAILED, REDEPLOY_FAILED
type string Yes Account type. Executing accounts as cloud-g2 is faster and cheaper. Enum: cloud-g1, cloud-g2, default: cloud-g2
region string Yes Region id to deploy account at. One of returned by the /users/current/regions endpoint
manualTrades boolean Yes Flag indicating if trades placed on this account are manual trades. Default is false. Supported for G2 only
slippage number Default trade slippage in points. Should be greater or equal to zero. If not specified, system internal setting will be used which we believe is reasonable for most cases
quoteStreamingIntervalInSeconds number Yes Quote streaming interval in seconds. Set to 0 in order to receive quotes on each tick. Default value is 2.5 seconds. Intervals less than 2.5 seconds are supported only for G2
tags Array Yes User-defined account tags
metadata object Extra information which can be stored together with your account. Total length of this field after serializing it to JSON is limited to 1024 characters
symbol string Any symbol provided by broker (required for G1 only)
reliability string Yes Used to increase the reliability of the account. Allowed values are regular and high. High is a recommended value for production environment. Default is high
baseCurrency string Yes 3-character ISO currency code of the account base currency. Default value is USD. The setting is to be used for copy trading accounts which use national currencies only, such as some Brazilian brokers. You should not alter this setting unless you understand what you are doing
copyFactoryRoles Array Yes Account roles for CopyFactory2 application. Allowed values are PROVIDER and SUBSCRIBER
resourceSlots number Yes Number of resource slots to allocate to account. Allocating extra resource slots results in better account performance under load which is useful for some applications. E.g. if you have many accounts copying the same strategy via CooyFactory API, then you can increase resourceSlots to get a lower trade copying latency. Please note that allocating extra resource slots is a paid option. Default is 1
copyFactoryResourceSlots number Yes Number of CopyFactory 2 resource slots to allocate to account. Allocating extra resource slots results in lower trade copying latency. Please note that allocating extra resource slots is a paid option. Please also note that CopyFactory 2 uses redundant infrastructure so that each CopyFactory resource slot is billed as 2 standard resource slots. You will be billed for CopyFactory 2 resource slots only if you have added your account to CopyFactory 2 by specifying copyFactoryRoles field. Default is 1
version number Yes MetaTrader version
hash number Yes Hash-code of the account
primaryReplica boolean Yes Flag indicating that account is primary
userId number Yes User id
primaryAccountId number Primary account id. Only replicas can have this field
accountReplicas Array<TradingAccountShortReplica> Yes Trading account replicas. Only primary account can have replicas
connections Array<AccountConnection> Active account connections. Empty value means that connection status is not known.
riskManagementApiEnabled boolean Yes Flag indicating that risk management API is enabled on account. Default is false
metastatsApiEnabled boolean Flag indicating that MetaStats API should be enabled on account. Default is false
allocateDedicatedIp string If set, allocates a dedicated IP with specified protocol to connect to the trading account terminal. If an account has replicas deployed in different regions at the same time, a separate IP address will be dedicated for the account in each region. Allowed value is ipv4
createdAt datetime Yes Time the account was created at, in ISO format

Example

{
  "_id": "1eda642a-a9a3-457c-99af-3bc5e8d5c4c9",
  "login": "50194988",
  "name": "mt5a",
  "server": "ICMarketsSC-Demo",
  "magic": 123456,
  "connectionStatus": "DISCONNECTED",
  "state": "DEPLOYED",
  "type": "cloud-g2",
  "region": "vint-hill",
  "manualTrades": true,
  "quoteStreamingIntervalInSeconds": 2.5,
  "tags": [],
  "reliability": "high",
  "baseCurrency": "USD",
  "copyFactoryRoles": ["PROVIDER"],
  "resourceSlots": 1,
  "copyFactoryResourceSlots": 4,
  "version": 4,
  "hash": 18093,
  "primaryReplica": true,
  "userId": "7b17e36a88502fd2faae5dd9d2166873",
  "accountReplicas": [],
  "metastatsApiEnabled": false,
  "riskManagementApiEnabled": false,
  "createdAt": "2022-12-11T09:09:27.454Z"
}

Usages