2 versions attached, Standard v1.00 and Advanced v2.00mirfai wrote: Sun Mar 29, 2026 7:42 am "Hi fellow coders, I would like to request to create an indicator that can detect candlestick patterns. Specifically the CB1 pattern. I have tried to look for an indicator that can detect the CB1 pattern but couldn't find one, even on TradingView. Below I will show what the CB1 pattern is."
So to summarize the CB1 concept so far:
CB1 = A reversal signal
It confirms a break of structure using the candle body (close price)
More accurate than traditional BOS which uses the wick/shadow
"The BOS pattern and CB1 pattern are different."
Version 1.00
Detects CB1 patterns:
- Bullish CB1: Between 2 Lows (New Lo below prev Lo)
Draws a horizontal line at the swing HIGH between the 2 lows
Signal: price BREAKS above that line = BUY
- Bearish CB1: Between 2 Highs (New Hi above prev Hi)
Draws a horizontal line at the swing LOW between the 2 highs
Signal: price BREAKS below that line = SELL
Version 2.00
Here's a full summary of everything added in v2:
1 — Minimum Distance Filter Controlled by UseDistanceFilter, MinSwingBars (default 10) and MinSwingPoints (default 50). A CB1 is only drawn if the two swing points are at least that many bars apart AND that many points apart in price. This kills the noise clusters you saw on the screenshot 1.
2 — Break Arrows When ShowBreakArrow = true, a green up-arrow (▲) is drawn on the exact bar where price first closes above a bullish CB1, and a red down-arrow (▼) for bearish breaks. Makes entry bars instantly visible without hunting for them.
3 — Fibonacci Zone Filter When UseFibFilter = true, the indicator measures the major swing range over FibLookback bars and calculates the 23.6 / 38.2 / 50 / 61.8 / 78.6 levels. Only CB1s forming within FibTolerance (default 0.5%) of one of those levels are drawn. Off by default so it doesn't surprise you — turn it on when you want higher-conviction setups only.
4 — Line Expiry / Colour Fade Once price closes through a CB1 level the line automatically changes to grey dashed (BrokenColor) and shortens to end at the break bar. Live levels stay solid and coloured — so at a glance you can instantly see what's still active vs already triggered.
5 — All alerts now also support email and push notifications in addition to pop-ups.