Adaptive Kinetic Ribbon [QuantAlgo]🟢 Overview
The Adaptive Kinetic Ribbon indicator synthesizes price velocity and volatility dynamics to identify trend direction, momentum strength, and acceleration phases across varying market conditions. It combines velocity-based momentum measurement, adaptive volatility weighting, dual-speed ribbon analysis, and acceleration-deceleration detection into a unified visual system that quantifies periods of sustained directional movement and momentum shifts, helping traders and investors identify trend continuation and reversal signals across various timeframes and asset classes.
🟢 How It Works
The indicator's core methodology lies in its adaptive kinetic approach, where velocity and volatility components are calculated dynamically and then smoothed through an adaptive alpha mechanism.
First, Velocity is measured to capture raw directional momentum by calculating the net price change over the lookback period:
velocity = source - source
This creates a momentum vector that quantifies how far and in which direction price has moved, providing the foundation for understanding trend strength and establishing whether the market is in a sustained directional phase.
Then, Volatility is computed to evaluate price variability and market noise by analyzing the standard deviation of bar-to-bar price changes:
volatility = ta.stdev(source - source , length) * mult
The volatility sensitivity multiplier allows traders to adjust how responsive the indicator is to market noise, with higher values creating faster adaptation during volatile periods and lower values maintaining stability during choppy conditions.
Next, Adaptive Alpha is calculated to create a dynamic smoothing coefficient that automatically adjusts based on the relationship between velocity and volatility:
adaptive_alpha = math.abs(velocity) / (math.abs(velocity) + volatility)
This alpha value ranges from 0 to 1, where values closer to 1 indicate strong, clear directional movement (high velocity relative to volatility), causing the indicator to respond quickly, while values closer to 0 indicate noisy, range-bound conditions (high volatility relative to velocity), causing the indicator to smooth more heavily and filter out false signals.
Following this, the Kinetic Line is constructed using exponential smoothing with the adaptive alpha coefficient:
var float kinetic_line = na
kinetic_line := na(kinetic_line ) ? source : kinetic_line + adaptive_alpha * (source - kinetic_line )
This creates an adaptive moving average that automatically adjusts its responsiveness: during strong trends with clear velocity, it tracks price closely like a fast EMA; during choppy, volatile periods, it smooths heavily like a slow SMA, providing optimal trend identification across varying market regimes without manual parameter adjustment.
Then, Ribbon Lines are generated by applying additional moving average smoothing to the kinetic line at two different speeds:
ribbon_fast = ma(kinetic_line, ribbon_fast_length, ma_type)
ribbon_slow = ma(kinetic_line, ribbon_slow_length, ma_type)
The dual-ribbon structure creates a visual envelope around the kinetic line, where the fast ribbon responds quickly to kinetic changes while the slow ribbon provides trend confirmation, with crossovers between these ribbons generating primary trend reversal signals.
Finally, Trend State and Acceleration are determined by analyzing the relative positioning and directional movement of the ribbon lines:
trend_up = ribbon_fast > ribbon_slow
acceleration = ribbon_fast > ribbon_fast
ribbonColor = trend_up ?
acceleration ? bullAccel : bullDecel :
not acceleration ? bearAccel : bearDecel
This creates a four-state classification system that distinguishes between bullish acceleration (uptrend strengthening), bullish deceleration (uptrend weakening), bearish acceleration (downtrend strengthening), and bearish deceleration (downtrend weakening), providing traders with nuanced momentum insights beyond simple bullish/bearish binary signals.
🟢 Signal Interpretation
▶ Bullish Acceleration (Bright Green): Fast ribbon above slow ribbon AND fast ribbon rising, indicating confirmed uptrend with building momentum = Strongest bullish condition, ideal for new long entries, adding to positions, or holding existing longs with confidence
▶ Bullish Deceleration (Dark Green): Fast ribbon above slow ribbon BUT fast ribbon falling, indicating uptrend intact but momentum weakening = Caution signal for longs, potential trend exhaustion developing, consider tightening stops or taking partial profits
▶ Bearish Acceleration (Bright Red): Fast ribbon below slow ribbon AND fast ribbon falling, indicating confirmed downtrend with building momentum = Strongest bearish condition, ideal for new short entries, exiting longs, or maintaining defensive positioning
▶ Bearish Deceleration (Dark Red): Fast ribbon below slow ribbon BUT fast ribbon rising, indicating downtrend intact but momentum weakening = Caution signal for shorts, potential trend exhaustion developing, prepare for possible reversal or consolidation
▶ Bullish Crossover: Fast ribbon crosses above slow ribbon, signaling trend reversal from bearish to bullish and initiation of new upward momentum phase = Primary buy signal, entry opportunity for trend-following strategies, exit signal for short positions
▶ Bearish Crossover: Fast ribbon crosses below slow ribbon, signaling trend reversal from bullish to bearish and initiation of new downward momentum phase = Primary sell signal, entry opportunity for short strategies, exit signal for long positions
▶ Ribbon Spread Width: Distance between fast and slow ribbons indicates trend strength and conviction, where wider spreads suggest strong, sustained directional movement with low reversal probability, while tight or converging ribbons indicate weak trends, consolidation, or impending reversal conditions
▶ Bar Color Alignment: When bar coloring is enabled, candlestick colors mirror the ribbon state providing immediate visual confirmation of momentum conditions directly on price action, eliminating the need to reference the indicator separately and enabling faster decision-making during active trading
🟢 Features
▶ Preconfigured Presets: Three optimized parameter configurations accommodate different trading styles, timeframes, and market analysis approaches: "Default" provides balanced trend identification suitable for swing trading on 4-hour and daily charts, "Fast Response" delivers heightened sensitivity optimized for intraday trading and scalping on 5-minute to 1-hour charts, and "Smooth Trend" offers conservative trend identification ideal for position trading and long-term analysis on daily to weekly charts.
▶ Built-in Alerts: Three alert conditions enable comprehensive automated monitoring of trend reversals and momentum transitions. "Bullish Crossover" triggers when the fast ribbon crosses above the slow ribbon, signaling the shift from downtrend to uptrend and the beginning of bullish momentum building. "Bearish Crossover" activates when the fast ribbon crosses below the slow ribbon, signaling the shift from uptrend to downtrend and the beginning of bearish momentum building. "Any Ribbon Crossover" provides a combined notification for either bullish or bearish crossover regardless of direction, useful for general trend reversal monitoring and ensuring no momentum shift goes unnoticed.
▶ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast and immediate identification of acceleration versus deceleration states across various devices and screen sizes. Each preset uses distinct colors for the four momentum states (bullish acceleration, bullish deceleration, bearish acceleration, bearish deceleration) with proper visual hierarchy. Optional bar coloring with adjustable transparency provides instant visual context of current momentum state and trend direction without switching between the price pane and indicator pane, enabling traders and investors to immediately assess trend positioning and acceleration dynamics while analyzing price action patterns and support/resistance levels.
BTCUSD
Institutional Structure [Clean Pro]Institutional Structure — Script Explanation
This script is designed to map institutional market behavior using high-timeframe structure, not retail noise.
It focuses on where smart money acts, not on frequent signals.
🔹 1. High-Timeframe Support & Resistance (HTF S/R)
The script identifies major structural highs and lows using a higher lookback period.
Purpose:
Defines where institutions previously distributed or accumulated
Acts as natural decision zones
Filters out low-quality intraday levels
Why it matters:
Institutions trade from key HTF levels, not random support/resistance.
🔹 2. Equilibrium (50% Mean Price)
The equilibrium line represents the fair price between HTF high and low.
How it’s used:
Below equilibrium → discount zone (buy interest)
Above equilibrium → premium zone (sell interest)
Professional insight:
Smart money prefers buying discounts and selling premiums, not chasing price.
🔹 3. Market Structure Shift (MSS)
Instead of frequent BOS labels, the script detects true directional shifts.
Bullish MSS:
Price closes above previous HTF high
Bearish MSS:
Price closes below previous HTF low
Why MSS over BOS:
MSS confirms control change
Reduces false signals
Aligns with institutional execution logic
🔹 4. Liquidity Sweep Detection (Wick-Based)
The script identifies stop-hunt behavior using wick rejection logic.
Buy-side liquidity:
Wick above HTF high, but close back below
Sell-side liquidity:
Wick below HTF low, but close back above
Meaning:
Stops were triggered, but price failed to accept → smart money absorption
🔹 5. Fair Value Gap (FVG) – Refined Imbalance
Fair Value Gaps highlight inefficient price movement.
Bullish FVG:
Price leaves an upside imbalance
Bearish FVG:
Price leaves a downside imbalance
How pros use it:
As reaction zones, not entry signals
Best combined with liquidity + MSS
🔍 How Everything Works Together
The script is context-based, not signal-based:
1️⃣ HTF structure defines the battlefield
2️⃣ Liquidity is taken (stop hunts)
3️⃣ MSS confirms direction
4️⃣ FVG offers precision
5️⃣ Equilibrium filters bias
This creates high-probability trade environments, not overtrading.
📌 Best Practices (Professional Use)
Timeframes: 1H / 4H / Daily
Avoid lower TF noise
Trade only after liquidity is taken
Use FVG as confirmation, not trigger
Respect equilibrium bias
🎯 Summary
✔ Clean institutional logic
✔ No clutter, no spam
✔ HTF-driven decisions
✔ Liquidity-first mindset
✔ Designed for BTC, Gold & FX
🧠 Trade where institutions trade — not where indicators flash.
ATR ZLEMA [QuantAlgo]🟢 Overview
The ATR ZLEMA indicator identifies trend direction and reversal points using a Zero Lag Exponential Moving Average (ZLEMA) combined with volatility-adjusted dynamic trailing stops. It eliminates the inherent lag of traditional moving averages while incorporating Average True Range (ATR) volatility measurement to create adaptive support and resistance levels that automatically adjust to market conditions, with optional noise filtering to reduce whipsaws in choppy markets, helping traders and investors identify trend changes, maintain positions during trending markets, and exit when momentum shifts across multiple timeframes and asset classes.
🟢 How It Works
The indicator's core methodology lies in its zero-lag trend detection system combined with volatility-adaptive trailing stops, where the ZLEMA eliminates moving average lag while ATR-based bands provide dynamic support and resistance levels:
lag = math.floor((zlemaLength - 1) / 2)
rawZlema = ta.ema(source + (source - source ), zlemaLength)
The Zero Lag EMA calculation uses lag reduction through data compensation, adding the difference between current price and lagged price to eliminate the delay inherent in traditional exponential moving averages, providing faster response to trend changes while maintaining smoothness.
The script incorporates an optional ATR-based noise filter that prevents the ZLEMA from updating during insignificant price movements, helping to reduce false signals in choppy, range-bound markets:
if enableNoiseFilter
noiseThreshold = atr * noiseFilter
priceChange = math.abs(rawZlema - zlema)
if priceChange > noiseThreshold
zlema := rawZlema
First, the indicator calculates the Average True Range to measure current market volatility, then applies a user-defined multiplier to determine the distance of the trailing stop from the ZLEMA:
atr = ta.rma(ta.tr(true), atrLength)
atrBand = atr * atrMultiplier
Next, dynamic trend detection occurs through a state-based system where the indicator tracks whether the ZLEMA is above or below the ATR trailing line, automatically adjusting the trailing stop position:
if trend == 1
if zlema < zlemaATR
trend := -1
zlemaATR := zlema + atrBand
else
zlemaATR := math.max(zlemaATR, zlema - atrBand)
The ATR trailing line acts as a volatility-adjusted stop that follows the ZLEMA during trends but never moves against the trend direction. It ratchets upward with the ZLEMA in uptrends and ratchets downward in downtrends, creating a protective barrier that adapts to market volatility.
Finally, trend reversal signals are generated when the ZLEMA crosses the ATR trailing line, indicating a shift in market momentum:
bullSignal = trend == 1 and trend == -1
bearSignal = trend == -1 and trend == 1
This creates a volatility-adaptive trend-following system that combines ZLEMA with dynamic support/resistance levels and optional noise filtering, providing traders with responsive directional signals and automatic stop-loss levels that adjust to both price momentum and market volatility conditions.
🟢 Signal Interpretation
▶ Bullish Trend (Green): ZLEMA trading above ATR trailing line with indicator showing bullish color, indicating established upward momentum with zero-lag confirmation = Long/Buy opportunities
▶ Bearish Trend (Red): ZLEMA trading below ATR trailing line with indicator showing bearish color, indicating established downward momentum with zero-lag confirmation = Short/Sell opportunities
▶ ATR Trailing Line as Dynamic Support: In uptrends, the trailing line acts as volatility-adjusted support level that rises with ZLEMA, never declining = Use as potential stop-loss reference for long positions = ZLEMA holding above indicates trend strength and momentum continuation
▶ ATR Trailing Line as Dynamic Resistance: In downtrends, the trailing line acts as volatility-adjusted resistance level that falls with ZLEMA, never rising = Use as potential stop-loss reference for short positions = ZLEMA holding below indicates trend weakness and momentum continuation
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets for different trading styles and market conditions. "Default" provides balanced configuration suitable for swing trading on daily and 4-hour charts with standard ZLEMA and ATR periods, moderate multiplier, and moderate noise filtering that works across most market conditions. "Fast Response" delivers aggressive configuration designed for intraday trading and scalping on 5-minute to 1-hour charts with shorter ZLEMA period for quick trend detection, reduced ATR period for rapid volatility adaptation, tighter multiplier for early entries/exits, and minimal noise filtering for maximum responsiveness. This is ideal for active traders monitoring positions closely but expect more frequent signals and potential whipsaws in choppy conditions. "Smooth Trend" focuses on conservative configuration for position trading and long-term trend following on daily to weekly charts with extended ZLEMA period for smoother trend identification, longer ATR period for stable volatility measurement, wide multiplier to filter minor corrections, and aggressive noise filtering to ensure only strong sustained trends trigger signals. This is best for patient traders focused on major trend moves with fewer reversals.
▶ Built-in Alerts: Three alert conditions enable comprehensive automated monitoring of trend changes and zero-lag momentum shifts. "Bullish Trend" triggers when the ZLEMA crosses above the ATR trailing line and trend state changes from bearish to bullish, signaling potential long entry opportunities with lag-eliminated confirmation. "Bearish Trend" activates when the ZLEMA crosses below the ATR trailing line and trend state changes from bullish to bearish, signaling potential short entry or long exit points with immediate momentum detection. "Any Trend Change" provides a combined alert for any trend reversal regardless of direction, allowing traders to be notified of all zero-lag momentum shifts without setting up separate alerts. These notifications enable traders to capitalize on trend changes and protect positions without continuous chart monitoring, leveraging the indicator's zero-lag technology for faster trend change alerts.
▶ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast for identifying bullish versus bearish trends across various trading environments. The adjustable cloud fill transparency control (0-100%) allows fine-tuning of the gradient area prominence between the ATR trailing line and ZLEMA, with higher transparency values (70-95) creating subtle background context without overwhelming the chart while lower values (20-40) produce bold, prominent trend zone emphasis for instant recognition. Optional bar coloring with adjustable transparency (0-100%) extends the trend color directly to the price bars themselves based on ZLEMA trend state, providing immediate visual reinforcement of current trend direction without requiring reference to the indicator lines.
BTC/M2 Fire Sniffer (Liquidity Range Z-Score)Howdy Fella. Great to see you here, exploring the true data in CRYPTOCAP:BTC analysis.
To ensure a perfect view on the markets, here are a few tips on how to fine tune the Fire Sniffer:
- Z-Score Lookback: 40
- Liquidity Ratio SuperSmoother Length: 8
- Z-score SuperSmoother Length: 132
Set the ranges as following:
Mean: -0.53
Liquidity Cycle Top: 0.8
Liquidity Cycle Bottom: -0.65
With that, you are set to go. Enjoy and make sure to let me know your thoughts on the script. You can contact me on X: @thebitcoinfrontier
BTC Fundamental Value Hypothesis [OmegaTools]BTC Fundamental Value Hypothesis is a macro-valuation and regime-detection model designed to contextualize Bitcoin’s price through relative market-cap comparisons against major capital reservoirs: Gold, Silver, the Altcoin market, and large-cap equities. Instead of relying on traditional on-chain metrics or purely technical signals, this tool frames BTC as an asset competing for global liquidity and “store-of-value mindshare”, then estimates an implied fair value based on how BTC historically coexists (or diverges) from these benchmark universes.
Core concept: relative market-cap anchoring
The indicator builds a reference-based fair price by translating external market capitalizations into implied BTC valuation using a dominance framework. In practice, you choose one or more reference universes (Gold, Silver, Altcoins, Stocks). For each selected universe, the script computes how large BTC “should be” relative to that universe (dominance ratio), and converts that into an implied BTC price. The final fair price is the average of the implied prices from the enabled universes.
Two dominance modes: automatic vs manual
1. Automatic Dominance % (default)
When enabled, the model estimates dominance ratios dynamically using a 252-period simple moving average of BTC market cap divided by each reference market cap. This produces an adaptive baseline that follows structural changes over time and reduces sensitivity to short-term spikes.
2. Manual Dominance %
If you prefer a discretionary macro thesis, you can directly input dominance parameters for each reference universe. This is useful when you want to stress-test scenarios (e.g., “BTC should converge toward X% of Gold’s market cap”) or align the model with a specific long-term adoption narrative.
Reference universes and data construction
- BTC market cap: pulled from CRYPTOCAP:BTC.
- Gold and Silver market caps: derived from the corresponding futures symbols (GC1!, SI1!) multiplied by an assumed total above-ground quantity (constant tonnage converted to troy ounces). This provides a practical and tradable proxy for spot valuation context.
- Altcoin market cap: pulled from CRYPTOCAP:TOTAL2 (total crypto market excluding BTC).
- Stocks market cap proxy (Σ3): a deliberately conservative equity benchmark built from three mega-cap stocks (AAPL, MSFT, AMZN) using total shares outstanding (request.financial) multiplied by price. This avoids index licensing complexity while still tracking a meaningful slice of global equity beta/liquidity.
Valuation output: overvalued vs undervalued (log-based)
The valuation readout is expressed as a percentage derived from the logarithmic distance between BTC price and the model’s fair price. This choice makes valuation comparable across long time horizons and reduces distortion during exponential growth phases. A positive valuation indicates BTC trading below the model’s implied value (undervalued), while a negative valuation indicates trading above it (overvalued).
Oscillator: relative momentum and regime confirmation
In addition to fair value, the indicator includes a momentum differential oscillator built from RSI(50):
- BTC RSI is compared to the average RSI of the selected reference universes.
- The oscillator highlights when BTC strength is leading or lagging the broader macro benchmarks.
- Color is rendered through a gradient to provide immediate regime readability (risk-on vs risk-off behavior, expansion vs contraction phases).
Visualization and UI components
- Fair Price overlay: the computed fair price is plotted directly on the BTC chart for immediate comparison with spot price action.
- Valuation shading: the area between price and fair price is filled to visually emphasize dislocation and potential mean-reversion zones.
- Oscillator panel: a zero-centered oscillator with filled bands helps you identify persistent trend regimes versus transitional conditions.
- Summary table: a right-side table displays the current valuation (over/under) and, when Automatic mode is enabled, the live dominance ratios used in the model (BTC/GOLD, BTC/SILVER, BTC/ALTC, BTC/STOCKS).
How to use it (practical workflows)
- Macro valuation context: use fair price as a structural anchor to assess whether BTC is trading at a premium or discount relative to external liquidity baselines.
- Regime filtering: combine valuation with the oscillator to distinguish “cheap but weak” from “cheap and strengthening” (and the inverse for tops).
- Mean-reversion mapping: large, persistent deviations from fair value often highlight speculative extremes or capitulation zones; this can support systematic entries/exits, position sizing, or hedging decisions.
- Scenario analysis: switch to Manual Dominance % to model adoption outcomes, policy-driven shifts, or multi-year re-rating assumptions.
Important notes and limitations (read before use)
- This is a hypothesis-driven macro model, not a literal intrinsic value calculation. Results depend on dominance assumptions, proxies, and data availability.
- Gold/Silver market caps are approximations based on futures pricing and fixed supply constants; real-world supply dynamics, above-ground estimates, and spot/futures basis can differ.
- The Stocks (Σ3) benchmark is a proxy and intentionally not “the whole market”. It is designed to represent a large-cap liquidity reference, not total equity capitalization.
- Always validate signals with additional context (market structure, volatility regime, risk management rules). This indicator is best used as a macro layer in a broader decision framework.
Designed for clarity, macro discipline, and repeatability
BTC Fundamental Value Hypothesis by OmegaTools is built for traders and investors who want a clean, data-driven way to interpret BTC through the lens of competing asset classes and capital flows. It is particularly effective on higher timeframes (Daily/Weekly) where macro relationships are more stable and valuation signals are less noisy.
© OmegaTools, Eros
MACD Forecast [QuantAlgo]🟢 Overview
The MACD Forecast extends the classic Moving Average Convergence Divergence (MACD) indicator by projecting potential future MACD line, Signal line, and Histogram values up to 20 bars ahead. Unlike traditional MACD implementations that only display historical momentum data, this indicator employs three distinct forecasting methodologies that analyze different market dimensions: price structure analysis, volume-weighted dynamics, and linear regression trends. Each method explores potential momentum trajectories from a unique analytical perspective, allowing traders to develop probabilistic expectations about future MACD behavior, anticipate signal crossovers before they materialize, and integrate forward-looking momentum analysis into their trading approach.
🟢 How It Works
The indicator operates through a multi-stage calculation process that extends the MACD calculation chain forward in time. First, it generates potential future price values using one of three selectable forecasting methods, each analyzing different market characteristics (structure breaks, volume flow, or statistical trend). These projected prices are then enhanced with configurable volatility simulation that adds realistic price-like fluctuations to the forecast, scaled by ATR (Average True Range) to ensure consistent behavior across different instruments and timeframes. The volatility control allows traders to choose between smooth projections or more realistic forecasts that mirror actual market behavior.
The system processes these volatility-adjusted price projections through an iterative moving average calculation that maintains continuity with historical MA states, computing forecasted fast and slow exponential (or other MA type) values while preserving the mathematical properties of each averaging method. It then calculates the difference between forecasted fast and slow MAs to produce future MACD line values, applies the signal line smoothing to these projections, and derives the forecasted histogram (MACD minus Signal).
The forecasting models adapt to market conditions by analyzing configurable lookback periods and recalculating all projections on every bar update. Traders can control the forecast horizon from 1 to 20 bars ahead. The implementation supports 10+ different moving average types (SMA, EMA, WMA, VWMA, RMA, DEMA, TEMA, ZLEMA, LSMA, ALMA, SMMA) for both the oscillator and signal calculations, creating visual continuity between historical and forecasted values displayed as semi-transparent histogram columns and dashed lines extending beyond the current bar.
🟢 Key Features
1. Market Structure Model
This model applies smart money concepts and price action analysis by identifying break of structure (BOS) and change of character (CHoCH) patterns to determine potential directional bias. The system detects swing highs and lows using configurable pivot lengths, then analyzes sequences of higher highs and lower lows to establish bullish or bearish structure states. When structure is bullish and price approaches recent swing lows, the forecast projects potential moves higher scaled by ATR and trend strength. Conversely, bearish structure near swing highs projects downward bias. In neutral structure states, the algorithm reverts to mean-reversion logic, projecting toward the midpoint between recent structural extremes. The trend strength calculation compares the frequency of higher highs versus lower lows across multiple structure periods, weighting the forecast accordingly.
▶ Practical Implications:
Explores potential MACD momentum behavior during structural trend continuation phases
Identifies scenarios where structure breaks might influence MACD crossovers or divergences
Could be useful for swing traders and position traders who incorporate market structure and price action analysis
The Structure Influence parameter allows blending between pure trend following and structure-weighted momentum forecasts
Helps visualize potential trend exhaustion when structure weakens or reverses while MACD remains extended
May assist in anticipating false breakouts when structure contradicts MACD momentum direction
Particularly relevant for traders who view MACD crossovers through the lens of swing highs/lows rather than pure price momentum
2. Volume-Weighted Model
This model synthesizes multiple volume-based metrics to assess potential capital flow and institutional activity. The algorithm combines On-Balance Volume (OBV) slope analysis, Accumulation/Distribution Line trajectory, volume-weighted returns, and volume spike detection above customizable thresholds. When all volume indicators align directionally (positive OBV slope, rising A/D line, positive volume momentum), the forecast projects stronger potential moves in that direction, reflecting significant accumulation or distribution. Volume spikes above the threshold trigger additional directional adjustments scaled by ATR. The Money Flow Multiplier calculation weights each bar's volume contribution based on where the close falls within the bar's range, providing granular insight into buying versus selling pressure. When volume metrics diverge from price trends, the forecast suggests potential consolidation or reversal scenarios reflected in weakening MACD momentum.
▶ Practical Implications:
Incorporates volume analysis into MACD momentum forecasting
Attempts to distinguish between MACD signals supported by volume versus those that may lack conviction
Could be particularly relevant in markets where volume data is reliable and significant (e.g., equities, crypto, major forex pairs during active sessions)
Volume Influence parameter enables adaptation to different market volume characteristics and trading activity levels
Highlights potential accumulation/distribution phases that might precede major MACD crossovers or divergences
May help filter low-volume price noise that creates false MACD histogram signals
Could be valuable for traders who require volume confirmation before acting on MACD crossover signals
May help identify volume climax patterns that sometimes coincide with MACD extremes before trend reversals
3. Linear Regression Model
This mathematical approach applies least-squares regression fitting to project simple trend trajectories based on recent price history. The algorithm calculates the best-fit line through the lookback period and extrapolates it forward using the regression equation, providing straightforward trend continuation forecasts without conditional logic or market-state dependencies. These projected prices feed through the MACD calculation chain (fast MA - slow MA, then signal line smoothing) to produce statistically-based momentum forecasts.
▶ Practical Implications:
Delivers reproducible MACD forecasts based on statistical principles rather than discretionary interpretation
Performs well in established trending markets with clear directional bias where momentum persistence is likely
Minimal parameter sensitivity (primarily controlled by lookback period length)
Computationally efficient with fast recalculation suitable for multi-timeframe MACD analysis
Serves as a neutral baseline to compare against the more complex structure and volume methods
Provides simpler momentum forecasts in low-noise environments without the assumptions inherent in structure or volume analysis
🟢 Universal Applications Across All Models
Each forecasting method projects potential future MACD values (MACD line, Signal line, and Histogram), which traders can use to:
▶ Anticipate potential crossovers: Visualize possible MACD/Signal crosses several bars ahead, enabling proactive position planning rather than reactive trade execution after crossovers have already occurred
▶ Explore momentum trajectory scenarios: Assess whether current MACD histogram is likely to strengthen (increasing bars) or weaken (decreasing bars), providing insight into trend continuation versus exhaustion probabilities
▶ Plan entry timing: Identify potential optimal entry points along the forecasted momentum curve, such as entering on forecasted histogram pullbacks during strong trends or waiting for forecasted crossovers before commitment
▶ Evaluate zero-line dynamics: Monitor forecasted MACD line position relative to the zero line (bullish above, bearish below) and anticipate when momentum might shift from positive to negative or vice versa
▶ Assess divergence development: Use forecasted MACD values alongside price projections to identify potential bullish or bearish divergences before they fully develop, enabling earlier positioning
▶ Adapt to market regimes: Switch between forecasting methods based on current market character (structure method for range-bound or reversal markets, volume method for liquidity-driven moves, linear regression for clean trending environments)
▶ Manage open positions: Use forecasted MACD momentum deterioration as an early warning for profit-taking or position reduction before traditional exit signals trigger
▶ Combine with other indicators: Layer forecasted MACD crossovers with support/resistance levels, volatility bands, candlestick patterns, or other indicators for multi-confirmation trade setups
🟢 Important Considerations
▶ The indicator includes extensive customization options: adjustable MACD periods (fast/slow/signal), multiple moving average types for both oscillator and signal calculations, configurable lookback periods for each forecast method, customizable forecast horizon, adjustable volatility simulation, volume spike thresholds, structure pivot lengths, influence parameters for blending forecast components, multiple color presets, adjustable forecast transparency, value labels with customizable sizing, and built-in alerts for all major MACD signal types (bullish/bearish crosses, zero-line crosses, histogram sign changes).
▶ As with all technical analysis tools, these forecasts represent potential scenarios based on current data and chosen methodologies. They should be integrated into a comprehensive trading plan that includes risk management, fundamental analysis, and multiple timeframe confirmation rather than used as standalone predictive signals. Market conditions can change rapidly, and no forecasting algorithm can fully foresee the future price action. Most importantly, the true benefit of this script lies not in expecting precise momentum predictions but in developing a forward-thinking perspective on possible MACD behavior and planning your responses accordingly, whether that means preparing for anticipated crossovers, adjusting position sizes based on forecasted momentum strength, or avoiding trades when all three methods show conflicting projections.
LRHS Strategy - BakaraFxThis indicator is designed to identify high-probability market reversal zones by combining liquidity sweeps, market structure shifts, and multi-timeframe confirmation.
Concept Behind the Indicator
Financial markets often move to collect liquidity above previous highs or below previous lows before reversing.
This tool focuses on detecting these liquidity raids and then waits for structural confirmation before highlighting potential reversal areas.
How It Works
1. Liquidity Sweep Detection
The indicator identifies when price takes out recent swing highs or lows, suggesting a stop-hunt or liquidity grab.
2. Structural Shift Confirmation
After the liquidity sweep, the script looks for a change in short-term market structure, indicating that momentum may be shifting in the opposite direction.
3. Multi-Timeframe Filtering
Users can select different timeframes for the liquidity hunt and the confirmation phase, allowing better alignment between higher-timeframe context and lower-timeframe entries.
4. Reversal Zones & Signals
When both liquidity and structure conditions are met, the indicator highlights potential reversal areas on the chart.
Best Use
• Works well on volatile markets (Gold, BTC)
• Designed for traders using liquidity, ICT, and price action concepts
• Can be used for scalping, intraday, or swing trading
Important Note
This tool is not a “buy/sell signal generator”.
It provides context and confirmation, helping traders make more informed decisions.
Disclaimer
This indicator is for educational purposes only.
It does not provide financial advice.
Always use proper risk management.
Relative Volume Suite [QuantAlgo]🟢 Overview
The Relative Volume Suite is a comprehensive volume analysis system that combines normalized volume measurements with statistical anomaly detection to identify and track significant trading activity deviations from established baselines. The indicator employs a dual-mode visualization approach by offering both relative volume (RVOL) histogram display for standard volume screening and cumulative directional RVOL candlesticks for tracking sustained volume momentum patterns. Through statistical analysis using moving averages and standard deviation, the system identifies volume anomalies that deviate from normal market behavior, flagging potential institutional activity, breakout confirmations, and accumulation/distribution patterns. This quantitative framework provides traders with a systematic methodology for volume regime identification, anomaly detection across raw or normalized volume data, and dynamic threshold-based screening across diverse market conditions and trading timeframes.
🟢 How It Works
The indicator calculates relative volume (RVOL) by dividing current bar volume by its simple moving average over a user-defined lookback period, producing a normalized ratio where values above 1.0 indicate higher-than-average volume and values below 1.0 represent lower-than-average activity. This normalization enables direct comparison of volume significance across different securities and time periods, eliminating the need to assess absolute volume numbers which vary dramatically between instruments.
The system also constructs a cumulative directional volume metric by calculating a running sum of relative volume, where up bars (close > open) contribute positive RVOL values and down bars contribute negative values. This cumulative calculation tracks the persistent alignment of volume with price direction over time, creating a momentum pathway that reveals sustained buying or selling pressure patterns.
The anomaly detection system operates through statistical analysis to flag unusual volume events. The system calculates a moving average baseline of the selected source using user-defined MA types over the anomaly MA length period, while simultaneously measuring standard deviation over the anomaly standard deviation length period. When the source data deviates from its moving average by more than one standard deviation, the indicator flags an anomaly, highlighting the bar with distinct coloring to draw attention to statistically significant volume events that fall outside normal market behavior patterns.
🟢 How to Use It
▶ Anomaly Detection: Anomaly-flagged bars appear in bright, attention-grabbing colors distinct from normal volume bars. Green anomalies on up bars highlight unusual buying volume that exceeds statistical norms, potentially signaling institutional accumulation, breakout confirmation, or reversal capitulation. Red anomalies on down bars reveal unusual selling volume, flagging potential distribution, breakdown validation, or panic selling events. The anomaly system acts as a filter, automatically screening thousands of bars to surface statistically significant volume events that may warrant detailed analysis.
Configure the anomaly detection parameters based on your trading style and timeframe. Lower Anomaly MA Length creates responsive anomaly detection that catches emerging volume regime changes quickly but may flag more normal variations. Higher Anomaly MA Length requires stronger evidence, detecting only major structural volume shifts with fewer false positives. The Anomaly StdDev Length controls sensitivity: lower values flag smaller deviations as anomalies for aggressive short-term trading, while higher values require extreme statistical significance for conservative longer-term analysis. For day trading, use shorter parameters to catch intraday volume spikes. For swing trading, use balanced settings. For position trading, use longer parameters to filter noise and identify only major volume events.
▶ Display Mode Selection: Choose Relative Volume mode for standard volume analysis and screening applications. In this mode, the histogram bars show when current volume exceeds average levels, with the threshold line providing visual reference for screening setups. Bars extending above the threshold line indicate potentially elevated volume worthy of attention. Use this mode when scanning multiple securities for volume breakouts, confirming price breakout validity, or identifying potential reversal points marked by volume climaxes.
Switch to Cumulative RVOL mode when tracking volume momentum and accumulation/distribution patterns over time. The candlestick visualization reveals whether volume is consistently supporting the prevailing price trend. Rising cumulative RVOL during an uptrend suggests buying pressure may be fueling the advance, while rising cumulative RVOL during a downtrend (or falling during uptrend) signals potential divergence where volume momentum opposes price direction, often a warning sign of weakening trend integrity. The zero line serves as the neutral reference point, with movement away from zero indicating building directional volume momentum.
▶ Trading Applications: Consider combining anomaly volume signals with other technical indicators for confluence-based trade decisions. For example, when anomaly volume appears on up bars near key support levels defined by moving averages or VWAP, this confluence of volume confirmation with technical structure may strengthen the case for long entries. Similarly, anomaly volume at resistance levels identified through pivot points or Fibonacci retracements could suggest potential reversal zones worth monitoring.
For breakout trading, look for elevated RVOL (above threshold) combined with anomaly detection when price breaks through significant levels like prior day highs, consolidation ranges, or moving average clusters. The presence of unusual volume alongside technical breakouts may indicate institutional participation validating the move. Conversely, breakouts occurring without corresponding volume anomalies might suggest lower conviction moves more susceptible to failure.
In trend-following strategies, use the indicator alongside directional tools like moving average crossovers or trend channels. Anomaly volume appearing in the direction of the established trend (buying anomalies during uptrends, selling anomalies during downtrends) could suggest continuation potential, while counter-trend anomalies may signal weakening momentum or potential reversals requiring closer monitoring.
Monitor the bar coloring feature which overlays volume-based colors directly onto price candles. This provides continuous visual feedback on whether current bars represent normal or anomalous volume conditions without needing to reference the separate volume pane. Consecutive anomaly-colored bars indicate sustained unusual activity, often preceding or confirming significant price moves.
▶ Alert Configuration: The indicator provides six distinct alert types for comprehensive volume monitoring. "RVOL Threshold Crossed" triggers when relative volume exceeds your defined threshold multiplier, useful for screening high-volume breakout candidates across multiple watchlists. "Volume Anomaly - Buying" and "Volume Anomaly - Selling" fire specifically when the statistical anomaly system detects directional unusual volume, enabling you to monitor institutional activity as it emerges. "Extreme Volume Spike" alerts when volume reaches significantly above the standard threshold, flagging only the most dramatic volume events like earnings releases, news events, or climactic reversals. "High Volume Buying" and "High Volume Selling" combine threshold crossing with directional confirmation, providing alerts that integrate both magnitude and direction of volume pressure.
▶ Visual Customization: The indicator offers six color presets (Classic, Aqua, Cosmic, Ember, Neon, Custom) optimized for different chart themes. Classic uses traditional green/red for universal compatibility, while Aqua, Cosmic, Ember, and Neon provide high-contrast alternatives for dark themes and personal preferences. Custom mode allows complete color control for matching corporate branding or specific visual requirements. The distinction between normal volume colors (neutral grays) and anomaly colors (bright attention-grabbing hues) helps statistically significant events stand out against baseline volume activity, supporting visual pattern recognition across multiple charts and timeframes.
ATR Supertrend [QuantAlgo]🟢 Overview
The ATR Supertrend indicator identifies trend direction and reversal points using volatility-adjusted dynamic support and resistance levels. It combines Average True Range (ATR) volatility measurement with adaptive price bands and EMA smoothing to create trailing stop levels that automatically adjust to market conditions, helping traders and investors identify trend changes, maintain positions during trending markets, and exit when momentum shifts across multiple timeframes and asset classes.
🟢 How It Works
The indicator's core methodology lies in its volatility-adaptive band system, where dynamic support and resistance levels are calculated based on market volatility and price movement:
smoothedSource = ta.ema(source, smoothingPeriod)
atr = ta.rma(ta.tr(true), atrLength) * atrMultiplier
The script uses ATR-based bands that expand and contract with market volatility, ensuring the indicator adapts to different market conditions rather than using fixed price distances:
if trend == 1
supertrend := math.max(supertrend, smoothedSource - atr)
else
supertrend := math.min(supertrend, smoothedSource + atr)
First, it applies optional EMA smoothing to the price source to reduce noise and filter out minor price fluctuations that could trigger premature trend changes, allowing traders to focus on genuine momentum shifts.
Then, the ATR calculation measures market volatility using the Average True Range over the specified lookback period, multiplied by the user-defined factor to set the band distance:
atr = ta.rma(ta.tr(true), atrLength) * atrMultiplier
Next, dynamic trend detection occurs through a state-based system where the indicator tracks whether price is in an uptrend or downtrend, automatically adjusting the Supertrend line position:
if trend == 1
if smoothedSource < supertrend
trend := -1
supertrend := smoothedSource + atr
The Supertrend line can act as a trailing stop that follows price during trends but never moves against the trend direction, i.e., it ratchets upward with price in uptrends and ratchets downward with price in downtrends.
Finally, trend reversal signals are generated when price crosses the Supertrend line, indicating a shift in market momentum:
bullSignal = trend == 1 and trend == -1
bearSignal = trend == -1 and trend == 1
This creates a volatility-adaptive trend-following system that combines dynamic support/resistance levels with momentum confirmation, providing traders with clear directional signals and automatic stop-loss levels that adjust to changing market conditions.
🟢 Signal Interpretation
▶ Bullish Trend (Green): Price trading above Supertrend line with indicator showing bullish color, indicating established upward momentum = Long/Buy opportunities
▶ Bearish Trend (Red): Price trading below Supertrend line with indicator showing bearish color, indicating established downward momentum = Short/Sell opportunities
▶ Supertrend Line as Dynamic Support: In uptrends, the Supertrend line can act as trailing support level that rises with price, never declining = Use as potential stop-loss reference for long positions = Price holding above indicates trend strength
▶ Supertrend Line as Dynamic Resistance: In downtrends, the Supertrend line can act as trailing resistance level that falls with price, never rising = Use as potential stop-loss reference for short positions = Price holding below indicates trend weakness
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets for different trading approaches. "Default" provides balanced trend detection for swing trading on daily/4-hour charts with moderate sensitivity. "Fast Response" delivers quick trend change detection for intraday trading on 5-minute to 1-hour charts, capturing moves early with increased whipsaw potential. "Smooth Trend" focuses on strong sustained trends for position trading on daily/weekly timeframes, filtering noise to identify only major trend shifts.
▶ Built-in Alerts: Three alert conditions enable comprehensive automated monitoring of trend changes and momentum shifts. "Bullish Trend" triggers when price crosses above the Supertrend line and the trend state changes from bearish to bullish, signaling potential long entry opportunities. "Bearish Trend" activates when price crosses below the Supertrend line and the trend state changes from bullish to bearish, signaling potential short entry or long exit points. "Any Trend Change" provides a combined alert for any trend reversal regardless of direction, allowing traders to be notified of all momentum shifts without setting up separate alerts. These notifications enable traders to capitalize on trend changes and protect positions without continuous chart monitoring.
▶ Color Customization: Five visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast for identifying bullish versus bearish trends across various trading environments. The adjustable cloud fill transparency control (0-100%) allows fine-tuning of the gradient area prominence between the Supertrend line and price, with higher opacity values creating subtle background context while lower values produce bold trend zone emphasis. Optional bar coloring with adjustable transparency (0-100%) extends the trend color directly to the price bars themselves, providing immediate visual reinforcement of current trend direction without requiring reference to the Supertrend line, with transparency controls allowing users to maintain visibility of candlestick patterns while still showing trend context.
BTC Buy&Sell 1h tw: stoova0Twitter: stoova0
This works exclusively on the BTC 1h chart. It is recommended to use the OKX exchange chart (specifically BtcUsdt.p) for analysis and trading. To set an alert, simply open the chart, select the indicator, and choose 'Any alert() function call' from the options.
Cumulative Volume Delta (CVD) Suite [QuantAlgo]🟢 Overview
The Cumulative Volume Delta (CVD) Suite is a comprehensive toolkit that tracks the net difference between buying and selling pressure over time, helping traders identify significant accumulation/distribution patterns, spot divergences with price action, and confirm trend strength. By visualizing the running balance of volume flow, this indicator reveals underlying market sentiment that often precedes significant price movements.
🟢 How It Works
The indicator begins by determining the optimal timeframe for delta calculation. When auto-select is enabled, it automatically chooses a lower timeframe based on your chart period, e.g., using 1-second bars for minute charts, 5-second bars for 5-minute charts, and progressively larger intervals for higher timeframes. This granular approach captures volume flow dynamics that might be missed at the chart level.
Once the timeframe is established, the indicator calculates volume delta for each bar using directional classification:
getDelta() =>
close > open ? volume : close < open ? -volume : 0
When a bar closes higher than it opens (bullish candle), the entire volume is counted as positive delta representing buying pressure. Conversely, when a bar closes lower than its open (bearish candle), volume becomes negative delta representing selling pressure. This classification is applied to every bar in the selected lower timeframe, then aggregated upward to construct the delta for each chart bar:
array deltaValues = request.security_lower_tf(syminfo.tickerid, lowerTimeframe, getDelta())
float barDelta = 0.0
if array.size(deltaValues) > 0
for i = 0 to array.size(deltaValues) - 1
barDelta := barDelta + array.get(deltaValues, i)
This aggregation process sums all the individual delta values from the lower timeframe bars that comprise each chart bar, capturing the complete volume flow activity within that period. The resulting bar delta then feeds into the various display calculations:
rawCVD = ta.cum(barDelta) // Cumulative sum from chart start
smoothCVD = ta.sma(rawCVD, smoothingLength) // Smoothed for noise reduction
rollingCVD = math.sum(barDelta, rollingLength) // Rolling window calculation
Note: This directional bar approach differs from exchange-level orderflow CVD, which uses tick data to separate aggressive buy orders (executed at the ask price) from aggressive sell orders (executed at the bid price). While this method provides a volume flow approximation rather than pure tape-reading precision, it offers a practical and accessible way to analyze buying and selling dynamics across all timeframes and instruments without requiring specialized data feeds on TradingView.
🟢 Key Features
The indicator offers five distinct visualization modes, each designed to reveal different aspects of volume flow dynamics and cater to various trading strategies and market conditions.
1. Oscillator (Raw): Displays the true cumulative volume delta from the beginning of chart history, accompanied by an EMA signal line that helps identify trend direction and momentum shifts. When CVD crosses above the signal line, it indicates strengthening buying pressure; crosses below suggest increasing selling pressure. This mode is particularly valuable for spotting long-term accumulation/distribution phases and identifying divergences where CVD makes new highs/lows while price fails to confirm, often signaling potential reversals.
2. Oscillator (Smooth): Applies a simple moving average to the raw CVD to filter out noise while preserving the underlying trend structure, creating smoother signal line crossovers. Use this when trading trending instruments where you need confirmation of genuine volume-backed moves versus temporary volatility spikes.
3. Oscillator (Rolling): Calculates cumulative delta over only the most recent N bars (configurable window length), effectively resetting the baseline and removing the influence of distant historical data. This approach focuses exclusively on current market dynamics, making it highly responsive to recent shifts in volume pressure and particularly useful in markets that have undergone regime changes or structural shifts. This mode can be beneficial for traders when they want to analyze "what's happening now" without legacy bias from months or years of prior data affecting the readings.
4. Histogram: Renders the per-bar volume delta as individual histogram bars rather than cumulative values, showing the immediate buying or selling pressure that occurred during each specific candle. Positive (green) bars indicate that bar closed higher than it opened with buying volume, while negative (red) bars show selling volume dominance. This mode excels at identifying sudden volume surges, exhaustion points where large delta bars fail to move price, and bar-by-bar absorption patterns where one side is aggressively consuming the other's volume.
5. Candles: Transforms CVD data into OHLC candlestick format, where each candle's open represents the CVD at the start of the bar and subsequent intra-bar delta changes create the high, low, and close values. This visualization reveals the internal volume flow dynamics within each time period, showing whether buying or selling pressure dominated throughout the bar's formation and exposing intra-bar reversals or sustained directional pressure. Use candle wicks and bodies to identify volume acceptance/rejection at specific CVD levels, similar to how price candles show acceptance/rejection at price levels.
▶ Built-in Alert System: Comprehensive alerts for all display modes including bullish/bearish momentum shifts (CVD crossing signal line), buying/selling pressure detection (histogram mode), and bullish/bearish CVD candle formations. Fully customizable with exchange and timeframe placeholders.
▶ Visual Customization: Choose from 5 color presets (Classic, Aqua, Cosmic, Ember, Neon) or create your own custom color schemes. Optional price bar coloring feature overlays CVD trend colors directly onto your main chart candles, providing instant visual confirmation of volume flow and making divergences immediately apparent. Optional info label with configurable position and size displays current CVD values, data source timeframe, and mode at a glance.
Triple KDJ - CKThe Triple KDJ is a market-reading architecture based on multiscale confirmation, not a new indicator. It consists of the simultaneous use of three KDJ settings with different parameters to represent three levels of price behavior: short-, medium-, and long-term. The systemic logic is simple and robust: a move is considered tradable only when there is directional coherence across all three layers, which reduces noise, prevents entries against the dominant regime, and stabilizes decision-making.
At the slowest level, the KDJ acts as a structural regime filter. It defines whether the market is, at that moment, permissive for buying, selling, or remaining neutral. When the slow KDJ shows the hierarchy J > K > D, the environment is bullish; when J < K < D occurs, the environment is bearish. If this condition is not clear, any signal on the faster levels should be ignored, as it represents only local fluctuation without directional support.
The intermediate KDJ fulfills the role of continuity confirmation. It checks whether the impulse observed on the short-term level is supported by the developing move. In practical terms, it prevents entries based solely on micro-impulses that fail to evolve into real price displacement. When the intermediate KDJ replicates the same directional hierarchy as the slow KDJ, structure and movement are aligned.
The fast KDJ is used exclusively as a timing tool, never as a standalone signal generator. This is where the J line reacts first, often emerging from extreme zones and offering the lowest-risk entry point. In the Triple KDJ, the fast layer does not “command” the trade; it simply executes what has already been authorized by the higher levels.
The J line plays a central role in this architecture. In the fast KDJ, it anticipates the change in impulse; in the intermediate KDJ, it confirms the transformation of that impulse into movement; and in the slow KDJ, it determines whether the market accepts or rejects that direction. For this reason, in the Triple KDJ the correct reading is not about line crossovers, but about a consistent hierarchy among J, K, and D across multiple scales.
Lakshmi - Low Volatility Range Breakout (LVRB)⚡️ Overview
The Low Volatility Range Breakout (LVRB) indicator is designed to identify consolidation phases characterized by suppressed volatility and generate actionable signals when price breaks out of these ranges. The underlying premise is rooted in the market principle that periods of low volatility often precede significant directional moves—volatility contraction leads to expansion.
Important Note on Optimization: The default parameter settings of this indicator have been specifically optimized for BTCUSDT on the 2-hour (2H) timeframe. While the indicator can be applied to other instruments and timeframes, users are encouraged to adjust the parameters accordingly to suit different trading conditions and asset characteristics.
This indicator automates the detection of "quiet" accumulation/distribution zones and provides clear visual cues and alerts when a breakout occurs.
⚡️ How to Use
1. Add the indicator to your chart. Default settings are optimized for BTCUSDT 2H.
2. Wait for a gray box to appear—this indicates a qualified low-volatility range is forming.
3. Monitor for breakout signals:
• LONG (green triangle below bar): Price broke above the range. Consider entering a long position.
• SHORT (red triangle above bar): Price broke below the range. Consider entering a short position.
4. Set alerts using "LVRB LONG" or "LVRB SHORT" to receive notifications on confirmed breakouts.
5. Adjust parameters as needed for different instruments or timeframes.
Tip: Combine with volume analysis or trend filters for higher-probability setups.
⚡️ How It Works
1. Low Volatility Bar Detection
A bar is classified as "low volatility" when it meets the following criteria:
• True Range (TR) is at or below the average TR (Simple Moving Average) multiplied by a user-defined threshold.
• (Optional) Candle Body is at or below the average body size multiplied by a separate threshold.
This dual-filter approach helps isolate bars that exhibit genuine compression in both range and directional commitment.
2. Range Box Formation
When consecutive low-volatility bars are detected, the indicator begins constructing a consolidation box:
• The box expands to encompass the high and low of qualifying bars.
• A minimum number of bars and a minimum fraction of low-volatility bars are required for the box to become "qualified" (active).
• A configurable tolerance allows for a limited number of consecutive non-low-vol bars within the sequence, accommodating minor noise without invalidating the range.
• If the box height exceeds a maximum threshold (defined as a multiple of the base ATR at sequence start), the range is invalidated.
3. Breakout Detection
Once a qualified range is established, the indicator monitors for breakouts:
• Wick Mode: Requires both a wick pierce beyond the range boundary AND a close outside the range.
• Close Mode: Requires only a close beyond the range boundary.
• (Optional) Breakout Body Filter: The breakout candle's body must exceed a multiple of the average body size at range formation.
• (Optional) Candle Direction Filter: Bullish breakouts require a green candle; bearish breakouts require a red candle.
Signals are displayed in real-time and confirmed upon bar close.
⚡️ Inputs & Parameters
• Volatility Window: Lookback period for calculating average TR and average body size.
• TR Multiplier: A bar's TR must be ≤ avgTR × this value to qualify as low-vol.
• Body Multiplier: A bar's body must be ≤ avgBody × this value (if body filter is enabled).
• Use Body Filter: Toggle the body size filter on/off.
• Min Bars in Box: Minimum number of bars required for a range to become qualified.
• Min Low-Vol Fraction: Minimum proportion of bars in the sequence that must be low-vol.
• Allowed Consecutive Non-Low-Vol Bars: Tolerance for consecutive bars that do not meet low-vol criteria.
• Max Box Height: Maximum allowed range height as a multiple of the base ATR.
• Breakout Mode: Choose between "Wick" (pierce + close) or "Close" (close only).
• Breakout Body Multiplier: Require breakout candle body ≥ avgBody × this value (1.0 = OFF).
• Require Candle Direction: Enforce green candle for LONG, red candle for SHORT.
⚡️ Visual Features
• Consolidation Boxes: Displayed in neutral (gray) color during formation. Upon a confirmed breakout, the box is colored green for bullish breakouts or red for bearish breakouts.
• Breakout Signals:
• LONG: Green upward triangle displayed below the price bar with "LONG" label.
• SHORT: Red downward triangle displayed above the price bar with "SHORT" label.
• Range Levels: Optional horizontal plots for the active range's high and low.
• Invalidated Boxes: Optionally retained in neutral (gray) color or deleted from the chart.
• Full Customization: Colors, transparency, and border width are all adjustable.
⚡️ Alerts
Two alert conditions are available:
• LVRB LONG: Triggered on a confirmed bullish breakout (bar close).
• LVRB SHORT: Triggered on a confirmed bearish breakout (bar close).
⚡️ Use Cases
• Breakout Trading: Enter positions when price escapes a well-defined low-volatility range.
• Volatility Expansion Plays: Anticipate increased volatility following periods of compression.
• Filtering Choppy Markets: Avoid trading during extended consolidation; wait for confirmed breakouts.
• Multi-Timeframe Analysis: Use on higher timeframes to identify major consolidation zones.
⚡️ Notes
• Best used in conjunction with volume analysis, trend context, or support/resistance levels for confirmation.
• Performance varies across instruments and timeframes; backtesting and parameter optimization are recommended.
⚡️ Credits
Developed by Lakshmi. Inspired by volatility contraction principles and range breakout methodologies.
⚡️ Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a guarantee of profits. Trading financial instruments involves substantial risk, and you may lose more than your initial investment. Past performance, whether indicated by backtesting or historical analysis, does not guarantee future results. The use of this indicator does not ensure or promise any profits or protection against losses. Users are solely responsible for their own trading decisions and should conduct their own research and/or consult with a qualified financial advisor before making any investment decisions. By using this indicator, you acknowledge and accept that you bear full responsibility for any trading outcomes.
Chan Theory - Chanlun|CCZT# Chan Theory - Chanlun|CCZT
## Overview
This indicator implements Chan Theory (缠论) structural analysis framework using Pine Script v5. It automatically identifies fractals, pens, segments, and pivot zones from price movements, providing objective structure-based trading signals.
**Key Features:**
- Real-time fractal and pen recognition with 4 pen type options
- Multi-level segment analysis (sub-level and main-level)
- Dynamic pivot zone identification and visualization
- Type I/II/III trading signal detection
- Customizable display settings for all structural components
## How It Works
### 1. Candlestick Containment Processing
Eliminates noise by processing candlestick containment relationships:
- **Uptrend**: Takes higher highs and higher lows
- **Downtrend**: Takes lower highs and lower lows
### 2. Fractal Recognition
Identifies top/bottom fractals on processed candlesticks:
- **Top Fractal**: Middle candlestick high > both adjacent highs
- **Bottom Fractal**: Middle candlestick low < both adjacent lows
### 3. Pen Construction (4 Types Available)
Connects valid fractals to form pens:
- **Classic Pen (老笔)**: Requires 5+ processed K-lines per pen
- **Optimized Pen (新笔)**: 4+ processed K-lines with 5+ raw K-lines
- **4K Pen**: 4 raw K-lines with specific conditions
- **Strict Pen (严笔)**: 5+ K-lines with directional validation
### 4. Segment Partitioning (3 Modes)
Groups pens into higher-level segments:
- **Dynamic Correction**: Real-time adjustment with new data
- **Strict Mode**: Full compliance with classical definitions
- **Extension Mode**: Flexible trend continuation handling
### 5. Pivot Zone Recognition
Identifies consolidation zones at multiple levels:
- Sub-level pivot zones (pen-based)
- Main-level pivot zones (segment-based)
- Real-time pivot extension visualization
## Trading Signals
### Type I Signals (1buy/1sell)
Trend reversal signals based on momentum divergence within segments. Requires pivot zone formation or sufficient pen count.
### Type II Signals (2buy/2sell)
Pullback entry signals occurring after Type I, identified by sub-level fractal confirmations.
### Type III Signals (3buy/3sell)
Breakout confirmation signals when price breaks and holds beyond prior pivot zones.
### Quasi-Type II Signals (L2buy/L2sell)
Similar to Type II but with less strict conditions.
## Settings Guide
| Setting | Description |
|---------|-------------|
| **Pen Type** | Choose Classic/Optimized/4K/Strict based on volatility |
| **Segment Mode** | Select calculation method matching your strategy |
| **Show Pivot Zones** | Toggle sub-level/main-level pivots |
| **Show Running Pen** | Display currently forming unconfirmed pen |
| **Fast Pen Mode** | Allow pens without complete fractals |
## Display Options
- Pen lines with customizable colors and width
- Segment lines for different levels
- Pivot zone boxes with gradient colors
- Trading signals at fractal positions
## Upcoming Features (Coming Soon)
The following features are planned for future releases:
### Pen & Fractal Enhancements
- Right containment check (启用右包含检查)
- Pen endpoint mode: Strict highest/lowest vs Secondary high/low (笔端点模式)
- Pen extension correction in secondary mode (次高次低模式启用笔延伸修正)
- Single pen to segment (单笔成段)
- Segment formation conditions (成段条件)
- K-line count for segment (K线数量)
- Pen/Segment count for trend (笔/段数量)
- Trend line start filter (趋势线起点过滤)
- Local extremum filter (局部极值过滤)
- Lookback period (回溯周期)
- 3K interval filter (3K间隔过滤)
- Raw K-line fractal display (显示原始K线分型)
- Raw fractal for pen (原始分型用于笔)
- Single pen to segment ratio (单笔成段比例)
- Top/Bottom to pen ratio (顶底成笔)
### Segment Enhancements
- Super trend line display (显示大趋势线)
- Trend line extension (趋势线延伸)
- Super trend line extension (大趋势线延伸)
- Super trend segment colors (线段颜色-大趋势线)
- Single segment to trend (单段成趋势)
- Trend breakthrough (趋势突破)
- Feature sequence gap detection (启用特征序列缺口检测)
### Pivot Zone Enhancements
- Big-level pivot zone display (大级别中枢)
- Early draw big-level pivot (提前绘制大级别中枢)
- Big-level pivot colors (大级别中枢颜色)
### Trading Signal Enhancements
- Big-level trading signals (大级别买卖点)
- Type 2 chain detection (类2链式判断)
- Type 3 search range (类3搜索范围)
- Type 3 rapid reversal alert (3类买卖点急速反转警报)
### MACD Divergence (Complete Module)
- Sub-level divergence display (显示次级别背驰)
- Main-level divergence display (显示本级别背驰)
- Type 1 divergence detection method (1买卖点背驰判断方式)
- Type 1 pivot requirement (1买卖点中枢要求)
- Type 1 divergence detection toggle (1类买卖点启用背驰判断)
### Signal Filtering (Complete Module)
- Fractal validity filter (买卖点分型过滤)
- Basic fractal filter (买卖点分型基础过滤)
- Type 1 MACD divergence filter (1买卖macd背驰过滤)
- Type 2 signal filter (2买卖点过滤)
- False signal trap avoidance (防狼术)
- Expected signal display (显示预期买卖点)
- Alert differentiation (警报区分)
### Feature Sequence (Complete Module)
- Feature sequence display (显示特征序列)
- Up/Down segment colors for feature sequence
## Notes
- This script is for technical analysis reference only
- Does not constitute investment advice
- Users should make independent trading decisions
- Best used in conjunction with Chan Theory MACD Divergence indicator
---
# 概述
本指标基于缠论(Chan Theory)技术分析框架,使用Pine Script v5实现价格结构的自动识别。自动解析分型、笔、线段和中枢等核心组件,提供客观的结构化交易信号。
**核心功能:**
- 实时分型和笔识别,提供4种笔类型选择
- 多级别线段分析(次级别和本级别)
- 动态中枢识别与可视化
- 一、二、三类买卖点检测
- 所有结构组件可自定义显示设置
## 工作原理
### 1. K线包含处理
消除K线包含关系带来的噪音:
- **上涨趋势**:取高点高值、低点高值
- **下跌趋势**:取高点低值、低点低值
### 2. 分型识别
在处理后的K线上识别顶底分型:
- **顶分型**:中间K线高点 > 两侧高点
- **底分型**:中间K线低点 < 两侧低点
### 3. 笔的构建(4种类型)
连接有效分型形成笔结构:
- **老笔**:每笔至少5根处理后K线
- **新笔**:4根处理后K线 + 5根原始K线
- **4K笔**:4根原始K线满足特定条件
- **严笔**:5根K线 + 方向验证
### 4. 线段划分(3种模式)
将笔组合成更高级别的线段:
- **当下延伸后修正**:随新数据实时调整
- **严格模式**:完全符合经典定义
- **延伸模式**:灵活处理趋势延续
### 5. 中枢识别
识别多级别的盘整区域:
- 次级别中枢(基于笔)
- 本级别中枢(基于线段)
- 实时中枢延伸可视化
## 买卖点信号
### 一类买卖点 (1buy/1sell)
基于线段内动量背驰的趋势反转信号,需要中枢形成或足够笔数。
### 二类买卖点 (2buy/2sell)
一类之后的回调入场信号,通过次级别分型确认识别。
### 三类买卖点 (3buy/3sell)
价格突破并站稳中枢边界的突破确认信号。
### 类二买卖点 (L2buy/L2sell)
条件较宽松的类似二类信号。
## 设置说明
| 设置项 | 说明 |
|--------|------|
| **笔的类型** | 根据波动性选择老笔/新笔/4K/严笔 |
| **线段模式** | 选择符合策略的计算方式 |
| **显示中枢** | 切换次级别/本级别中枢显示 |
| **运行中的笔** | 显示当前形成中的未确认笔 |
| **急速成笔** | 允许无完整分型成笔 |
## 显示选项
- 笔线条,可自定义颜色和宽度
- 不同级别的线段线条
- 中枢区域带渐变色
- 买卖点信号显示在分型位置
## 即将推出的功能(敬请期待)
以下功能计划在后续版本中发布:
### 分型、笔增强功能
- 启用右包含检查
- 笔端点模式:严格最高最低点 / 允许次高次低点
- 次高次低模式启用笔延伸修正
- 单笔成段
- 成段条件(突破极值/数量条件/任一满足)
- K线数量要求
- 笔/段数量要求
- 趋势线起点过滤
- 局部极值过滤
- 回溯周期
- 3K间隔过滤
- 显示原始K线分型
- 原始分型用于笔
- 单笔成段比例
- 顶底成笔
### 线段增强功能
- 显示大趋势线
- 趋势线延伸
- 大趋势线延伸
- 线段颜色(大趋势线)
- 单段成趋势
- 趋势突破
- 启用特征序列缺口检测
### 中枢增强功能
- 是否显示大级别中枢
- 提前绘制大级别中枢
- 大级别中枢颜色设置
### 买卖点增强功能
- 大级别买卖点
- 启用类2链式判断
- 类3搜索范围
- 启用3类买卖点急速反转警报
### MACD背驰模块(完整模块)
- 显示次级别背驰
- 显示本级别背驰
- 1买卖点背驰判断方式
- 1买卖点中枢要求
- 1类买卖点启用背驰判断
### 买卖点过滤模块(完整模块)
- 买卖点分型过滤
- 买卖点分型基础过滤
- 1买卖macd背驰过滤
- 2买卖点过滤
- 防狼术
- 显示预期买卖点
- 警报区分
### 特征序列模块(完整模块)
- 显示特征序列
- 上涨/下跌线段特征序列颜色
## 声明
- 本脚本仅供技术分析参考
- 不构成投资建议
- 用户应自行做出交易决策
- 建议结合缠论macd背驰指标使用
Fourier Smoothed Volume Zone Oscillator Forecast [QuantAlgo]🟢 Overview
Volume tells the story that price alone cannot. When thousands of contracts change hands on an upward move versus a handful on a downward drift, the market communicates something meaningful about conviction and participation. The Fourier Smoothed Volume Zone Oscillator (FSVZO) captures this relationship by measuring directional volume flow, producing readings that reveal whether buyers or sellers control the tape with genuine commitment. Building on this foundation, this FSVZO Forecast indicator adds a forward-looking dimension through three distinct projection engines: a market structure model that interprets swing dynamics, a volume-weighted approach that examines accumulation and distribution flows, and a linear regression method that extrapolates recent directional behavior. What distinguishes this implementation is its dual forecasting architecture. Since FSVZO fundamentally depends on the interplay between price movement and volume activity, the indicator projects both elements independently before calculating future oscillator values, creating coherent framework for mean reversion trading across multiple asset classes and timeframes, from intraday scalping on liquid futures to swing trading equities and cryptocurrencies.
🟢 How It Works
The indicator begins by calculating a Volume Zone Oscillator using a directional volume approach: it multiplies volume by the sign of price change (positive when price rises, negative when price falls), applies a weighted moving average to this directional volume, then divides by a simple moving average of total volume. The result scales to a percentage, typically oscillating between -100 and +100, with readings beyond these levels indicating exceptional momentum conditions. Multiple smoothing passes, including a triple-smoothed SMA sequence and optional additional smoothing, reduce noise while preserving meaningful signals.
The forecasting mechanism operates through a two-stage process that distinguishes this indicator from simpler projection tools. First, the system estimates future price levels using the selected forecasting method. Second, it independently projects future volume using one of three volume models: average (baseline historical volume), momentum (volume adjusted for recent acceleration or deceleration), or mean reversion (volume gravitating toward longer-term norms). These dual projections then feed into a simulated FSVZO engine that replicates the actual oscillator's mathematics, calculating directional volume relationships and applying identical smoothing operations to produce projected values.
Since momentum oscillators rarely travel in straight lines, the projection system incorporates dynamic price oscillation. This mechanism draws from stored patterns of recent price changes, applies mathematical wave functions tied to current volatility conditions, and factors in momentum characteristics to create natural-looking forecast trajectories. The Price Volatility input allows traders to adjust the degree of fluctuation in projections. Higher settings produce more waviness, while lower settings generate smoother trend-like forecasts. The complete system generates up to 20 bars of projected FSVZO and MA values, rendered as dashed lines extending beyond current price action.
🟢 Key Features
1. Market Structure Model
This projection method analyzes price action through the lens of swing point dynamics and structural shifts. The algorithm identifies pivot highs and pivot lows within a configurable lookback range, then evaluates whether the market exhibits bullish characteristics (successive higher highs and higher lows) or bearish patterns (successive lower highs and lower lows). When price breaks previous swing levels, the model recognizes these as potential changes of character that inform projection direction.
Price forecasts under this model incorporate proximity analysis to key structural levels and aggregate trend strength, measured by counting trend-confirming swings across recent history. Bullish structure combined with price near support zones biases projections upward, generating forecasted FSVZO readings that reflect potential buying momentum. Bearish structure near resistance creates downward-biased projections. ATR scaling keeps projections proportional to current market volatility.
▶ Practical Implications:
Designed for traders who build strategies around support, resistance, and swing-based entries
Structure-based projections provide context around pivot zones where FSVZO direction changes may coincide with price reactions
Can help visualize potential divergence setups as structural shifts in price may precede FSVZO direction changes
Shows how FSVZO projections shift based on proximity to detected swing highs and lows
Works best when markets display clear directional swings rather than choppy consolidation
May produce less useful output during extended consolidation phases with overlapping swing points
Day traders can combine structural projections with session pivots for intraday momentum context
2. Volume-Weighted Model
This method synthesizes multiple volume indicators to construct informed price projections that subsequently drive FSVZO forecasts. The algorithm tracks On-Balance Volume to measure cumulative buying and selling pressure over time, monitors the Accumulation/Distribution Line to assess where price settles within each bar's range relative to volume, and computes volume-weighted returns that emphasize high-activity price movements. Directional slopes of these metrics reveal whether volume patterns confirm or contradict prevailing price direction.
Significant volume spikes receive heightened attention, with their directional bias incorporated into forecast calculations. When OBV slope, A/D line slope, and volume momentum align in the same direction, the model generates more assertive price projections, translating to stronger FSVZO movements. Conflicting volume signals produce dampened projections, suggesting FSVZO may consolidate rather than extend. The Volume Influence parameter allows traders to weight how heavily volume analysis affects the final projection versus pure price trend extrapolation.
▶ Practical Implications:
Designed for traders who incorporate volume confirmation into their analysis
Helps identify whether current price moves are accompanied by supportive volume patterns
Volume-based projections can provide additional context when evaluating divergences between price and momentum
Best suited for instruments with meaningful volume data
Swing traders can assess whether breakout moves show volume commitment
3. Linear Regression Model
The most mathematically direct of the three approaches, linear regression fits an optimal straight line through recent price data using least-squares methodology and extends that trajectory forward. These projected prices, combined with volume forecasts, generate corresponding FSVZO projections without conditional market interpretation or structural analysis. The forecast simply addresses one question: if price continues at its current rate of change with projected volume conditions, where would FSVZO readings be in upcoming bars?
▶ Practical Implications:
Functions well during sustained, orderly trends where price progression remains relatively linear
Responds more slowly to sudden directional shifts or volatility regime changes
Works effectively on higher timeframes where trends develop more gradually
Useful benchmark for comparing against structure or volume models to gauge projection differences
🟢 Universal Applications Across All Models
Regardless of which forecasting method you select, the FSVZO Forecast indicator projects future oscillator positions that may assist with:
▶ Mean Reversion Trading at Extreme Zones: FSVZO displays defined overbought and oversold territories that create potential mean reversion opportunities. When FSVZO enters these upper or lower extremes, traders can monitor for potential exhaustion and reversal setups as the oscillator moves back toward neutral. Projections add a timing dimension to this analysis by showing where FSVZO may travel in upcoming bars, allowing traders to anticipate when the oscillator might approach or exit extreme zones.
▶ Trend Following with the Colored Band: The filled band between FSVZO main line and offset line delivers immediate trend visualization across all forecast models. Green coloring indicates rising FSVZO (current value higher than previous = long/buy opportunity), while red coloring indicates falling FSVZO (current value lower than previous = short/sell opportunity). This visual system provides quick reference for current momentum direction. For trend following applications, traders can monitor band color for directional bias and watch for color transitions as potential warning signals. Projections extend this visualization into future bars, showing whether the forecast anticipates continued momentum or potential direction changes. Combining band direction with FSVZO's position relative to zero provides layered context: green band above zero suggests bullish momentum, red band below zero suggests bearish momentum, while mixed readings suggest transitional conditions.
▶ Divergence Detection: Built-in divergence scanning identifies regular (R label) and hidden (H label) divergences between price and FSVZO. Regular divergences occur when price makes a higher high while FSVZO makes a lower high (bearish) or price makes a lower low while FSVZO makes a higher low (bullish). Hidden divergences signal potential trend continuation. Projections can provide context for whether developing divergences might continue or resolve.
▶ Signal Line Crossovers: The indicator tracks crossovers between FSVZO and its moving average. Crossovers from below occur when FSVZO rises above the MA, while crossovers from above occur when FSVZO falls below the MA. Projections may help anticipate when these crossovers could occur.
▶ Zero Line Analysis: FSVZO crossing above zero indicates a shift to positive directional volume flow. Crossing below zero indicates a shift to negative directional volume flow. Projections can show whether the oscillator may approach or cross the zero line in upcoming bars.
▶ White Noise Filtering: The optional Ehlers White Noise overlay displays an additional oscillator that measures the degree of randomness in price movement. This can help identify periods when price movements lack clear directional commitment, providing context for when momentum signals may be less meaningful.
▶ Multi-Model Comparison: Running different projection methods and noting where they agree or disagree provides additional analytical context. When multiple methods project similar trajectories, this alignment may warrant special attention.
▶ Trade Management: Reference projected FSVZO levels when planning stops, position adjustments, or profit targets based on anticipated momentum conditions.
🟢 Important Considerations
▶ This indicator requires volume data to function correctly. Instruments that do not report volume or report unreliable volume data will produce meaningless or zero readings.
▶ These forecasts derive from mathematical analysis of recent price and volume behavior. Markets operate as dynamic systems influenced by countless factors that no technical indicator can fully anticipate. Projected FSVZO values represent potential momentum scenarios based on current conditions, and actual readings may follow different paths than those visualized. Historical tendencies and mathematical extrapolations provide no guarantee of future market behavior. Consider these projections as one component within a comprehensive trading methodology that includes disciplined risk management, appropriate position sizing, and multiple analytical perspectives. The primary value of this script lies not in expecting precise forecasts but in developing forward-looking awareness of possible market conditions and structuring your trades accordingly.
Valex Bot - V3Valex Bot V3 is a macro trend intelligence indicator designed to cut through market noise and highlight the most important directional shifts in price. Built for traders who prioritize clarity and confidence, it delivers clean, visually intuitive trend guidance along with precise buy and sell signals that align with major market cycles. By anchoring its analysis to higher-timeframe market structure, Valex Bot V3 helps users stay on the right side of powerful trends while avoiding emotional overtrading and false signals common on lower timeframes. Whether used as a standalone trend system or as a directional filter for entries, it excels at identifying high-probability market phases across crypto, forex, and traditional markets.
Volume-Weighted Price Z-Score [QuantAlgo]🟢 Overview
The Volume-Weighted Price Z-Score indicator quantifies price deviations from volume-weighted equilibrium using statistical standardization. It combines volume-weighted moving average analysis with logarithmic deviation measurement and volatility normalization to identify when prices have moved to statistically extreme levels relative to their volume-weighted baseline, helping traders and investors spot potential mean reversion opportunities across multiple timeframes and asset classes.
🟢 How It Works
The indicator's core methodology lies in its volume-weighted statistical approach, where price displacement is measured through normalized deviations from volume-weighted price levels:
volumeWeightedAverage = ta.vwma(priceSource, lookbackPeriod)
logDeviation = math.log(priceSource / volumeWeightedAverage)
volatilityMeasure = ta.stdev(logDeviation, lookbackPeriod)
The script uses logarithmic transformation to capture proportional price changes rather than absolute differences, ensuring equal treatment of percentage moves regardless of price level:
rawZScore = logDeviation / volatilityMeasure
zScore = ta.ema(rawZScore, smoothingPeriod)
First, it establishes the volume-weighted baseline which gives greater weight to price levels where significant trading occurred, creating a more representative equilibrium point than simple moving averages.
Then, the logarithmic deviation measurement converts the price-to-average ratio into a normalized scale:
logDeviation = math.log(priceSource / volumeWeightedAverage)
Next, statistical normalization is achieved by dividing the deviation by its own historical volatility, creating a standardized z-score that measures how many standard deviations the current price sits from the volume-weighted mean.
Finally, EMA smoothing filters noise while preserving the signal's responsiveness to genuine market extremes:
rawZScore = logDeviation / volatilityMeasure
zScore = ta.ema(rawZScore, smoothingPeriod)
This creates a volume-anchored statistical oscillator that combines price-volume relationship analysis with volatility-adjusted normalization, providing traders with probabilistic insights into market extremes and mean reversion potential based on standard deviation thresholds.
🟢 Signal Interpretation
▶ Positive Values (Above Zero): Price trading above volume-weighted average indicating potential overvaluation relative to volume-weighted equilibrium = Caution on longs, potential mean reversion downward = Short/sell opportunities
▶ Negative Values (Below Zero): Price trading below volume-weighted average indicating potential undervaluation relative to volume-weighted equilibrium = Caution on shorts, potential mean reversion upward = Long/buy opportunities
▶ Zero Line Crosses: Mean reversion transitions where price crosses back through volume-weighted equilibrium, indicating shift from overvalued to undervalued (or vice versa) territory
▶ Extreme Positive Zone (Above +2.5σ default): Statistically rare overvaluation representing 98.8%+ confidence level deviation, indicating extremely stretched bullish conditions with high mean reversion probability = Strong correction warning/short signal
▶ Extreme Negative Zone (Below -2.5σ default): Statistically rare undervaluation representing 98.8%+ confidence level deviation, indicating extremely stretched bearish conditions with high mean reversion probability = Strong buying opportunity signal
▶ ±1σ Reference Levels: Moderate deviation zones (±1 standard deviation) marking common price fluctuation boundaries where approximately 68% of price action occurs under normal distribution
▶ ±2σ Reference Levels: Significant deviation zones (±2 standard deviations) marking unusual price extremes where approximately 95% of price action should be contained under normal conditions
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets accommodate different analytical approaches, instruments and timeframes. "Default" provides balanced statistical measurement suitable for swing trading and daily/4-hour analysis, offering deviation detection with moderate responsiveness to price dislocations. "Fast Response" delivers heightened sensitivity optimized for intraday trading and scalping on 15-minute to 1-hour charts, using shorter statistical windows and minimal smoothing to capture rapid mean reversion opportunities as they develop. "Smooth Trend" offers conservative extreme identification ideal for position trading on daily to weekly charts, employing extended statistical periods and heavy noise filtering to isolate only the most significant market extremes.
▶ Built-in Alerts: Seven alert conditions enable comprehensive automated monitoring of statistical extremes and mean reversion events. Extreme Overbought triggers when z-score crosses above the extreme threshold (default +2.5σ) signaling rare overvaluation, Extreme Oversold activates when z-score crosses below the negative extreme threshold (default -2.5σ) signaling rare undervaluation. Exit Extreme Overbought and Exit Extreme Oversold alert when prices begin reverting from these statistical extremes back toward the mean. Bullish Mean Reversion notifies when z-score crosses above zero indicating shift to overvalued territory, while Bearish Mean Reversion triggers on crosses below zero indicating shift to undervalued territory. Any Extreme Level provides a combined alert for any extreme threshold breach regardless of direction. These notifications allow you to capitalize on statistically significant price dislocations without continuous chart monitoring.
▶ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast for identifying positive versus negative deviations across trading environments. The adjustable fill transparency control (0-100%) allows fine-tuning of the gradient area prominence between the z-score line and zero baseline, with higher opacity values creating subtle background context while lower values produce bold deviation emphasis. Optional bar coloring extends the z-score gradient directly to the indicator pane bars, providing immediate visual reinforcement of current deviation magnitude and direction without requiring reference to the plotted line itself.
*Note: This indicator requires volume data to function correctly, as it calculates deviations from a volume-weighted price average. Tickers with no volume data or extremely limited volume will not produce meaningful results, i.e., the indicator may display flat lines, erratic values, or fail to calculate properly. Using this indicator on assets without volume data (certain forex pairs, synthetic indices, or instruments with unreported/unavailable volume) will produce unreliable or no results at all. Additionally, ensure your chart has sufficient historical data to cover the selected lookback period, e.g., using a 100-bar lookback on a chart with only 50 bars of history will yield incomplete or inaccurate calculations. Always verify your chosen ticker has consistent, accurate volume information and adequate price history before applying this indicator.
Stress & Recovery Daily Stock/BTC This indicator is a stress → recovery regime tool designed for Daily charts (Bitcoin and equities). It combines Williams Vix Fix (WVF) to detect panic/capitulation conditions (potential bottoms) with RSI vs EMA(RSI) to confirm the start of a recovery phase — but only when that recovery occurs within a configurable number of bars after a WVF panic event.
It is not a generic trend indicator. It focuses on one specific sequence:
Panic spike (WVF) → Recovery confirmation (RSI crossing above EMA(RSI)).
What it Shows
1) Red Bottom Shadow (Panic Zone)
A red shaded area below the baseline appears when WVF triggers a panic condition. This highlights periods where downside pressure and “panic-like” behavior are elevated.
To avoid clutter, the red triangle marker (▼) is plotted only once per red cluster, specifically on the last bar of the panic cluster (end of the WVF signal streak).
2) Green State Ribbon (Recovery Regime)
A green ribbon above the baseline indicates a recovery regime. You can choose how the green signal behaves:
Crossover only: green is active only on the single bar where RSI crosses above EMA(RSI).
State (RSI > EMA): green stays active as long as RSI remains above EMA(RSI).
3) Amber Ribbon (Conflict State)
If panic (WVF) and recovery (green state) overlap, the ribbon turns amber.
This indicates a mixed condition: panic is still present, but momentum is attempting to reverse.
4) Green Triangle Marker (▲) — Validated Recovery Start
A green triangle (▲) appears only when RSI crosses above EMA(RSI) AND that crossover happens within N bars from the most recent WVF panic zone. This time-window filter helps avoid unrelated RSI crossovers that occur far from capitulation events.
How to Use
- Treat red shadow as a “panic/stress zone”.
- Look for the green triangle (▲) as the first validated recovery trigger after panic.
- Use green ribbon as a recovery regime filter (especially in “State” mode).
- Use amber ribbon as a caution zone (overlap = mixed signals).
This indicator is best used as a context and timing filter, not as a complete trading system by itself.
Notes:
- Designed and tuned for Daily timeframe usage.
- Signals may behave differently on intraday timeframes or illiquid assets.
RSI Forecast [QuantAlgo]🟢 Overview
While standard RSI excels at measuring current momentum and identifying overbought or oversold conditions, it only reflects what has already happened in the market. The RSI Forecast indicator builds upon this foundation by projecting potential RSI trajectories into future bars, giving traders a framework to consider where momentum might head next. Three analytical models power these projections: a market structure approach that reads swing highs and lows, a volume analysis method that weighs accumulation and distribution patterns, and a linear regression model that extrapolates recent trend behavior. Each model processes market data differently, allowing traders to choose the approach that best fits their analytical style and the asset they're trading.
🟢 How It Works
At its foundation, the indicator calculates RSI using the standard methodology: comparing average upward price movements against average downward movements over a specified period, producing an oscillator that ranges from 0 to 100. Traders can apply an optional signal line using various moving average types (e.g., SMA, EMA, SMMA/RMA, WMA, or VWMA), and when SMA smoothing is selected, Bollinger Bands can be added to visualize RSI volatility ranges.
The forecasting mechanism operates by first estimating future price levels using the chosen projection method. These estimated prices then pass through a simulated RSI engine that mirrors the actual indicator's mathematics. The simulation updates the internal gain and loss averages bar by bar, applying the same RMA smoothing that powers real RSI calculations, to produce authentic projected values.
Since RSI characteristically moves in waves rather than straight lines, the projection system incorporates dynamic oscillation. This draws from stored patterns of recent RSI movements, factors in the tendency for RSI to pull back from extreme readings, and applies mathematical wave functions tied to current momentum conditions. The Oscillation Intensity control lets traders adjust how much waviness appears in projections. Signal line (RSI-based MA) projections follow the same logic, advancing the chosen moving average type forward using its proper mathematical formula. The complete system generates 15 bars of projected RSI and signal line values, displayed as dashed lines extending beyond current price action.
🟢 Key Features
1. Market Structure Model
This projection method reads price action through swing point analysis. It scans for pivot highs and pivot lows within a defined lookback range, then evaluates whether the market is building bullish patterns (successive higher highs and higher lows) or bearish patterns (successive lower highs and lower lows). The algorithm recognizes structural shifts when price violates previous swing levels in either direction.
Price projections under this model factor in proximity to key swing levels and overall trend strength, measured by tallying trend-confirming swings over recent history. When bullish structure prevails and price hovers near support, upward price bias enters the projection, pushing forecasted RSI higher. Bearish structure near resistance creates the opposite effect. The model scales its projections using ATR to keep them proportional to current volatility conditions.
▶ Practical Implications for Traders:
Aligns well with traders who focus on support, resistance, and swing-based entries
Provides context for where RSI might travel as price interacts with structural levels
Tends to perform better when markets display clear directional swings
May produce less useful output during consolidation phases with overlapping swings
Offers early visualization of potential divergence setups
Swing traders can use structure-based projections to time entries around key pivot zones
Position traders could benefit from the trend strength component when holding through larger moves
On lower timeframes, it helps scalpers identify micro-structure shifts for quick momentum plays
Useful for mapping out potential RSI behavior around breakout and breakdown levels
Day traders can combine structural projections with session highs and lows for intraday context
2. Volume-Weighted Model
This method blends multiple volume indicators to inform its price projections. It tracks On-Balance Volume to gauge cumulative buying and selling pressure, monitors the Accumulation/Distribution Line to assess where price closes relative to its range on each bar, and calculates volume-weighted returns to give heavier influence to high-volume price movements. The model examines the directional slope of these metrics to assess whether volume confirms or contradicts price direction.
Unusually high volume bars receive special attention, with their directional bias factored into projections. When all volume metrics point the same direction, the model produces more aggressive price forecasts and consequently stronger RSI movements. Conflicting volume signals lead to more muted projections, suggesting RSI may move sideways rather than trending.
▶ Practical Implications for Traders:
Suited for traders who incorporate volume confirmation into their analysis
Works best with instruments that report accurate, meaningful volume data
Useful for identifying situations where momentum lacks volume support
Less applicable to instruments with sparse or unreliable volume information
Scalpers on liquid markets can spot volume-backed momentum for quick entries and exits
Helps intraday traders distinguish between genuine moves and low-volume fakeouts
Position traders can assess whether institutional participation supports longer-term trends
Effective during news events or market opens when volume spikes often drive directional moves
Swing traders can use volume divergence in projections to anticipate potential reversals
3. Linear Regression Model
The simplest of the three methods, linear regression fits a straight line through recent price data using least-squares mathematics and extends that line forward. These projected prices then generate corresponding RSI forecasts. This creates a clean momentum projection without conditional logic or interpretation of market characteristics. The forecast simply asks: if the recent price trend continues at its current rate of change, where would RSI be in the coming bars?
▶ Practical Implications for Traders:
Delivers a clean, mathematically neutral projection baseline
Functions well during sustained, orderly trends
Involves fewer parameters and produces consistent, reproducible output
Responds more slowly when trend direction shifts
Works best in trending environments rather than ranging markets
Ideal for position traders who want to ride established trends
Useful for swing traders to gauge trend exhaustion when actual RSI deviates from linear projections
Scalpers can use the smooth output as a reference point to measure short-term momentum deviations
Effective baseline for comparing against structure or volume models to measure market complexity
Works particularly well on higher timeframes where trends develop more gradually
🟢 Universal Applications Across All Models
Regardless of which forecasting method you select, the indicator projects future RSI positions that may help with:
▶ Overbought/Oversold Planning: See whether RSI trajectories point toward extreme zones, giving you time to prepare responses before conditions develop
▶ Entry and Exit Timing: Factor projected RSI levels into your timing decisions for opening or closing positions
▶ Crossover Anticipation: Watch for projected crossings between RSI and its signal line (RSI-based MA) that might indicate upcoming momentum shifts
▶ Mean Reversion Context: When RSI sits at extremes, projections can illustrate potential paths back toward the midline
▶ Momentum Evaluation: Assess whether current directional strength appears likely to continue or fade based on projection direction
▶ Divergence Awareness: Use forecast trajectories alongside price action to spot potential divergence formations earlier
▶ Comparative Analysis: Run different projection methods and note where they agree or disagree, using alignment as an additional filter, for instance
▶ Multi-Timeframe Context: Compare RSI projections across different timeframes to identify alignment or conflict in momentum outlook
▶ Trade Management: Reference projected RSI levels when adjusting stops, scaling positions, or setting profit targets
▶ Rule-Based Systems: Incorporate projected RSI conditions into systematic trading approaches for more forward-looking signal generation
Note: It is essential to recognize that these forecasts derive from mathematical analysis of recent price behavior. Markets are dynamic environments shaped by innumerable factors that no technical tool can fully capture or foresee. The projected RSI values represent potential scenarios for how momentum might develop, and actual readings can take different paths than those visualized. Historical tendencies and past patterns offer no guarantee of future behavior. Consider these projections as one element within a comprehensive trading approach that encompasses disciplined risk management, appropriate position sizing, and diverse analytical methods. The true benefit lies not in expecting precise forecasts but in developing a forward-thinking perspective on possible market conditions and planning your responses accordingly.
Crypto Flow Index (CFI) - RS vs BTC/ETH ---
Crypto Flow Index, CFI
Crypto Flow Index, CFI, measures relative strength between an asset and Bitcoin or Ethereum.
You use CFI to judge whether capital favors your asset or the benchmark.
CFI does not give entry or exit signals.
You use CFI as a bias and context tool.
---
What CFI measures
Relative strength money flow on the BASE/BTC or BASE/ETH pair.
Volume weighted pressure, not price alone.
Momentum blended into flow to smooth rotations.
Optional USD trend filter using fast and slow EMAs.
---
How to read CFI
Above 50 means relative strength favors the asset.
Below 50 means relative strength favors BTC or ETH.
Rising CFI shows strengthening relative demand.
Falling CFI shows weakening relative demand.
---
Histogram
Green bars show positive relative flow.
Red bars show negative relative flow.
Larger bars signal stronger pressure.
---
Bias ribbon
Green ribbon shows bullish relative bias.
Red ribbon shows bearish relative bias.
Gray ribbon shows transition or balance.
---
How to use CFI
Favor long trades when CFI stays above 50.
Avoid longs when price rises but CFI falls.
Spot rotations before price reacts.
Combine with structure, entries, and risk rules.
---
Important limits
CFI compares assets only to BTC or ETH.
CFI does not represent the entire crypto market.
USD price and relative strength often diverge.
---
Core question CFI answers
Is your asset gaining or losing strength versus Bitcoin or Ethereum.
---
BTC Valuation ZonesBTC Valuation – Distance From 200 MA
This indicator provides a simple but powerful Bitcoin valuation framework based on how far price is from the 200-period Moving Average, a level that has historically acted as Bitcoin’s long-term equilibrium.
Instead of predicting tops or bottoms, this tool focuses on mean-reversion behavior:
When price deviates too far above the 200 MA → risk increases
When price deviates deeply below the 200 MA → long-term opportunity increases
Adaptive Z-Score Oscillator [QuantAlgo]🟢 Overview
The Adaptive Z-Score Oscillator transforms price action into statistical significance measurements by calculating how many standard deviations the current price deviates from its moving average baseline, then dynamically adjusting threshold levels based on historical distribution patterns. Unlike traditional oscillators that rely on fixed overbought/oversold levels, this indicator employs percentile-based adaptive thresholds that automatically calibrate to changing market volatility regimes and statistical characteristics. By offering both adaptive and fixed threshold modes alongside multiple moving average types and customizable smoothing, the indicator provides traders and investors with a robust framework for identifying extreme price deviations, mean reversion opportunities, and underlying trend conditions through the visualization of price behavior within a statistical distribution context.
🟢 How It Works
The indicator begins by establishing a dynamic baseline using a user-selected moving average type applied to closing prices over the specified length period, then calculates the standard deviation to measure price dispersion:
basis = ma(close, length, maType)
stdev = ta.stdev(close, length)
The core Z-Score calculation quantifies how many standard deviations the current price sits above or below the moving average basis, creating a normalized oscillator that facilitates cross-asset and cross-timeframe comparisons:
zScore = stdev != 0 ? (close - basis) / stdev : 0
smoothedZ = ma(zScore, smooth, maType)
The adaptive threshold mechanism employs percentile calculations over a historical lookback period to determine statistically significant extreme zones. Rather than using fixed levels like ±2.0, the indicator identifies where a specified percentage of historical Z-Score readings have fallen, automatically adjusting to market regime changes:
upperThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, upperPercentile) : fixedUpper
lowerThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, lowerPercentile) : fixedLower
The visualization architecture creates a four-tier coloring system that distinguishes between extreme conditions (beyond the adaptive thresholds) and moderate conditions (between the midpoint and threshold levels), providing visual gradation of statistical significance through opacity variations and immediate recognition of distribution extremes.
🟢 How to Use This Indicator
▶ Overbought and Oversold Identification:
The indicator identifies potential overbought conditions when the smoothed Z-Score crosses above the upper threshold, indicating that price has deviated to a statistically extreme level above its mean. Conversely, oversold conditions emerge when the Z-Score crosses below the lower threshold, signaling statistically significant downward deviation. In adaptive mode (default), these thresholds automatically adjust to the asset's historical behavior, i.e., during high volatility periods, the thresholds expand to accommodate wider price swings, while during low volatility regimes, they contract to capture smaller deviations as significant. This dynamic calibration reduce false signals that plague fixed-level oscillators when market character shifts between volatile and ranging conditions.
▶ Mean Reversion Trading Applications:
The Z-Score framework excels at identifying mean reversion opportunities by highlighting when price has stretched too far from its statistical equilibrium. When the oscillator reaches extreme bearish levels (below the lower threshold with deep red coloring), it suggests price has become statistically oversold and may snap back toward the mean, presenting potential long entry opportunities for mean reversion traders. Symmetrically, extreme bullish readings (above the upper threshold with bright green coloring) indicate potential short opportunities or long exit points as price becomes statistically overbought. The moderate zones (lighter colors between midpoint and threshold) serve as early warning areas where traders can prepare for potential reversals, while exits from extreme zones (crossing back inside the thresholds) often provide confirmation that mean reversion is underway.
▶ Trend and Distribution Analysis:
Beyond discrete overbought/oversold signals, the histogram's color pattern and shape reveal the underlying trend structure and distribution characteristics. Sustained periods where the Z-Score oscillates primarily in positive territory (green bars) indicate a bullish trend where price consistently trades above its moving average baseline, even if not reaching extreme levels. Conversely, predominant negative readings (red bars) suggest bearish trend conditions. The distribution shape itself provides insight into market behavior, e.g., a narrow, centered distribution clustering near zero indicates tight ranging conditions with price respecting the mean, while a wide distribution with frequent extreme readings reveals volatile trending or choppy conditions. Asymmetric distributions skewed heavily toward one side demonstrate persistent directional bias, whereas balanced distributions suggest equilibrium between bulls and bears.
▶ Built-in Alerts:
Seven alert conditions enable automated monitoring of statistical extremes and trend transitions. Enter Overbought and Enter Oversold alerts trigger when the Z-Score crosses into extreme zones, providing early warnings of potential reversal setups. Exit Overbought and Exit Oversold alerts signal when price begins reverting from extremes, offering confirmation that mean reversion has initiated. Zero Cross Up and Zero Cross Down alerts identify transitions through the neutral line, indicating shifts between above-mean and below-mean price action that can signal trend changes. The Extreme Zone Entry alert fires on any extreme threshold penetration regardless of direction, allowing unified monitoring of both overbought and oversold opportunities.
▶ Color Customization:
Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and aesthetic preferences, ensuring optimal contrast and readability across trading platforms. The bar transparency control (0-90%) allows fine-tuning of visual prominence, with minimal transparency creating bold, attention-grabbing bars for primary analysis, while higher transparency values produce subtle background context when using the oscillator alongside other indicators. The extreme and moderate zone coloring system uses automatic opacity variation to create instant visual hierarchy, with darkest colors highlight the most statistically significant deviations demanding immediate attention, while lighter shades mark developing conditions that warrant monitoring but may not yet justify action. Optional candle coloring extends the Z-Score color scheme directly to the price candles on the main chart, enabling traders to instantly recognize statistical extremes and trend conditions without needing to reference the oscillator panel, creating a unified visual experience where both price action and statistical analysis share the same color language.






















