Indicator · Pine Script v5 · On the chart

Regression Trend with Fibonacci

by suyons· code credited to syoungs

This indicator plots a linear regression channel on the price chart.

View on GitHub

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code257
Settings24inputs
LicenceNone statedfile: MPL-2.0
Last update4 months ago21 Jun 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

257 lines of Pine Script v5 from channel/01-regression-trend-with-fibonacci.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

01-regression-trend-with-fibonacci.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © syoungs

//@version=5
indicator("Regression Trend with Fibonacci", overlay = true)

group1 = "Linear Regression"
sourceInput = input.source(close, "", inline="1", group=group1)
lengthInput = input.int(200, "", 2, 500, 1, inline="1", group=group1)

useUpperDevInput = input.bool(true, title="Upper", inline = "2", group = group1)
upperMultInput = input.float(2.0, title="", inline = "2", group = group1)
useLowerDevInput = input.bool(true, title="Lower", inline = "2", group = group1)
lowerMultInput = input.float(2.0, title="", inline = "2", group = group1)

group2 = "Display Settings"
showPearsonInput = input.bool(true, "Pearson's R", inline = "1", group = group2)
showPearsonColor = input.color(color.yellow, "", inline = "1", group = group2)
extendLeftInput = input.bool(false, "Extend Left", inline = "1", group = group2)
extendRightInput = input.bool(false, "Extend Right", inline = "1", group = group2)
extendStyle = switch
    extendLeftInput and extendRightInput => extend.both
    extendLeftInput => extend.left
    extendRightInput => extend.right
    => extend.none

group3 = "Color Settings"
colorUpper = input.color(color.white, "Upper", inline = "1", group = group3)
colorBase = input.color(color.white, "Base", inline = "1", group = group3)
colorLower = input.color(color.white, "Lower", inline = "1", group = group3)

calcSlope(source, length) =>
    max_bars_back(source, 5000)
    if not barstate.islast or length <= 1
        [float(na), float(na), float(na)]
    else
        sumX = 0.0
        sumY = 0.0
        sumXSqr = 0.0
        sumXY = 0.0
        for i = 0 to length - 1 by 1
            val = source[i]
            per = i + 1.0
            sumX += per
            sumY += val
            sumXSqr += per * per
            sumXY += val * per
        slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX)
        average = sumY / length
        intercept = average - slope * sumX / length + slope
        [slope, average, intercept]
        
[s, a, i] = calcSlope(sourceInput, lengthInput)
startPrice = i + s * (lengthInput - 1)
endPrice = i
var line baseLine = na
if na(baseLine) and not na(startPrice)
    baseLine := line.new(bar_index - lengthInput + 1, startPrice, bar_index, endPrice, width=1, extend=extendStyle, color=colorBase, style=line.style_dashed)
else
    line.set_xy1(baseLine, bar_index - lengthInput + 1, startPrice)
    line.set_xy2(baseLine, bar_index, endPrice)
    na
uptrend = startPrice <= endPrice

calcDev(source, length, slope, average, intercept) =>
    upDev = 0.0
    dnDev = 0.0
    stdDevAcc = 0.0
    dsxx = 0.0
    dsyy = 0.0
    dsxy = 0.0
    periods = length - 1
    daY = intercept + slope * periods / 2
    val = intercept
    for j = 0 to periods by 1
        price = high[j] - val
        if price > upDev
            upDev := price
        price := val - low[j]
        if price > dnDev
            dnDev := price
        price := source[j]
        dxt = price - average
        dyt = val - daY
        price -= val
        stdDevAcc += price * price
        dsxx += dxt * dxt
        dsyy += dyt * dyt
        dsxy += dxt * dyt
        val += slope
    stdDev = math.sqrt(stdDevAcc / (periods == 0 ? 1 : periods))
    pearsonR = dsxx == 0 or dsyy == 0 ? 0 : dsxy / math.sqrt(dsxx * dsyy)
    [stdDev, pearsonR, upDev, dnDev]
    
[stdDev, pearsonR, upDev, dnDev] = calcDev(sourceInput, lengthInput, s, a, i)
upperStartPrice = startPrice + (useUpperDevInput ? upperMultInput * stdDev : upDev)
upperEndPrice = endPrice + (useUpperDevInput ? upperMultInput * stdDev : upDev)
var line upper = na
lowerStartPrice = startPrice + (useLowerDevInput ? -lowerMultInput * stdDev : -dnDev)
lowerEndPrice = endPrice + (useLowerDevInput ? -lowerMultInput * stdDev : -dnDev)
var line lower = na
if na(upper) and not na(upperStartPrice)
    upper := line.new(bar_index - lengthInput + 1, upperStartPrice, bar_index, upperEndPrice, width=1, extend=extendStyle, color=colorUpper)
else
    line.set_xy1(upper, bar_index - lengthInput + 1, upperStartPrice)
    line.set_xy2(upper, bar_index, upperEndPrice)
    na
if na(lower) and not na(lowerStartPrice)
    lower := line.new(bar_index - lengthInput + 1, lowerStartPrice, bar_index, lowerEndPrice, width=1, extend=extendStyle, color=colorLower)
else
    line.set_xy1(lower, bar_index - lengthInput + 1, lowerStartPrice)
    line.set_xy2(lower, bar_index, lowerEndPrice)
    na

channel_width = upperStartPrice - lowerStartPrice

// Pearson's R
var label r = na
label.delete(r[1])
if showPearsonInput and not na(pearsonR)
    r := label.new(bar_index - lengthInput + 1, uptrend ? lowerStartPrice : upperStartPrice, str.tostring(pearsonR, "R #.##"), color = color.new(color.white, 100), textcolor=showPearsonColor, size=size.normal, style=label.style_none)

// Fibonacci Ratio
group4 = "Fibonacci IN"
fib_in_1 = input.float(0.786, "1", minval=0.001, maxval = 0.999, step=0.001, inline="1", group=group4)
// fib_in_1_p = plot(lower+fib_in_1*dev*2, "IN1", #787b86)
fib_in_2 = input.float(0.618, "2", minval=0.001, maxval = 0.999, step=0.001, inline="1", group=group4)
// fib_in_2_p = plot(lower+fib_in_2*dev*2, "IN2", #787b86)
fib_in_3 = input.float(0.382, "3", minval=0.001, maxval = 0.999, step=0.001, inline="2", group=group4)
// fib_in_3_p = plot(lower+fib_in_3*dev*2, "IN3", #787b86)
fib_in_4 = input.float(0.236, "4", minval=0.001, maxval = 0.999, step=0.001, inline="2", group=group4)
// fib_in_4_p = plot(lower+fib_in_4*dev*2, "IN4", #787b86)

group5 = "Fibonacci EX"
fib_ex_1 = input.float(1.272, "1", minval=-9.999, maxval = 9.999, step=0.001, inline="1", group=group5)
// fib_ex_1_p = plot(lower+fib_ex_1*dev*2, "EX1", #f23645)
fib_ex_2 = input.float(-0.272, "2", minval=-9.999, maxval = 9.999, step=0.001, inline="1", group=group5)
// fib_ex_2_p = plot(lower+fib_ex_2*dev*2, "EX2", #ff9800)
fib_ex_3 = input.float(1.618, "3", minval=-9.999, maxval = 9.999, step=0.001, inline="2", group=group5)
// fib_ex_3_p = plot(lower+fib_ex_3*dev*2, "EX3", #ff9800)
fib_ex_4 = input.float(-0.618, "4", minval=-9.999, maxval = 9.999, step=0.001, inline="2", group=group5)
// fib_ex_4_p = plot(lower+fib_ex_4*dev*2, "EX4", #f23645)

group6 = "Fibonacci Color"
in_color = input.color(#787b86, "IN", inline="1", group=group6)
ex12_color = input.color(#ff9800, "EX1-2", inline="1", group=group6)
ex34_color = input.color(#f23645, "EX3-4", inline="1", group=group6)

var line fib_in_1_line = na
var label fib_in_1_label = na
var line fib_in_2_line = na
var label fib_in_2_label = na
var line fib_in_3_line = na
var label fib_in_3_label = na
var line fib_in_4_line = na
var label fib_in_4_label = na

var line fib_ex_1_line = na
var label fib_ex_1_label = na
var line fib_ex_2_line = na
var label fib_ex_2_label = na
var line fib_ex_3_line = na
var label fib_ex_3_label = na
var line fib_ex_4_line = na
var label fib_ex_4_label = na

if na(fib_in_1_line) and not na(startPrice)
    if uptrend
        fib_in_1_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_1 * channel_width, bar_index, lowerEndPrice + fib_in_1 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_1_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_1 * channel_width, text=str.tostring(fib_in_1, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_2_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_2 * channel_width, bar_index, lowerEndPrice + fib_in_2 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_2_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_2 * channel_width, text=str.tostring(fib_in_2, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_3_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_3 * channel_width, bar_index, lowerEndPrice + fib_in_3 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_3_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_3 * channel_width, text=str.tostring(fib_in_3, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_4_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_4 * channel_width, bar_index, lowerEndPrice + fib_in_4 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_4_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_in_4 * channel_width, text=str.tostring(fib_in_4, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        
        fib_ex_1_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_1 * channel_width, bar_index, lowerEndPrice + fib_ex_1 * channel_width, extend=extendStyle, color=ex12_color, style=line.style_dashed, width=1)
        fib_ex_1_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_1 * channel_width, text=str.tostring(fib_ex_1, "#.###"), style=label.style_none, textcolor = ex12_color, textalign = text.align_center)
        fib_ex_2_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_2 * channel_width, bar_index, lowerEndPrice + fib_ex_2 * channel_width, extend=extendStyle, color=ex12_color, style=line.style_dashed, width=1)
        fib_ex_2_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_2 * channel_width, text=str.tostring(fib_ex_2, "#.###"), style=label.style_none, textcolor = ex12_color, textalign = text.align_center)
        fib_ex_3_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_3 * channel_width, bar_index, lowerEndPrice + fib_ex_3 * channel_width, extend=extendStyle, color=ex34_color, style=line.style_dashed, width=1)
        fib_ex_3_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_3 * channel_width, text=str.tostring(fib_ex_3, "#.###"), style=label.style_none, textcolor = ex34_color, textalign = text.align_center)
        fib_ex_4_line := line.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_4 * channel_width, bar_index, lowerEndPrice + fib_ex_4 * channel_width, extend=extendStyle, color=ex34_color, style=line.style_dashed, width=1)
        fib_ex_4_label := label.new(bar_index - lengthInput + 1, lowerStartPrice + fib_ex_4 * channel_width, text=str.tostring(fib_ex_4, "#.###"), style=label.style_none, textcolor = ex34_color, textalign = text.align_center)
    else
        fib_in_1_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_1 * channel_width, bar_index, upperEndPrice - fib_in_1 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_1_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_1 * channel_width, text=str.tostring(fib_in_1, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_2_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_2 * channel_width, bar_index, upperEndPrice - fib_in_2 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_2_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_2 * channel_width, text=str.tostring(fib_in_2, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_3_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_3 * channel_width, bar_index, upperEndPrice - fib_in_3 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_3_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_3 * channel_width, text=str.tostring(fib_in_3, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)
        fib_in_4_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_4 * channel_width, bar_index, upperEndPrice - fib_in_4 * channel_width, extend=extendStyle, color=in_color, style=line.style_dashed, width=1)
        fib_in_4_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_in_4 * channel_width, text=str.tostring(fib_in_4, "#.###"), style=label.style_none, textcolor = in_color, textalign = text.align_center)

        fib_ex_1_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_1 * channel_width, bar_index, upperEndPrice - fib_ex_1 * channel_width, extend=extendStyle, color=ex12_color, style=line.style_dashed, width=1)
        fib_ex_1_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_1 * channel_width, text=str.tostring(fib_ex_1, "#.###"), style=label.style_none, textcolor = ex12_color, textalign = text.align_center)
        fib_ex_2_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_2 * channel_width, bar_index, upperEndPrice - fib_ex_2 * channel_width, extend=extendStyle, color=ex12_color, style=line.style_dashed, width=1)
        fib_ex_2_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_2 * channel_width, text=str.tostring(fib_ex_2, "#.###"), style=label.style_none, textcolor = ex12_color, textalign = text.align_center)
        fib_ex_3_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_3 * channel_width, bar_index, upperEndPrice - fib_ex_3 * channel_width, extend=extendStyle, color=ex34_color, style=line.style_dashed, width=1)
        fib_ex_3_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_3 * channel_width, text=str.tostring(fib_ex_3, "#.###"), style=label.style_none, textcolor = ex34_color, textalign = text.align_center)
        fib_ex_4_line := line.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_4 * channel_width, bar_index, upperEndPrice - fib_ex_4 * channel_width, extend=extendStyle, color=ex34_color, style=line.style_dashed, width=1)
        fib_ex_4_label := label.new(bar_index - lengthInput + 1, upperStartPrice - fib_ex_4 * channel_width, text=str.tostring(fib_ex_4, "#.###"), style=label.style_none, textcolor = ex34_color, textalign = text.align_center)
else
    if uptrend
        line.set_xy1(fib_in_1_line, bar_index - lengthInput + 1, lowerStartPrice + fib_in_1 * channel_width)
        line.set_xy2(fib_in_1_line, bar_index, lowerEndPrice + fib_in_1 * channel_width)
        label.set_xy(fib_in_1_label, bar_index - lengthInput + 1, lowerStartPrice + fib_in_1 * channel_width)
        line.set_xy1(fib_in_2_line, bar_index - lengthInput + 1, lowerStartPrice + fib_in_2 * channel_width)
        line.set_xy2(fib_in_2_line, bar_index, lowerEndPrice + fib_in_2 * channel_width)
        label.set_xy(fib_in_2_label, bar_index - lengthInput + 1, lowerStartPrice + fib_in_2 * channel_width)
        line.set_xy1(fib_in_3_line, bar_index - lengthInput + 1, lowerStartPrice + fib_in_3 * channel_width)
        line.set_xy2(fib_in_3_line, bar_index, lowerEndPrice + fib_in_3 * channel_width)
        label.set_xy(fib_in_3_label, bar_index - lengthInput + 1, lowerStartPrice + fib_in_3 * channel_width)
        line.set_xy1(fib_in_4_line, bar_index - lengthInput + 1, lowerStartPrice + fib_in_4 * channel_width)
        line.set_xy2(fib_in_4_line, bar_index, lowerEndPrice + fib_in_4 * channel_width)
        label.set_xy(fib_in_4_label, bar_index - lengthInput + 1, lowerStartPrice + fib_in_4 * channel_width)

        line.set_xy1(fib_ex_1_line, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_1 * channel_width)
        line.set_xy2(fib_ex_1_line, bar_index, lowerEndPrice + fib_ex_1 * channel_width)
        label.set_xy(fib_ex_1_label, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_1 * channel_width)
        line.set_xy1(fib_ex_2_line, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_2 * channel_width)
        line.set_xy2(fib_ex_2_line, bar_index, lowerEndPrice + fib_ex_2 * channel_width)
        label.set_xy(fib_ex_2_label, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_2 * channel_width)
        line.set_xy1(fib_ex_3_line, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_3 * channel_width)
        line.set_xy2(fib_ex_3_line, bar_index, lowerEndPrice + fib_ex_3 * channel_width)
        label.set_xy(fib_ex_3_label, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_3 * channel_width)
        line.set_xy1(fib_ex_4_line, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_4 * channel_width)
        line.set_xy2(fib_ex_4_line, bar_index, lowerEndPrice + fib_ex_4 * channel_width)
        label.set_xy(fib_ex_4_label, bar_index - lengthInput + 1, lowerStartPrice + fib_ex_4 * channel_width)

    else
        line.set_xy1(fib_in_1_line, bar_index - lengthInput + 1, upperStartPrice - fib_in_1 * channel_width)
        line.set_xy2(fib_in_1_line, bar_index, upperEndPrice - fib_in_1 * channel_width)
        label.set_xy(fib_in_1_label, bar_index - lengthInput + 1, upperStartPrice - fib_in_1 * channel_width)
        line.set_xy1(fib_in_2_line, bar_index - lengthInput + 1, upperStartPrice - fib_in_2 * channel_width)
        line.set_xy2(fib_in_2_line, bar_index, upperEndPrice - fib_in_2 * channel_width)
        label.set_xy(fib_in_2_label, bar_index - lengthInput + 1, upperStartPrice - fib_in_2 * channel_width)
        line.set_xy1(fib_in_3_line, bar_index - lengthInput + 1, upperStartPrice - fib_in_3 * channel_width)
        line.set_xy2(fib_in_3_line, bar_index, upperEndPrice - fib_in_3 * channel_width)
        label.set_xy(fib_in_3_label, bar_index - lengthInput + 1, upperStartPrice - fib_in_3 * channel_width)
        line.set_xy1(fib_in_4_line, bar_index - lengthInput + 1, upperStartPrice - fib_in_4 * channel_width)
        line.set_xy2(fib_in_4_line, bar_index, upperEndPrice - fib_in_4 * channel_width)
        label.set_xy(fib_in_4_label, bar_index - lengthInput + 1, upperStartPrice - fib_in_4 * channel_width)

        line.set_xy1(fib_ex_1_line, bar_index - lengthInput + 1, upperStartPrice - fib_ex_1 * channel_width)
        line.set_xy2(fib_ex_1_line, bar_index, upperEndPrice - fib_ex_1 * channel_width)
        label.set_xy(fib_ex_1_label, bar_index - lengthInput + 1, upperStartPrice - fib_ex_1 * channel_width)
        line.set_xy1(fib_ex_2_line, bar_index - lengthInput + 1, upperStartPrice - fib_ex_2 * channel_width)
        line.set_xy2(fib_ex_2_line, bar_index, upperEndPrice - fib_ex_2 * channel_width)
        label.set_xy(fib_ex_2_label, bar_index - lengthInput + 1, upperStartPrice - fib_ex_2 * channel_width)
        line.set_xy1(fib_ex_3_line, bar_index - lengthInput + 1, upperStartPrice - fib_ex_3 * channel_width)
        line.set_xy2(fib_ex_3_line, bar_index, upperEndPrice - fib_ex_3 * channel_width)
        label.set_xy(fib_ex_3_label, bar_index - lengthInput + 1, upperStartPrice - fib_ex_3 * channel_width)
        line.set_xy1(fib_ex_4_line, bar_index - lengthInput + 1, upperStartPrice - fib_ex_4 * channel_width)
        line.set_xy2(fib_ex_4_line, bar_index, upperEndPrice - fib_ex_4 * channel_width)
        label.set_xy(fib_ex_4_label, bar_index - lengthInput + 1, upperStartPrice - fib_ex_4 * channel_width)

Overview

Regression Trend with Fibonacci fits a regression line to a chosen source over a lookback length, then draws the base line plus optional upper and lower deviation bands scaled by multipliers. Fibonacci ratios mark internal and extension levels around that channel. Settings change the source, length, band multipliers, Pearson's R visibility, line colors, and whether the lines extend left or right. It recalculates only on the last bar and does not issue trade entries or exits.

Details

Published by

suyons on GitHub

Code credit

syoungs, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
sourceInputsourceclosesourceInput
lengthInputint200lengthInput
UpperbooltrueuseUpperDevInput
upperMultInputfloat2.0upperMultInput
LowerbooltrueuseLowerDevInput
lowerMultInputfloat2.0lowerMultInput
Pearson's RbooltrueshowPearsonInput
showPearsonColorcolorcolor.yellowshowPearsonColor
Extend LeftboolfalseextendLeftInput
Extend RightboolfalseextendRightInput
Uppercolorcolor.whitecolorUpper
Basecolorcolor.whitecolorBase
Show all 24 settings
SettingTypeDefaultVariable
Lowercolorcolor.whitecolorLower
1float0.786fib_in_1
2float0.618fib_in_2
3float0.382fib_in_3
4float0.236fib_in_4
1float1.272fib_ex_1
2float-0.272fib_ex_2
3float1.618fib_ex_3
4float-0.618fib_ex_4
INcolor#787b86in_color
EX1-2color#ff9800ex12_color
EX3-4color#f23645ex34_color
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener

Function - Linear Regression

by ricardosantos79
261 stars

This indicator fits a linear regression through stored pivot highs and lows and draws the resulting channel on the price chart. A function returns predicted values, maximum and minimum deviations, and the average absolute deviation. Confirmed two-bar pivots up

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Function - Linear Regression

AI Trend

by dearvn
257 stars

AI Trend is an indicator that plots pivot points, trend lines, and support and resistance levels directly on the price chart. It marks high and low pivots based on user-defined length, draws trend lines that check for violations at specified points, and identi

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of AI Trend

Ichimoku Cloud

by harryguiacorn
219 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud
219 stars

This indicator identifies local swing highs and swing lows to construct a Zig Zag pattern on the main price chart. It evaluates pivot points based on a customizable number of surrounding left and right bars. Using persistent variables, the script tracks previo

Indicator v4 Support & resistanceTrend Repaints
Updated 5 years ago · None stated GitHub repository of Teaching: Finding Highs and Lows 6

Dynamic Linear Regression

by TradersPost
218 stars

Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Dynamic Linear Regression

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers