And the issue it has is it modifies the order immediately without meeting conditions and when it modifies it only removes the stop loss for some reason
The only way that I see that is possible is if profit,profit2 are both zero.
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.
yea its only for buy orders,
And the issue it has is it modifies the order immediately without meeting conditions and when it modifies it only removes the stop loss for some reason
The only way that I see that is possible is if profit,profit2 are both zero.
Check their values.
Thats what they are
open is open 0
bot is the bottom value of a trend
they are both dynamic and are set as the distance of start trade from the original stoploss*2Do not double post.
I have deleted the new topic.
The only way that I see that is possible is if profit,profit2 are both zero.
Check their values.
Have you actually checked their values?
I don't mean check the calculations, I mean print their actual values to the log as I believe that they are being calculated to zero.
Are you calculating with ints and expecting the result to be a double?
Always use
as the earlier code will not compile with it as it is missing some braces.