Plot Error in VwapBands indicator

 

Good night people,


I'm trying to create a Vwap Bands indicator, and I have the following error when plotting, when the intraday chart changes days, that is, I'm on 08/17 and it moves to 08/18, the plot is as shown in the figure, the indicator plots values there at 0, could you help me to adjust it?! thanks

below is the code.


int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const duplo &alto[],

                const double &low[],

                const duplo &fechar[],

                const longo &tick_volume[],

                const longo &volume[],

                const int &spread[])

  {


   // Número de barras a calcular

   int begin=(prev_calculated<=0 || prev_calculated>rates_total) ?

             0 : prev_calculated-1;

      

     //ArraySetAsSeries(VWAPBuffer,true);

     ArraySetAsSeries(BufferVWap,true);

     if(CopyBuffer(vWap_Handle,0,0,rates_total-begin,BufferVWap) < 0)

      {

               Print("Erro ao copiar buffer da VWap");

               retorna 0;

      }

            for(int i=begin;i<rates_total && !IsStopped();i++)

      {

         int forAsSeries=taxas_total-1-i; //para acessar o array atr

         VWAPBuffer[i] = BufferVWap[forAsSeries];// * 1.003333 ; 

         VWAPBuffer1[i] = BufferVWap[forAsSeries] * 1,003333; 

      }

     return(taxas_total);

  }    

 

This is the forum in English language so please use English to write something here
(I used in-built online translation feature to edit your with with translation).

-----------------------

Please edit your post to insert your code by using the CODE button (Alt-S)!

Use the CODE button

 
Rafael Campolina Vidal:

Good night people,


I'm trying to create a Vwap Bands indicator, and I have the following error when plotting, when the intraday chart changes days, that is, I'm on 08/17 and it moves to 08/18, the plot is as shown in the figure, the indicator plots values there at 0, could you help me to adjust it?! thanks

below is the code.

Do you use time in the calculation of the bands ?