OPEN-SOURCE SCRIPT

Mean Reverting Suite [OmegaTools]

353
Overview
The Mean Reverting Suits (MR Suite) by OmegaTools is an advanced analytical and visualization framework designed to identify directional exhaustion, statistical overextensions, and conditions consistent with mean-reversion dynamics. It integrates three pillars into a single display: a composite momentum-normalized oscillator, a percentile-based extension model with volume contextualization, and a dynamic structural mapping engine built on confirmed pivots. The indicator does not generate signals or prescribe trade actions; it provides objective context so users can evaluate market balance and the likelihood that price is departing from its recent statistical baseline.

Core logic
The composite oscillator blends MFI on two horizons and RSI on HL2, then averages them to produce a stabilized mean-reversion gauge. Candle and bar colors are mapped by a dual gradient centered at 50. Readings above 50 progressively shift from neutral gray toward the bearish accent color to reflect increasing momentum saturation; readings below 50 shift from the bullish accent color toward gray to reflect potential accumulation or temporary undervaluation. This continuous mapping avoids rigid thresholds and conveys the strength and decay of momentum as a smooth spectrum.

The percentile-based extension model measures the persistence of directional bias by tracking how many bars have elapsed since the last opposing condition. These rolling counts are compared to the 80th percentile of their own historical distributions stored in arrays. When a current streak exceeds its respective percentile, the environment is labeled as statistically extended in that direction. Background shading communicates this information and is modulated by relative volume, computed as live volume divided by a blended average of SMA(30) and EMA(11). Higher opacity implies greater liquidity participation during the extension.

The structural mapping module uses confirmed pivot highs and lows at the chosen length to create persistent horizontal levels that extend forward and automatically maintain themselves until price invalidates or refreshes them. These levels represent market memory zones and assist in reading where reactions previously formed. The engine updates in real time, ensuring the framework continuously reflects the prevailing structure.

Standard deviation and z-score overlay
The updated version introduces a mean and dispersion layer. A simple moving average of HL2 over twice the length provides the reference mean. Dispersion is estimated as the moving average of the absolute deviation between close and the mean over five times the length. The z-score is computed as the distance of price from the mean divided by this dispersion proxy. Visual arrows highlight observations where the absolute z-score exceeds two standard deviations, offering a concise view of statistically unusual departures from the local mean. This layer complements the percentile extension model by adding an orthogonal measure of extremity based on distributional distance rather than run length.

Visualization
Candle bodies and borders inherit the oscillator’s gradient color, creating an immediate sense of directional pressure and potential momentum fatigue. The chart background activates when the extension model detects a statistically rare streak, using blue tones for bearish extension and red tones for bullish extension, with intensity scaling by relative volume. Horizontal lines denote active pivot-based levels, automatically extending, truncating, and refreshing as structure evolves. The z-score arrows appear only when deviations exceed the ±2 threshold, keeping the display focused on noteworthy statistical events.

Inputs and configuration
Length controls the sensitivity of all modules. Lower values make the oscillator and pivot detection more reactive; higher values smooth readings and widen structural context. Bullish and Bearish colors are user-selectable to match platform themes or accessibility requirements.

Interpretation guidance
A strong red background indicates an unusually extended bullish run in the presence of meaningful volume; a strong blue background indicates an unusually extended bearish run in the presence of meaningful volume. Candle gradients near deep bearish tones suggest oscillator readings well above 50; gradients near deep bullish tones suggest oscillator readings well below 50. Pivot lines mark the most recently confirmed structural levels that the market has reacted to. Z-score arrows denote points where price has moved beyond approximately two standard deviations of its local mean, signaling statistically uncommon distance rather than directional persistence. None of these elements are directives; they are objective descriptors designed to improve situational awareness.

Advantages
The framework is adaptive by design and self-normalizes to each instrument’s volatility and rhythm through percentile logic and dispersion-based distance. It is volume-aware, visually encoding liquidity pressure so that users can distinguish thin extensions from structurally significant ones. It reduces chart clutter by unifying momentum state, statistical extension, standard deviation distance, and structural levels into a single coherent view. It is asset- and timeframe-agnostic, suitable for intraday through swing horizons across futures, equities, FX, and digital assets.

Usage notes
MR Suite is intended for analytical and educational purposes. It does not provide trading signals, risk parameters, or strategy instructions. Users may employ its context alongside their own methodologies, risk frameworks, and execution rules. The indicator’s value derives from quantifying how unusual a move is, showing how much liquidity supports it, and anchoring that information to evolving structural references, thereby improving the clarity and consistency of discretionary assessment without prescribing actions.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.