How to check StopLoss not exceeds the StopOut Level before open the trade?

 
  • 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, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
  • 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
 
Sherif Hasan:

I want to check stopout level before place the stop loss for pending order?


See here.

StopLevel Minimum Distance Limitation.

A trade operation will not be performed if any of the following conditions is disrupted.

Order Type
Open Price StopLoss (SL) TakeProfit (TP)
Buy
Modification is prohibited
Bid-SL StopLevel TP-Bid StopLevel
Sell
Modification is prohibited SL-Ask StopLevel Ask-TP StopLevel
BuyLimit
Ask-OpenPrice ≥ StopLevel OpenPrice-SL ≥ StopLevel TP-OpenPrice ≥ StopLevel
SellLimit
OpenPrice-Bid ≥ StopLevel SL-OpenPrice ≥StopLevel OpenPrice-TP ≥ StopLevel
BuyStop
OpenPrice-Ask ≥ StopLevel OpenPrice-SL ≥ StopLevel TP-OpenPrice ≥ StopLevel
SellStop
Bid-OpenPrice ≥ StopLevel SL-OpenPrice ≥ StopLevel OpenPrice-TP ≥ StopLevel
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
  • book.mql4.com
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
Sherif Hasan:

I want to check stopout level before place the stop loss for pending order?

See also this article https://www.mql5.com/en/articles/2555
The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • 2016.08.01
  • MetaQuotes Software Corp.
  • www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 

For clarification: does the OP mean stop level (relating to minimum distances) or stop out level (relating to margin)?

Reason: