On calculate not working?

Can anyone help me the oncalculate() function is not being called in my programme

Please tell when is oncalculate() function called in MT5 and when will it not be called

OnCalculate is called when the indicator is loaded on the chart and when a new tick comes in.
There is no oncalculate function. Is your function form exactly matching one of the two forms? Post your code.

struct st_Bars //structure initialization

  {

   int               Bar_1;

   int               Bar_2;

   int               Bar_3;

   int               Bar_4;

  };

st_Bars Bars_Ext; // declaration of structure type variable 

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

  {

   Trade_Symbol=Symbol();

   Period_Trade=Period();

   Dig=(int)SymbolInfoInteger(Trade_Symbol,SYMBOL_DIGITS);//number of decimal places in current symbol

//--- indicator buffers mapping

   SetIndexBuffer(0,supportBuffer,INDICATOR_DATA);

   SetIndexBuffer(1,resistanceBuffer,INDICATOR_DATA);

   h_RSI=iRSI(Trade_Symbol,Period_Trade,Period_RSI,PRICE_CLOSE); //return handle of RSI indicator

   if(h_RSI<0) Print("Incorrect handle of RSI ");

   if(Analyze_Bars>Bars(Trade_Symbol,Period_Trade)) //if less bars in history for analysis,

     {

      Print("The history of the less",Analyze_Bars,"bar"); // than specified in bars parameter, then you need to tell this

      Bars_H=Bars(Trade_Symbol,Period_Trade);

      Print("Number of bars in history = ",Bars_H);

     }

   else

     {

      Bars_H=Analyze_Bars;

     }

//---

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   IndicatorRelease(h_RSI); // remove handle at deinitialization  

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

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 a=1;

   if(a==1)

   {

   Print("Waiting for working");

   }

   ArraySetAsSeries(supportBuffer,true);

   ArraySetAsSeries(resistanceBuffer,true);

   Bars_Ext.Bar_1=Ext_1(Low_RSI,High_RSI,Bars_H,h_RSI,Trade_Symbol,

                        Distans,Period_Trade); // find bar index of first extremum 

   if(Bars_Ext.Bar_1<0)

     {

      Print("Insufficient bars in history for analysis");

      return(0);

     }

   if(Bars_Ext.Bar_1>0) First_Ext=One_ext(Bars_Ext,Trade_Symbol,h_RSI,Low_RSI,Period_Trade);

   Bars_Ext.Bar_2=Ext_2(Low_RSI,High_RSI,Bars_H,h_RSI,Trade_Symbol,

                        Bars_Ext,2,Distans,First_Ext,Period_Trade); // find bar index of second extremum 

   if(Bars_Ext.Bar_2<0)

     {

      Print("Insufficient bars in history for analysis");

      return(0);

     }

   Bars_Ext.Bar_3=Ext_2(Low_RSI,High_RSI,Bars_H,h_RSI,Trade_Symbol,

                        Bars_Ext,3,Distans,First_Ext,Period_Trade); // find bar index of third extremum 

   if(Bars_Ext.Bar_3<0)

     {

      Print("Insufficient bars in history for analysis");

      return(0);

     }

   Bars_Ext.Bar_4=Ext_2(Low_RSI,High_RSI,Bars_H,h_RSI,Trade_Symbol,

                        Bars_Ext,4,Distans,First_Ext,Period_Trade); // find bar index of last extremum 

   if(Bars_Ext.Bar_4<0)

     {

      Print("Insufficient bars in history for analysis");

      return(0);

     }

   Level(true,First_Ext,Bars_Ext,Trade_Symbol,Period_Trade); // get coefficients k and b for resistance line 

   for(int i=0;i<Bars_H;i++)

     {

      resistanceBuffer[i]=NormalizeDouble(K*i+B,Dig);

     }

   Level(false,First_Ext,Bars_Ext,Trade_Symbol,Period_Trade); // get coefficients k and b for support line

   for(int i=0;i<Bars_H;i++)

     {

      supportBuffer[i]=NormalizeDouble(K*i+B,Dig);

     }

   return(rates_total);

  }   

This is the code upto the oncalculate function

The code upto the deinit function is runnng but the oncalculate function is not being called

Nothing apparently wrong in this code, except it doesn’t compile.

Post all the relevant code.