Download MetaTrader 5


Returns the number of open positions.

int  PositionsTotal();

Return Value

Value of int type.


For the "netting" interpretation of positions (ACCOUNT_MARGIN_MODE_RETAIL_NETTING and ACCOUNT_MARGIN_MODE_EXCHANGE), only one position can exist for a symbol at any moment of time. This position is a result of one or more deals. Do not confuse positions with valid pending orders, which are also displayed on the Trading tab of the Toolbox window.

If individual positions are allowed (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING), multiple positions can be open for one symbol.

See also

PositionGetSymbol(), PositionSelect(), Position Properties

Updated: 2016.02.23