Estimating margin requirements in MQL5 - page 3

 
Alexander Laur:

Where do you trade?

I have a link that opens.

Then follow this link https://www.mql5.com/ru/code/16396/119568#!tab=code

It opens for me too.

 
Petros Shatakhtsyan:

Apparently it is difficult to discuss anything with you.

Firstly I already said your links don't open and secondly how can you determine the margin when the leverage changes and each symbol has its own leverage.

Forum on Trading, Automated Trading Systems and Strategy Tests

Estimating the Margin Requirements in MQL5

Alexander Laur, 2018.07.01 08:00

Check this out: https://www.mql5.com/ru/code/12076/131935#!tab=code

It might help.


Remove the highlighted from the link and it will open. But there's nothing of value there.

 
Alexander Laur:

Gentlemen, I know how to calculate the deposit. Gave me a link to a ready-made code.

If you have problems with openings, values, etc., I'm no longer interested.

Whoever wants to figure it out, will figure it out. And whoever wants to get clever, go ahead.

If you want to talk about something, you must read the first post of the thread carefully.

Although I have done that myself on occasion. I can be inattentive. And your code is not worth a kind word.

 
Petros Shatakhtsyan:

And I thought that after my explanations even a schoolboy would understand.

And the surprising thing is that there are a lot of good developers here, but for some reason it's the third year I've raised this issue on this form and more than once.

I agree with Petros! There are cases when some brokers increase margin requirements for certain currencies, usually during important news or weekends.

That is why I think that the leverage size for the selected symbol is not superfluous. It is not available at the moment.

Besides, some brokers allow different leverages for different volumes. As far as I understand, this point cannot be defined programmatically either... For example an excerpt from the specification of one popular broker:


Floating margin


 
Dennis Kirichenko:

I agree with Petros! There are cases when some brokers increase margin requirements for certain currencies, usually during important news or at weekends.

That is why I think that the leverage size for the selected symbol is not superfluous. It does not exist at the moment.

I thought nobody understood :) Without the leverage of the symbol you won't be able to calculate the margin.


Here I once found this table from one site and already showed it.

It's for determining the margin, but I used it to determine the real leverage for the right symbol.

But to do this you have to open an order toget the difference between the margin before and after opening the order.

And you need to know the leverage of the symbol before opening the order.



Something the screenshot is not inserted !

 
Petros Shatakhtsyan:

And I thought nobody understood :)

Here I once found this table from a website and already showed it.

It's for determining the margin, but I used it to determine the real leverage for the right symbol.

But to do this you have to open an order toget the difference between margin before and after opening the order.

And you need to know the leverage of the symbol before opening the order.

Something is wrong with the screenshot!

I have attached a screenshot too, it is not showing. I have not got a screenshot yet. The site is just moving to new servers, we chat in mobile mode :-)).

Here's how it is at one broker:

Cumulative position size in USD. US DOLLARSLeverage
FX Majors currency pairs
less than 1m.500
1m - 5m200
5 Mio. - 10 Mio.100
over 10 million5
 
Dennis Kirichenko:

I've attached a screenshot too, it's not showing. It's just the site is moving to new servers, we're in mobile mode :-))

But nothing, we'll wait, especially when a very difficult match starts in an hour.

 
Dennis Kirichenko:

I've attached a screenshot too, it's not showing. It's just that the site is moving to new servers, we're in mobile mode :-))

Here's how one broker has it:

Cumulative position size in USD. US DOLLARSLeverage
FX Majors currency pairs
less than 1m.500
1m - 5m200
5 Mio. - 10 Mio.100
over 10 million5

Have you checked the leverage it gives out in problematic cases?

 double Margin = 0;
 bool calcMargin = OrderCalcMargin(orderType, symbol, Lots, price, Margin);

And we need to check the marginInitial value.

 double marginInitial;
 double marginMaintenance;
bool marginRate = SymbolInfoMarginRate(symbol, orderType, marginInitial, marginMaintenance);
 
Dennis Kirichenko:

I've attached a screenshot too, it's not showing. It's just that the site is moving to new servers, we're in mobile mode :-))

Here's how one broker has it:

Cumulative position size in USD. US DOLLARSLeverage
FX Majors currency pairs
less than 1m.500
1m - 5m200
5 Mio. - 10 Mio.100
over 10 million5

The leverage depends not only on the total funds, it also changes before the market closes and sometimes changes during important news.

Some brokers warn about this and advise to keep the Margin Level at a level that does not trigger a Stop Out when the leverage decreases.

Real leverage checked with my robot, more than a year on the real. When the leverage of this symbol changes, it immediately sent a message to my phone. Sometimes they lowered the leverage 2.4 times without warning. But not all brokers do that.

 

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 for some particular cases? Something is wrong. Again, the terminal reports a shortage of funds in the account without contacting the server. How does it know this? Why don't these functions call there?