Download MetaTrader 5

right way to warn about a stop out

To add comments, please log in or register



As far as i understand it, stopout level is a percentage of the minimal margin at which all orders are forcibly closed.


to compute the stop out here is the code:

  int level=AccountStopoutLevel();

  if (AccountStopoutMode()==0)
     Print("StopOut = ", level, "%");
      int d = 100*level/AccountBalance();
      Print("StopOut = ", d, "%");

  Now let's suppose i have a Margin of 10.0 on a $1000 account (1% of the capital)


the stop out level has to be multiplied by the margin ( AccountMargin()), right?

so if stop out is 60% then the stop out will close all orders if the equity falls under 10.0 * 60% = $6  ?


is it correct?


and secondly, what is a very bad stop out level? under what amounts falls a good stopout so that it doesn't close orders too often...


thanks a lot



  • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
  • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerlot + CommissionPerLot) (Note OOP-OSL includes the SPREAD)
  • Do NOT use TickValue by itself - DeltaPerlot
  • You must normalize lots properly and check against min and max.
  • You must also check FreeMargin to avoid stop out
To add comments, please log in or register