@rekurt/openkline - v0.2.0
    Preparing search index...

    Class FibExtension

    Fibonacci extension — three anchor points (A → B → C) that project target levels beyond the swing. Conventionally A and B define the impulse leg and C is the retracement low/high; the extension projects targets above (or below) the impulse using Fibonacci ratios applied to the A→B range from C.

    level price = C + ratio * (B − A)

    Levels emitted: 0, 0.382, 0.618, 1.000, 1.272, 1.618, 2.000, 2.618.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    color: string | null = null
    id: string
    points: AnchorPoint[] = []
    KIND: "fibext" = 'fibext'
    LEVELS: number[] = ...

    Accessors

    • get isComplete(): boolean

      True once requiredPoints clicks have been collected.

      Returns boolean

    • get isReplayCapExempt(): boolean

      True when the drawing's rendered geometry does NOT depend on its anchor index/time — e.g. a full-width horizontal price level. Such drawings stay visible (and selectable) under a replay cap even when their stored anchor index sits past the revealed prefix, because the index is cosmetic for them. Index/time-dependent drawings (the default) are hidden once every anchor is past the cap, so a not-yet-revealed shape never leaks. Subclasses whose render ignores the index override this to true.

      Returns boolean

    • get kind(): string

      Unique discriminator used in snapshots. Subclasses override.

      Returns string

    • get requiredPoints(): number

      How many clicks are needed before the drawing is "complete".

      Returns number

    Methods

    • Hit-test a screen point (in canvas pixels) against this drawing for selection. Returns true when the point is within tolerance pixels of the rendered geometry.

      The default implementation treats the anchors as a polyline (correct for segment shapes like TrendLine and Arrow). Shapes whose rendered geometry differs from a simple anchor polyline — full-width/height lines, rectangles, rays, channels, fib levels — override this.

      Parameters

      • px: number
      • py: number
      • layout: ChartLayout
      • viewport: Viewport
      • tolerance: number = DRAWING_HIT_TOLERANCE_PX

      Returns boolean

    • Restore the numeric payload produced by snapshotData. Called by the snapshot factory after the anchors are populated. No-op in the base class.

      Parameters

      • _data: number[] | undefined

      Returns void

    • Optional numeric payload persisted alongside the anchors. The base class emits nothing; subclasses that derive geometry from sampled data (regression channel) override this so the snapshot round-trips exactly. Mirrors restoreData.

      Returns number[] | undefined