Fills a buffer with values taken from an array
fill(array:Array)
Parameters
Name |
Type |
Действие |
Значение по умолчанию |
array |
Array |
Array of numbers |
— |
Return value
A reference to an object of type Buffer for a chain of calls
Example
export class Main extends Indicator {
constructor() {
super();
this.buffers = {
bufferMain : this.addBuffer(),
};
}
onInit() {
this.buffers.bufferMain.setColor(Color.Red);
}
async onUpdate() {
const priceType = 0,
{bufferMain} = this.buffers,
{Close} = await Bar.load([Bar.Mode.Close], priceType);
// fill bufferMain with array values Close
bufferMain.fill(Close);
}
}