Leverage for each symbol - page 2

 
Petr Nosek:
The broker was e.g. Purple Trading. But the relation are always right at all of my brokers.


Thanks.

In this case the Margin calc mode must be 1 (CFD) , right?

Yes.

 
Petr Nosek:

Leverage relations among:

  1. Margin calc mode
  2. Margin percentage
  3. Contract size

by my research are:

Margin calc mode
Leverage
0 - Forex
100 / MarginPercentage
1 - CFD
1 / MarginPercentage
2 - ???    My brokers don't have such a symbol with 2 as Margin calc mode
???
3 - CFD-Index
1 / (MarginPercentage * ContractSize)
4 - CFD-Leverage  100 / MarginPercentage

But unfortunately we can't get the value of Margin Percentage by MQL4 function.

And what are we doing when Forex symbol's return 3 ? :-D

 
Alain Verleyen:
 Yes.

thank you for confirmation

 
Alain Verleyen:

And what are we doing when Forex symbol's return 3 ? :-D

Then we are in trouble :D

Have you ever encountered with this?  UPDATE: I've seen your picture.

 
Alain Verleyen:

And what are we doing when Forex symbol's return 3 ? :-D

OK then it is as usual: we can't rely on anything. ;-)
 
Petr Nosek:
OK then it is as usual: we can't rely on anything. ;-)
It's what I thought, I was surprised by your confidence.
 
Alain Verleyen:
It's what I thought, I was surprised by your confidence.
I understand you, I'm too naive :D
 

Even though as we agreed with Alain that we can't rely on anything, I've written code for finding out a leverage for a specific symbol. Feel free to use it but don't forget that you should use it on your own risk. I've set the array possibleLeverage (in the function GetPossibleSymbolLeverage) to my own need (ESMA) and it's easy to change it. The code works for my needs very well. If you find a bug or have some suggestions let me know.

UPDATE: see the next post

 
I've slightly updated my code in order to find out by it if Tick Value is in account currency or in margin currency. This solution works for me perfectly but if you want to use it you should check if it works with your broker's data too.
Files:
Scripts.zip  4 kb
 

Hello,

I expect from MetaQuotes Software Corp. team, add new Account Properties (like: expanding of  AccountInfoInteger() or AccountInfoDouble()) concerning the detail info about Leverage for each Symbol. EA traders need it very much, because of new ESMA rules. Now the Identifier (ACCOUNT_LEVERAGE_ of ENUM_ACCOUNT_INFO_INTEGER in   AccountInfoInteger() is useless.

Old Forex Trader

Reason: