Aggiornato
QubitCandleDetector

QubitCandleDetector identifies completed candlestick formations on the chart's exact symbol and exchange. A multi-timeframe panel covers 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1D, 2D, 3D and 1W.
WHAT IT CHECKS
The detector combines candle geometry with the context before a reversal starts. It does not classify every long upper wick as an inverted hammer. Reversals require a matching prior trend, a recent price leg and placement near the relevant local extreme.
Supported formations: Hammer, Hanging Man, Inverted Hammer, Shooting Star; Doji, Dragonfly Doji, Gravestone Doji, Long-legged Doji and Spinning Top; bullish/bearish Marubozu, Engulfing and Harami; Morning/Evening Star and Doji Star; Three White Soldiers and Three Black Crows. Stars distinguish classic body gaps from the touching-body 24/7 variant.
RULES AND CONTEXT
Hammer-family bodies must exceed 10% and be at most 35% of the candle's range. The main wick must be at least twice the body. The opposite wick must be no more than both 25% of the body and 5% of the range, with the full body in the outer third.
The prior trend uses the preceding close relative to its 20-bar average and the direction of that average compared with five bars earlier. A five-bar local context check additionally tests slope, the recent price leg, the formation's position in the prior range and whether its opening or first candle extends the preceding move. For multi-candle reversals, this history ends before the entire formation, so the recovery candle cannot create its own prior trend.
Engulfing uses real-body containment rather than wick containment. Harami requires the smaller opposite-colour body to be strictly inside the first body. Stars require a small middle body at the extreme and a strong opposite third body closing beyond the first body's midpoint. Soldiers and crows require advancing closes, opens inside the preceding real bodies and short trailing wicks. These are explicit conservative Qubit definitions; different pattern indicators can use different thresholds.
READING THE PANEL
Each row describes the most recently completed candle on that timeframe. It shows the strongest detected formation, its strength score, body size and the candle's UTC closing time. Hover over the pattern to see all detected formations for that candle.
Strength combines a pattern-specific base (10-35 points), geometry (up to 25), size relative to the preceding 20 bodies or ranges (up to 30), and applicable prior-trend context (10). Grades are Weak below 40, Moderate below 60, Strong below 80 and Very strong from 80. Strength is a descriptive score, not a winning probability.
The separate green/red body meter is the completed body's size divided by the preceding 20 average bodies. It fills at 3x; the exact ratio remains visible above that level. Its colour reflects whether the candle closed up or down. A red-bodied hammer can still have a bullish formation label, because body colour and reversal context are different measurements.
TIMING AND ALERTS
Chart labels and bar tinting appear only on completed chart candles. Higher-timeframe rows use one-bar-offset source data with lookahead enabled, avoiding future-data leakage. Lower-timeframe rows use completed intrabars, with the latest completed reading retained between closes. All rows use the chart exchange and symbol, without averaging markets. Native TradingView 2D/3D year-end boundaries are supported.
The panel needs 28 consecutive valid candles. It shows Awaiting history if there is insufficient or discontinuous data. No pattern means the candle did not meet the supported formation rules. Neutral doji shapes are not automatically assigned a bullish or bearish prediction.
Choose a chart timeframe to control its labels and alerts. In Create Alert, select QubitCandleDetector and either the bullish/bearish completed-pattern condition or Any alert() function call for a detailed message. The default minimum chart-label/alert score is 40; the panel is not filtered by this setting. Neutral chart labels are off by default. Alerts must be created by the user; adding the indicator does not create subscriptions automatically.
Use standard time-based candles. This is a single-symbol analysis companion, not an all-market scanner, trading strategy or order-execution tool. Candle formations do not guarantee a reversal, continuation, profit or the colour of the next candle. Exchange history revisions can change historical readings. The code is open for inspection under MPL 2.0.
WHAT IT CHECKS
The detector combines candle geometry with the context before a reversal starts. It does not classify every long upper wick as an inverted hammer. Reversals require a matching prior trend, a recent price leg and placement near the relevant local extreme.
Supported formations: Hammer, Hanging Man, Inverted Hammer, Shooting Star; Doji, Dragonfly Doji, Gravestone Doji, Long-legged Doji and Spinning Top; bullish/bearish Marubozu, Engulfing and Harami; Morning/Evening Star and Doji Star; Three White Soldiers and Three Black Crows. Stars distinguish classic body gaps from the touching-body 24/7 variant.
RULES AND CONTEXT
Hammer-family bodies must exceed 10% and be at most 35% of the candle's range. The main wick must be at least twice the body. The opposite wick must be no more than both 25% of the body and 5% of the range, with the full body in the outer third.
The prior trend uses the preceding close relative to its 20-bar average and the direction of that average compared with five bars earlier. A five-bar local context check additionally tests slope, the recent price leg, the formation's position in the prior range and whether its opening or first candle extends the preceding move. For multi-candle reversals, this history ends before the entire formation, so the recovery candle cannot create its own prior trend.
Engulfing uses real-body containment rather than wick containment. Harami requires the smaller opposite-colour body to be strictly inside the first body. Stars require a small middle body at the extreme and a strong opposite third body closing beyond the first body's midpoint. Soldiers and crows require advancing closes, opens inside the preceding real bodies and short trailing wicks. These are explicit conservative Qubit definitions; different pattern indicators can use different thresholds.
READING THE PANEL
Each row describes the most recently completed candle on that timeframe. It shows the strongest detected formation, its strength score, body size and the candle's UTC closing time. Hover over the pattern to see all detected formations for that candle.
Strength combines a pattern-specific base (10-35 points), geometry (up to 25), size relative to the preceding 20 bodies or ranges (up to 30), and applicable prior-trend context (10). Grades are Weak below 40, Moderate below 60, Strong below 80 and Very strong from 80. Strength is a descriptive score, not a winning probability.
The separate green/red body meter is the completed body's size divided by the preceding 20 average bodies. It fills at 3x; the exact ratio remains visible above that level. Its colour reflects whether the candle closed up or down. A red-bodied hammer can still have a bullish formation label, because body colour and reversal context are different measurements.
TIMING AND ALERTS
Chart labels and bar tinting appear only on completed chart candles. Higher-timeframe rows use one-bar-offset source data with lookahead enabled, avoiding future-data leakage. Lower-timeframe rows use completed intrabars, with the latest completed reading retained between closes. All rows use the chart exchange and symbol, without averaging markets. Native TradingView 2D/3D year-end boundaries are supported.
The panel needs 28 consecutive valid candles. It shows Awaiting history if there is insufficient or discontinuous data. No pattern means the candle did not meet the supported formation rules. Neutral doji shapes are not automatically assigned a bullish or bearish prediction.
Choose a chart timeframe to control its labels and alerts. In Create Alert, select QubitCandleDetector and either the bullish/bearish completed-pattern condition or Any alert() function call for a detailed message. The default minimum chart-label/alert score is 40; the panel is not filtered by this setting. Neutral chart labels are off by default. Alerts must be created by the user; adding the indicator does not create subscriptions automatically.
Use standard time-based candles. This is a single-symbol analysis companion, not an all-market scanner, trading strategy or order-execution tool. Candle formations do not guarantee a reversal, continuation, profit or the colour of the next candle. Exchange history revisions can change historical readings. The code is open for inspection under MPL 2.0.
Note di rilascio
Chart preview refreshed to show a single QubitCandleDetector instance. Pattern rules, supported timeframes and calculations are unchanged.Note di rilascio
Added confirmed bullish and bearish regular RSI divergence across all 11 panel timeframes: 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1D, 2D, 3D and 1W. Existing candlestick detection rules are unchanged.DIVERGENCE RULES
Uses RSI(14) on closing prices from the chart's exact exchange and symbol. Bullish divergence requires a lower price low and a higher RSI low; bearish requires a higher price high and a lower RSI high. Price and RSI must form pivots on the same candles. Only adjacent price swings are compared, 6-61 candles apart, with five candles on each side. Equal price/RSI endpoints do not qualify, and intermediate price pivots are never skipped.
TIMING
The signal becomes available at the close of the fifth candle after the second pivot. The chart label marks that confirmation candle. The connecting line is drawn between the earlier price pivots only after confirmation; it was not available at the pivot itself. Hover for price/RSI endpoints and exact timestamps. Table signals remain active through age 10 bars unless price breaks the second pivot. Hidden divergence is not included.
SMALLER, REPOSITIONABLE PANEL
Open indicator Settings > Inputs > Panel. Choose any of nine screen positions, Compact (default), Detailed or Collapsed layout, and Tiny, Small or Normal text. The optional signal-only filter hides rows without a candle pattern or active divergence. Collapsed shows only the completed chart-timeframe summary. Pine tables use selectable screen anchors rather than free dragging.
Compact combines RSI and divergence in one column. Detailed retains the body-size meter and UTC candle close. Hover over readings for more detail. All readings use completed candles; each panel row uses its own timeframe. Price lines, confirmation labels and alerts use the chart timeframe.
ALERTS AND VALIDATION
Added separate bullish and bearish RSI divergence alert conditions and included divergence in the optional detailed alert message. Create or recreate alerts to use the updated script and settings. Existing alerts keep their original snapshot.
Actual TradingView CSV exports were compared with the reference candle and divergence implementations on all 11 timeframes; 53 additional reference tests passed. These checks validate implementation consistency, not predictive accuracy. Divergence and candle patterns do not guarantee a reversal or the next candle's colour.
Note di rilascio
This update adds a dedicated RSI(14) pane with bullish and bearish divergence connectors matching the price pivots. Pivot lines appear only after confirmation; they are not early predictions. Price labels and the movable compact table remain on the main chart.The indicator legend now displays only QubitCandleDetector. A website-alert mode can deliver newly confirmed candle patterns and RSI divergences on 15m, 30m, 1h, 2h, 4h, 8h, 12h, daily and weekly intervals; 2D and 3D are optional. The all-timeframe alert uses a separate 1-minute host so it checks frequently, while the signal records retain their actual timeframe. Normal chart drawings work on other chart intervals without a runtime error.
Existing candle-pattern and confirmed-divergence rules are unchanged. Alerts use saved snapshots: recreate an alert after updating its code or settings. Formation scores describe the pattern and are not probabilities of profit.
Note di rilascio
Divergence now compares RSI(14) values at adjacent confirmed price swing lows/highs. It no longer requires RSI to form its own pivot on the exact same candles. The 5-left / 5-right confirmation, 6–61-bar spacing, strictly lower-low/higher-RSI and higher-high/lower-RSI conditions remain. Price and RSI lines connect the same candle dates. Historical pivot lines appear only when the second price swing confirms; the confirmation marker identifies when the signal became available.Added a configurable RSI average (14-period SMA by default; EMA selectable). Red fill highlights RSI below 17 while still falling; green fill highlights RSI above 83 while still rising. Thresholds are adjustable. Shading and the average on the forming candle may change until its close.
An optional compact RSI context panel shows closed-candle price versus RSI pace, RSI-point distance to the two boundaries, and correlation of price returns with RSI changes. Each pace is normalized by its own prior typical movement rather than directly comparing price units with RSI points. The panel describes observed momentum; it does not forecast a bounce, remaining price movement or a required RSI reset. No trade execution is included.
Recreate existing alerts to use the changed divergence rules; TradingView alerts retain their saved script snapshot.
Note di rilascio
Added an optional completed-candle RSI alert for RSI(14, close) strictly below 20. Website JSON mode emits one oversold observation per matching source-candle close on every enabled timeframe; this is not a bullish reversal claim. Confirmed bullish and bearish price-swing divergence alerts remain independent of RSI extremes. Existing candle detection, RSI average, divergence drawings and price/RSI pace calculations are unchanged. Alerts use the exact crypto exchange and symbol selected in TradingView. Recreate existing alerts to load this updated script snapshot.Note di rilascio
QubitCandleDetector now includes hidden RSI divergence, integrated Qubit EMA/MA, and higher-timeframe support/resistance zones.HIDDEN DIVERGENCE
Hidden bullish: a higher price low with a lower RSI low at those price pivots.
Hidden bearish: a lower price high with a higher RSI high at those price pivots.
Like regular divergence, these use adjacent confirmed price swings with five candles on each side, 6–61 bars apart. RSI is RSI(14) on close, sampled at the price swing. There is no RSI extreme requirement. Equal endpoints do not qualify.
Hidden divergence has its own switch and dashed H-BULL / H-BEAR connectors on price and RSI. Regular divergence remains solid. Lines connect historical pivots, but become known only after five candles to the right of the second pivot have closed. Labels identify confirmation; these are delayed observations, not advance predictions.
QUBIT EMA / MA
Select EMA, MA, both, or Off. Defaults are close-source 7/25/99 with yellow, pink and purple lines, using the chart's native timeframe. The optional fourth 200-period line is disabled by default. MA is the simple moving average; EMA is exponential. Lengths and source are configurable. Input values do not clutter the script title.
STRONG SUPPORT / RESISTANCE
Source timeframes start at 1h: 1h, 2h, 4h, 8h, 12h, daily and weekly by default; 2D and 3D are optional. Each uses the exact chart's symbol and exchange, never another coin's prices.
A unique 3-left / 3-right price swing must be followed by a substantial CLOSED departure: at least 2x the Wilder ATR(14) measured before the pivot, and the confirmation close must still hold at least 1x ATR away from the zone edge. A small bounce or a wick alone is insufficient. Invalid/gapped formations and plateau extrema are excluded.
Evidence combines departure strength, available relative volume, successful later recoveries, age, higher timeframe and overlap between independent source frames. Raw touches do not automatically make a level stronger. Grade labels are Qualified, Strong and Major; the score is not a win probability or measured buyer/seller order flow. Tooltips show prices, timeframe sources, confirmation time and evidence.
Default visibility is within 3% of price, with at most three zones on each side. Always visible removes the proximity filter while keeping the drawing limit. A decisive completed source candle beyond a zone invalidates it; a live quote beyond its edge temporarily hides it. There is no automatic role reversal. Zones start drawing at confirmation, not at the earlier pivot.
History is bounded to 5,000 available bars per source timeframe and 48 retained unbroken zones per source. Daily and weekly frames cover much longer periods than intraday frames. This is not unlimited listing history, and exchange data can be shorter. The summary tooltip reports loaded coverage. The display represents current retained zones, not a historical strategy backtest.
ALERTS
Regular and hidden divergence alerts remain separate and independent of RSI level. Existing candle alerts and RSI-below-20 website observations remain available. S/R and moving averages are chart-only and NEVER create website Signals events. S/R calculations are skipped in website alert mode to conserve resources. The all-timeframe website alert uses a standard 1-minute chart as a clock for higher-timeframe closes; it does not restrict the signal timeframe to one minute. Recreate existing TradingView alerts to load the new script/settings snapshot.
Validation includes independent comparisons against actual TradingView candle exports for all four divergence directions and integrated average calculations, plus synthetic zone tests and a comparison of weekly zone prices/evidence against exchange candles. These checks validate the implementation, not future trading performance. Patterns, divergences and historical reactions can fail; no outcome is guaranteed.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.