I’m trying to understand the philosophy of using the copybuffer() function in identifiers.
Here in the penultimate line is the code:
I am interested in the general approach shown here.
As far as I understand, the red-highlighted 0 means that every time OnCalculate() is executed, the full data set is copied, starting from zero to the current bar.
In my opinion, this is a very expensive operation, i.e. instead of zero, you should specify something like prev_calculated, i.e. not copy the entire data set, but only one last bar. If the source indicator is redrawn, then only the area to be redrawn should be copied, but it is still only the last few bars.
The copybuffer() format allows this approach. However, 0 is specified. Why?
I guess I don’t know something or don’t take it into account. Please help me figure it out.