Execute code lines / Draw objects only once?

 

I'm frustrated because someone answered this for me but I can't find it in all my old posts and comments. I'm struggling to figure out how to run a segment of code only once, particularly when drawing an object. For example, if I create a bool variable for a MACD crossover and I want to draw an arrow or whatever. How do I write it so that it only draws an arrow one time and not on every tick

Thanks in advance for your help. I really appreciate it!

 
dasilvja: if I create a bool variable for a MACD crossover and I want to draw an arrow or whatever. How do I write it so that it only draws an arrow one time and not on every tick?

You are looking at a signal. Act on a change of signal.
          MQL4 (in Strategy Tester) - double testing of entry conditions - MQL5 programming forum #1 2017.12.12