Trendline (Chart object) False Trigger Alerts
-
Hi,
I created a trendline alert EA that alerts me when price touches a trendline that I have drawn on the chart. 80% of the time, it works well. However at other times, it triggers without even reaching the trendline.
Does anyone know what could be wrong? I have looked through the blocks over and over again without any luck.
By the way (in case anyone is wondering) I used '<=' and '>=' rather than '<x' and '>x' intentionally.
Here a link to the EA: shared/DNUCf7I6d
It is a simple one.Regards
Ose -
I was finally able to work out the cause of the issue. I realised the problem only occurred at the end of a trendline. Hence one bar after the trendline has ended, it seems to evaluate the value of the trendline as 0. Hence, since my condition says "Trigger when BID is greater than Trendline price value" it would trigger at that point.
So now, I simply make my trendlines longer.