in Barstate.ts, the length of data is determined by this.context.data.close.data.length, but per my debug, this.context.data.close.data.length is always the same as current idx, seems the this.context.data.close.data is gradually added.
I think we should use this.context.length.