Calculate Margin needed based on Symbol Info

 

Hi geeks,


How can I calculate an instrument margin required, based on Symbol Info numbers?

Maybe I could use SYMBOL_MARGIN_HEDGED?

Tks

 
Daniel Arges:

Hi geeks,


How can I calculate an instrument margin required, based on Symbol Info numbers?

Maybe I could use SYMBOL_MARGIN_HEDGED?

Tks

Use MarketInfo(Symbol(),MODE_MARGINHEDGED)
 
Thank you. It seems it does not apply for MT5 :(
 
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...
 

tks.


SymbolInfoMarginRate() needs SYMBOL_MARGIN_MAINTENANCE as parameter. And for all symbols is 0 or null, from my broker! :(

 
Sorry for now. My code has and error. I´m fixing. tks guys
Reason: