You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am probably very clumsy with my questions and therefore I am not getting the answers I expect. Forgive me, Russian is only partly my mother tongue. But I will try again.
I carefully read the whole branch. The answer to my original question was given - it is impossible to get the actual value of leverage for a single position from the terminal.
But it was also mentioned that perhaps the leverage changes not for these positions, but for an instrument as a whole. And now the only question I have left is how to get that leverage from the terminal. Provided that it is different from the total leverage of the account. Not to calculate, but exactly to get the actual value.
It would be quite good if it could be done BEFORE opening the next position.
I am probably very clumsy with my questions and therefore I am not getting the answers I am expecting. Forgive me, Russian is only partly my mother tongue. But I will try again.
I carefully read the whole branch. The answer to my original question was given - it is impossible to get the actual value of leverage for a single position from the terminal.
But it was also mentioned that perhaps the leverage changes not for these positions, but for an instrument as a whole. And now the only question I have left is how to get that leverage from the terminal. Provided that it is different from the total leverage of the account. Not to calculate, but exactly to get the actual value.
It would be nice if you could do it BEFORE opening the next position.
The broker told you - may change it AFTER
and BEFORE - everything is already written above, but you need to calculate
You were told by your broker - he can change it AFTER
and BEFORE - it's all written above, but you need to calculate
Yes, that's what I want to know, how do I get the actual leverage for a symbol AFTER the broker has changed it, but BEFORE opening the next position on that symbol. I am not able to calculate it correctly yet. Because all the formulas for calculations presented earlier contain either the account leverage (which remains unchanged) or the amount of margin from the symbol settings (which also has not changed).
Right, so I'm trying to figure out how to get the actual leverage for a symbol AFTER the broker has changed it, but BEFORE opening the next position on that symbol. I am not able to calculate it correctly yet. Because all the formulas for calculations presented earlier contain either the account leverage (which has remained unchanged) or the amount of margin from the symbol settings (which has not changed either).
come on
actual leverage:
https://www.mql5.com/ru/forum/353040/page2#comment_18675097
leverage in the margin calculation
https://www.mql5.com/ru/forum/353040/page4#comment_18728440
and you're in luck.
;)
the actual shoulder:
https://www.mql5.com/ru/forum/353040/page2#comment_18675097
There is a formula on the link:
It contains MarketInfo("USDCHF",MODE_MARGINREQUIRED) value, which does not change after the broker has changed the leverage for this instrument. TheMarketInfo function returns the margin from the symbol settings, which corresponds to the leverage in the account settings. If it didn't, I wouldn't have any more questions. This is exactly where the problem lies.
it is the resulting leverage that we substitute in the margin calculation
https://www.mql5.com/ru/forum/353040/page4#comment_18728440
And the problem will be that the leverage obtained in the previous step will not correspond to the actual leverage. It will be equal to the leverage of account settings, which is returned by AccountLeverage() function. Accordingly, the margin, calculated this way, will be much smaller than the actual one, if the leverage of this instrument doesn't correspond to the account leverage.
If you want, you can easily check it yourself:
There is a formula on the link:
It contains MarketInfo("USDCHF",MODE_MARGINREQUIRED) value, which does not change after the broker has changed the leverage for this instrument. TheMarketInfo function returns the margin from the symbol settings, which corresponds to the leverage in the account settings. If it didn't, I wouldn't have any more questions. That is exactly where the problem lies.
And the problem here will be that the leverage obtained in the previous step will not match the actual leverage. It will be equal to the leverage of account settings, which is returned by AccountLeverage(). Accordingly, the margin, calculated this way, will be much smaller than the actual one, if the leverage of this instrument doesn't correspond to the account leverage.
If you want, you can easily check it yourself:
You should try it first before predicting the outcome.
I've been working with this formula on floating leverage, it reacts in time
and it's not what you see with your eyes.
and it's certainly not what you saw with your eyes.
and not on demo, but on real
You should try it first before predicting the outcome
I did not predict the outcome. Of course, I tried to do so before suggesting it to you.
Here's the script:
Here is the result of its execution:
Here is the actual value:
The reason for the discrepancy is that the USDRUB symbol's leverage is different from the account's leverage. And my question is how to get the value of this leverage by means of MQL4 before opening a position.
ok
Try it like this now
void OnStart()
{
double LEVERAGE = NormalizeDouble( MarketInfo("EURUSD",MODE_LOTSIZE)/MarketInfo("USDCHF",MODE_MARGINREQUIRED),0);
double M = MarketInfo( "USDRUB" ,MODE_LOTSIZE)/ LEVERAGE; // M=CC/ КП
Print(" М = ",M);
Print("LEVERAGE = ",LEVERAGE);
Print("VOL = ",MarketInfo( "USDRUB" ,MODE_LOTSIZE));
}
ok
Try this now.
I did. Here is the result:
However, I don't really understand why this time to calculate the USDRUB leverage you suggest to divide the EURUSD contract volume by the margin to open one standard lot for USD/CHF. But the result is the same value of margin (200). Whereas the actual margin held is 1000.