Changing the TF is a problem - page 8

 

In short, the conclusion is this.

We manually count the difference between counted and uncounted bars, and if it's more than 1...

we reset all buffers at once or element by element.

It is not nice. Maybe the developers will reset all the same if there is a condition?

 
Vasyl Nosal:

In short, the conclusion is this.

We manually count the difference between counted and uncounted bars, and if it's more than 1...

we reset all buffers at once or element by element.

It is not nice. Maybe the developers will reset all the same if there is a condition?

Twenty-five again :) . In that case, why do you need your head? It's impossible to foresee all variants of reaction to events. The choice of variant lies on the programmer's shoulders (although, there's nothing to do here, two lines: check for ==0 and react).
 
Vasyl Nosal:

In short, the conclusion is this.

We manually count the difference between counted and uncounted bars, and if it's more than 1...

we reset all buffers at once or element by element.

It is not nice. Maybe the developers will reset the buffers themselves if there is a condition?

Again?! © :D And this after all explanations with examples how to write indicators correctly? )))

 
Sergei Vladimirov:

What, again?!! © :D And this after all the explanations with examples of how to write indicators correctly? )))

So. In my version and in yours goes zeroing, no?
 
Vasyl Nosal:
So. In my variant and in yours there is zeroing, no?

In my version, each bar is calculated. If the buffer value on such a bar should be zero, it will become zero, if it should be equal to 5, it will become 5. In your case, you can simply null the buffers through ArrayInitialize() and then do not calculate those bars where the buffers' value should remain null. But first, this is a bad programming style (very bad!), and second, this is a special case.

All bars should be calculated explicitly. Only this way you can be sure that there will be no "rubbish", uncalculated data, etc. in any cell, and you won't have to catch bugs (which you struggled with in this thread).

And you don't need to keep track of history updates either, it's unnecessary. Just start calculation from bar [rates_total - MathMax(prev_calculated, 1)], and everything will be always guaranteed to be calculated and recalculated, if necessary.

 
Sergei Vladimirov:

In my version, each bar is calculated. If the buffer value on such a bar should be zero, it will become zero, if it should be equal to 5, it will become 5. In your case, you can simply null the buffers through ArrayInitialize() and then do not calculate those bars where the buffers' value should remain null. But first, this is a bad programming style (very bad!), and second, this is a special case.

All bars should be calculated explicitly. Only this way you can be sure that there will be no "rubbish", uncalculated data, etc. in any cell, and you won't have to catch bugs (which you struggled with in this thread).

And you don't need to keep track of history updates, it's unnecessary. Just start calculation with bar [rates_total - MathMax(prev_calculated, 1)], and everything will always be guaranteed to be calculated and recalculated if necessary.

Ouch. Ok.

Developers won't implement anything anyway.

Thanks to all.

Reason: