Indicator · Pine Script v6 · On the chart

Chart Patterns [ActiveQuants]

by MarcosACH· code credited to ActiveQuants

This indicator detects classic price structure on the chart by finding swing pivot highs and lows over a user-defined period.

View on GitHub

GitHub stars5on the repository
Pine versionv6current
Lines of code369
Settings16inputs
LicenceNone statedfile: MPL-2.0
Last update1 year ago8 Jul 2025

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

369 lines of Pine Script v6 from chart_patterns.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

chart_patterns.pinescript
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ActiveQuants
// Created by ActiveQuants
// Last updated: May 8, 2025

//@version=6
indicator(title = "Chart Patterns [ActiveQuants]", overlay = true, max_bars_back = 500, max_lines_count = 500, max_labels_count = 500)

//#region ------ USER INPUTS
// Visibility and Common Styling
int showLast = input.int(defval = 3000, title = "Show Last History (Bars)", minval = 10, step = 10, tooltip = "Number of bars back the indicator can plot.", group = "visibility and common styling", confirm = true)
string patternsVisibility = input.string(defval = "All", title = "Patterns", options = ["All", "Active", "Confirmed", "Invalid"], group = "visibility and common styling")
int patternLineWidth = input.int(defval = 1, title = "Pattern Line Width", minval = 1, maxval = 10, group = "visibility and common styling")
color bearishColor = input.color(defval = color.red, title = "Bearish Color", group = "visibility and common styling")
color bullishColor = input.color(defval = color.green, title = "Bullish Color", group = "visibility and common styling")

// Pivot Points
int period = input.int(defval = 10, title = "Period", minval = 2, group = "pivot points")
bool showPivotHighs = input.bool(defval = true, title = "Show Pivot Highs", group = "pivot points")
bool showPivotLows = input.bool(defval = true, title = "Show Pivot Lows", group = "pivot points")
color pivotHighColor = input.color(defval = #ff5252, title = "Pivot Highs Color", inline = "pivots color", group = "pivot points")
color pivotLowColor = input.color(defval = #089981, title = "Pivot Lows Color", inline = "pivots color", group = "pivot points")

// Patterns
bool showLowerLow = input.bool(defval = true, title = "Lower Low", group = "patterns")
bool showLowerLowLowerHigh = input.bool(defval = true, title = "Lower Low & Lower High", group = "patterns")
bool showHigherHigh = input.bool(defval = true, title = "Higher High", group = "patterns")
bool showHigherHighHigherLow = input.bool(defval = true, title = "Higher High & Higher Low", group = "patterns")
bool showDoubleTops = input.bool(defval = true, title = "Double Tops", group = "patterns")
bool showDoubleBottoms = input.bool(defval = true, title = "Double Bottoms", group = "patterns")
//#endregion

//#region ------ USER-DEFINED TYPES
type PatternInfo
    string patternType
    string status
    int breakBarIdx

    int p1Idx
    int p2Idx
    int p3Idx
    int p4Idx
    int p5Idx
    int p6Idx
    float p1Price
    float p2Price
    float p3Price
    float p4Price
    float p5Price
    float p6Price

    float supportSlope
    float resistanceSlope

    array<line> connectingLines
    int firstConnectingLineBreakIdx
    int lastConnectingLineBreakIdx
    line supportLine
    line resistanceLine
    int supportLineBreakIdx
    int resistanceLineBreakIdx
    linefill patternFill

    label mainLabel
    label label1
    label label2
    label label3
//#endregion

//#region ----- FUNCTIONS
// @function Gets pivot points and updates global price/index arrays.
// @param period (int) The number of bars back to check.
// @returns "ph", "phx", "pl", "plx", "newPivotDetected"
getPivotPoints(int period, array<float> pivotsPrices, array<int> pivotsBarIndices) =>
    var int lastPivot = 1
    var int phx = na
    var int plx = na

    float upper = ta.highest(period)
    float lower = ta.lowest(period)

    lastPivot := high[period] > upper ? 1 : low[period] < lower ? -1 : lastPivot[1]

    float ph = lastPivot == 1 and lastPivot[1] != 1 ? high[period] : na
    phx := lastPivot == 1 and lastPivot[1] != 1 ? bar_index[period] : phx

    float pl = lastPivot == -1 and lastPivot[1] != -1 ? low[period] : na
    plx := lastPivot == -1 and lastPivot[1] != -1 ? bar_index[period] : plx

    bool newPivotDetected = false

    if not na(ph)
        array.push(pivotsPrices, ph)
        array.push(pivotsBarIndices, phx)
        newPivotDetected := true
    if not na(pl)
        array.push(pivotsPrices, pl)
        array.push(pivotsBarIndices, plx)
        newPivotDetected := true

    [ph, phx, pl, plx, newPivotDetected]

getPivotsSlope(float p1Price, float p2Price, int p1Index, int p2Index) =>
    if na(p1Price) or na(p2Price) or p1Index == p2Index
        na
    else
        (p2Price - p1Price) / (p2Index - p1Index)

method deletePattern(PatternInfo pattern) =>
    if not na(pattern.connectingLines)
        for lineId in pattern.connectingLines
            lineId.delete()
        pattern.connectingLines.clear()
    pattern.supportLine.delete()
    pattern.resistanceLine.delete()
    pattern.mainLabel.delete()
    pattern.label1.delete()
    pattern.label2.delete()
    pattern.label3.delete()

method updatePattern(PatternInfo pattern) =>
    if (pattern.patternType == "Double Top" and close < pattern.p5Price) or (pattern.patternType == "Double Bottom" and close > pattern.p5Price)
        pattern.lastConnectingLineBreakIdx := bar_index
        pattern.status := "Confirmed"
        pattern.mainLabel.set_x(pattern.lastConnectingLineBreakIdx)
        if not na(pattern.connectingLines) and pattern.connectingLines.size() >= 2
            pattern.connectingLines.get(-2).set_x2(pattern.lastConnectingLineBreakIdx)
            pattern.connectingLines.get(-1).set_x2(pattern.lastConnectingLineBreakIdx)

    else if pattern.patternType == "Double Top" or pattern.patternType == "Double Bottom"
        pattern.mainLabel.set_x(bar_index)
        if not na(pattern.connectingLines) and pattern.connectingLines.size() >= 2
            pattern.connectingLines.get(-2).set_x2(bar_index)
            pattern.connectingLines.get(-1).set_x2(bar_index)

lowerLow(float p1, float p2, float p3, float p4, float p5) =>
    p1 < p2 and p1 < p3 and
     p2 > p3 and p2 < p4 and
     p3 < p4 and
     p4 > p5 and
     p5 < p3

lowerLowLowerHigh(float p1, float p2, float p3, float p4, float p5, float p6) =>
    p1 < p2 and p1 < p3 and
     p2 > p3 and p2 < p4 and
     p3 < p4 and
     p4 > p5 and p4 > p6 and
     p5 < p3 and p5 < p6

higherHigh(float p1, float p2, float p3, float p4, float p5) =>
    p1 > p2 and p1 > p3 and
     p2 < p3 and p2 > p4 and
     p3 > p4 and
     p4 < p5 and
     p5 > p3

higherHighHigherLow(float p1, float p2, float p3, float p4, float p5, float p6) =>
    p1 > p2 and p1 > p3 and
     p2 < p3 and p2 > p4 and
     p3 > p4 and
     p4 < p5 and p4 < p6 and
     p5 > p3 and p5 > p6

doubleTop(float p2, float p3, float p4, int p1Idx, int p4Idx, float atr) =>
    close[bar_index - p1Idx] < p3 and p2 > p3 and p4 > p3 and math.abs(p2 - p4) <= atr[bar_index - p4Idx]/6

doubleBottom(float p2, float p3, float p4, int p1Idx, int p4Idx, float atr) =>
    close[bar_index - p1Idx] > p3 and p2 < p3 and p4 < p3 and math.abs(p2 - p4) <= atr[bar_index - p4Idx]/6
//#endregion

//#region ------ CALCULATIONS
var array<float> pivotsPrices = array.new<float>()
var array<int> pivotsBarIndices = array.new<int>()
var array<PatternInfo> activePatterns = array.new<PatternInfo>()

[ph, phx, pl, plx, newPivotDetected] = getPivotPoints(period, pivotsPrices, pivotsBarIndices)
float atr = ta.atr(14)

if array.size(pivotsPrices) >= 6 and newPivotDetected and barstate.isconfirmed
    i1 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 6)
    i2 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 5)
    i3 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 4)
    i4 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 3)
    i5 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 2)
    i6 = array.get(pivotsBarIndices, array.size(pivotsBarIndices) - 1)

    p1 = array.get(pivotsPrices, array.size(pivotsPrices) - 6)
    p2 = array.get(pivotsPrices, array.size(pivotsPrices) - 5)
    p3 = array.get(pivotsPrices, array.size(pivotsPrices) - 4)
    p4 = array.get(pivotsPrices, array.size(pivotsPrices) - 3)
    p5 = array.get(pivotsPrices, array.size(pivotsPrices) - 2)
    p6 = array.get(pivotsPrices, array.size(pivotsPrices) - 1)

    if lowerLow(p2, p3, p4, p5, p6) and showLowerLow
        PatternInfo newPattern = PatternInfo.new(
             patternType = "LL",
             status = "Confirmed",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             mainLabel = label.new(i6, close, "LL", yloc = yloc.belowbar, color = bearishColor, style = label.style_label_up, size = size.small, tooltip = "Lower Low")

         )
        newPattern.connectingLines.push(line.new(newPattern.p2Idx, newPattern.p2Price, newPattern.p3Idx, newPattern.p3Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bearishColor, width = patternLineWidth))
        activePatterns.push(newPattern)
    
    if lowerLowLowerHigh(p1, p2, p3, p4, p5, p6) and showLowerLowLowerHigh
        PatternInfo newPattern = PatternInfo.new(
             patternType = "LL & LH",
             status = "Confirmed",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             mainLabel = label.new(i6, close, "LL & LH", yloc = yloc.abovebar, color = bearishColor, style = label.style_label_down, size = size.small, tooltip = "Lower Low & Lower High")

         )
        newPattern.connectingLines.push(line.new(newPattern.p1Idx, newPattern.p1Price, newPattern.p2Idx, newPattern.p2Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p2Idx, newPattern.p2Price, newPattern.p3Idx, newPattern.p3Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bearishColor, width = patternLineWidth))
        activePatterns.push(newPattern)

    if higherHigh(p2, p3, p4, p5, p6) and showHigherHigh
        PatternInfo newPattern = PatternInfo.new(
             patternType = "HH",
             status = "Confirmed",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             mainLabel = label.new(i6, close, "HH", yloc = yloc.abovebar, color = bullishColor, style = label.style_label_down, size = size.small, tooltip = "Higher High")

         )
        newPattern.connectingLines.push(line.new(newPattern.p2Idx, newPattern.p2Price, newPattern.p3Idx, newPattern.p3Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bullishColor, width = patternLineWidth))
        activePatterns.push(newPattern)

    if higherHighHigherLow(p1, p2, p3, p4, p5, p6) and showHigherHighHigherLow
        PatternInfo newPattern = PatternInfo.new(
             patternType = "HH & HL",
             status = "Confirmed",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             mainLabel = label.new(i6, close, "HH & HL", yloc = yloc.belowbar, color = bullishColor, style = label.style_label_up, size = size.small, tooltip = "Higher High & Higher Low")

         )
        newPattern.connectingLines.push(line.new(newPattern.p1Idx, newPattern.p1Price, newPattern.p2Idx, newPattern.p2Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p2Idx, newPattern.p2Price, newPattern.p3Idx, newPattern.p3Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bullishColor, width = patternLineWidth))
        activePatterns.push(newPattern)

    if doubleTop(p4, p5, p6, i3, i6, atr) and showDoubleTops
        PatternInfo newPattern = PatternInfo.new(
             patternType = "Double Top",
             status = "Active",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             label1 = label.new(i4, close, "Top 1", yloc = yloc.abovebar, color = bearishColor, style = label.style_label_down, size = size.small),
             label2 = label.new(i6, close, "Top 2", yloc = yloc.abovebar, color = bearishColor, style = label.style_label_down, size = size.small)
         )

        for i=newPattern.p3Idx to newPattern.p4Idx
            if getPivotsSlope(newPattern.p3Price, newPattern.p4Price, newPattern.p3Idx, newPattern.p4Idx) * (i - newPattern.p3Idx) + newPattern.p3Price >= newPattern.p5Price
                newPattern.firstConnectingLineBreakIdx := i
                break

        for i=newPattern.p6Idx to bar_index
            int x = bar_index - i
            if close[x] < newPattern.p5Price
                newPattern.lastConnectingLineBreakIdx := i
                newPattern.status := "Confirmed"
                break

        newPattern.mainLabel := label.new(na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, close, "Double Top", yloc = yloc.abovebar, color = bearishColor, style = label.style_label_down, size = size.small)
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p6Idx, newPattern.p6Price, na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, newPattern.p5Price, color = bearishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(na(newPattern.firstConnectingLineBreakIdx) ? bar_index : newPattern.firstConnectingLineBreakIdx, newPattern.p5Price, na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, newPattern.p5Price, color = bearishColor, style = line.style_dotted, width = patternLineWidth + 1))
        activePatterns.push(newPattern)

    if doubleBottom(p4, p5, p6, i3, i6, atr) and showDoubleBottoms
        PatternInfo newPattern = PatternInfo.new(
             patternType = "Double Bottom",
             status = "Active",
             p1Idx = i1, p1Price = p1,
             p2Idx = i2, p2Price = p2,
             p3Idx = i3, p3Price = p3,
             p4Idx = i4, p4Price = p4,
             p5Idx = i5, p5Price = p5,
             p6Idx = i6, p6Price = p6,
             connectingLines = array.new_line(),
             label1 = label.new(i4, close, "Bottom 1", yloc = yloc.belowbar, color = bullishColor, style = label.style_label_up, size = size.small),
             label2 = label.new(i6, close, "Bottom 2", yloc = yloc.belowbar, color = bullishColor, style = label.style_label_up, size = size.small)
         )

        for i=newPattern.p3Idx to newPattern.p4Idx
            if getPivotsSlope(newPattern.p3Price, newPattern.p4Price, newPattern.p3Idx, newPattern.p4Idx) * (i - newPattern.p3Idx) + newPattern.p3Price <= newPattern.p5Price
                newPattern.firstConnectingLineBreakIdx := i
                break

        for i=newPattern.p6Idx to bar_index
            int x = bar_index - i
            if close[x] > newPattern.p5Price
                newPattern.lastConnectingLineBreakIdx := i
                newPattern.status := "Confirmed"
                break

        newPattern.mainLabel := label.new(na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, close, "Double Bottom", yloc = yloc.belowbar, color = bullishColor, style = label.style_label_up, size = size.small)
        newPattern.connectingLines.push(line.new(newPattern.p3Idx, newPattern.p3Price, newPattern.p4Idx, newPattern.p4Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p4Idx, newPattern.p4Price, newPattern.p5Idx, newPattern.p5Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p5Idx, newPattern.p5Price, newPattern.p6Idx, newPattern.p6Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(newPattern.p6Idx, newPattern.p6Price, na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, newPattern.p5Price, color = bullishColor, width = patternLineWidth))
        newPattern.connectingLines.push(line.new(na(newPattern.firstConnectingLineBreakIdx) ? bar_index : newPattern.firstConnectingLineBreakIdx, newPattern.p5Price, na(newPattern.lastConnectingLineBreakIdx) ? bar_index : newPattern.lastConnectingLineBreakIdx, newPattern.p5Price, color = bullishColor, style = line.style_dotted, width = patternLineWidth + 1))
        activePatterns.push(newPattern)
//#endregion

//#region ------ PLOTTING
plot(showPivotHighs ? ph : na, "Swing High", color.new(pivotHighColor, 50), 5, plot.style_circles, offset = -period, show_last = showLast)
plot(showPivotLows ? pl : na, "Swing Low", color.new(pivotLowColor, 50), 5, plot.style_circles, offset = -period, show_last = showLast)

for pattern in activePatterns
    if pattern.status == "Active"
        pattern.updatePattern()

    if newPivotDetected and pattern.p6Idx < bar_index - period and pattern.status == "Active"
        if (low[period] >= pattern.p5Price and pattern.patternType == "Double Top") or (low[period] <= pattern.p5Price and pattern.patternType == "Double Bottom")
            pattern.status := "Invalid"
            pattern.mainLabel.set_x(bar_index - period), pattern.mainLabel.set_text("Invalid " + pattern.mainLabel.get_text()), pattern.mainLabel.set_tooltip("This pivot was created before the " + pattern.patternType + " neckline breakout!")
            if pattern.connectingLines.size() >= 2
                pattern.connectingLines.get(-2).set_x2(bar_index - period)
                pattern.connectingLines.get(-1).set_x2(bar_index - period)

    if pattern.p1Idx < bar_index - showLast
        pattern.deletePattern()

    if barstate.islastconfirmedhistory and 
         ((patternsVisibility == "Active" and pattern.status != "Active") or (patternsVisibility == "Confirmed" and pattern.status != "Confirmed") or (patternsVisibility == "Invalid" and pattern.status != "Invalid"))
        pattern.deletePattern()
//#endregion

Overview

Chart Patterns [ActiveQuants] draws connecting lines and labels for lower lows, lower lows with lower highs, higher highs, and higher highs with higher lows, plus double tops and double bottoms. Double-top and double-bottom formations are marked Active while developing, Confirmed after a close beyond the neckline, or Invalid if a later pivot breaks the structure. Users can filter which pattern types and statuses appear, set line width and colors, and limit how far back drawings are plotted. It does not place trades.

Details

Published by

MarcosACH on GitHub

Code credit

ActiveQuants, as written in the script's header

Draws

On the price chart

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.

Topics

pinescriptpinescript-algorithmspinescript-indicatorstechnical-analysistechnical-analysis-indicatorstrading-algorithmstrading-indicatorstradingvewtradingview

Settings

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

SettingTypeDefaultVariable
Show Last History (Bars)int3000showLast
PatternsstringAllpatternsVisibility
Pattern Line Widthint1patternLineWidth
Bearish Colorcolorcolor.redbearishColor
Bullish Colorcolorcolor.greenbullishColor
Periodint10period
Show Pivot HighsbooltrueshowPivotHighs
Show Pivot LowsbooltrueshowPivotLows
Pivot Highs Colorcolor#ff5252pivotHighColor
Pivot Lows Colorcolor#089981pivotLowColor
Lower LowbooltrueshowLowerLow
Lower Low & Lower HighbooltrueshowLowerLowLowerHigh
Show all 16 settings
SettingTypeDefaultVariable
Higher HighbooltrueshowHigherHigh
Higher High & Higher LowbooltrueshowHigherHighHigherLow
Double TopsbooltrueshowDoubleTops
Double BottomsbooltrueshowDoubleBottoms
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

Sideway Zones Live

by dearvn
257 stars

Sideway Zones Live is an overlay indicator that estimates inner and outer sideways bands from recent highs and lows with a rational quadratic kernel. It tracks swing pivots over a loopback period and counts bars that remain between the outer high and low. Afte

Indicator v5 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Sideway Zones Live
56 stars

This indicator calculates dynamic upper and lower trendlines from pivot highs and pivot lows across a specified bar length. Trendline slopes are derived using ATR, standard deviation, or linear regression methods. It plots trendlines and breakout signal labels

Indicator v5 TrendSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of Trendlines With Breaks [LUX]

Reversal Breakout System

by TamaraKGreen
46 stars

This indicator detects inside candles inside larger parent candles on the price chart. It plots colored boxes around inside and parent candles, fills them with user-adjustable transparency, draws Fibonacci retracement lines and mother candle range lines, and d

Indicator v6 Candlestick patternsBreakout
Updated 8 weeks ago · None stated GitHub repository of Reversal Breakout System
24 stars

This indicator maps Smart Money Concepts (SMC) market structure directly onto the price chart. It detects internal and swing structure breaks (BOS and CHoCH), tracks bullish and bearish order blocks, identifies fair value gaps (FVG), highlights equal highs and

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 12 days ago · Custom licence GitHub repository of Smart Money Concepts [LuxAlgo] Test B

The Market Tradability Engine calculates multi-factor tradability, balance, compression, and direction scores to evaluate market regime quality. It classifies market conditions into eight distinct states, including Balance, Compression, Ready, Breakout, Trend,

Indicator v6 TrendVolatility & bands
Updated 3 days ago · MIT GitHub repository of Market Tradability Engine [WavesUnchained]

This indicator tracks swing highs and swing lows to generate trend-following trailing stop levels on the price chart. When the closing price breaks above the previous swing high, the system establishes a bullish state using the recent swing low as a trailing s

Indicator v4 TrendBreakout
Updated 4 years ago · None stated GitHub repository of Accurate Swing Trading System

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers