Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
How about using a function like the following at every tick for closing opened orders at their stop losses?
A newbie, needs confirmation from experienced coders.
Thanks.
Always count down when closing orders.
What is the point of your function?
If the price has hit the stop loss, it will already be closed.
If it hasn't, then you will be trying to close at an invalid price.
Always count down when closing orders.
What is the point of your function?
If the price has hit the stop loss, it will already be closed.
If it hasn't, then you will be trying to close at an invalid price.
Ok ... see, got, thanks a lot.
You do agree with some posters here saying that both of them (SL and OrderClose function) should be used for the same order?
Ok ... see, got, thanks a lot.
You do agree with some posters here saying that both of them (SL and OrderClose function) should be used for the same order?
I agree that when it is intended that a trade be closed by the EA at a certain level, there should also be an emergency SL in place.
Thanks Keith,
Thanks to all here shared their experiences.
For example, let's say I have a long EURUSD position and its stop loss is at 1.1350.
In OnTick(), the most common way to use OrderClose() looks like the following, isn't it?