Work with trading accounts

information about instruments available for account type

Example value of responce:

{
  "instruments": [
    {
      "symbol": "string",                  //the name of the symbol           
      "symbol_group": "string",            //the name of symbol group
      "digits": 0,                         //the number of decimal places in the price of the symbol.
      "contract_size": 0,                  //the contract size of the symbol  
      "stops_level": 0,                    //the price band, within which placing stop orders is not allowed
      "calc_mode": 0,                      //the mode of margin and profit calculation
      "trade_mode": 0,                     //the symbol trading mode
      "volume_min": 0,                     //the minimum volume of trade operations for the symbol.
      "volume_max": 0,                     //the maximum volume of trade operations for the symbol
      "volume_step": 0,                    //the volume change step for trade operations for the symbol.
      "hedged_margin": 0,                  //the value of the hedged margin
      "maintenance_margin": 0,             //the size of the maintenance margin
      "initial_margin_rate_buy": 0,        //the initial margin rate for orders of the specified type (buy)
      "initial_margin_rate_sell": 0,       //the initial margin rate for orders of the specified type (sell)
      "maintenance_margin_rate_buy": 0,    //the maintenance margin rate for orders of the specified type (buy)
      "maintenance_margin_rate_sell": 0,   //the maintenance margin rate for orders of the specified type (sell)
      "tick_size": 0,                      //the size of one tick of the symbol
      "tick_value": 0,                     //the price of one tick of the symbol
      "swap_mode": 0,                      //the swap calculation mode for the symbol
      "swap_long": 0,                      //the swap size for long positions
      "swap_short": 0,                     //the swap size for short positions
      "swap_3day": 0,                      //the triple swap day
      "sessions": {
        "additionalProp1": {
          "trade": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ],
          "quote": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ]
        },
        "additionalProp2": {
          "trade": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ],
          "quote": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ]
        },
        "additionalProp3": {
          "trade": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ],
          "quote": [
            {
              "open": "00:00",
              "close": "24:00"
            }
          ]
        }
      }
    }
  ]
}

Create accounts with different types

create an account

post
Authorizations
AuthorizationstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
Responses
chevron-right
200

an account was successfully created

application/json
post
/accounts/demo

create an account

post
Authorizations
AuthorizationstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
Responses
chevron-right
200

an account was successfully created

application/json
post
/accounts/default

create an account

post
Authorizations
AuthorizationstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
min_depositnumberRequired

minimum amount of trading balance to start copy strategy, default 1000

Example: 1000
min_copy_rationumberRequired

min copy ratio available for the strategy, default 1

Example: 1
max_copy_rationumberRequired

max copy ratio available for the strategy, default 10

Example: 10
commissionnumberRequired

commission charged from successful sessions, default 10%

Example: 10
Responses
chevron-right
200

an account was successfully created

application/json
post
/accounts/master

create an account

post
Authorizations
AuthorizationstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
master_account_idstringRequired

master account id that strategy will be copied

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
copy_rationumberRequired

copy ratio to apply for deals from shared trading strategy, -1 means auto calculation from balances proportion

Example: -1
is_enablebooleanRequired

binary flag to activate copying for next session

Example: true
Responses
chevron-right
200

an account was successfully created

application/json
post
/accounts/investor

Delete an account

Update account parameters

update account parameters

patch
Authorizations
AuthorizationstringRequired
Path parameters
accountidstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
Responses
chevron-right
200

an account was successfully updated

application/json
patch
/accounts/demo/{accountid}

update account parameters

patch
Authorizations
AuthorizationstringRequired
Path parameters
accountidstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
Responses
chevron-right
200

an account was successfully updated

application/json
patch
/accounts/default/{accountid}

update account parameters

patch
Authorizations
AuthorizationstringRequired
Path parameters
accountidstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
leverageintegerOptional

leverage for the trading account

Example: 100
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
min_depositnumberRequired

minimum amount of trading balance to start copy strategy, default 1000

Example: 1000
min_copy_rationumberRequired

min copy ratio available for the strategy, default 1

Example: 1
max_copy_rationumberRequired

max copy ratio available for the strategy, default 10

Example: 10
commissionnumberRequired

commission charged from successful sessions, default 10%

Example: 10
Responses
chevron-right
200

an account was successfully updated

application/json
patch
/accounts/master/{accountid}

update account parameters

patch
Authorizations
AuthorizationstringRequired
Path parameters
accountidstringRequired
Query parameters
server_codestringRequired
Body
external_idstringRequired

external id reference for account

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
account_type_keystringOptional

name of the group

Example: demo\rockwest\rw502_rwstagedemo_usd
namestringOptional

name of the account

Example: demo account
trading_passstringOptional

password for MT to login as a trader

Example: !StrongTrader!
investor_passstringOptional

password for MT to login as an investor

Example: !StrongInvestor!
master_account_idstringRequired

master account id that strategy will be copied

Example: ec2930bb-c200-4a2d-9f1f-3e938e39de54
copy_rationumberRequired

copy ratio to apply for deals from shared trading strategy, -1 means auto calculation from balances proportion

Example: -1
is_enablebooleanRequired

binary flag to activate copying for next session

Example: true
Responses
chevron-right
200

an account was successfully updated

application/json
patch
/accounts/investor/{accountid}

Get transactions

Get a list of transactions for the account

get a list of transaction for the account (trading and balance) in specified time interval GMT

get
Authorizations
AuthorizationstringRequired
Path parameters
accountidstringRequired
Query parameters
server_codestringRequired
fromintegerOptional

unix time in ms

tointegerOptional

unix time in ms

isAscbooleanOptional

sorting type

Responses
chevron-right
200

list of transactions

application/json
get
/transactions/demo/{accountid}/info
circle-info

In query parameter IsAsc can be false - descrease sort or true - increase sort.

triangle-exclamation

Example of responce:

Description of parameters

Parameter
Type
Discription

is_entry

boolean

TRUE if and only then when a new position is opened by the user ( it means entering the market); in all other cases it is equal to FALSE. For example for MT5 is_entry = TRUE when parameter entry=ENTRY_IN in IMTDeal structure.

action

string

  • buy - buy transaction

  • sell - sell trasnsaction

  • bonus - bonus, if the word 'bonus' appears in the transaction comment

  • credit - account credit operation (for MT5 if the Action=DEAL_CREDIT in the IMTDeal structure takes the value DEAL_CREDIT)

  • negative_balance_compensation - operation related to compensation of a negative balance (for MT5 if the Action=DEAL_SO_COMPENSATION in IMTDeal structure)

  • balance - operations to change the account balance (for MT5, if the Action field in the IMTDeal structure takes the following values DEAL_BALANCE, DEAL_CHARGE, DEAL_CORRECTION, DEAL_BONUS, DEAL_COMMISSION, DEAL_COMMISSION_DAILY, DEAL_COMMISSION_MONTHLY)

In all other cases, for MT5, the string value of the Action field of the IMTDeal structure is passed.

For MT4 plugin the parameter type can be:

OP_BUY

0

OP_SELL

1

OP_BUY_LIMIT

2

OP_SELL_LIMIT

3

OP_BUY_STOP

4

OP_SELL_STOP

5

OP_BALANCE

6

OP_CREDIT

7

For MT5 plugin the parameter type can be:

DEAL_BUY

0

A Buy deal

DEAL_SELL

1

A Sell deal

DEAL_BALANCE

2

A balance operation

DEAL_CREDIT

3

Credit operation

DEAL_CHARGE

4

Additional charges/withdrawals

DEAL_CORRECTION

5

Correcting operations

DEAL_BONUS

6

Operations of this type affect the credit assets of a client (IMTUser::Credit)

DEAL_COMMISSION

7

Commission

DEAL_COMMISSION_DAILY

8

Daily commission

DEAL_COMMISSION_MONTHLY

9

Monthly commission

DEAL_AGENT_DAILY

10

Daily agent commission

DEAL_AGENT_MONTHLY

11

Daily agent commission

DEAL_INTERESTRATE

12

Accrual of annual interest

DEAL_BUY_CANCELED

13

A canceled Buy deal. Using the IMTExecution::TE_DEAL_CANCEL trade execution, the Gateway API can notify the platform about the cancellation of a previously executed deal in the external trading system. In this case the type of the earlier executed Buy trade is replaced with this one. The profit/loss of a trade is cleared. Then the client's position is recalculated and the appropriate profit/loss is added/subtracted as a separate balance operation. Deal cancellation does not change the client's order history. Deal cancellation does not entail changes in client's orders history. A deal of the DEAL_BUY_CANCELED type is not included into the calculation of the financial state of account and is not taken into account in recalculated positions.

DEAL_SELL_CANCELED

14

A canceled Sell deal. Using the IMTExecution::TE_DEAL_CANCEL trade execution, the Gateway API can notify the platform about the cancellation of a previously executed deal in the external trading system. In this case the type of the earlier executed Buy trade is replaced with this one. The profit/loss of a trade is cleared. Then the client's position is recalculated and the appropriate profit/loss is added/subtracted as a separate balance operation. Deal cancellation does not change the client's order history. Deal cancellation does not entail changes in client's orders history. A deal of the DEAL_SELL_CANCELED type is not included into the calculation of the financial state of account and is not taken into account in recalculated positions.

DEAL_DIVIDEND

15

Dividend operations

DEAL_DIVIDEND_FRANKED

16

Franked (non-taxable) dividend operations (tax is paid by a company, not a client).

DEAL_TAX

17

Charging a tax

DEAL_AGENT

18

Charging an agent commission. Used during an instant commission charge to an agent (each time the agent's client performs a deal.

DEAL_SO_COMPENSATION

19

An operation connected with the compensation of a negative account after the Stop Out event (IMTConGroup::TRADEFLAGS_SO_COMPENSATION).

Get detail information about specified transaction

Example of responce:

Getting balance information

Example of responce:

Change balance

If method isn't enabled through environment variables, the request will be always http error code 404.

Last updated