Actual margin levels and stopout

 

Just margin by itself does not count in the stoploss and fees so given enough market positions there will eventually be a stopout.

There should be a formula to check free margin based on this for a new position with stoploss and fees.

Calculating margin in such a way predicts the outlook of a margin level that you don't know otherwise.

.. Stoploss and Lot give the amount of margin required in addition to the fees associated with it.

So why then not assume you can formulate a margin in use and then calculate it against the equity.

.. then you would know what your margin level would look like at the point of worse case scenario.

But actually that would mean you won't get a stopout on any of your market positions even if some stops are in profit.

The margin available would be somewhere within the total margin and the stopout level.

What you must have is the available margin and the used margin for the required margin.

.. then if you calculate that the required margin causes stopout or is within level 100 then margin is full.

But I am having trouble formulating it not sure if it can be calculated efficiently without much MT4 built-in identifiers.

Anyone?

 
you have available margin and used margin.
and you can loop through open positions, and calculate their MAE values. (all worse case scenarios SL hit losses summed together.)
and you have your hypothetical (not opened yet) position info (the margin it needs, and its SL hit result.)

then you can calculate whether it's possible to land in MarginCall or not.
you actually should consider all these before calculating new lot-sizes. so that no new position can even be able to cause a margin call or stopout.
I don't think anyone is willing to do your math work for you.
 
Code2219 or probably 2319:
you have available margin and used margin.
and you can loop through open positions, and calculate their MAE values. (all worse case scenarios SL hit losses summed together.)
and you have your hypothetical (not opened yet) position info (the margin it needs, and its SL hit result.)

then you can calculate whether it's possible to land in MarginCall or not.
you actually should consider all these before calculating new lot-sizes. so that no new position can even be able to cause a margin call or stopout.
I don't think anyone is willing to do your math work for you.

just nobody from freelancer ;)))

but aren't you forgetting to include the most valuable margin requirement of the market position risk? the stoploss? not only that but the fees. I am telling you MT4 margin identifiers do no justice to market positions with a stoploss and fees. i have already tried freelancer on a handful of tries and i think it's a good forum topic. what do you mean MAE? I am talking about actual margin levels. Margin level, Margin used, Margin available & Margin required needs to be reevaluated because orders should have stops. ;))

 

I am going to try a couple of things.

Anyway I think I've got it.
 
ask in right forum : MQL4