A candle-pair indicator that marks a bearish signal when a bar fails to take the previous high and closes below the previous low, and a bullish signal in the mirror case.
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
134 lines of Pine Script v6 from indicators/change-of-context.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
An optional divisions filter also requires the close to sit in the lower or upper fraction of the bar's range, with 2 to 10 divisions. Marker symbol, colour, position and size are adjustable. It draws labels on the price chart. It issues no stop, target or exit rules.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bearish Symbol
string
▼
bearSym
Bearish Symbol Color
color
color.new(color.red, 0)
bearCol
Bearish Symbol Location
string
Above bar
bearLoc
Bullish Symbol
string
▲
bullSym
Bullish Symbol Color
color
color.new(color.lime, 0)
bullCol
Bullish Symbol Location
string
Below bar
bullLoc
Marker Size
string
Small
sizeOpt
Use Divisions Filter
bool
false
useDivisions
Number of Divisions
string
4
divOpt
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.
The Bullish/Bearish Candle Series Distribution indicator calculates the length of the current streak of consecutive bullish or bearish candles based on user-selected mode. It tracks streak lengths from 2 to 59 and plots a histogram in a separate pane showing t
This indicator plots a normalized candle dynamic visualization inside a custom 500x500 Gann square grid within a separate pane. It normalizes each bar's open and close prices relative to its high-low range, storing the resulting coordinate pairs in fixed-size
This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete
This indicator calculates the Qstick value as a simple or exponential moving average of the difference between a chosen close source and open source. It plots that oscillator in a separate pane as a yellow line, draws a dashed zero line, and shades the backgro
This indicator draws a separate OHLC bar series in its own pane using plotbar. Each bar is colored lime when the close is greater than or equal to the open, and red when the close is below the open. It has no user inputs, no signals, and no entry, exit, stop,
This indicator builds a synthetic Heikin-Ashi series using only the current open and the opens of the previous three bars. It derives open, high, low, and close from those values, rounds each price to the symbol mintick, and plots the result as candles in a se