Hurst Exponent Oscillator [PhenLabs]📊 Hurst Exponent Oscillator -
Version: PineScript™ v5
📌 Description
The Hurst Exponent Oscillator (HEO) by PhenLabs is a powerful tool developed for traders who want to distinguish between trending, mean-reverting, and random market behaviors with clarity and precision. By estimating the Hurst Exponent—a statistical measure of long-term memory in financial time series—this indicator helps users make sense of underlying market dynamics that are often not visible through traditional moving averages or oscillators.
Traders can quickly know if the market is likely to continue its current direction (trending), revert to the mean, or behave randomly, allowing for more strategic timing of entries and exits. With customizable smoothing and clear visual cues, the HEO enhances decision-making in a wide range of trading environments.
🚀 Points of Innovation
Integrates advanced Hurst Exponent calculation via Rescaled Range (R/S) analysis, providing unique market character insights.
Offers real-time visual cues for trending, mean-reverting, or random price action zones.
User-controllable EMA smoothing reduces noise for clearer interpretation.
Dynamic coloring and fill for immediate visual categorization of market regime.
Configurable visual thresholds for critical Hurst levels (e.g., 0.4, 0.5, 0.6).
Fully customizable appearance settings to fit different charting preferences.
🔧 Core Components
Log Returns Calculation: Computes log returns of the selected price source to feed into the Hurst calculation, ensuring robust and scale-independent analysis.
Rescaled Range (R/S) Analysis: Assesses the dispersion and cumulative deviation over a rolling window, forming the core statistical basis for the Hurst exponent estimate.
Smoothing Engine: Applies Exponential Moving Average (EMA) smoothing to the raw Hurst value for enhanced clarity.
Dynamic Rolling Windows: Utilizes arrays to maintain efficient, real-time calculations over user-defined lengths.
Adaptive Color Logic: Assigns different highlight and fill colors based on the current Hurst value zone.
🔥 Key Features
Visually differentiates between trending, mean-reverting, and random market modes.
User-adjustable lookback and smoothing periods for tailored sensitivity.
Distinct fill and line styles for each regime to avoid ambiguity.
On-chart reference lines for strong trending and mean-reverting thresholds.
Works with any price series (close, open, HL2, etc.) for versatile application.
🎨 Visualization
Hurst Exponent Curve: Primary plotted line (smoothed if EMA is used) reflects the ongoing estimate of the Hurst exponent.
Colored Zone Filling: The area between the Hurst line and the 0.5 reference line is filled, with color and opacity dynamically indicating the current market regime.
Reference Lines: Dash/dot lines mark standard Hurst thresholds (0.4, 0.5, 0.6) to contextualize the current regime.
All visual elements can be customized for thickness, color intensity, and opacity for user preference.
📖 Usage Guidelines
Data Settings
Hurst Calculation Length
Default: 100
Range: 10-300
Description: Number of bars used in Hurst calculation; higher values mean longer-term analysis, lower values for quicker reaction.
Data Source
Default: close
Description: Select which data series to analyze (e.g., Close, Open, HL2).
Smoothing Length (EMA)
Default: 5
Range: 1-50
Description: Length for smoothing the Hurst value; higher settings yield smoother but less responsive results.
Style Settings
Trending Color (Hurst > 0.5)
Default: Blue tone
Description: Color used when trending regime is detected.
Mean-Reverting Color (Hurst < 0.5)
Default: Orange tone
Description: Color used when mean-reverting regime is detected.
Neutral/Random Color
Default: Soft blue
Description: Color when market behavior is indeterminate or shifting.
Fill Opacity
Default: 70-80
Range: 0-100
Description: Transparency of area fills—higher opacity for stronger visual effect.
Line Width
Default: 2
Range: 1-5
Description: Thickness of the main indicator curve.
✅ Best Use Cases
Identifying if a market is regime-shifting from trending to mean-reverting (or vice versa).
Filtering signals in automated or systematic trading strategies.
Spotting periods of randomness where trading signals should be deprioritized.
Enhancing mean-reversion or trend-following models with regime-awareness.
⚠️ Limitations
Not predictive: Reflects current and recent market state, not future direction.
Sensitive to input parameters—overfitting may occur if settings are changed too frequently.
Smoothing can introduce lag in regime recognition.
May not work optimally in markets with structural breaks or extreme volatility.
💡 What Makes This Unique
Employs advanced statistical market analysis (Hurst exponent) rarely found in standard toolkits.
Offers immediate regime visualization through smart dynamic coloring and zone fills.
🔬 How It Works
Rolling Log Return Calculation:
Each new price creates a log return, forming the basis for robust, non-linear analysis. This ensures all price differences are treated proportionally.
Rescaled Range Analysis:
A rolling window maintains cumulative deviations and computes the statistical “range” (max-min of deviations). This is compared against the standard deviation to estimate “memory”.
Exponent Calculation & Smoothing:
The raw Hurst value is translated from the log of the rescaled range ratio, and then optionally smoothed via EMA to dampen noise and false signals.
Regime Detection Logic:
The smoothed value is checked against 0.5. Values above = trending; below = mean-reverting; near 0.5 = random. These control plot/fill color and zone display.
💡 Note:
Use longer calculation lengths for major market character study, and shorter ones for tactical, short-term adaptation. Smoothing balances noise vs. lag—find a best fit for your trading style. Always combine regime awareness with broader technical/fundamental context for best results.
Marketregime
Volatility Regime Classifier | ATRP Percentile ZonesThis indicator helps you understand the current volatility environment of any asset by comparing recent ATR-based values to its historical range.
It defines four regimes:
🔴 Low Volatility: Volatility is decreasing
🟢 Normal: Volatility is increasing but still below average
🟠 High: Volatility is elevated
🟣 Extreme: Volatility is very high compared to recent history
⚙️ How it works
We calculate the Average True Range (ATR) as a percentage of price (ATRP), then compare a short-term ATR to a longer-term one. Their difference shows whether volatility is picking up or slowing down.
To make the signal more adaptive, we look at the distribution of recent volatility over a rolling window. We compute the 50th and 70th percentiles of that history to set dynamic thresholds.
About distribution & percentiles
Volatility in financial markets doesn't follow a normal (Gaussian) distribution, it's often skewed, with sudden spikes and fat tails. That means fixed thresholds (like "ATR > 20") can be misleading or irrelevant across assets and timeframes.
Using percentiles solves this:
The 50th percentile marks the middle of the recent volatility range.
The 70th percentile captures a zone where volatility is unusually high, but not too rare, which keeps the signal usable and not overly sensitive.
These levels offer a balance:
⚖️ not too reactive, not too slow — just enough to highlight meaningful shifts.
✅ Use cases
Spot changes in market conditions
Filter or adapt strategies depending on the regime
Adjust position sizing and risk dynamically
Dual-Phase Trend Regime Oscillator (Zeiierman)█ Overview
Trend Regime: Dual-Phase Oscillator (Zeiierman) is a volatility-sensitive trend classification tool that dynamically switches between two oscillators, one optimized for low volatility, the other for high volatility.
By analyzing standard deviation-based volatility states and applying correlation-derived oscillators, this indicator reveals not only whether the market is trending but also what kind of trend regime it is in —Bullish or Bearish —and how that regime reacts to market volatility.
█ Its Uniqueness
Most trend indicators assume a static market environment; they don't adjust their logic when the underlying volatility shifts. That often leads to false signals in choppy conditions or late entries in trending phases.
Trend Regime: Dual-Phase Oscillator solves this by introducing volatility-aware adaptability. It switches between a slow, stable oscillator in calm markets and a fast, reactive oscillator in volatile ones, ensuring the right sensitivity at the right time.
█ How It Works
⚪ Volatility State Engine
Calculates returns-based volatility using standard deviation of price change
Smooths the current volatility with a moving average
Builds a volatility history window and performs median clustering to determine typical "Low" and "High" volatility zones
Dynamically assigns the chart to one of two internal volatility regimes: Low or High
⚪ Dual Oscillators
In Low Volatility, it uses a Slow Trend Oscillator (longer lookback, smoother)
In High Volatility, it switches to a Fast Trend Oscillator (shorter lookback, responsive)
Both oscillators use price-time correlation as a measure of directional strength
The output is normalized between 0 and 1, allowing for consistent interpretation
⚪ Trend Regime Classification
The active oscillator is compared to a neutral threshold (0.5)
If above: Bullish Regime, if below: Bearish Regime, else: Neutral
The background and markers update to reflect regime changes visually
Triangle markers highlight bullish/bearish regime shifts
█ How to Use
⚪ Identify Current Trend Regime
Use the background color and chart table to immediately recognize whether the market is trending up or down.
⚪ Trade Regime Shifts
Use triangle markers (▲ / ▼) to spot fresh regime entries, which are ideal for confirming breakouts within trends.
⚪ Pullback Trading
Look for pullbacks when the trend is in a stable condition and the slow oscillator remains consistently near the upper or lower threshold. Watch for moments when the fast oscillator retraces back toward the midline, or slightly above/below it — this often signals a potential pullback entry in the direction of the prevailing trend.
█ Settings Explained
Length (Slow Trend Oscillator) – Used in calm conditions. Longer = smoother signals
Length (Fast Trend Oscillator) – Used in volatile conditions. Shorter = more responsive
Volatility Refit Interval – Controls how often the system recalculates Low/High volatility levels
Current Volatility Period – Lookback used for immediate volatility measurement
Volatility Smoothing Length – Applies an SMA to the raw volatility to reduce noise
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Impulse Volume Oscillator [Alpha Extract]Impulse Volume Oscillator
A sophisticated indicator designed to identify market impulse moves and volume-based momentum shifts, helping traders capture significant price movements with precision.
Combining price deviations with volume analysis, this oscillator dynamically measures market strength and weakness, providing clear signals for potential trend continuations and reversals.
🔶 Volume-Adjusted Normalization
Utilizes a unique normalization technique that incorporates volume impact to enhance signal quality. This approach ensures the indicator responds more strongly to high-volume price movements while filtering out low-volume noise.
vol_ratio = ta.rsi(volume, 14) / 50
vol_factor = vol_impact > 0 ? 1 + (vol_ratio - 1) * vol_impact : 1
raw_normalized = dev / (ta.stdev(source, bars) * mult)
vol_adjusted = raw_normalized * vol_factor
normalized = ta.sma(vol_adjusted, smooth)
🔶 Adaptive Regime Detection
Incorporates threshold-based regime identification that clearly distinguishes between trending and mean-reverting market conditions. The customizable threshold system allows traders to adapt to different market volatilities and timeframes.
🔶 Customizable Parameters
Fine-tune detection sensitivity with adjustable inputs for lookback period, standard deviation multiplier, volume impact, and signal smoothing. These parameters enable traders to optimize the indicator for various trading styles and market conditions.
❓How It Works
🔶 Impulse Calculation
The oscillator measures price deviation from a moving average baseline, normalized by standard deviation, and then adjusts the signal based on relative volume strength. This creates a responsive yet stable indicator that accurately reflects market momentum.
// Calculate the basis using the selected MA
basis = get_ma(source, bars)
// Calculate the normalized value with volume impact
dev = source - basis
🔶 Dynamic Visualization
The histogram changes color based on signal strength, providing instant visual cues about market conditions. Green bars indicate positive momentum while red bars represent negative momentum, with color intensity reflecting signal strength.
🔶 Trend Confirmation
Built-in trend direction analysis provides confluence with the primary signal, helping traders distinguish between counter-trend bounces and genuine trend reversals. This dual-confirmation approach significantly reduces false signals.
🔶 Visual Alerts & Boundary Tracking
Monitors signal extremes and dynamically adjusts visualization transparency based on signal strength. The indicator highlights particularly strong impulse moves with background shading, making potential trading opportunities immediately apparent.
🔶 Custom Candle Coloring
Optional candle coloring applies the same color logic as the histogram directly to price candles, providing a unified visual framework that helps traders correlate indicator signals with price action.
🔶 Momentum Shift Detection
Automatically identifies important zero-line crossovers that often signify the beginning of new impulse moves. These transition points frequently offer favorable risk/reward entry opportunities.
🔶 Snapshot samples
1 Week
1 Day
15 Min
🔶 Why Choose AE - Impulse Volume Oscillator?
This indicator provides a comprehensive approach to identifying significant market moves by combining volume analysis with price momentum. By offering clear visual signals for both trend continuation and reversal scenarios, it empowers traders to make more informed decisions across various market conditions and timeframes.
Stock Sector ETF with IndicatorsThe Stock Sector ETF with Indicators is a versatile tool designed to track the performance of sector-specific ETFs relative to the current asset. It automatically identifies the sector of the underlying symbol and displays the corresponding ETF’s price action alongside key technical indicators. This helps traders analyze sector trends and correlations in real time.
---
Key Features
Automatic Sector Detection:
Fetches the sector of the current asset (e.g., "Technology" for AAPL).
Maps the sector to a user-defined ETF (default: SPDR sector ETFs) .
Technical Indicators:
Simple Moving Average (SMA): Tracks the ETF’s trend.
Bollinger Bands: Highlights volatility and potential reversals.
Donchian High (52-Week High): Identifies long-term resistance levels.
Customizable Inputs:
Adjust indicator parameters (length, visibility).
Override default ETFs for specific sectors.
Informative Table:
Displays the current sector and ETF symbol in the bottom-right corner.
---
Input Settings
SMA Settings
SMA Length: Period for calculating the Simple Moving Average (default: 200).
Show SMA: Toggle visibility of the SMA line.
Bollinger Bands Settings
BB Length: Period for Bollinger Bands calculation (default: 20).
BB Multiplier: Standard deviation multiplier (default: 2.0).
Show Bollinger Bands: Toggle visibility of the bands.
Donchian High (52-Week High)
Daily High Length: Days used to calculate the high (default: 252, approx. 1 year).
Show High: Toggle visibility of the 52-week high line.
Sector Selections
Customize ETFs for each sector (e.g., replace XLU with another utilities ETF).
---
Example Use Cases
Trend Analysis: Compare a stock’s price action to its sector ETF’s SMA for trend confirmation.
Volatility Signals: Use Bollinger Bands to spot ETF price squeezes or breakouts.
Sector Strength: Monitor if the ETF is approaching its 52-week high to gauge sector momentum.
Enjoy tracking sector trends with ease! 🚀