How do you calculate the margin? - page 6

 
Janis Ozols:

Tried it. Here's the result (same values):

However, I don't really understand why this time to calculate USDRUB leverage you suggest to divide EURUSD contract volume by the margin to open one standard USD/CHF lot.

mmm

interesting

the situation is not even the one you describe, it's quite different.

here neither before nor after, but ALWAYS

Are you allowed to trade on the real rouble?

and as an option, replace the ruble with the USDCHF

 
Renat Akhtyamov:

and the situation is not even what you are describing, it is quite different

here neither before nor after, but in the course of EVERYTHING.

Yes, the situation is different from what I described in the beginning. This is because I already got the answer to my original question, but another one - how to get the value of leverage for a symbol in the software, if it is different from the account leverage. And this server is the best for reproducing such a situation. If I figure it out, I already know how to apply this knowledge to solve my original problem.


Renat Akhtyamov:

is real rouble trading allowed?

and as an option, replace the ruble with the USDCHF.

Yes, trading in Ruble is permitted. If the ruble is not suitable for some reason, you may use USDZAR or USDTRY instead. The gap will be even more significant.

If USDCHF is substituted for ruble, all is considered correct - the result of leverage and margin calculation according to the formulas corresponds exactly to the actual one. I think I will not be wrong in assuming that this is because the USDCHF leverage(as well as most other symbols) equals the account leverage.

 
Janis Ozols:

Yes, the situation is different from the one I described in the beginning. That's because my original question is already answered, but I have another one - how to get the leverage value for a symbol in case it is different from the account leverage. And this server is the best for reproducing such a situation. If I figure it out, I already understand how to apply this knowledge to solve my original problem.


Yes, ruble trading on the real is allowed. If the ruble is not suitable for some reason, you can take USDZAR or USDTRY instead.

If USDCHF is substituted for ruble, all is considered correct - the result of leverage and margin calculations according to the formulas correspond exactly to the actual one. I think I'm not mistaken if I assume that this happens because the USDCHF leverage(as well as in most other instruments) is equal to the account leverage.

got it figured out

Now you can continue the conversation with your broker

 

Someone recently pointed out, quite rightly, that the broker is always right. As long as they act within the regulations. So I had no questions about the broker in the first example.

As for the broker in the last example, my conversation with him boiled down to the following: There are trading conditions and there is a leverage for each instrument. If they charged you more margin than they should have, write a claim and we will deal with it. Unfortunately, we do not provide advisory services on EAs and scripts. Try to consult more experienced programmers on specialized forums.

That's what I try :)

 
Janis Ozols:

Someone recently pointed out, quite rightly, that the broker is always right. As long as they act within the regulations. So I had no questions about the broker in the first example.

As for the broker in the last example, my conversation with him boiled down to the following: There are trading conditions and there is a leverage for each instrument. If they charged you more margin than they should have, write a claim and we will deal with it. Unfortunately, we do not provide advisory services on EAs and scripts. Try to consult more experienced programmers on specialized forums.

That's what I try :)

I would simply ask why the margin does not correspond to the trading conditions?

And I would show you a screenshot of an order on USDRUB

The Expert Advisor is out of the question, the answer would be

 
Renat Akhtyamov:

I would simply ask why the margin does not match the trading conditions and show a screenshot of the USDRUB order

EA is out of the question, the answer would be

The tricky part is that it is exactly the same as the trading conditions. The maximum leverage on USDRUB specified there is 1:100. If we substitute this value into your second formula (100000 / 100) we get a margin amount of 1000 USD. Exactly the one that is withheld and indicated in the terminal.

And what I really want to find out is how to get this value of leverage (1:100) for USDRUB in the EA (or script) in order to correctly calculate the risks before opening a position. That is, I can't do without mentioning the EA and MQL4. They always reply to such a mention in a very polite and predictable manner.

 
Janis Ozols:

The tricky part is that it exactly matches the trading conditions. The maximum USDRUB leverage specified there is 1:100. If we substitute this value into your second formula (100000 / 100) we get a margin amount of 1000 USD. Exactly the one that is withheld and indicated in the terminal.

And what I really want to find out is how to get this value of leverage (1:100) for USDRUB in the EA (or script) in order to correctly calculate the risks before opening a position. That is, I can't do without mentioning the EA and MQL4. They always reply to such a mention in a very polite and predictable manner.

There is no cheat there.

When you opened the demo, what leverage was it, 500?

that's why the margin turns out to be 200

you have to have a filter to filter the real trade conditions.

that's what changes the margin to 1000

as a simple rule, the priority is not defined - if it is a rouble, then trade conditions are so-and-so

as for them: such and such trading conditions, but if it is a rouble, then such trading conditions are as follows ;))))

 

Obviously "insidious" is again not the right word. You were simply suggesting that the broker should be questioned if the margin is not in line with the trading conditions. And it does meet them! Another thing that it does not correspond to the account leverage (1:500), but my reply to it was like this: "Look at the trading conditions, everything is specified there. If the maximum leverage for a symbol is lower than the leverage of your account, then the one which is less will be used. And that is what is used in practice.

P.S. As far as I know, this forum does not really welcome discussion of brokers. Therefore I would very much like to return the topic of discussion closer to the MQL4 language and the question how to get the value of leverage for a certain instrument with its help, if it is different from the leverage of an account. I took the server of a particular broker only as an example, because the situation I am interested in can be reproduced there at any time.

P.P.S. If the leverage of a single instrument can not be determined by means of MQL4 (in case it is different from the leverage of the account) BEFORE opening a position, in fact, it will also be an answer to my question. I just need to know for sure that it is impossible, which I am not sure of at the moment.
 
Janis Ozols:

If it is impossible to determine the leverage of an individual instrument using MQL4 (in case it is different from the account's leverage) BEFORE opening a position, in fact, that would also be the answer to my question. I just need to know for sure that it is impossible, which I'm not sure of at the moment.

Impossible.

PS: yes, change broker

 
Andrey Khatimlianskii:

Impossible.

PS: yes, change broker

I had to write a crutch to check the equivalence of the calculated margin value to the actual one on every tick and in case of significant discrepancy immediately close the last open order and block further attempts to open new ones. This system had been working successfully up to June 16.

But in the end the broker disappeared along with my money. Its name started with Fort and ended with FS.

Reason: