Minimum Stop Loss allowed vs. coin
-
Hello partners! I am doing an EA but I find that the Stop Loss that I want to incorporate depending on the set of coins or PAR (EURUSD, USDCHF) will not open the operation because it is lower than the minimum allowed by the Brocker; Is there any method or block that can detect this and set the Stop Loss to the minimum allowed?
Thanks a lot. -
@banditdos Very good question; I am also interested. But @Banditdos does not open the operation or on the contrary it opens it but without Stop Loss?
-
-
This function returns the minimum stop distance:
MarketInfo(Symbol(), MODE_STOPLEVEL)https://docs.mql4.com/constants/environment_state/marketinfoconstants
-
@roar Sorry, how is this function incorporated, with the MQL block and variables? Would you be so kind to put a picture of the block with the formula because I think @Banditdos will appreciate it. Thanks a lot.
-
@xyon126 just put it anywhere you want that value to be, in "modify variables" block for example

-
-
@roar By the way, you have put "min_stop_points" that is, if we want them to be "pips" we have to divide it by 10, is that correct?
That is, this:

-
-
@xyon126 it says "points" in the mql4 article, I've never actually used this lol. I guess youre right.
@Banditdos just copy it exactly as in the pictures and see what you get.
This one should be secure: if no stop-loss, set SL of 2 times minimum
https://fxdreema.com/shared/3VcgNhIX -
@roar hi! Please, why divide the stop level for 5 ?

-
@ambrogio to get pips, multiply by ten, to double the amount, multiply by two.
x/10*2 = x/5 -
@roar oh yes! you have already simplified. (P.S. to get pips divide by ten, not multiplied
) -
Thank you very much to both of you, I hope @Banditdos understands it, by the way @roar , @ambrogio could you look at this Link: "http://fxdreema.com/forum/topic/11525/draw-tredline/7" and help me, since the answers they have given me have not helped me at all and I think that you can help me.
-
@xyon126 Hi! I realized that you want to draw trendline as in the AutoCAD environment, but I can't figure out how to do it, I'm sorry.
-
@ambrogio Thank you very much for trying to help me.

