Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1602

 
Max N #:
I just didn't scroll down to the bottom of the list, there's a margin at the bottom.
What is it? Above, you say, there was a discrepancy - 9645 and 17555, which is closer to which value from the terminal? (it is only important that it was the account of the broker, and there can be different leverage on demo and real accounts). In general, discrepancies in the formula can be most likely due to an erroneous leverage value. Here you say "like 40". If it's a Russian company, then 40 there is for quals, and for ordinary people - less. Moreover, 40 is a currency leverage, but for gold it is most likely different. In my case it is 22 for both quals and non-quals. Substitute 22, and you'll probably get your 17555)).
 
Max N #:
like 40
And you can see the leverage on the broker's website, under Trading Conditions >> Margin Requirements (or perhaps Contract Specification). Something like that.
 
Max N #:
If you multiply it by that mythical coefficient 1.81, you get roughly the same number. all that's left is to figure out what that coefficient is.

A margin call factor?

SymbolInfoMarginRate.

Margin for Forex

Margin: Lots * Contract_Size / Leverage * Margin_Rate
 
Max N #:
manual calculation
Look, you have 2 results, 9645 and 17555. Let's assume that 9645 is wrong, because you set the leverage at 40 instead of 22. Let's correct it, 9645*40/22. We get 17537, exactly in the hole, plus or minus the exchange rate. Don't think that we are wasting our time, it's easier with a script, autopilot and robot-vacuum cleaner: imho, if you fish here, such things should be in your head on clear shelves. By the way, taking advantage of this opportunity, since you are interested in gold, a kind advice - please do not hurry to move to a real account, to trading for real money. Gold, imho, is one of the most dangerous assets for trading (including its seeming predictability, it grows, how simple everything is.... It is deceptive, and in general it is like a wild bull at a bullfight, it will knock a bullfighter out of the saddle so that you can't pick up the bones).
 
Jack_the_singer #:
And 40 is currency leverage, but for gold it is most likely different. In my case it is 22, for both quals and non-quals. Substitute 22, and you will most likely get your 17555)).

yes, I looked at the broker's (alfaforex) specs, the leverage is 22, although the My_Account_Info script shows a leverage of 40.

With leverage 22 is also the correct figure.

on the demo account, by the way, the margin is different, a little less than 15500 approx.
 
Aleksey Nikolayev #:

Margin collection ratio?

SymbolInfoMarginRate()

Margin for Forex

Margin: Lots * Contract_Size / Leverage * Margin_Rate
I saw this formula in the help, but I didn't understand how to calculate the contract size, and it turns out that with leverage 40 and multiplied by the coefficient it also converges :) maybe the broker has already put this coefficient in the calculation in advance and that's why he writes leverage 22 in the specification, although in the terminal it is 40.
 
Max N #:
My_Account_Info script shows a leverage of 40.
So I'm just saying, screw the scripts))). Although there may be some good ones).
 
Alexey Viktorov #:
Check the readings against the specification. Show me what you got.

I'm not quite sure where to look for debugging information like you have on your screen, I don't have that anywhere :)

ps

I think I added it to the observation, but there are only zeros.

Files:
кк.JPG  43 kb
 
Max N #:
so it writes leverage 22 in the specification, although in the terminal it is 40
At the broker you named, when you open a position on gold on a real account you will have your margin frozen on the basis of leverage 22. Exactly as in the specification.
 
Jack_the_singer #:
By the way, since you are interested in gold, a kind advice - please do not hurry to move to a real account, to trading with real money. Gold, imho, is one of the most dangerous assets for trading.

I have been watching the market for a long time, gold is very tricky and subtle now. trading in a kitchen like alfaforex and on the interbank (tickmill) is very different. on tickmill I have a leverage of 200, but even placing minimum orders like 0.05 lot you can sometimes see how the market reacts - it simply flies away from the order line and goes to the support, then it comes back from the support, breaks through your order and goes further. if you place a large volume, there is a high probability that it will not break through for a long time.

In the kitchen there is no such effect, but it is understandable, the kitchen does not display the volume anywhere, nobody sees it.