Download MetaTrader 5
To add comments, please log in or register
Do you want to become a well-known developer? Execute the orders of traders in the Freelance service!
Sameer
784
Sameer 2013.12.31 07:00 

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

Ubzen
Moderator
5394
Ubzen 2013.12.31 07:11  
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.

whroeder1
13941
whroeder1 2013.12.31 13:34  
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()
/
To add comments, please log in or register