The trailing is as follow, I want the trail to trigger when a threshold is reached. And it should be checked every single tick. If the threshold is reached, we move the stop loss to the current price.
The stop loss is kind of working, except that it is doing its work only after a bar is closed and move onto the next bar. A proof is in the attached diagram
If you look at the red circle, you can see that the position is closed one bar late, hence, the stop loss is working one bar late.
Thank you for your precious time. Any help would be appreciated.
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
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.
Hello everyone!
So I have a stop loss check in the Ontick function like this:
Some part of the code is hide away for simplicity.
The trailing is as follow, I want the trail to trigger when a threshold is reached. And it should be checked every single tick. If the threshold is reached, we move the stop loss to the current price.
The stop loss is kind of working, except that it is doing its work only after a bar is closed and move onto the next bar. A proof is in the attached diagram
If you look at the red circle, you can see that the position is closed one bar late, hence, the stop loss is working one bar late.
Thank you for your precious time. Any help would be appreciated.