1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
36 lines of Pine Script v4 from indicators/DonchianTrendPeriod.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.
For a chosen period it marks an uptrend when the close exceeds the previous highest high and a downtrend when the close falls below the previous lowest low, otherwise it keeps the prior trend. Ten column bands use slightly shorter periods and color green or red according to whether each band agrees with the main trend. The only setting is the Donchian channel period. It does not place trades or draw on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Donchian Channel Period
int
30
dlen
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.
This indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and
This indicator calculates and plots the exponential moving average on the chart, along with Keltner Channel bands. It applies optional filters based on Keltner Channel and Money Flow to identify breakout signals. Breakouts occur when price crosses the EMA with
This indicator analyzes volume character and market structure in a separate chart pane. It color-codes volume bars to identify institutional accumulation, distribution, climax volume, and volume dry-up conditions during volatility contraction patterns. The scr
Trend Score History calculates a composite trend metric ranging between -5 and +5 by evaluating session VWAP, EMA alignment, price-volume flow, lower-timeframe Donchian channel breakouts, and Opening Range breakouts. It plots the cumulative score as histogram
This indicator identifies potential bullish breakout opportunities by detecting volatility expansions in the direction of an established trend. It calculates the Average True Range (ATR) and determines if volatility is expanding by comparing ATR to its moving
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