Getting Notifications for Every time a Level is Hit

 
Hi 

I'm trying to set up a robot to tell me when price moves by about 10 points.   

What I've tried is if(Bid < OBJ_HLINE)
   {

      SendNotification("Message");



The problem with that is, it notifies on every tick, so endless messages.  But if I say if(Bid == OBJ_HLINE), the price will probably never be exactly equal to it.  

I would also like to be able to have it reset itself, so if it goes below, but then travels down a further 10 points and goes below another line, then to notify me again, and the same for if it heads back up above a line, to tell me, and of course if it goes above the first line mentioned, a drop below it again would trigger a new alert.  


I'm sure there is a better way to do this than to have dozens of horizontal lines on a chart, but I am just trying to put something basic together before I learn more.  I thought this would be much more straightforward, but I have a lot to learn of course.  


Thanks and I'd greatly appreciate some help with this

 
You can create a variable to store the last reported price. If the variable is the same as current then no notification else send new level notification
 
Dua Yong Rew:
You can create a variable to store the last reported price. If the variable is the same as current then no notification else send new level notification

Thanks Dua, I understand that and it's a great solution, however I can't get my head around how to apply it.  

Where do I get the last reported price?  Would it simply be the message I create?  Basically saying, yes price is below 100, cancelling that question coming up again, and moving to the next question, is price below 90,
and the same for above, is price above 100 etc?   


Maybe there's more to it than that, but I'm not sure how I would write the code for it, if you can provide a little more details.  

Reason: