fibSpiral

Draws Fibonacci Spiral arcs from two anchors: a base point (center) and a scale point (sets the starting radius). It’s a visual way to explore growth/decay paths and curved support/resistance derived from Fibonacci proportions.

Syntax

fibSpiral(basePoint, scalePoint, styles?)

Parameters

  • basePoint (PricedData) · Center of the spiral (time & price), e.g. newPoint(time(60), closeC(60)).

  • scalePoint (PricedData) · Sets initial radius/scale for the spiral, e.g. newPoint(time(30), high(30)).

  • styles ((Omit<LinesLevels,'coeff'>)) · Line look (no coeff here): · linestyle (number) · Line style (solid/dotted/dashed). · linewidth (number) · Line width. · linecolor (RGBAColor | BaseColors) · Line color (accepts named colors or color.rgba).

Return Value

  • (string) The drawing ID of the created Fibonacci Spiral.

Example

Goal: Every 70 candles, place a spiral centered at an older pivot, scaled by a nearer point, with a subtle dashed line.

//@version=1
init = () => {
  // Put drawings on the main price chart and inherit its price formatting
  indicator({ onMainPanel: true, format: 'inherit' });
};

onTick = () => {
  // Draw occasionally to avoid clutter
  if (index % 70 === 0) { // ← change 70 for more/less frequency
    // 1) Choose anchors
    const base = newPoint(time(6), closeC(6)); // spiral center
    const scale = newPoint(time(5), high(5));   // sets initial radius

    // 2) Define style once (no coeffs for spiral)
    const style = {
      linestyle: 1,         // dashed
      linewidth: 5,
      linecolor: color.red
    };

    // 3) Build the spiral
    fibSpiral(base, scale, style);
  }
};

Result

Tips

  • Choose a meaningful pivot for basePoint (clear swing high/low) so the spiral radiates from a relevant market landmark.

  • If the line is too strong, reduce linewidth or pick a softer color to keep the chart readable.

  • Combine with horizontal tools (like fibRetracement) to spot curved + straight confluence zones.

Warning

Good Practice

Last updated