ENUM_SYMBOL_CALC_MODE is wrong? Or TradeCalcMode() is wrong? Or i'm confused?

 

I was testing the ENUM_SYMBOL_CALC_MODE enumeration with the TradeCalcMode () function of the CSymbolInfo class ...

I tried EURUSD and USDJPY.

I was expecting that (TradeCalcMode()  == SYMBOL_CALC_MODE_FOREX)

Becouse  (Leverage()==200)

But however  (TradeCalcMode()  == SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE)

That is (TradeCalcMode() == 5)

So... something ir wrong here!! Or i'm confused?



I just to try this and is the same reslut

SymbolInfoInteger(Symbol(), SYMBOL_TRADE_CALC_MODE) == SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE


UPDATE:

Ok, I'm sorry... Look the attach image... I'm thinking now or (Leverage()==200) is wrong or my broker server is crazy...

 

Thank you so much!!

void OnStart()
{   
   Comment( 
            "\nLeverage       =",accountInfo.Leverage(),
            "\nTradeCalcMode  =",symbolInfo.TradeCalcMode(),"==", SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE          
           );
}
Files:
test.png  33 kb
 
Hello, may i ask did you get the answer why it causing this? Because I also faced the same result, the enum that retrieve from the server was 5 but the specification shown as Forex no leverage which should be 1. I'm Using SYMBOL_CALC_MODE
 
Thammatat Sangria #:
Hello, may i ask did you get the answer why it causing this? Because I also faced the same result, the enum that retrieve from the server was 5 but the specification shown as Forex no leverage which should be 1. I'm Using SYMBOL_CALC_MODE
So, this will take you a while to understand. It took me full 3 weeks of studying to get all aspects.

Leverage is set for the account, but a symbol may vary this leverage. So actually you have a leverage that is symbol depending. You can calculate the symbols leverage with the margin calculations described in the docs.

The calculation mode specifies the type of margin calculation you need to apply to the symbol.

Your account leverage is just a base setting, the actual applied leverage is symbol dependant, and the calculation to use is specified with the calculation mode enumeration.
 
Dominik Egert #:
So, this will take you a while to understand. It took me full 3 weeks of studying to get all aspects.

Leverage is set for the account, but a symbol may vary this leverage. So actually you have a leverage that is symbol depending. You can calculate the symbols leverage with the margin calculations described in the docs.

The calculation mode specifies the type of margin calculation you need to apply to the symbol.

Your account leverage is just a base setting, the actual applied leverage is symbol dependant, and the calculation to use is specified with the calculation mode enumeration.
Thank you for the summary, just wanna recap to make sure did i get it right. 

Basically the calculation mode depend on the symbol setting even though in the specification appear FOREX NO LEVERAGE, but if the symbol setting was given a little leverage on that pair, the calculation would be apply as other method which is not the FOREX NO LEVERAGE.

Is that how its works
 
Thammatat Sangria #:
Thank you for the summary, just wanna recap to make sure did i get it right. 

Basically the calculation mode depend on the symbol setting even though in the specification appear FOREX NO LEVERAGE, but if the symbol setting was given a little leverage on that pair, the calculation would be apply as other method which is not the FOREX NO LEVERAGE.

Is that how its works
Forex no leverage is just a name for a calculation. The resulting margin requirements is determined by that calculation.

The "no leverage" just says that your account leverage is not applied. But the symbols margin rate is

No leverage
Margin:  Lots * Contract_Size * Margin_Rate

In contrast to forex:
Margin:  Lots * Contract_Size / Leverage * Margin_Rate
 
Dominik Egert #:
Forex no leverage is just a name for a calculation. The resulting margin requirements is determined by that calculation.

The "no leverage" just says that your account leverage is not applied. But the symbols margin rate is

Margin:  Lots * Contract_Size * Margin_Rate


Thank you, so the margin calculation based on the symbol setting, in this aspect I able to get it.

How about the calculation mode? because in the MT5 symbol specification, let's say symbol is EURNOK, in the specification, the calculation mode was Forex no leverage, however when i try to retrieve the calculation mode of that symbol its return as 5 which is  SYMBOL_CALC_MODE_CFDLEVERAGE according to the documentation https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_trade_mode

Do you have any advice on this issues?
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
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Thammatat Sangria #:
Thank you, so the margin calculation based on the symbol setting, in this aspect I able to get it.

How about the calculation mode? because in the MT5 symbol specification, let's say symbol is EURNOK, in the specification, the calculation mode was Forex no leverage, however when i try to retrieve the calculation mode of that symbol its return as 5 which is  SYMBOL_CALC_MODE_CFDLEVERAGE according to the documentation https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_trade_mode

Do you have any advice on this issues?
Take a look at ENUM_SYMBOL_CALC_MODE, it lists the formulas in the table.

Margin: (Lots * ContractSize * MarketPrice) / Leverage * Margin_Rate