indicator · on price · open source
Change of Character (CHOCH) indicator
Change of Character (CHOCH) is a free open-source indicator by @deepwick. Change of Character (CHOCH) fires when price breaks structure against the prevailing trend… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Change of Character (CHOCH) does
Change of Character (CHOCH) fires when price breaks structure against the prevailing trend — a higher low after a run of lower lows (bullish CHOCH) or a lower high after higher highs (bearish CHOCH).
- Often the first sign of a trend reversal.
- An optional
confirmClosefilter waits for the bar to close beyond the level. - Pairs well with order blocks and FVGs for reversal entries.
- Different from BOS: CHoCH flips the trend bias, BOS continues it.
- The most reliable reversal signal comes from pairing a CHOCH with a clean break of the trigger swing.
- CHOCH + retest of the broken level = institutional entry trigger.
- Default swing = 5; use higher swing on higher-timeframe charts for slower CHOCH signals.
- A CHOCH followed by a BOS in the same direction = full trend flip, the highest-conviction reversal setup.
- Toggle the labels off if you only want the trend-state in code.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Change of Character (CHOCH)", overlay=true)
swing = input.int(5, "Swing Length", minval=2, maxval=50)
confirmClose = input.bool(true, "Confirm on Close")
bullColor = input.string("color.lime", "Bullish CHOCH Color")
bearColor = input.string("color.maroon", "Bearish CHOCH Color")
alertBull = input.bool(true, "Alert on Bullish CHOCH")
alertBear = input.bool(true, "Alert on Bearish CHOCH")
alertStreak = input.bool(false, "Alert on CHOCH Streak")
markerSize = input.string("small", "Arrow Size")
ph = ta.pivothigh(high, swing, swing)
pl = ta.pivotlow(low, swing, swing)
var float lastPh = na
var float prevPh = na
var float lastPl = na
var float prevPl = na
var int trend = 0
if not na(ph)
prevPh := lastPh
lastPh := ph
if not na(prevPh) and ph < prevPh
trend := -1
else if not na(prevPh) and ph > prevPh
trend := 1
if not na(pl)
prevPl := lastPl
lastPl := pl
if not na(prevPl) and pl > prevPl
trend := 1
else if not na(prevPl) and pl < prevPl
trend := -1
bullChoch = trend == -1 and lastPl > prevPl and low < lastPh
bearChoch = trend == 1 and lastPh < prevPh and high > lastPl
bullChoch := confirmClose ? (bullChoch and close > lastPh) : bullChoch
bearChoch := confirmClose ? (bearChoch and close < lastPl) : bearChoch
plotshape(bullChoch and not bullChoch[1], "Bull CHOCH", style=shape.triangleup, location=location.belowbar, color=bullColor, text="CHOCH")
plotshape(bearChoch and not bearChoch[1], "Bear CHOCH", style=shape.triangledown, location=location.abovebar, color=bearColor, text="CHOCH")
alertcondition(bullChoch and not bullChoch[1], "Bullish CHOCH", "Change of character to upside")
alertcondition(bearChoch and not bearChoch[1], "Bearish CHOCH", "Change of character to downside")
alertcondition(bullChoch and bullChoch[1], "Bullish CHOCH streak", "Two consecutive bullish CHOCH signals — strong reversal")
alertcondition(bearChoch and bearChoch[1], "Bearish CHOCH streak", "Two consecutive bearish CHOCH signals — strong reversal")
alertcondition(bullChoch and not bullChoch[1] and close > lastPh + ta.atr(14), "Strong bull CHOCH", "Strong bullish CHOCH with 1+ ATR break")
No comments yet.
Sign in to comment.