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
Yeah, well... fantasy is everything... but why should people trying to help you fantasize about what you fantasize about? Anyway, that's not the question.
How do you get what you need from that formula?
The formula itself is Margin = Lots *ContractSize*MarketPrice*Percentage/100
Hence, Percentage = Margin/(Lots *ContractSize*MarketPrice/100)
It is not in the list of obsolete functions yet. So it produces the missing value to determine the percentage of margin.
Having received all the data for the current moment at the current price, we can easily recalculate the margin that was withheld at the order opening price.
If you need it for mql5, you should use
Norm.
The leverage will not affect the margin? Maybe we should add the coefficient: 100/leverage to the formula?
Norm.
Will the leverage have no effect on the margin? Maybe add a coefficient to the formula: 100/leverage ?
The leverage is generally outside of the basic formula Margin = (Lots*ContractSize*MarketPrice*Percentage)/Leverage, so I did not take it into account. For determining what the question is about, the leverage is like a cow's saddle. But further it may be required, but it doesn't concern the current question...
The leverage is generally outside of the basic formula Margin = (Lots*ContractSize*MarketPrice*Percentage)/Leverage, so I did not take it into account. For determining what the question is about, the leverage is like a cow's saddle. But further it may be required, but that's beyond the scope of the current question...
A percentage margin can only be a percentage of something (e.g. a deposit), taking into account the minimum lot. The leverage is just "for something".
Yeah, well... fantasy is everything... but why should people trying to help you fantasize about what you fantasize about? Anyway, that's not the question.
How do you get what you need from that formula?
The formula itself is Margin = Lots *ContractSize*MarketPrice*Percentage/100.
Hence, Percentage = Margin/(Lots *ContractSize*MarketPrice/100)
It is not in the list of obsolete functions yet. So it produces the missing value to determine the percentage of margin.
Having got all the data for the current moment at the current price, we can easily recalculate the margin that was withheld at the order opening price.
If you need it for mql5, you should use
Hello, I would like for example to calculate margin separately for gold (independently of other instruments). Can you tell me how to do it, if you do not know the percentage margin? Because in this case, we already have two unknowns: the margin itself and the margin percentage...
Hello, I would for example like to calculate margin separately for gold (independently of other instruments). Can you tell me how to do it, if the margin percentage is unknown? Because in this case we already have two unknowns: both the margin itself and the margin percentage...
My answer is all there is to calculate everything you need.
However, this is not a margin amount taken at the time the order is opened, but it is the current margin at the current price. Only one unknown is left, i.e. the percentage margin that is not a percentage value and that is calculated using the formula. Then we are left with the price that does not correspond to the last one. Again, using the same formula, we calculate the margin for the corresponding price.The error in the calculations may be a couple of pennies, but that's the cost of rounding.
If you want to use MT5, go to another section of the forum.
You didn't surprise me with your common knowledge, or worse:
Well, yes... I do not understand why people trying to help you should fantasize about what you have fantasized about.
How do you get what you need from that formula?
The formula itself is Margin = Lots *ContractSize*MarketPrice*Percentage/100
Hence, Percentage = Margin/(Lots *ContractSize*MarketPrice/100)
Alexey Viktorov:
If you need it for mql5 you should use
MQL5 again...
Let me rephrase my question... I don't need this value or a formula to calculate it. I want the name of constant(or its numeric value) that I can use in SymbolInfoDouble() query to get the value I need from the terminal. That's it! :)
Well... Seems to be a simple question and you start a polemic... I didn't take a screenshot from MT5 or created a topic in the MT4 section. I didn't come here to amaze you, but to get a simple answer to a simple question. How to take the right value out of the formula, I'm well aware of it. We're good at maths. The question was not how to calculate, but how to get it from the terminal.
MQL5 again...
Let me try to rephrase the question... I don't need to calculate this value, I don't need a formula to calculate this value. I need a constant name(or a numeric value) which I can use in SymbolInfoDouble() query to get the value I need from the terminal. That's it! :)
NOTHING!!!
And no one is going to do it. It's a strange approach, though. I want it, and you developers do it for me. Just because I want to. I sincerely tried to help... but alas, no luck...
My answer has everything to calculate everything you need.
But it's not the margin taken at the moment of order opening; it's the margin at the present time, at the current price. Only one unknown is left, i.e. the percentage margin that is not a percentage value and that is calculated using the formula. Then we are left with the price that does not correspond to the last one. Again, using the same formula, we calculate the margin for the corresponding price.The calculation error may be a couple of kopecks but it is the rounding error.
You can do a simple experiment, comparing the value of MARGINREQUIRED and placing real orders of one lot size on different instruments. And then it will become clear that MARGINREQUIRED is lying not only for sales, but also for cross rates.
And, secondly, when calculating the total margin for the instrument for all of its orders (gold, in our case), it is the order open prices that must be taken into account. The MARGINREQUIRED value does not give us anything at all here.
A simple experiment can be conducted comparing the MARGINREQUIRED value and placing real orders of one lot size on different instruments. And then it will become clear that MARGINREQUIRED lies not only in selling, but also in cross-rates.
And, secondly, when calculating the total margin for the instrument for all of its orders (gold, in our case), it is the order open prices that must be taken into account. The MARGINREQUIRED value does not give me anything at all here.
I cannot understand why it does not work. Here we have 3 orders open and the margin value corresponds to all the calculations by 100%.