Trailing Stop - Check Parenthesis Precedence
In your case it warns you because of this:
if((Bid < NormalizeDouble(OrderOpenPrice() - TrailingStart * vPoint,Digits)) && (sl > (NormalizeDouble(Ask + (TrailingStop + TrailingStep)* vPoint,Digits))) || (OrderStopLoss() == 0.0))
There && and || are mixed and the compiler doesn't know what you want: if (a && (b || c)) or if ((a && b) || c)
Check it - it's different.
if((Bid < NormalizeDouble(OrderOpenPrice() - TrailingStart * vPoint, Digits) && sl > NormalizeDouble(Ask + (TrailingStop + TrailingStep) * vPoint, Digits)) || OrderStopLoss() == 0.0)
Re: Trailing Stop - Check Parenthesis Precedence
Thanks for spotting the warning mistakes made during the coding process. I am forevermore thankful for such an open-minded community.
Exhaustion may have played a role in these mistakes. I'm working on it though, and learning through this support community...
Thanks @Vinicius de Oliveira & @Carl Schreiber
You're welcome. 👍
Hello, MQL5 Community
Please assist with the following code function: "check operator precedence for possible error; use parentheses to clarify precedence".
I have attached an image and snippet of code showing where I get the warning "⚠". Despite my best efforts, I have not been able to resolve this warning.
The area affected is within the "if(OrderType() == OP_SELL) provided in the code:
|| (OrderStopLoss() == 0.0))
Please let me know if I am missing anything and if so, I would appreciate your support and guidance with the correct format.