setAnchor()

Sets the anchor point for indicator symbols
setAnchor(value:int)

Parameters

Name Type Действие Значение по умолчанию
value int It is one of the values listed in Anchor

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 = {
             BufferForArrows1 : this.addBuffer(),
         };
     }

     onInit() {
         this.buffers.BufferForArrows1
             .setShape(Shape.Arrow)
             .setColor(Color.Red)
             .setArrow(ArrowSymbols.ArrowDoubleUpWards)
             .setWidth(5)
             // Set the anchor point of the arrow symbol
             .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]);
         }
     }
}