[Q] Minimal SL ?

 

Is there a mql5 function witch can tell me, what is the minimal Stop Loss for the trade ?


I manually calculated that minimal SL for GBPUSD for my broker is 13 pips, if I try to set smaller SL, it gives me error: Invalid StopLoss value. (fixed spread 3 pips)


Not all brokers have this limitation.

 

StopsLevel()

 
MODE_STOPLEVEL14Minimal permissible StopLoss/TakeProfit value in points.

 

Use this with MarketInfo() should help you. Example MarketInfo(Symbol(),MODE_STEPLEVEL) will return you required minimum stoplevel. Check http://book.mql4.com/appendix/marketinfo and http://book.mql4.com/appendix/limits please. Yes every broker has different requirements. It is essential to understand every single tweak. Devil is in detail. 

MarketInfo() Identifiers - Appendixes - MQL4 Tutorial
  • book.mql4.com
MarketInfo() Identifiers - Appendixes - MQL4 Tutorial
 
fx1.net:
MODE_STOPLEVEL14Minimal permissible StopLoss/TakeProfit value in points.

 

Use this with MarketInfo() should help you. Example MarketInfo(Symbol(),MODE_STEPLEVEL) will return you required minimum stoplevel. Check http://book.mql4.com/appendix/marketinfo and http://book.mql4.com/appendix/limits please. Yes every broker has different requirements. It is essential to understand every single tweak. Devil is in detail. 

The question was about mql5.

SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL);
Reason: