Leverage for each symbol - page 2

To add comments, please log in or register
Alain Verleyen
37537
Alain Verleyen  
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.

Alain Verleyen
37537
Alain Verleyen  
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

Petr Nosek
1965
Petr Nosek  
Alain Verleyen:
 Yes.

thank you for confirmation

Petr Nosek
1965
Petr Nosek  
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.

Petr Nosek
1965
Petr Nosek  
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. ;-)
Alain Verleyen
37537
Alain Verleyen  
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.
Petr Nosek
1965
Petr Nosek  
Alain Verleyen:
It's what I thought, I was surprised by your confidence.
I understand you, I'm too naive :D
Petr Nosek
1965
Petr Nosek  

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

Petr Nosek
1965
Petr Nosek  
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
Old Forex -Trader
314
Old Forex -Trader  

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

To add comments, please log in or register