Download MetaTrader 5

minimal stoploss

To add comments, please log in or register
saada
10
saada  

hello

How can Expert  determine the minimum stop loss value ?

Fernando Carreiro
3917
Fernando Carreiro  
saada: How can Expert  determine the minimum stop loss value ?

Are you referring to the Broker's "Stops Level"? If so, then you can use:

  • For old style, pure MQL4: MarketInfo() function with the "MODE_STOPLEVEL" identifier

    MODE_STOPLEVEL

    14

    Stop level in points

    A zero value of MODE_STOPLEVEL means either absence of any restrictions on the minimal distance for Stop Loss/Take Profit or the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal. In the second case, GetLastError() can return error 130, because MODE_STOPLEVEL is actually "floating" here.


  • For MQL4+/5 (recommended solution for compatibility in both versions): SymbolInfoInteger() function with "SYMBOL_TRADE_STOPS_LEVEL"

    SYMBOL_TRADE_STOPS_LEVEL

    Minimal indention in points from the current close price to place Stop orders

    int



MarketInfo - Market Info - MQL4 Reference
MarketInfo - Market Info - MQL4 Reference
  • docs.mql4.com
MarketInfo - Market Info - MQL4 Reference
saada
10
saada  

thank u Fernando for ansuer

i have tried MarketInfo () with MODE_STOPLEVEL But it always returns 0

Fernando Carreiro
3917
Fernando Carreiro  
saadai have tried MarketInfo () with MODE_STOPLEVEL But it always returns 0

Several possibilities:

  1. You may be implementing it incorrectly, so show your code so that we can check it.
  2. or ... the Broker does not have Stops Level and does not have a minimum stop size.
  3. or ... your definition of Minimum Stop size is something else completely, and we are not talking about the same things.
To add comments, please log in or register