Stochastic Histogram Regime [Gabremoku]Stochastic Histogram Regime is a refined Stochastic-based momentum oscillator that transforms classic %K / %D logic into a mid-centered histogram regime model with adaptive zones, squeeze detection, and sequential BUY/SELL signaling.
Instead of using the traditional 0–100 Stochastic layout alone, this script recenters the oscillator around its midline and highlights:
momentum expansion and recovery phases
adaptive extreme zones
K/D compression regimes
sequential crossover signals
squeeze-aware signal styling
a compact live dashboard
The Stochastic Oscillator measures where the current close sits relative to its recent price range, and its two core lines — %K and %D — are commonly used to spot momentum shifts, overbought/oversold conditions, and crossover signals.
What it shows
📊 Mid-centered stochastic histogram — instead of plotting Stochastic only in its standard form, the script centers the histogram around the 50 level so bullish and bearish pressure become easier to compare visually.
📈 %K line and ghost %D line — the main momentum line stays visually dominant, while %D acts as a softer confirmation layer.
🎯 Adaptive zones — rather than relying only on static 80/20 thresholds, the script calculates percentile-based extreme zones from recent Stochastic behavior. Traditional Stochastic readings above 80 are often considered overbought and readings below 20 oversold, but adaptive thresholds can better reflect changing market behavior.
🗜️ Combined squeeze regime — the script measures both:
compression around the midline
compression between %K and %D
This creates a composite squeeze state that helps identify low-momentum contraction phases before expansion.
🚦 Sequential BUY/SELL state machine — primary signals are filtered through K/D crossover logic, slope confirmation, and optional extreme-zone requirements.
🔺 Follow-up triangles — repeated same-direction confirmations after the first primary signal can be shown as lighter continuation markers.
🪧 Minimal dashboard — displays state, K/D values, adaptive zone range, slope, and squeeze status.
Core logic
The script is built around the idea that the Stochastic Oscillator is not just an overbought/oversold tool, but a momentum regime detector.
Classic Stochastic compares the latest close to the recent high-low range and is typically interpreted through:
%K and %D crossovers
movement around 80/20 zones
and changes in momentum before price fully reacts
Your script extends that by:
recentering the oscillator around 50
using histogram structure for directional emphasis
adapting extreme zones to recent behavior
and combining crossover quality with slope and squeeze context
This makes it more structured than a standard Stochastic display.
State model
The indicator classifies momentum into five readable states:
Bull Impulse
Bull Recovery
Bear Impulse
Bear Recovery
Neutral
This adds nuance to the usual Stochastic reading because it separates:
strong directional continuation
weaker recovery phases
and non-directional compression
In practice:
Bull Impulse suggests K is above D, above the mid-neutral area, and still rising
Bear Impulse suggests K is below D, below the mid-neutral area, and still falling
recovery states identify improving momentum before full expansion
Signal logic
The script uses a filtered signal engine based on %K / %D crossovers, which are among the most common Stochastic signals.
Primary BUY and SELL signals can be filtered by:
extreme zone location
K slope confirmation
signal mode: Aggressive, Balanced, or Strict
This helps reduce the classic problem of noisy Stochastic crossovers in sideways conditions. Stochastic crossovers are useful, but they generally become more meaningful when combined with trend or momentum context rather than taken in isolation.
How to read it
A practical reading method is:
Use the histogram around the midline to read directional pressure.
Use adaptive zones to identify statistically stretched momentum.
Use %K / %D crossovers for trigger logic.
Use the squeeze state to identify contraction before expansion.
Treat follow-up triangles as continuation confirmation, not as fresh primary entries.
In general:
positive histogram with rising K = improving bullish momentum
negative histogram with falling K = improving bearish momentum
squeeze ON = compressed momentum regime
BUY/SELL labels = primary filtered crossover signals
Features
✅ Mid-centered stochastic histogram
✅ %K and ghost %D structure
✅ Percentile-based adaptive extreme zones
✅ Neutral zone around the 50 midline
✅ Composite squeeze detection
✅ Sequential BUY / SELL state machine
✅ Optional follow-up continuation markers
✅ Overlay and pane signal display options
✅ Minimal live dashboard
✅ Alert conditions for BUY, SELL, and squeeze state
Notes
This indicator is designed to improve the readability of Stochastic momentum structure, especially in transitions between compression, recovery, and impulse phases. Like all Stochastic-based tools, it can produce noisy signals in choppy markets, and overbought/oversold readings should generally be interpreted as momentum context rather than automatic reversal calls.
Author: Gabremoku
Pine Script v6
Pine Script® 인디케이터






















