設置指標符號的錨點
setAnchor(value:int)
Parameters
Name |
Type |
Действие |
Значение по умолчанию |
value |
int |
它是列在其中的價值觀之一 Anchor |
— |
Return value
引用Buffer類型的對像以進行一系列調用
Example
export class Main extends Indicator {
constructor() {
super();
this.buffers = {
BufferForArrows1 : this.addBuffer(),
};
}
onInit() {
this.buffers.BufferForArrows1
.setShape(Shape.Arrow)
.setColor(Color.Red)
.setArrow(ArrowSymbols.ArrowDoubleUpWards)
.setWidth(5)
// 設置箭頭符號的錨點
.setAnchor(Anchor.Top);
}
async onUpdate() {
const priceType = PriceType.Bid,
{BufferForArrows1} = this.buffers,
{Close} = await Bar.load([Bar.Mode.Close], priceType),
barSize = Close.length;
for (let i = 0; i < barSize-1; i++) {
BufferForArrows1.set(i, Close[i]);
}
}
}