Estimating margin requirements in MQL5 - page 4

 
Vladimir:

It turns out that there is no way to find out the value of the required margin without trying to actually execute a trade request to the server on the account where it is planned (not on another account, not on a demo)?

Does the small, in comparison with the planned volume of transaction, save the situation in such a sample request? Judging by https://www.mql5.com/ru/forum/261955/page4#comment_7947380, no.

This is original. Functions OrderCheck() or OrderCalcMargin() are meaningless, except in particular cases? Something is wrong. Again, the terminal reports lack of funds in the account without contacting the server. How does it know this? Why don't these functions call there?

It is just the way it works when informing.

)

 
Renat Akhtyamov:

Everything is working fine, as long as it reports

)

The word "normal" in your interpretation means what? Actually, even more perplexing is the word "all". For you to conclude that everything is normal, it is enough that the terminal has not contacted the server and gave a message about insufficient funds. Have I got it right, the word "all" does not include activity of MQL5 programs? Does everything else, except for MQL5 programs, work normally? Is this what you mean?

If you remember, the question was how to find out the required margin in MQL5 program. If you can give me a hint, please do.

 
Vladimir:

The word "normal" in your interpretation means what? Actually, even more perplexing is the word "all". To conclude that everything is normal, it is enough that the terminal has not addressed the server and gave a message about insufficient funds. Have I got it right, the word "all" does not include activity of MQL5 programs? Does everything else, except for MQL5 programs, work normally? Is this what you mean?

If you remember, the question was how to find the required margin in MQL5. If you can give me a hint, please do.

Go here

https://www.mql5.com/ru/forum/261955/page4#comment_7947370

And carefully study the language.

You can find out all the more when you get help, otherwise only freelancing will save you.

Оценка маржинальных требований в MQL5
Оценка маржинальных требований в MQL5
  • 2018.07.01
  • www.mql5.com
Пример из спецификации контрактов одного ДЦ, где кредитное плечо является свойством символа, и, даже, как пишет ДЦ, его курса...
 
Renat Akhtyamov:

Here

https://www.mql5.com/ru/forum/261955/page4#comment_7947370

and learn the language carefully.

you have to use the leverage of the corresponding symbol, and you need more help, otherwise only freelancing will save you.

Here is the table already inserted:

You still haven't understood that to determine the margin, you have to use the real leverage of the respective symbol, not the leverage of the trading account.

 
Petros Shatakhtsyan:

Here is the table already inserted:

You still haven't understood that to determine margin, you have to use the actual leverage of the respective symbol, not the leverage of the trading account.

Petros, to calculate the margin or what?

Again

In team checking for sufficiency of funds (

OrderCalcMargin

) It's already "all inclusive" and it's useless to bother with the size of leverage.

But, if necessary, this question can be solved.

Forum on trading, automated trading systems & strategy testing

Evaluation of Margin Requirements in MQL5

Renat Akhtyamov, 2018.07.01 11:19

That's not going to help here.

It has different leverage on different sims.

The leverage can be calculated based on the margin, because the server will give the answer for the amount of margin already taking into account the leverage

If you have enough knowledge of the language, the code can be written in a moment.
 
Renat Akhtyamov:

Petros, to calculate the margin or what?

Again

The sufficiency check team (

) is already "all inclusive" and it is useless to bother with the size of the leverage.

But, if necessary, this question can be solved.

If you have enough knowledge of the language, the code is ready in a moment.

Did you try to do the math yourself or just blah-blah-blah?

The native OrderCalcMargin() function gives margin only including the leverage size which we get using AccountInfoInteger(ACCOUNT_LEVERAGE).

Checked.

 
{"icon":"step-confirm","text":"Step_agreed_comment","params":[{"type":1,"value":"3476348"},{"type":2,"value":"StepAcceptance_title"},{"type":2,"value":"Customer"}]}
Документация по MQL5: Торговые функции / OrderCalcMargin
Документация по MQL5: Торговые функции / OrderCalcMargin
  • www.mql5.com
Вычисляет размер маржи, необходимой для указанного типа ордера на текущем счете и при текущем рыночном окружении без учета текущих отложенных ордеров и открытых позиций. Позволяет оценить размер маржи для планируемой торговой операции. Значение возвращается в валюте счета. [out]  Переменная, в которую...
 
Renat Akhtyamov:

Petros, to calculate the margin or what?

Again

To the sufficiency check team (

) Everything is already "all inclusive" and it's useless to bother with the size of leverage.

But, if necessary, this issue is resolved as well.

If you have enough knowledge of the language, the code can be written in a moment.

It would be good. How do you check your statement? (Yes, by the way, OrderCalcMargin is not a "sufficiency check command", OrderCheck() does the checking )

Which code were you talking about? To arrange a binary search of the margin amount by indicative (Yes-No) readings of OrderCheck() in a real account for attempts to open real trades for different deposit sizes, including 5 million? All right, the code, but who will pay for this pleasure?

And what to do with the result? Do we believe that this will be so for any brokerage company? On what grounds? A responsible statement from the developer would be of great help here, but he, as you can see, is silent. I don't think he has a solution either.

After all, not all margin valuation issues have already been voiced. To estimate the margin for a pending order, we must foresee the leverage of this account for this symbol at the moment of news about this and that; the pending order will survive till Friday night. Not to check what the leverage is now, but to anticipate what it will be then and there.

Another question is whether the leverage will decrease individually. Will it be detected by OrderCalcMargin() or OrderCheck()?


Or, to everyone's delight, does the developer have something to say about how to estimate the margin to open a trade without opening it? And every trader in every account does not need to conduct their own experiments to find out the current leverage for each symbol?

 

It all comes from the fact that some people do some things by heart and think they already know MQLs or trading.

And they don't realise that they are wimps and give advice to those they should take their cue from.

 
Renat Akhtyamov:

Petros, to calculate the margin or what?

Again

To the sufficiency check team (

OrderCalcMargin

If your account is already "all-inclusive" and there is no need to bother with the amount of leverage.

But, if necessary, this issue is also resolved

If you have enough knowledge of the language, the code can be written in a moment.

I advise you to read carefully what this function is for:


margin

[out] Variable, which will be used to calculate the required margin if this function is executed successfully. The calculation is done as if there were no pending orders and open positions in the current account.

Value of margin depends on many factors and may change when the market environment changes.

Reason: