Skip to content

Tracking trades#

MetaApi implements a mechanism which can be used to bind metatrader objects to the identifiers of the objects used in your application. In order to use this feature your application should supply clientId value in trade and then all related metatrader objects returned by MetaApi will contain this value in the clientId field.

MetaApi stores this information in order comment, thus the total length of order comment and clientId is restricted to 26 alphanumeric characters.

clientId must follow ${strategyId}_${positionId}_${orderId} format and allows you to bind MetaTrader objects to user application objects. Example of correct clientId value is RF_EURUSD_GjCy5lk. Due to limited length of the clientId fields we recommend using alphanumeric ids in your application so that available storage space is used efficiently.

Note, that ${orderId} part may be replaced by the MetaApi application with the MT order id for trades resulting from take profit or stop loss execution.