Indicator · Pine Script v5 · On the chart

Triangle Patterns

by atroopa

An indicator that draws sloping upper and lower trendlines from confirmed pivot highs and lows, forming triangle-style channels.

View on GitHub

Repaints

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code296
Settings40inputs
LicenceNone stated
Last update2 months ago4 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

The slope can be calculated with ATR, standard deviation or linear regression, scaled by a slope multiplier, and breakouts through the lines are flagged and available as alerts. A second part adds zigzag-style reversal lines with deviation and depth settings plus price and level labels. Pivots are confirmed late and plotted back in time, so drawings can change as new pivots form.

Details

Published by

atroopa on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Settings

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

SettingTypeDefaultVariable
lengthint14length
Slopefloat1.k
Slope Calculation MethodstringAtrmethod
Show Only Confirmed Breakoutsboolfalseshow
Deviationfloat3threshold_multiplier
Depthint10depth
Reverseboolfalsereverse
Extend Left    |    Extend RightboolfalseextendLeft
extendRightbooltrueextendRight
Show Pricesbooltrueprices
Show Levelsbooltruelevels
levelsFormatstringValueslevelsFormat
Show all 40 settings
SettingTypeDefaultVariable
Labels PositionstringLeftlabelsPosition
Background Transparencyint85backgroundTransparency
show_0booltrueshow_0
value_0int0value_0
color_0color#787b86color_0
show_0_236booltrueshow_0_236
value_0_236float0.236value_0_236
color_0_236color#f44336color_0_236
show_0_382booltrueshow_0_382
value_0_382float0.382value_0_382
color_0_382color#81c784color_0_382
show_0_5booltrueshow_0_5
value_0_5float0.5value_0_5
color_0_5color#4caf50color_0_5
show_0_618booltrueshow_0_618
value_0_618float0.618value_0_618
color_0_618color#009688color_0_618
show_0_65boolfalseshow_0_65
value_0_65float0.65value_0_65
color_0_65color#009688color_0_65
show_0_786booltrueshow_0_786
value_0_786float0.786value_0_786
color_0_786color#64b5f6color_0_786
show_1booltrueshow_1
value_1int1value_1
color_1color#787b86color_1
show_1_272boolfalseshow_1_272
value_1_272float1.272value_1_272
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 6 weeks ago · None stated GitHub repository of Sideway Zones Live
228 stars

This indicator plots dynamic support and resistance levels on the price chart. It detects pivot highs and lows using the pivot length and tracks touches to build strength-based levels. Support and resistance zones appear as colored boxes while lines mark key l

Indicator v6 Support & resistanceBreakout
Updated 3 months ago · None stated GitHub repository of Dynamic Support & Resistance
220 stars

This indicator identifies High Of Low Price (HOLP) and Low Of High Price (LOHP) candlestick setups based on price extremes over a specified lookback period. A HOLP signal triggers when the current bar closes above the high of a recent session low, whereas a LO

Indicator v5 Candlestick patternsBreakout
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns - HOLP-LOHP

Donchian Channels (DC)

by mihakralj
99 stars

This indicator calculates and plots Donchian Channels directly on the price chart. It determines the highest high and lowest low over a user-selected lookback period using an optimized monotonic deque algorithm, as well as a middle basis line computed as their

Indicator v6 Volatility & bandsSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Donchian Channels (DC)

Lows from New Highs

by be-thomas
65 stars

This indicator tracks bar lows during consecutive rising highs using Pine Script arrays. When at least four lows accumulate or the price breaches the minimum low in the stack, the script sorts the recorded lows in ascending order and flushes them. It plots up

Indicator v4 Support & resistanceBreakout
Updated 5 days ago · GPL-3.0 GitHub repository of Lows from New Highs

This indicator tracks smart money market structure directly on the price chart. It calculates dual-period swing highs and swing lows to detect Changes of Character (CHoCH), Breaks of Structure (BOS), inducements, and liquidity sweeps. When structural levels ar

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · Apache-2.0 GitHub repository of Market Structure with Inducements & Sweeps [LuxAlgo]

More Support & resistance 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