OPEN-SOURCE SCRIPT

Cipher B Adaptive v6

1 106
Cipher B — Adaptive v6

Cipher B — Adaptive is a WaveTrend-style momentum oscillator that re-tunes itself to the coin it is applied to. The same script gives usable overbought/oversold levels and cross signals on BTC daily, a mid-cap alt on 4H or a meme coin on 5 minutes, without changing the settings.

WHY THIS EXISTS
Classic Cipher B oscillators use fixed levels (±53 / ±60) and fixed smoothing (10 / 21). Those numbers were tuned for BTC-like behaviour. On a meme coin the wave regularly runs to ±90, so "overbought" fires far too early and a cross at -55 is not really a dip. On BTC on higher timeframes the wave rarely reaches ±60, so the extreme zones are almost never touched. This script solves that with two independent adaptive layers.

HOW IT WORKS

1. Asset profile (volatility tier)
The script measures annualised realised volatility: the standard deviation of log returns over the lookback, scaled by the number of bars per year for the chart timeframe. Because it is annualised, a 5-minute chart and a daily chart are compared on the same scale. The result is mapped to a 0…1 factor between two thresholds:
• below 75% = Large Cap (BTC / ETH behaviour)
• 75% to 150% = Alt
• above 150% = Meme
The factor stretches the Channel and Average lengths by up to 30% on the noisiest coins, which suppresses whipsaw crosses without adding lag on calm charts. If you disagree with the detection, the Profile input overrides it.

2. Adaptive levels
In Adaptive mode the outer OB/OS levels are the 95th and 5th percentile of WT1 over the last 300 bars, clamped between 40 and 95. The inner levels are the outer level × 0.88, which preserves the original 53/60 geometry. Levels are asymmetric by default: in an uptrend the oversold line sits shallower, so dip signals fire where dips actually end, and the overbought line sits deeper. Turn on Symmetric levels if you prefer mirrored lines. Fixed mode keeps your manual levels and widens them by the profile, up to 35% on meme-tier coins.

3. Waves and money flow
WT1 (blue) and WT2 (dark blue) are the standard WaveTrend pair. The cloud between them is green while momentum is bullish and red while it is bearish; the histogram shows the same distance. The green/red money-flow wave is the Cipher B style RSI-MFI hybrid: sustained green means buying pressure behind the move.

4. Divergence
Pivots are found on the oscillator, not on price. Price is read in the window around each pivot, and a divergence is confirmed once, when the second pivot is confirmed. Markers are drawn on the actual pivot bar and the two pivots are connected with a line. Optional filters: at least one pivot must be inside the OB/OS zone, and the pivots must be within a set number of bars of each other. Hidden (trend-continuation) divergences can be switched on separately.

HOW TO READ THE SIGNALS
• Dim dot: WT1 crosses WT2 in the mid-range. Informational only.
• Solid green / red dot: a cross inside the oversold / overbought zone. This is the classic Cipher B buy / sell dot.
• Gold / orange diamond (STRONG): a zone cross that is either beyond the extreme level or follows a divergence within the last 20 bars.
• Triangle marked DIV: regular divergence. Small triangle marked H: hidden divergence.
• Shaded background: WT1 is beyond the extreme levels.

INFO TABLE
The table shows the detected profile (auto or manual), annualised volatility, the lengths and levels currently in use, WT1 / WT2, zone, momentum and money-flow direction. If a signal looks off on a particular coin, this is where you check what the script decided.

SETTINGS WORTH KNOWING
• Profile: Auto / Large Cap / Alt / Meme.
• Large-cap vol ceiling and Meme vol floor: the tier thresholds. Raise them on very low timeframes if BTC keeps being classed as Alt.
• Max length stretch: set to 0 to disable smoothing adaptation.
• Level mode, Adaptive lookback, Extreme percentile: how the levels are derived. A lower percentile (for example 90) gives more signals.
• Divergence memory: how long a divergence keeps upgrading zone crosses to STRONG.

ALERTS
Ten alert conditions: any cross, zone cross, STRONG signal, regular divergence and hidden divergence, each for both directions.

NOTES
• The first 300 bars of a chart use the fixed levels until enough history exists for the percentile.
• The volatility thresholds and the 365-day annualisation are tuned for crypto. On stocks or forex the profile reads differently; use the Profile override there.
• Cross signals confirm on bar close. Divergence signals confirm a few bars after the pivot (Pivot length), as with any pivot-based method. Nothing is recalculated on past bars after that.

CREDITS
Built on the WaveTrend oscillator by LazyBear and the Cipher B concept popularised by Market Cipher and VuManChu's open-source Cipher B. The volatility profile, percentile levels, tiered signals and pivot-aligned divergence logic are original to this script.

This indicator is an analysis tool, not financial advice. Test it on your own markets and timeframes before relying on it.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.