Determining netting or hedging mode with MQL5 ?

 

Hello,


according to the MQL5 documentation it should be possible to determine whether an account is under the netting or hedging mode the following way:


AccountInfoString(ACCOUNT_MARGIN_MODE_RETAIL_NETTING);


Unfortunately this only produces a compilation error — any ideas, please?

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
, then each symbol positions will be closed in the same order, in which they are opened, starting with the oldest one. In case of an attempt to close positions in a different order, the trader will receive an appropriate error. There are several types of accounts that can be opened on a trade server. The type of account on which an...
 

Code:

ENUM_ACCOUNT_MARGIN_MODE m_margin_mode=(ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE)


ENUM_ACCOUNT_MARGIN_MODE

Identifier

Description

ACCOUNT_MARGIN_MODE_RETAIL_NETTING

Used for the OTC markets to interpret positions in the "netting" mode (only one position can exist for one symbol). The margin is calculated based on the symbol type (SYMBOL_TRADE_CALC_MODE).

ACCOUNT_MARGIN_MODE_EXCHANGE

Used for the exchange markets. Margin is calculated based on the discounts specified in symbol settings. Discounts are set by the broker, but not less than the values set by the exchange.

ACCOUNT_MARGIN_MODE_RETAIL_HEDGING

Used for the exchange markets where individual positions are possible (hedging, multiple positions can exist for one symbol). The margin is calculated based on the symbol type (SYMBOL_TRADE_CALC_MODE) taking into account the hedged margin (SYMBOL_MARGIN_HEDGED).

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING. Some symbols...
 
Vladimir Karputov:

Code:


ENUM_ACCOUNT_MARGIN_MODE

Identifier

Description

ACCOUNT_MARGIN_MODE_RETAIL_NETTING

Used for the OTC markets to interpret positions in the "netting" mode (only one position can exist for one symbol). The margin is calculated based on the symbol type (SYMBOL_TRADE_CALC_MODE).

ACCOUNT_MARGIN_MODE_EXCHANGE

Used for the exchange markets. Margin is calculated based on the discounts specified in symbol settings. Discounts are set by the broker, but not less than the values set by the exchange.

ACCOUNT_MARGIN_MODE_RETAIL_HEDGING

Used for the exchange markets where individual positions are possible (hedging, multiple positions can exist for one symbol). The margin is calculated based on the symbol type (SYMBOL_TRADE_CALC_MODE) taking into account the hedged margin (SYMBOL_MARGIN_HEDGED).

Thank you, worked! :-)
 

OK, but how about: ACCOUNT_MARGIN_MODE_EXCHANGE

Is it hedging? is it netting? is it neither? Can we open oppositing trades on this like in hedge?

I have never come across this one in different accounts and brokers...in what cases we see it?

Thank you in advance for any clarification.


Reason: