margin call liquidation level

 

hi all,


I know there is a way to view the "available" leverage of the account

Is there a way to view the "set" margin call notification or warning level ? (can be 125% ) (the level at which new trades cannot be placed)

also, is there a way to view the "set" margin call liquidation level ? (can be 50 %) (the level at which potions get closed automatically, either all or biggest losing first)


Thanks

 
t4fast: I know there is a way to view the "available" leverage of the account Is there a way to view the "set" margin call notification or warning level ? (can be 125% ) (the level at which new trades cannot be placed) also, is there a way to view the "set" margin call liquidation level ? (can be 50 %) (the level at which potions get closed automatically, either all or biggest losing first)

https://docs.mql4.com/account/AccountStopoutMode.

https://docs.mql4.com/account/AccountStopoutLevel.

https://docs.mql4.com/constants/marketinfo.

MODE_MARGINCALCMODE 28 Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
MODE_MARGININIT 29 Initial margin requirements for 1 lot.
MODE_MARGINMAINTENANCE 30 Margin to maintain open positions calculated for 1 lot.
MODE_MARGINHEDGED 31 Hedged margin calculated for 1 lot.
MODE_MARGINREQUIRED 32 Free margin required to open 1 lot for buying.

Try making use of the above information. Calculating margin can be tricky. I'll recommend searching for additional information in Articles and on Forum.

 
No need for all that info. Use AccountFreeMarginCheck - MQL4 Documentation

To prevent a margin all just verify that free margin (after opening) will be greater than the drop in equity at most adverse excursion (i.e. SL for all open and the new orders). See my code's Lotsize()
Reason: