How to plot averages in Renko2indicator?

 

Could anyone help how to plot the bollinger band through the other renko2 indicator?


And SimpleMA by including only the value of i, the indicator works, however it runs through the candle chart and does not follow renko2.


I'm trying this way, but an error is shown in the Diary.


Thank you

https://www.mql5.com/pt/code/19559



 static int prev_total = 0;
   int index = rates_total - 1;
   int total = RenkoOffline.UpdateRates();
   if(total<=0) return(0);
   
// Fill indicator buffers
   if(rates_total != prev_calculated || total != prev_total)
   for(int i=index, j=total-1; i>0 && j>0; i--, j--)
     {

      open_buffer[i]       = RenkoOffline.GetValue(1, j);
      high_buffer[i]       = RenkoOffline.GetValue(2, j);
      low_buffer[i]        = RenkoOffline.GetValue(3, j);
      close_buffer[i]      = RenkoOffline.GetValue(4, j);
      close_buffer[i-1]   = RenkoOffline.GetValue(4, j-1);
      
      // Custom buffers
      tick_volume_buffer[i] = RenkoOffline.GetValue(5, j);
      real_volume_buffer[i] = RenkoOffline.GetValue(6, j);
      time_buffer[i] = RenkoOffline.GetValue(0, j);
      
      // Color buffer
      if(close_buffer[i]>close_buffer[i-1])
         color_buffer[i] = 2;
      else
         color_buffer[i] = 1;
         

      ExtMLBuffer[i]=SimpleMA(close_buffer[i], ExtBandsPeriod, price);
      //--- calculate and write down StdDev
      //ExtStdDevBuffer[i]=StdDev_Func((j-1),price,ExtMLBuffer,ExtBandsPeriod);
      //--- upper line
      //ExtTLBuffer[i]=ExtMLBuffer[i]+ExtBandsDeviations*ExtStdDevBuffer[i];
      //--- lower line
      //ExtBLBuffer[i]=ExtMLBuffer[i]-ExtBandsDeviations*ExtStdDevBuffer[i];
      
               
     }


2020.05.29 00:38:25.017 2020.05.21 00:00:00   array out of range in 'MovingAverages.mqh' (18,46)
Renko 2.0
Renko 2.0
  • www.mql5.com
CDouble & CDoubleVector Uma biblioteca para métodos de arredondamento comuns usados no desenvolvimento MQL, classe wrapper primitiva para "type" (double) e vetor para objetos CDouble. MQL5 e MQL4 são compatíveis! MACD_Squeeze Oscilador MACD Squeeze similar ao indicador Trade The Markets Squeeze, mas baseado no MACD. Optimal F para MQL5 (por...
 

Resolved.


ExtMLBuffer[i]=SimpleMA(i, ExtBandsPeriod, close_buffer);
Reason: