indicator not updating, please help to solve this.

 

hi everybody!

please help to understand the issue with indicator.

seems like working but not updating properly. see code example below.

thanks.

#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//|                         on calculate                             |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {     
   int limit=MathMax(rates_total-prev_calculated-2,2);
   for(int i=1; i<limit; i++)
     {      
      string engulf_arrow_down_name="EngulfArrowDown"+IntegerToString(i);
      string engulf_font_down_name="EngulfTextDown"+IntegerToString(i);
            
      if(Close[i+1]>Open[i+1])
      if(Close[i]<Open[i])
      if(Close[i]<Low[i+1])
      if(High[i]>High[i+1])
      {      
       ObjectDelete(0,engulf_arrow_down_name);
       ObjectCreate(NULL,engulf_arrow_down_name,OBJ_ARROW_DOWN,0,Time[i],High[i]);
       ObjectSetInteger(NULL,engulf_arrow_down_name,OBJPROP_ANCHOR,ANCHOR_BOTTOM); 
       ObjectSet(engulf_arrow_down_name,OBJPROP_COLOR,clrCoral);
       ObjectSet(engulf_arrow_down_name,OBJPROP_WIDTH,0);
       ObjectSet(engulf_arrow_down_name,OBJPROP_BACK,1);
       ObjectSet(engulf_arrow_down_name,OBJPROP_RAY,0);
    
       ObjectDelete(0,engulf_font_down_name);
       ObjectCreate(NULL,engulf_font_down_name,OBJ_TEXT,0,Time[i],High[i]+100*Point);
       ObjectSetString(NULL,engulf_font_down_name,OBJPROP_TEXT,"Engulf"); 
       ObjectSetString(NULL,engulf_font_down_name,OBJPROP_FONT,"Orator Std"); 
       ObjectSetInteger(NULL,engulf_font_down_name,OBJPROP_FONTSIZE,7); 
       ObjectSetDouble(NULL,engulf_font_down_name,OBJPROP_ANGLE,-90); 
       ObjectSetInteger(NULL,engulf_font_down_name,OBJPROP_ANCHOR,ANCHOR_RIGHT); 
       ObjectSetInteger(NULL,engulf_font_down_name,OBJPROP_COLOR,clrBlack); 
      }
     }
    
   return(rates_total);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
 

Don't double post! Don't triple post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)
 
William Roeder #:

Don't double post! Don't triple post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)

i tried to delete them but there is no way to do it.

 
William Roeder #:

Don't double post! Don't triple post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)

hi again. 

is it possible to delete the other posts? i tried but there is no way how. 

i do understand the rules of posting and from now on im gonna follow them. 

I want to continue this post if possible. (I'm really trying to figure out how to write indicator in a certain way)

thank you and have a nice day:)