if(BuyClose > BUYtrendlineValue + (Buffer * UsePoint) && NewBUYtime != OldBUYtime && (BuyClose1 < BUYtrendlineValue || BuyClose2 < BUYtrendlineValue))
I have braced everything as you have shown, but still have the same problem. The last part starting from BuyClose1 is ignored.
In the attached screen image the first Buy transaction is according to the code, but the others should not happen, because the BuyClose1 and BuyClose2 values are not smaller than the BUYtrendlineValue (represented by the drawn trend line)
It should give false but do not and a trade is wrongly executed.
Here is my code for getting the value of the trend line at the specific bar:
BUYtrendlineValue = ObjectGetValueByTime(0,BUYtrendlineName,TimeCurrent(),0);
BUYtrendlineValue = NormalizeDouble(BUYtrendlineValue,MarketInfo(OrderSymbol(),MODE_DIGITS));
To add comments, please log in or register