Indicator meaning

 

Good morning everyone,

can someone help me to understand the meaning of this part of the code of my indicator? What does it do?


       if(val1 > 0)
       { 
           v1[i] = High[i];
           counter1 = 1;          
       }
       else
       {
           v1[i] = v1[i+1];
           counter1++;           
       }
 

It propagates the previous value ,unless ,a new value comes in from val1 

it also keeps a counter which is intended to be bars since last change ,but if the system is not gated by new bar detection there will be issues with the counters usability

 
Lorentzos Roussos:

It propagates the previous value ,unless ,a new value comes in from val1 

it also keeps a counter which is intended to be bars since last change ,but if the system is not gated by new bar detection there will be issues with the counters usability

Thank you very much

Reason: