how to find leverage and minimum lot size for each symbol

 
Hello,
Each symbol need different minimum lot or leverage.
These two values are used to calculate margin = lot_size x contract_size / leverage.

For example :
CFD sp500 has minimum_lot = 0.1 and leverage =20
CFD ibex35 , min_lot = 0.1 and leverage = 10
CFD nas100 , min_lot = 0.02 and leverage = 20

Instructions SymbolInfoDouble(), SymbolInfoInteger() or SymbolInfoString() don't give these values.
Are there other solutions ?
Thanks

 
paul selvan:
Hello,
Each symbol need different minimum lot or leverage.
These two values are used to calculate margin = lot_size x contract_size / leverage.

For example :
CFD sp500 has minimum_lot = 0.1 and leverage =20
CFD ibex35 , min_lot = 0.1 and leverage = 10
CFD nas100 , min_lot = 0.02 and leverage = 20

Instructions SymbolInfoDouble(), SymbolInfoInteger() or SymbolInfoString() don't give these values.
Are there other solutions ?
Thanks

These functions give you all you need to know. But your approach is way to simple to even begin to understand how it's calculated.

I suggest you read the documentation on SymbolInfoInteger and SymbolInfoDouble carefully.

You will find all formulas to calculate margin requirements and how to actually calculate the leverage for a specific symbol.

But be assured, it's not trivial, and it's not as simple as you have shown. - In basics you are right, but actually there is a little more to it.

Anyways, there is also lots of information on the forum, I suggest you do a research after studying the docs. - It took me 3 weeks to understand how it works, and I called 2 different brokers to get some basic understanding and support on the matter.

One of them is in the EU and therefore has a restriction on leverage to 30. But the account (AccountInfoInteger) reported 200. - Reason was, they have Spot markets, which are allowed to have a leverage of 200 in the EU.

Once you have understood the docs, you will see why it is not trivial.
 

Hello ,

Thanks for your reply

Dominik Christian Egert #:
It took me 3 weeks to understand how it works, and I called 2 different brokers to get some basic understanding and support on the matter.
One of them is in the EU and therefore has a restriction on leverage to 30. But the account (AccountInfoInteger) reported 200. - Reason was, they have Spot markets, which are allowed to have a leverage of 200 in the EU.
Once you have understood the docs, you will see why it is not trivial.


Dominik Christian Egert #:
I suggest you read the documentation on SymbolInfoInteger and SymbolInfoDouble carefully.

May be should use 

long l = SymbolInfoInteger(NULL, SYMBOL_TRADE_CALC_MODE);

with :

SYMBOL_CALC_MODE_CFDINDEX

SYMBOL_CALC_MODE_CFDLEVERAGE

SYMBOL_CALC_MODE_CFD

But how to call these identifiers.

Is it the way to use these instructions :

double initial_margin_rate = SymbolInfoDouble(NULL, SYMBOL_MARGIN_INITIAL);
double mainteance_margin_rate = SymbolInfoDouble(NULL, SYMBOL_MARGIN_MAINTENANCE);
bool b = SymbolInfoMarginRate(NULL, ORDER_TYPE_BUY, initial_margin_rate, mainteance_margin_rate) 

Dominik Christian Egert #:
Anyways, there is also lots of information on the forum, I suggest you do a research after studying the docs. 

ok 

regards

how to find leverage and minimum lot size for each symbol
how to find leverage and minimum lot size for each symbol
  • 2023.07.05
  • www.mql5.com
Hello, Each symbol need different minimum lot or leverage. These two values are used to calculate margin = lot_size x contract_size / leverage...
 

Has anything changed with this topic?

By changed, I mean is there now a universal method all MQL5 programmers can use to calculate margin in their accounts currency, discover applicable leverage for their accounts regardless of symbol,  a best way to determine minimum lot sizes, tick values, etc....?

I have seen multiple forum threads on these topics, and I am wondering if a Best Known Method (BKM) has evolved that everyone can use?

I am studying the ExpertMoney.mqh, NTC_GetLeaverage.mqh, NTC_GetExchangeRate.mqh, Accountinfo.mqh, and SymbolInfo.mqh files and their associated classes to determine the best coding course of action.

Some classes appear to overlap functionality. An example of that would be CSymbolInfo.MarginLong() and CAccountInfo.MarginInitial()

Is there a Golden Path of Coding Righteousness for selecting what classes to use for optimum Expert Advisor functionality, safety and minimal computational overhead ?

I appreciate that this is a complex question.

Thanks for your thoughts, suggestions, and advice.