export class Main extends Indicator { constructor() { super(); this.buffers = { bufferMain : this.addBuffer(), }; } onInit() { this.buffers.bufferMain .setColor(Color.Red) .setWidth(3); } async onUpdate() { const priceType = 0, {bufferMain} = this.buffers, {Close} = await Bar.load([Bar.Mode.Close], priceType); bufferMain.fill(Close); // 獲取緩衝區的大小 let BufferSize = bufferMain.size(); this.print('bufferMain size is '+ BufferSize + ' elements.'); } }