Does 3DOscillator repaints?

 

Hi

Does 3DOscillator  CI repaints? According to some backtests ive done it seems it does. I m quite suprised since in the code i can only see using iRSI&iCCI.

Is there a way to fix this? 

https://www.mql5.com/en/code

 

 
It doesn't repaint. It is BROKEN.
        sig1 = sig1n[i];
        sig2 = sig2n[i];
it never initializes those two variables prior to the start of the loop.
 
WHRoeder:
It doesn't repaint. It is BROKEN.
it never initializes those two variables prior to the start of the loop.


yep i ve also noticed that those two arent used at all anywhere in the code. But i never thought that this was the problem. 

Although i set a 

sig1 = 1.0;
sig2 = 1.0;

 at the beginning of the start it doesn't seems to change the results in the backtest

 
They are used right above that.
        sig1n[i] = sk*E3D + (1 - sk)*sig1;
        sig2n[i] = sk2*sig1 + (1 - sk2)*sig2;
        sig1 = sig1n[i];
        sig2 = sig2n[i];
They aren't initialized before the loop. So it works fine initially when its processing all bars and then fails when its only processing bar zero.
 
WHRoeder:
They are used right above that.
They aren't initialized before the loop. So it works fine initially when its processing all bars and then fails when its only processing bar zero.


well what i m doing is this but i dont this is what you mean cause it doesnt fix the problem:

int start()
  {
   
   if(Bars<=cs) return(0);
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+cs);
   SetIndexDrawBegin(1,Bars-CountBars+cs);
   int i,i2;//counted_bars=IndicatorCounted();
   double rsi,maxrsi,minrsi,storsi,E3D,sig1,sig2;
   sig1=0;
   sig2=0;
........
.........
 
athanfx:


well what i m doing is this but i dont this is what you mean cause it doesnt fix the problem:

 


ok i got it and solved it... thanks for your help!!! Sometimes its so obvious... i hate debugging in mt4... it reminds me C/C++ in very early 90s ... 
Reason: