fibTrendExt

The Fibonacci Trend Extension is like a forward-looking version of retracement. Instead of just measuring the pullback between two points, it projects Fibonacci levels beyond your chosen move. Traders use it to spot potential profit targets or continuation levels in the direction of the trend.

Think of it as:

  • Retracement → “How far back might price pull?”

  • Trend Extension → “How far forward might price go?”

Syntax

fibTrendExt(originPoint, targetPoint, anchorPoint, styles?)

Parameters

  • originPoint: The first anchor of your trend move. Usually the start of a swing. Build with newPoint(time, price) . Example: newPoint(time(40), low(40)).

  • targetPoint: The second anchor. Typically the end of the initial swing. Build with newPoint(time, price) . Example: newPoint(time(25), high(25)).

  • anchorPoint: The third point, used to “project” the extension from. Often a retracement low/high after the move. Example: newPoint(time(10), low(10)).

  • styles (optional) Customize the look:

    • coeffsAsPercents (boolean): display Fibonacci coefficients as percentages instead of raw values.

    • extendLines (boolean): extend Fibonacci extension lines beyond their endpoints.

    • extendLinesLeft (boolean): extend lines to the left side of the anchor point.

    • fibLevelsBasedOnLogScale (boolean): calculate Fibonacci levels using a logarithmic price scale.

    • fillBackground (boolean): fill the background area between Fibonacci levels.

    • horzLabelsAlign (string): horizontal alignment of level labels.

    • horzTextAlign (string): horizontal alignment of label text.

    • labelFontSize (number): font size used for level labels.

    • level1level24 (LevelsWithText): individual Fibonacci level configuration with text.

    • levelstyle (Omit<LinesLevels, keyof Levels>): visual style applied to Fibonacci levels.

    • reverse (boolean): reverse the Fibonacci direction.

    • showCoeffs (boolean): show Fibonacci coefficients on levels.

    • showPrices (boolean): show price values on levels.

    • showText (boolean): show custom text on levels.

    • transparency (number): transparency level.

    • trendline (Omit<LinesLevels, 'coeff'>): configuration for the main trendline.

    • vertLabelsAlign (string): vertical alignment of level labels.

    • vertTextAlign (string): vertical alignment of label text.

Return Value

  • string — The unique id of the extension drawing.

Example

This script plots a green Fibonacci Trend Extension every 30 candles. We take three clear swing points to define it:

This will draw green extension levels above the original swing, often landing around 161.8%, 261.8%, etc.

Result

circle-info

Tips

  • Use it for profit targets in trending markets.

  • Combine with retracements — retracement gives entry zones, extension gives exit zones.

  • The 161.8% level is a favorite among traders as a strong target.

triangle-exclamation

Warning

circle-check

Good Practice

Last updated