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
328 lines of Pine Script v5 from Tradingview/opening-range.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Opening Range calculates MACD momentum sequences alongside Stochastic oscillator limits to generate buy and sell triangle shapes. Additionally, it evaluates trend alignment across three Exponential Moving Averages (9, 14, and 21 EMAs) and incorporates an embedded Zig Zag calculation to trace market swings and reversals. Users can adjust MACD lengths, Stochastic boundaries, EMA settings, and Zig Zag thresholds. Note that the Zig Zag component updates past swing points retroactively on the chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
trendLength
int
5
trendLength
sequentialLength
int
3
sequentialLength
useAlerts
bool
false
useAlerts
fastLength
int
5
fastLength
slowLength
int
26
slowLength
MACDLength
int
9
MACDLength
overbought
int
80
overbought
oversold
int
20
oversold
KPeriod
int
10
KPeriod
DPeriod
int
10
DPeriod
priceH
source
high
priceH
priceL
source
low
priceL
Show all 22 settings
Setting
Type
Default
Variable
priceC
source
close
priceC
reversalAmount
float
1.00
dev_threshold
Zig Zag Up Color
color
#388e3c
upcolor
Zig Zag Down Color
color
#df0000
downcolor
Zig Zag Undefined Color
color
#e65100
undefinedcolor
Text Color
color
color.white
txtcol
Zig zag Line Width
int
2
zigwidth
Extend to Last Bar
bool
true
extend_to_last_bar
Display Reversal Price Change
bool
true
display_reversal_price_change
showarrows
bool
true
showarrows
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 script provides an indicator-based backtesting engine framework that simulates trade entries, exits, and filtering directly on the price chart. It evaluates selected entry rules and multi-layered filters, including moving average trends, volume increases,
This indicator combines pivot-based support and resistance levels with multi-timeframe MACD crossovers and a higher-timeframe exponential moving average trend filter. It identifies support and resistance touches using pivot highs and lows within a user-defined
This overlay indicator plots Central Pivot Range levels and bands across yearly, quarterly, monthly, weekly, daily, and six-hour periods. Each timeframe can be shown or hidden, and pivot and band colors are set separately. It also marks MACD momentum and EMA t
GemHunter v4 classifies market conditions into bullish, bearish, or neutral regimes using a multi-indicator voting system. It combines exponential moving average alignment, MACD momentum, and RSI strength, optionally gated by ADX trend strength and higher-time
The Moving Confluence Overlay indicator identifies confluence trading setups on the price chart by combining an exponential moving average ribbon, StochRSI crossovers, MACD momentum, and ATR volatility spike detection. When conditions align, it triggers trade
Xiaotang System V5.0 is a price-chart overlay indicator that identifies momentum breakouts across moving averages and session VWAP. It computes Heikin-Ashi price data, 50-period and 200-period SMAs, and intraday VWAP while monitoring 5-minute higher-timeframe