i have a condition ,when a candle hits a target the value which was false become true and alert fires,
problem is when it hits the target several time in same time frame in 1 candle the value remains same and alert keeps on comming till that candle is closed.
i tried using variable with var keyword also with varip keyword
if(crossunder(close,trailprice) and trailprice!=0.0 and long==false)
long:=true
alert(you hit the target
)
this code keeps on running on same bar even if long becomes true