Variable For Broker's Minimum S/L
-
Is there a way to call variable that contains broker's s/l minimum for a particular symbol? For example, to use a condition block that says if market price for [symbol name] > broker minimum for that symbol, then set s/l.
I am looking at the column on the right side of this page titled "limit and stop loss levels": http://www.xm.com/assets/pdf/spreads/XM ... o_2013.pdf
-
In MQL4 this value can be get with:
MarketInfo(Symbol(),MODE_STOPLEVEL)the returned value is in poits, for example it can be 20 in 5-digits broker (0.00020). I can add this somewhere, but you can also use this is Value -> Numeric.
For specified symbol:MarketInfo("EURUSD",MODE_STOPLEVEL)But now when the requested SL is too short, the minimum is taken. Or at least it tries to take the minimum, but sometimes there are error messages because the price changed. Well, even if this happens it will try to send the trade with updated SL until it succeed.
-
thanks!
-
this is giving me compile errors when I put MarketInfo("EURUSD",MODE_STOPLEVEL) into "start when profit is above" field. If I leave that field empty then, it works but I need to put this there as offset so trailing stop doesn't start in the negative zone: http://fxdreema.com/shared/hp3YtkRhc
-
I noticed that when you edit block, the comma (",") in "MarketInfo("EURUSD",MODE_STOPLEVEL)" changes to a period (".") but if you set it back to a comma, then it compiles without errors. But it still doesn't work correctly.
Trailing stop mode = dynamic size (in pips)
Start when profit is above = dynamic leveldynamic size (in pips) = dynamic level?
-
I will check that ","->"." problem...
But this formula gives value in points, but in fxDreema "pips" can be different, it depends if the broker is 4 or 5 digits, and Point format set in fxDreema. There is something more to be added to that formula, but I don't think you need to do that, because when Trailing stop modifies SL or TP, it checks stops level and if SL or TP is too small - it takes the minimum. You can try this if you set fixed pips to something small, for example 1. -
Let's say you want to tell Trailing stop to keep SL at the minimum distance. If you set small value it should do that by itself. Is there another reason for you to use this parameter?
-
well, let's say you want to offset the trailing stop so it starts after the open price. A fixed value won't work for all symbols, wouldn't I need a dynamic value? How would I do this?