How to stop this indicator giving me repeated alerts on my DAshboard below?

 

I tried for a few days, all kinds of ways I did to make the alert not repeat. now i'm stuck.... That is my code, 


   if ((Price_Now <= MA5_low &&  Price_Now >= MA10_low )||(Price_Now >= MA5_low &&  Price_Now <= MA10_low))  //--- PRICE CLOSE BERADA DLM  MA
                                                         {
                                                          
                                                                    
                                                                  if(TimeStamp != Time[0])
                                                                  {
                                                                  
                                                                 
                                                               
                                                                  Alert("Reentry Buy : "+SymbolName(i,true)+" , " + pperiod(TimeFrames[x])+" , " + string(Price_Now) +" , "  );
                                                                  TimeStamp = Time[0];
                                                                  }
                                                                  
                                                                  
                                                            
                                                                 
                                                                  CreateTextLable(Result_Name,"ZBUY_1",Size,"Times New Roman",Text_Color,0,(x+2)*(Size+Column_Space),i+3);//zzl
                                                         }
MQL5 forum
MQL5 forum
  • www.mql5.com
MQL5: Forum on automated trading systems and strategy testing
 

Find out yourself ..

Just create for each logical part a variable and control it in the debugger like:

bool b1 = rice_Now <= MA5_low,
     b2 =  ....

Here is how to use the debugger:

Code debugging:  https://www.metatrader5.com/en/metaeditor/help/development/debug
Error Handling and Logging in MQL5:  https://www.mql5.com/en/articles/2041
Tracing, Debugging and Structural Analysis of Source Code, scroll down to: "Launching and Debuggin": https://www.mql5.com/en/articles/272

Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...
Reason: