Please help, how to calculate the SL in MM - page 2

 
You will find some friends here: Friends to code in MT4 & MT5
 

Formula is :

MaxLotsAbleToOpen / ( Risk = SL_Funds + Commission_Funds + FundsCurrent ) * ( Funds - MarginCallFunds )

Reason: