Indicatore

Indicatore

Indicatore

MHIDa ATR-Distance DipWHAT IT DOES
ATR-Distance Dip is a visual context tool that measures how far price has stretched BELOW a reference moving average - not in fixed percentage points, but in ATR units (units of volatility). The same setting adapts by itself: in a calm market a small move already counts as far, in a choppy market price must travel further before it counts.
It draws:
- The reference average (EMA, default 20).
- A dynamic threshold line at (average - N x ATR), default N = 3.5.
- A shaded stretch zone between the average and the threshold.
- A small triangle when the previous bar closed below the threshold and the current bar closes back up (the first comeback candle after the drop).
- An optional alert on that comeback event, so you can be notified to LOOK at the chart.
HOW IT IS CALCULATED
- average = EMA(close, 20)
- ATR = simple moving average of the True Range over 14 bars (a plain SMA of the true range, not Wilder's smoothing)
- threshold = average - N x ATR (N adjustable, default 3.5; a sensible exploratory range is 2.5 / 3.5 / 4.5)
- highlight condition (evaluated on closed bars): previous close below the previous threshold AND current close above the previous close.
WHY ATR INSTEAD OF A FIXED PERCENTAGE
A fixed distance like 5% below the average means different things in quiet and in volatile regimes. Measuring the stretch in ATR units keeps the meaning consistent: 3.5 ATR below the average is unusually stretched both in slow and in fast markets, because the yardstick itself follows current volatility.
HOW TO USE IT
Add it to a standard candlestick chart. Watch the shaded zone: when price falls below the threshold line, the market is unusually stretched below its average for the current volatility regime. The triangle marks only the first attempt to come back (a close above the previous close), which is where a chart reader may want to start paying attention. Adjust the average length, the ATR length and the multiple to your instrument and timeframe: the defaults are a starting point, not the one true configuration.
HONESTY NOTE
This is a context and chart-reading aid, not a trading system: it issues no entries, no exits and simulates no trades. Directional markers are drawn only on standard chart types. It is not financial advice. You always decide. Indicatore

Indicatore

Elaris Market Energy [Professional]Elaris Market Energy
Overview
Elaris Market Energy is a multi-factor oscillator designed to evaluate the strength, direction, participation, and sustainability of market movement.
Rather than relying on a single momentum calculation, the indicator combines several independent market characteristics into one normalized energy score. The goal is to help traders distinguish between weak price movement, developing participation, strong directional expansion, compression, and potential exhaustion.
The Market Energy score is displayed in a separate oscillator panel and generally ranges from -100 to +100.
* Positive values represent bullish market energy.
* Negative values represent bearish market energy.
* Values near zero represent neutral conditions, weak participation, or market compression.
This indicator is intended to support market analysis and confirmation. It is not presented as a complete trading system and does not guarantee future price movement.
---
Core Market Energy Model
The final Market Energy score is calculated from six configurable components.
Price Impulse
Measures directional price displacement relative to current market volatility.
This helps distinguish meaningful movement from ordinary price fluctuations.
Candle Conviction
Evaluates the structure of the current candle using:
* Candle body size
* Closing position inside the candle range
* Upper and lower wick balance
* Bullish or bearish candle direction
A strong directional candle generally contributes more energy than an indecisive candle.
Volume Participation
Compares current volume with its recent average and evaluates whether market participation supports the current directional move.
On symbols where volume data is unavailable or limited, the volume component may provide less information.
Range Expansion
Measures whether the current true range is expanding relative to recent market activity.
Range expansion can help identify periods where volatility and directional participation are increasing together.
Trend Alignment
Evaluates:
* Price position relative to an internal trend average
* Direction and slope of the trend average
* Alignment between current movement and broader market direction
This component helps reduce the influence of momentum that is moving against the prevailing trend structure.
Momentum Efficiency
Combines directional momentum with movement efficiency.
Movement efficiency compares the net price displacement with the total distance traveled. Cleaner directional movement generally produces a stronger reading than unstable or highly overlapping price action.
---
Directional Movement Confirmation
The indicator also uses Directional Movement Index information.
The relationship between positive and negative directional movement helps confirm whether bullish or bearish pressure is dominant.
ADX is used as a supporting measurement of trend strength. It does not independently determine the Market Energy score and is applied as a controlled confirmation component.
---
Market Regimes
The indicator classifies market conditions into several practical regimes.
Compression
Market Energy remains close to zero, suggesting limited directional participation or reduced momentum.
Compression can occur during consolidation, low volatility, or periods of market indecision.
Bullish or Bearish Energy
Directional participation is developing, but the movement has not yet reached the strong-energy threshold.
Strong Bullish or Bearish Energy
Multiple components are aligned and directional participation has increased.
These conditions may support continuation analysis when confirmed by price structure.
Extreme Energy
The oscillator has reached an unusually strong directional reading.
Extreme energy can represent:
* Strong continuation
* Rapid volatility expansion
* Late-stage momentum
* A condition that may eventually transition into exhaustion
An extreme reading should not automatically be interpreted as a reversal signal.
Fading Energy
Directional energy remains elevated but is beginning to weaken.
Fading energy may indicate reduced participation, consolidation, or potential exhaustion. Price confirmation remains important.
---
Signal Types
Bullish Energy Entry
A bullish signal may appear when:
* Market Energy crosses above the selected entry threshold
* Energy is above its signal line
* Energy acceleration is positive
* Enabled trend and directional filters are satisfied
* Optional volume and candle-quality filters are satisfied
Bearish Energy Entry
A bearish signal uses the opposite conditions:
* Market Energy crosses below the negative entry threshold
* Energy is below its signal line
* Energy acceleration is negative
* Enabled bearish filters are satisfied
Compression Release
Compression-release markers identify a transition from low-energy conditions into directional expansion.
These signals are intended to highlight developing volatility and participation after a compressed market phase.
Energy Exhaustion
Exhaustion markers identify situations where:
* Energy recently reached an extreme level
* The energy score begins to decline
* Energy acceleration turns against the previous direction
* Price begins showing an opposing reaction
Exhaustion markers are warnings of weakening momentum. They do not confirm a complete trend reversal on their own.
---
Visual Elements
Energy Histogram
The histogram displays both direction and intensity.
* Bullish columns represent positive energy.
* Bearish columns represent negative energy.
* Stronger opacity represents increasing directional intensity.
* Faded columns indicate weakening energy.
Energy Line
The main line shows the smoothed composite Market Energy score.
Signal Line
The signal line provides a slower reference for identifying changes in short-term energy direction.
Energy Cloud
The cloud between the Energy line and Signal line provides a quick visual representation of bullish or bearish energy alignment.
Regime Background
Optional background shading highlights:
* Strong bullish conditions
* Strong bearish conditions
* Market compression
Dashboard
The optional dashboard summarizes:
* Current Market Energy score
* Current market regime
* Energy acceleration
* Relative volume
* ADX
* Price impulse
* Candle conviction
* Volume pressure
* Range expansion
* Trend alignment
* Momentum efficiency
* Signal confirmation mode
The dashboard is intended to provide a quick overview without requiring the trader to interpret each internal calculation separately.
---
Calculation Profiles
Fast
Uses shorter internal calculation lengths.
This profile reacts more quickly but may also produce more frequent changes and additional noise.
It may be suitable for lower-timeframe analysis when combined with strict filters.
Balanced
Provides a middle ground between responsiveness and stability.
This is the default profile and is suitable as a general starting point.
Conservative
Uses longer calculation lengths.
This profile produces slower and generally more stable readings, which may be useful on higher timeframes or when fewer signals are preferred.
---
Suggested Usage
The indicator can be used for several types of market analysis.
Trend Confirmation
Bullish price structure combined with positive and increasing Market Energy may support bullish continuation analysis.
Bearish price structure combined with negative and decreasing Market Energy may support bearish continuation analysis.
Breakout Confirmation
A breakout accompanied by:
* Range expansion
* Increased relative volume
* Strong impulse
* Rising Market Energy
may have greater participation than a breakout occurring during weak or compressed energy.
Pullback Analysis
During a broader trend, temporary energy weakness followed by renewed directional acceleration may help identify continuation conditions.
Compression Monitoring
Low absolute Market Energy can help identify markets that are consolidating or losing directional participation.
A later compression release may highlight the start of renewed expansion.
Exhaustion Monitoring
Extreme energy followed by weakening acceleration may help traders identify when a mature move is losing participation.
This should be combined with price structure, support and resistance, liquidity levels, or other confirmation methods.
---
Recommended Starting Settings
For lower timeframes, traders may consider:
* Fast or Balanced profile
* Higher entry threshold
* Volume filter enabled
* Candle-quality filter enabled
* Candle-close confirmation enabled
For medium timeframes, the Balanced profile and default settings provide a practical starting point.
For higher timeframes, the Conservative profile may provide smoother regime identification and fewer short-term fluctuations.
Settings should be adjusted based on the symbol, timeframe, liquidity, and trading approach.
---
Alerts
The script includes alert conditions for:
* Bullish Energy Entry
* Bearish Energy Entry
* Bullish Compression Release
* Bearish Compression Release
* Bullish Energy Exhaustion
* Bearish Energy Exhaustion
* Strong Bullish Regime
* Strong Bearish Regime
* Energy Compression
For stable alerts, enabling candle-close confirmation and selecting “Once Per Bar Close” when creating the TradingView alert is recommended.
---
Repainting Information
Elaris Market Energy does not use future data, lookahead logic, or future-confirmed pivot calculations.
The indicator does not repaint historical closed-bar signals when candle-close confirmation is enabled.
The live Market Energy value may change while the current candle is still forming because price, volume, candle range, and volatility are still changing.
When “Confirm Signals On Candle Close” is enabled, signals are only confirmed after the candle closes.
When this setting is disabled, signals may appear during an open candle and may disappear before that candle closes.
---
Important Notes
This indicator is a technical analysis tool and should not be interpreted as financial advice.
Market Energy measures current and historical market conditions. It does not predict future results with certainty.
Signal performance can vary significantly across:
* Symbols
* Asset classes
* Timeframes
* Volatility conditions
* Liquidity environments
* Trending and ranging markets
Traders should use appropriate risk management and independently evaluate all trading decisions.
Indicatore

Capitulation Stretch Reversion [Jayadev Rana]OVERVIEW
Capitulation Stretch Reversion is a long-biased, price-action mean-reversion strategy. Its thesis is simple: in an established uptrend, sharp multi-bar pullbacks that stretch price well below its short-term mean tend to snap back. The strategy waits for that stretched, capitulating condition, enters on the first sign of a turn, and exits when price reverts to the mean.
Everything is derived from raw price and range (EMAs of price and Average True Range) - there are no oscillators or external data.
HOW IT WORKS
1. Regime filter. A long EMA (default 200) defines the regime. Long trades are only permitted while price is above it, keeping every entry aligned with the prevailing drift. A symmetric short side exists but is OFF by default (see Direction).
2. Stretch + capitulation. A setup can only arm when price has extended at least a set number of ATRs below a short reversion mean (default 0.5 x ATR from a 5-EMA) AND has printed a run of consecutive lower closes (default 2). This is the "capitulation" filter - it avoids buying shallow noise and waits for a genuine flush.
3. Entry. When the stretched, capitulating condition is met and the current bar closes back up (a reversal bar), a long is taken on the confirmed bar.
4. Exit - three ways. The target is a reversion to the mean: the position is closed once price closes back at or above the reversion EMA. A protective stop sits a wide, volatility-based distance below entry (default 3 x ATR). A time stop closes any trade that has neither hit target nor stop within N bars (default 10).
WHY THE STOP IS WIDE
Mean reversion trades a high hit-rate against an unfavourable reward-to-risk: the target (a snap back to the mean) is near, while the protective stop is deliberately wide so normal wobble does not knock you out. This produces frequent winners but occasional losers that are larger than a typical win. That trade-off is intentional and is shown honestly in the results below - read the LIMITATIONS section carefully.
BACKTEST (defaults, on the loaded history)
Tested on SPY daily with the default inputs and the properties set in the script (10,000 initial capital, 100% of equity per trade, 0.03% commission, 2 ticks slippage). On the sample available in the Strategy Tester this produced roughly a 67% win rate with a profit factor near 1.67, a max drawdown around 10%, and no margin calls, modestly ahead of buy-and-hold over the same window. This is a limited in-sample backtest, not a forward result - your own data window, symbol, fees and fills will differ.
SETTINGS
Regime EMA Length - trend filter that gates entries.
Reversion Mean Length - the EMA used as the snap-back target.
Stretch (ATR from mean) - how far price must extend before a setup arms.
Capitulation Bars - consecutive closes required to confirm exhaustion.
Protective Stop (ATR) and Time Stop (bars) - the exit envelope.
Direction - Trade Longs (on) and Trade Shorts (off by default; counter-trend shorts on up-drifting index ETFs have a much lower hit-rate).
Dashboard - live regime, position, win rate, profit factor and net profit.
LIMITATIONS
Signals are evaluated on bar close, not intraday. The reported win rate is in-sample on a finite history and will not persist unchanged out of sample. Because winners are small and losers wide, a cluster of stopped trades can still produce a meaningful drawdown despite a high win rate - position size accordingly. Percent-of-equity sizing at 100% is for demonstration; use realistic risk-based sizing in practice. Mean reversion underperforms in strong, one-directional trends where price never stretches, and can suffer if a pullback turns into a full regime change. This script is a research and educational tool, not financial advice or a guarantee of future performance.
ORIGINALITY
The contribution is the specific combination: an ATR-normalised "stretch" distance from a fast mean, gated by a consecutive-lower-close capitulation count and a regime filter, with a mean-touch target against a wide ATR stop and a time stop. It is built from first principles on price and range, not a wrapper around a built-in indicator. Strategia

Robust Bollinger Bands"First and foremost, full credit and massive respect to John Bollinger for inventing the original Bollinger Bands, an absolute cornerstone of technical analysis. This script does not aim to replace his legendary work, but rather to build upon his core philosophy by applying modern robust statistics to solve extreme outlier scenarios."
Description:
Overview
The "Institutional Robust Bollinger Bands" is a highly advanced, mathematically robust volatility indicator designed to solve the most common flaws of the classic Bollinger Bands. Standard Bollinger Bands rely on a Simple Moving Average (SMA) and Standard Deviation. Because standard deviation squares the distance from the mean, extreme market events (flash crashes, large gaps, or massive outlier wicks) artificially inflate the bands. This creates a "ghosting effect" where the bands remain irrationally wide long after the volatile event has passed, leading to false signals (fakeouts).
This script completely rebuilds the volatility model using Robust Statistics, Huber Weights, Kaufman-inspired Efficiency Ratios, and Asymmetric Expansion.
How It Solves the Classic Bollinger Bands Problem
Median (Q50) vs. SMA: Instead of using an SMA for the Basis line, this indicator uses the Median (Q50). The Median is statistically immune to single-bar manipulation. Even if a massive outlier wick occurs, the Basis line remains stable, completely ignoring the "fake" movement.
Huber Weighted Dispersion vs. Standard Deviation: Instead of squaring outliers, this script uses Median Absolute Deviation (MAD) and Huber Weights. Price action that falls outside a statistical threshold (1.345 * MAD) receives heavily penalized weights. This means the bands measure true continuous volatility rather than being skewed by one-off anomalies.
Asymmetric Bands: Financial markets do not follow a perfect normal distribution (Bell Curve); they exhibit skewness and fat tails. This script calculates the Skewness (Q75 + Q25 - 2 * Q50) and Kurtosis (Q95 - Q05). If the trend is aggressively skewed to the upside, the upper band expands further while the lower band tightens, adapting to the directional momentum asynchronously.
The Role of Classic Indicators & Custom Volatility Engines
While the core logic replaces classic averages with quantiles, we still utilize the classic Simple Moving Average (SMA) for a very specific, underlying purpose: Smoothing dynamic mathematical engines.
Efficiency Ratio (ER): We calculate a raw directional efficiency (netDisp / hlRange) inspired by Perry Kaufman's methodology. We then apply an SMA to smooth this raw data. This smoothed ER dynamically adjusts the Lambda (Skewness) multiplier. When the market is trending cleanly, the asymmetry expands automatically.
Gap & Body Volatility: We measure real tick-by-tick shock (disp = body + gap). We use an SMA to compare the short-term volatility of this calculation against its long-term average. This dynamically adjusts the Mu (Fat Tail) multiplier, fortifying the bands automatically when market gaps increase.
Key Features for Traders
Self-Adaptive Multipliers: You don't need to manually change settings for different assets. The internal Efficiency Ratio and Volatility engines automatically scale the Skewness and Kurtosis multipliers based on the asset's current state.
Percentile-Based Squeeze Detection (Yellow Background): Instead of looking for an absolute lowest value (which often breaks in prolonged ranging markets), the script uses a Percentile Rank logic. If the current bandwidth falls within the narrowest 15% (adjustable) of the last 100 bars, the background turns Gold/Yellow. This provides a highly stable visual cue that a major volatility breakout is building up.
QUICK COMPARISON: CLASSIC BB vs. ROBUST BB
1. BASIS LINE (MIDDLE BAND)
Classic: SMA (Simple Moving Average) - Sensitive to spikes.
Robust: Median (Q50) - Completely immune to single-candle manipulation.
2. VOLATILITY MEASUREMENT
Classic: Standard Deviation (Squared errors) - Outliers cause "Ghosting Effect".
Robust: Huber Weighted Dispersion - Punishes outliers, keeping bands stable.
3. BAND STRUCTURE
Classic: Perfectly Symmetric - Ignores market trend bias.
Robust: Asymmetric Expansion - Adapts to price skewness (Bullish/Bearish bias).
4. DYNAMIC MULTIPLIERS
Classic: Static (User-defined) - Requires manual tuning.
Robust: Self-Adaptive - Automatically scales Kurtosis and Skewness via Efficiency Ratios.
5. SQUEEZE DETECTION
Classic: Manual observation.
Robust: Percentile-Rank Based - Background turns yellow when bandwidth is in the narrowest 15% of recent history.
Usage
Use this indicator exactly as you would use classic Bollinger Bands, but with the confidence that outlier wicks will not distort your analysis. Look for continuous Squeeze (yellow) zones to prepare for breakouts, and observe the asymmetric expansion of the bands to understand the true strength and bias of a trend.
Disclaimer: This script is for educational and analytical purposes only. It does not constitute financial advice.
Indicatore

Indicatore

Indicatore

Indicatore

Williams VIX Fix Elite [MarkitTick]💡 The Williams VIX Fix Elite is a comprehensive, overlay-based technical analysis system designed to bring the powerful volatility-tracking properties of the traditional Williams VIX Fix directly onto the main price chart. By synthesizing statistical volatility extremes with an array of multi-timeframe trend filters, volume confirmation parameters, and dynamic risk management plotting, this tool transcends basic observation. It provides traders with a complete, structured methodology for identifying high-probability exhaustion zones and potential market reversals while strictly managing risk.
✨ Originality and Utility
Standard volatility indicators are almost exclusively relegated to separate oscillator panes at the bottom of the chart. This traditional placement forces the user to constantly shift their visual focus, often leading to a disconnect between volatility metrics and actual price action. This indicator resolves that friction by mapping volatility exhaustion directly onto the candlesticks themselves through an intuitive color-coded heatmap.
Furthermore, the utility of this script lies in its holistic approach to signal generation. Rather than providing isolated volatility alerts, it acts as a confluence engine. It mandates that a volatility spike must be corroborated by higher timeframe trend alignment, adequate localized volume, directional momentum, and specific standard deviation thresholds before generating an actionable signal. This transforms a simple oscillator concept into a robust, chart-integrated trading framework complete with dynamically calculated risk-to-reward parameters, rendering it highly useful for both discretionary analysis and automated alert integrations.
🔬 Methodology and Concepts
● The Volatility Engine
• Williams VIX Fix (WVF)
At its core, the script calculates the Williams VIX Fix. It does this by measuring the percentage drawdown of the current bar's low from the highest closing price over a user-defined lookback period. This mathematical approach creates a synthetic volatility index that mirrors the behavioral characteristics of the CBOE VIX, where high values indicate market fear and potential bottoms.
• Statistical Bounds
To determine when the WVF has reached a statistically significant extreme, the script applies Bollinger Bands to the WVF data. It calculates a Simple Moving Average (SMA) of the WVF and plots standard deviation bands around it. A "Spike" is registered when the WVF value breaches the upper Bollinger Band or a percentile-based historical high threshold.
● Confluence Filtering
• Higher Timeframe (HTF) Alignment
The script extracts moving average data from a user-selected higher timeframe. It assesses whether the higher timeframe's closing price and dual-period EMAs exhibit a bullish or bearish hierarchy, ensuring signals are not taken against the macro-directional flow.
• Volatility and Volume Validation
A signal is only considered valid if the localized volatility, measured by the Average True Range (ATR), exceeds its historical average multiplied by a strict threshold. Additionally, the localized volume must exceed its moving average, confirming that the reversal is backed by market participation.
• Signal Execution and Risk Logic
When all conditions align (a volatility spike followed by a directional reversal candle, validated by all filters), the script locks in the signal upon the bar's close. It immediately calculates a Stop Loss utilizing an ATR multiplier and projects three Take Profit levels mathematically derived from user-defined Risk-to-Reward (R:R) ratios.
🎨 Visual Guide
● Chart Overlay Elements
• Candlestick Heatmap
The indicator repaints the standard chart candles to reflect the immediate signal bias. A confirmed Long signal colors the candlestick body, borders, and wicks in a distinct bullish hue (default teal). Conversely, a confirmed Short signal paints the candle in a bearish hue (default red). Neutral periods retain a standard gray tone.
• Dynamic Trade Levels
Upon signal confirmation, the script automatically plots horizontal lines detailing the trade parameters:
Stop Loss Line: A solid, thick line plotted below (for longs) or above (for shorts) the entry price, acting as the primary risk invalidation level.
Entry Line: A dashed line marking the exact closing price of the signal candle.
Take Profit Lines: Three sequential dashed lines representing TP1, TP2, and TP3, mapping out the reward targets.
The space between the Stop Loss and Entry is highlighted with a semi-transparent risk linefill, while the space extending toward the Take Profit targets is highlighted with a reward linefill, visually contrasting the risk against the potential payout.
● The Interactive Dashboard
A dedicated data panel is rendered on the chart (default top-right) providing real-time telemetry of the script's internal calculations.
WVF Value & Spike Level: Displays the raw volatility index number alongside a visual progress bar indicating how close the current value is to the historical threshold.
HTF & Trend Bias: Textually confirms the current macro and localized trend alignment (Bullish/Bearish).
Volume & ATR: Confirms whether current volume is above or below average and displays the exact ATR value.
R:R Ratio: A visual gauge of the current signal's risk-to-reward structure.
Cooldown Status: Displays the remaining bars before a new signal can be generated, preventing over-signaling during congested price action.
📖 How to Use
● Execution Protocol
• Step 1: Signal Identification
Wait for a colored signal candle to print on the chart. A teal candle signifies a Long opportunity, while a red candle signifies a Short opportunity. Always wait for the candle to fully close, as signals are only validated upon bar confirmation to ensure accuracy.
• Step 2: Dashboard Verification
Consult the on-chart dashboard. Ensure that the "Spike Level" gauge was heavily filled prior to the signal, and visually confirm that the "HTF Bias" and "Trend Bias" align with your intended trade direction. Verify that the "Volume" metric indicates "Above Avg" for optimal setup quality.
• Step 3: Risk Assessment
Observe the plotted trade levels. The visual linefills will immediately show you the required risk (the distance from the dashed Entry line to the solid Stop Loss line). Assess whether this required risk fits within your personal account parameters. If the ATR has expanded too aggressively, the stop loss may be too wide, and the setup should be skipped.
• Step 4: Trade Management
If the trade is entered, utilize the plotted TP1, TP2, and TP3 lines as scaling-out points. The script also includes automated JSON alert outputs designed for third-party execution platforms, allowing users to fully automate the Long, Short, and Take Profit hit actions.
⚙️ Inputs and Settings
● Core Settings
• WVF Lookback: Defines the historical period used to find the highest close for the volatility drawdown calculation.
• BB Length & BB Mult: Controls the Simple Moving Average length and the standard deviation multiplier applied to the WVF. Lowering the multiplier increases sensitivity to volatility spikes.
• Percentile HH Lookback & High % Threshold: An alternative absolute-threshold filter based on a percentage of the highest historical WVF values.
● Filters
• HTF Resolution: Select the specific higher timeframe used for the macro trend validation.
• ATR Length & Min Mult: Defines the lookback for the Average True Range and the multiplier required to validate adequate localized volatility.
• Min Spike Above BB %: A Z-score threshold ensuring the volatility spike is mathematically severe before triggering a signal.
• Volume Avg Length & Min Mult: Dictates the volume moving average parameters required for trade confirmation.
• Cooldown Bars: The mandatory resting period (in bars) between valid signals to eliminate redundant alerts.
● Trade Tools & Alerts
• SL ATR Mult: The multiplier applied to the current ATR to calculate the Stop Loss distance from the entry price.
• TP1, TP2, TP3 R-Multiple: Dictates the reward distance for target lines relative to the calculated Stop Loss risk.
• Alert Actions: String inputs allowing the user to customize the JSON payload commands sent to automated webhook services.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Behavioral Finance and Volatility Asymmetry
The underlying architecture of this indicator is deeply rooted in the academic principles of behavioral finance, specifically the asymmetry of market participant reactions. Financial markets typically exhibit a "stealth" characteristic during uptrends (low volatility, steady buying) and a "panic" characteristic during downtrends (high volatility, aggressive selling). The Williams VIX Fix capitalizes on this behavioral asymmetry by focusing exclusively on drawdowns from peak closes. By quantifying this localized panic, the script provides a mathematical representation of capitulation—a state where sell-side liquidity is exhausted, and rational market equilibrium is poised to return.
● Gaussian Distribution and Standard Deviation Anomalies
To objectively define an "exhaustion point," the script relies on the statistical concept of normal distribution. By applying a Simple Moving Average to the raw volatility data, it establishes a baseline mean of market stress. The inclusion of Standard Deviation bands (Bollinger Bands) allows the system to measure dispersion from this mean. When the volatility index breaches the upper band, it represents an anomaly—an event occurring outside the expected standard deviation threshold. Statistically, extreme deviations from the mean are unsustainable, implying an imminent reversion. This indicator isolates these rare deviations to time market entries.
● The Role of True Range in Risk Normalization
Risk management within the script is governed by the Average True Range (ATR), a concept introduced by J. Welles Wilder. The True Range accounts for absolute price movement, including gap openings, providing a more comprehensive measure of market kinetic energy than standard percentage changes. By tying the Stop Loss and Take Profit levels dynamically to the ATR, the script automatically normalizes risk across different market environments. In a highly volatile state, the ATR expands, naturally widening the stop loss to avoid premature invalidation from market noise. In a compressed state, the ATR contracts, tightening the risk parameters. This dynamic adaptation ensures that the statistical risk profile of each trade setup remains proportional to the current localized market geometry.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicatore

Indicatore

Indicatore

Effective Spread OscillatorOverview
Effective Spread Oscillator is a liquidity gauge built from price alone. It estimates the effective bid-ask spread — the real round-trip cost of trading — from open/high/low/close bars, with no quote or order-book data, then percentile-ranks it into a 0–100 read. High = a wide effective spread: thin, illiquid, stressed conditions where slippage and gaps are large. Low = a tight spread: deep, liquid, orderly trade. It is an analytical study of market liquidity and trading friction — not a directional signal and not a strategy.
Why these parts are ONE tool (mashup justification)
Liquidity is normally invisible without Level-2 data. This reconstructs it from bars and then makes it usable, in a chain where each link fixes what the previous one can't do alone:
A low-frequency spread estimator recovers the effective spread from the geometry of OHLC prices — the cost the tape hides. Two are offered: Abdi-Ranaldo (close vs the high-low mid-range) and Corwin-Schultz (consecutive high-low ranges). Negative small-sample estimates — a known statistical artefact of these methods — are floored at zero.
Percentile ranking turns an instrument-specific cost into a universal 0–100 read, so "expensive liquidity" means the same thing on an index future, a stock, or FX. A raw spread number in basis points is not comparable across symbols; a percentile is.
A liquidity-state verdict (stressed / normal / liquid) plus a widening-vs-tightening read makes it legible at a glance, which a bare number isn't.
The calibration harness then tests the well-documented link on your instrument: does a spread spike actually precede a volatility expansion? It reports the conditional hit rate against the unconditional base rate, so you see the Edge rather than assume it.
Chained, they answer one question: is liquidity stressed right now, and has that stress preceded bigger moves here?
How it works
The estimator is computed on log prices and evaluated one bar back (so no future value is referenced), averaged over a window, optionally smoothed, and percentile-ranked over a lookback into the 0–100 oscillator. A spike arms when the spread crosses into the high band; the harness then checks whether the realised range over the next horizon exceeds k × ATR × √horizon more often than the base rate. (The √horizon term keeps the base rate informative near 50% instead of saturating on intraday charts.)
How to use it
The high band (above the upper guide) is stressed / illiquid: widen stops, expect slippage and gaps, and treat breakouts with care — this is where volatility expansions cluster. The low band is liquid / orderly: tighter behaviour, cleaner fills. Use it as a risk and position-sizing context that sits behind your directional tools, and read the Edge row to see whether spread spikes have actually preceded bigger ranges on this symbol. Spikes are marked in the pane and, optionally, on the price chart. The dashboard has a Compact layout (default) and a Pro layout (estimator in use, spread in bps, spike sample, base rate). Context — never a standalone trigger.
Universal across markets
The high / low / close inputs are configurable, so it runs on any instrument and timeframe. Defaults target intraday index futures. Crucially, it needs no volume, so it also works on volume-less feeds (cash indices, spot FX) where flow-based tools cannot.
Non-repainting
The estimator is evaluated one bar back, so it never references a future value, and the calibration harness logs and resolves only on confirmed bars, so its statistics never inflate intrabar. The live oscillator value updates each bar, like any oscillator.
Originality
The spread estimators are published academic work, credited below. What's original here is the construction around them: the percentile normalisation that makes the cost comparable across instruments, the liquidity-state and widening/tightening read, the price-overlay stress marker, and — most of all — the forward-calibration harness that tests the spread-spike → volatility-expansion link against a base rate on your own symbol rather than asserting it. Clean-room implementation; no third-party code reused.
Concept credits
Serial-covariance spread estimator — Richard Roll (1984)
High-low range spread — Shane Corwin & Paul Schultz (2012)
Close-high-low spread — Farshid Abdi & Angelo Ranaldo (2017)
The current state of the art generalising this family to the full OHLC information set is the EDGE estimator of David Ardia, Emanuele Guidotti & Tim Kroencke (Journal of Financial Economics, 2024). This script implements the Corwin-Schultz and Abdi-Ranaldo estimators.
Honest limits
These are estimates of the effective spread from bar geometry, not measured quotes — accurate in aggregate, noisy bar to bar, which is exactly why a window and smoothing are used. Estimates can be small and are floored at zero in tiny samples. The Edge figures are in-sample, with overlapping forward windows and no costs — descriptive context, not a verified backtest. Nothing here predicts direction.
Disclaimer
Research and educational tool only. Not financial advice and no guarantee of profitability or accuracy. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability. Indicatore

Keltner Position Divergence with Reliability ScoringOverview
Keltner-Position Divergence with Reliability Scoring turns where price sits inside its Keltner channel into a bounded oscillator, reads it for divergence against price, and then scores — in real time — whether those divergences have actually been worth acting on for the symbol on your chart, and which direction is carrying the edge. It is a context / research read, not a standalone buy or sell signal.
The idea
A Keltner channel frames price with an ATR envelope around a moving average. Where price sits inside that envelope — pinned to the upper band, mid, or pinned to the lower band — is a bounded read of stretch. When price makes a new high but its Keltner position does not confirm (a lower band-position high), that non-confirmation can precede a turn. This script measures the divergence between price and its Keltner position, then keeps a self-updating track record of whether such divergences pay.
Why these parts are combined (mashup rationale)
Three components form one pipeline, not three separate signals:
A Keltner-position oscillator — price's location within the ATR envelope (0 centre, +1 upper band, −1 lower band), z-scored so the bands and zones mean the same on every asset.
Confirmed-pivot divergence — regular and hidden, between that position line and price, with an optional triple-pivot mode for rarer, stronger disagreements.
A reliability harness — a binomial-proportion confidence test that asks whether each class of divergence has preceded a favourable move (a k×ATR travel over a fixed horizon) more often than a same-zone baseline, reported per direction with a Wilson confidence bound.
Part 1 builds the bounded stretch read, part 2 fires only where price and position disagree, part 3 decides whether that disagreement has actually paid on this instrument. Remove any one and the tool can no longer answer "is this Keltner divergence worth trading here?"
How to use it
Read the verdict panel first. GREEN = these divergences have beaten a same-spot baseline here; RED = they've lost to it (skip, or change the band width / timeframe); AMBER = not statistically established yet; GREY = still gathering data. "Best signal" names the direction with the strongest measured edge; "Reward : risk" is the average best-vs-worst move after a signal, in ATR. A divergence is price making a higher high / lower low while the Keltner-position line does the opposite — marked in the pane and, optionally, on the price chart. It is context, never a standalone trigger.
Settings worth knowing
The regime filter ("Only count signals in regime") restricts the track record to signals that fired in a chosen regime — reverting markets suit divergence, strong trends punish it — so you can measure the edge where it's supposed to work. Costs subtracted (×ATR) raises the bar a signal must clear so the score is net of costs. Band width, MA length and the z-score window adapt the read to any instrument.
Universality & non-repainting
It reads only the chart's own price (configurable source), so it runs on any symbol, any timeframe, with no external data. Pivots confirm a fixed number of bars after the fact, and the track-record harness logs, updates and resolves only on confirmed (closed) bars, so its statistics never inflate or shift intrabar. The live oscillator updates each bar like any oscillator. All figures are in-sample and past-only.
Outputs for other scripts
Generic EXP_* plots — oscillator, signal, probability, edge, edge lower-bound, sample count, regime, band position — are published to the Data Window for use from other scripts via input.source().
Originality
Standard Keltner tools just plot the channel. This one turns band-position into a divergence oscillator and keeps a self-updating, confidence-scored, per-class track record against a same-zone baseline — so you see not just that a divergence printed, but whether and how it has paid on the current market. Clean-room implementation; no third-party Pine code reused.
Concept credits
Keltner channel — Chester Keltner; ATR-band refinement — Linda Raschke
Average True Range — J. Welles Wilder
Binomial score confidence interval — Edwin B. Wilson
Trend-efficiency regime measure — Perry Kaufman
Disclaimer
For research and education only. Not financial advice, not a recommendation, and not a guarantee of future results. All figures are in-sample and past-only. Markets carry risk; do your own research and manage your own risk. Indicatore

Stryk TrendsStryk: ATR Trends
Everything in this tool is measured in units of one master ATR. Change that one length and the whole indicator retunes together — the candle coloring, the compression reads, the reversal checks, and the trailing stop all use the same yardstick.
What it is
At the center is a composite value line: a weighted blend of seven EMAs (8 through 144) and a rolling volume-weighted average. The VWMA leans the line toward where volume actually transacted, and its window can auto-size to your chart timeframe so it covers a similar span whether you're on the 1-minute or the daily. Price tends to return to this line, and the whole tool reads price against it.
Candles color by distance from that line. Near it, they're neutral. The further price stretches away, the deeper the up or down color gets, reaching full saturation at a set ATR distance. A signal can also flip the candles to a solid color temporarily, so you can run the tool with every line hidden and still get the read from the candles alone.
The engines
Compression coil. A dedicated ATR is ranked into a percentile. When it compresses into the bottom of its range, the market is coiled. When the coil releases and price is at the same time over-extended from the composite, a fade marker prints back toward the line. One fire per release, inside a short window. A second marker can print if volume steps up afterward.
Compression release. A separate lens using Donchian width (highest high minus lowest low) ranked in the same percentile framework. When the envelope tightens and then releases, a marker prints in the direction of an ATR-normalized momentum read. This is not a Bollinger-inside-Keltner squeeze — it's built entirely in percentile space.
Reversal engine. Once price has stretched a set number of ATRs from the composite, the engine watches for the turn. It counts four independent checks: an RSI rollover, a close back inside the band around the line, a confirmed pivot, and a volume climax. When enough agree, a reversal marker prints — once per leg, and it won't re-arm until price comes back near the line. Pivots confirm after their right-side bars complete, so that check is delayed by design rather than repainting.
Whale and spike. A per-bar order-flow estimate built from close location and volume. Two whale reads fire from it: a fade of a volume spike where the delta ran against the move, and absorption — heavy delta into a bar that barely moved. Both can be gated by trend so you don't fade into a strong stretch. Bars at the extreme relative-volume threshold print a spike marker instead; the whale band sits below that threshold, so the two never fire on the same bar. The spike is an attention marker, not a directional call.
ATR trailing stop. A ratcheting volatility stop, either always on or armed by a coil fire. The default runs a tight 3/3 configuration as the real line, with a wider manual configuration drawn faintly beside it as a reference. The stop's ATR can be pulled from a higher timeframe, lookahead-off.
Volume participation. A volume EMA normalized 0 to 100 against its own recent range. Fifty is average. The extremes tint the background and the value sits in the status box.
Status box. One table on the chart reports every active engine on the last bar — stop side and level, compression stage, last reversal with its confluence count, last release, whale scenario, last spike, and participation. Rows light up when fresh and dim after a few bars. Every row can be toggled and the layout can run stacked or horizontal.
How I use it
Candle color is the base read. The coil and release tell me volatility compressed and which way it resolved. The reversal and whale engines flag exhaustion at the stretched edges. The trailing stop manages the rest. Each engine is independent — turn off what you don't use.
Originality
The rolling VWMA is the plain public-domain construction, sum(price x volume) / sum(volume), implemented directly with no external library. The compression framework — ATR-percentile coil plus Donchian-width release, scored in one percentile system — is original construction. Native built-ins only. Non-repainting on closed bars: higher-timeframe requests are lookahead-off on confirmed values, and alerts are meant for once-per-bar-close.
Notes
Built for standard candles only. The volume engines need a symbol with real volume, and the whale delta is an estimate from bar structure, not exchange order-flow data. This is an analysis tool, not advice, and it doesn't predict anything.
Indicatore

Indicatore

AlgoZ Pro Price ActionAlgoZ Pro Price Action is a clean price action based forex indicator built to help traders identify potential Buy, Sell, and Exit areas using a combination of market structure, trend filtering, volatility logic, and dynamic trade management.
This indicator is designed around the idea that not every trade needs to have a high win rate to be useful. Instead of only looking for quick scalp targets, AlgoZ Pro Price Action is built to manage trades with a runner-style approach. The goal is to cut weak trades faster, protect trades that start moving in the right direction, and allow stronger moves to continue when momentum is present.
The default settings are best suited for 1-minute EUR/USD forex trading. Other forex pairs and timeframes may work differently and should be tested before use.
The indicator uses market structure breaks to identify possible directional shifts. When price breaks key internal support or resistance levels, the script checks multiple filters before plotting a signal. These filters are designed to reduce low-quality signals during chop, weak momentum, or overextended conditions.
AlgoZ Pro Price Action includes Buy, Sell, and Exit labels directly on the chart. Buy signals are shown in teal, Sell signals are shown in pink, and Exit signals are shown in a neutral color. The bars can also be colored based on the active signal direction so it is easier to visually track the current market bias.
One of the main parts of this indicator is the trend lock system. The trend lock helps prevent the indicator from flipping back and forth too quickly during noisy market conditions. It uses EMA trend structure, slope behavior, and confirmation bars to decide whether the market is currently favoring Buy-side or Sell-side continuation. Countertrend signals must be stronger before they are allowed through, which helps reduce random reversal signals during an active move.
The indicator also includes automatic forex pair adjustment. It detects whether the chart is a JPY pair or a non-JPY forex pair and automatically adjusts pip size calculations. This helps prevent issues where a stop or exit calculation is too tight or too wide because of the symbol’s price format. The script also includes auto volatility tuning, which uses ATR-based logic to scale stop size, runner triggers, trailing stop distance, dead-trade protection, and cooldown behavior based on the current pair’s movement.
Trade management is handled through a dynamic exit engine. Instead of using only fixed take profit levels, the indicator uses runner logic. Once a trade moves far enough in profit, the trade can enter runner mode. From there, the script can move the stop, protect profit, and trail the trade if the move continues. This allows stronger trades to breathe while still giving the indicator a way to exit when momentum fades.
AlgoZ Pro Price Action also includes dead-trade protection. If a trade has been open for a certain number of bars and has failed to make meaningful progress, the script can plot an Exit signal. This is designed to help remove weak trades that are not moving enough to justify staying in them.
The indicator includes several optional filters and controls, including EMA trend filtering, ADX strength filtering, chop filtering, candle body quality filtering, minimum EMA separation, price distance from the slow EMA, overextension protection, post-exit cooldown, and emergency protection logic.
Main features include:
• Buy, Sell, and Exit labels
• Teal and pink AlgoZ Pro visual theme
• Price action and market structure based signals
• Internal support and resistance break logic
• Optional BOS / CHoCH structure markings
• EMA trend filtering
• ADX trend strength filter
• Chop and range filter
• Candle quality filter
• Trend lock system
• Countertrend signal protection
• Auto pip size detection
• Auto adjustment for JPY and non-JPY forex pairs
• ATR-based auto pair tuning
• Dynamic stop logic
• Runner-style trade management
• Breakeven / profit lock logic
• Trailing stop logic for stronger moves
• Dead-trade exit protection
• Optional bar coloring
• Optional entry and stop lines
• Optional status table
Recommended default use:
1-minute EUR/USD forex chart.
Other forex pairs and timeframes may require adjustment depending on spread, volatility, session, and market conditions. Indicatore

DJT Strategy - The Art of the DipWHAT THIS IS
A satirical — but mechanically honest — volatility-event mean-reversion strategy for index charts (ES, SPX, SPY, NQ...). It trades one hypothesis, known to Wall Street as the TACO trade ("Trump Always Chickens Out"): when a policy Announcement detonates the VIX, the sell-off is usually walked back within days — a "90-day pause," a "very productive call," a clarification that the tariffs apply primarily to penguins. The dip, having been artisanally manufactured, is bought.
The jokes are in the labels. The engine underneath is a real VIX-spike fade with staged exits, and every decision is lookahead-clean.
HOW IT WORKS — ENTRY (Chaos Detection)
• Covfefe Threshold — VIX trades ≥ 12% (default) above YESTERDAY'S CONFIRMED daily close. Not today's repainting value — yesterday's close is final data the moment today begins.
• Flash Tantrum — fast intraday VIX rate-of-change (default 8% over 6 bars) to catch the 2:37 PM post that ends four decades of trade policy in under 280 characters.
• Minimum VIX floor (default 18) — below this the market is not scared, it is merely golfing.
• Vol-curve confirmation (default ON) — requires VIX9D > VIX. Genuine event panic inverts the front of the volatility curve: 9-day vol pricing above 30-day is the fingerprint of a real scare. If the curve isn't inverted, even the market doesn't believe the post, and the signal is skipped. This is the filter that separates an actual tantrum from a slow-drift vol day.
When everything aligns, the strategy goes long the chart symbol at the next bar open.
HOW IT WORKS — EXITS (the TACO Protocol, staged like the walk-back itself)
• GREAT CALL — the first reassuring headline: VIX Δ falls back under 8% (default) → take half the position off.
• CONCEPTS OF A PLAN — VIX reverts to within 4% of yesterday's close: a Framework of a Concept of a Deal has been reached → close the rest.
• YOU'RE FIRED — fixed stop loss (default 1.5%). Sometimes he does not, in fact, chicken out. This is the apology budget.
• DECLARE VICTORY — fixed profit target (default 2.5%). Exit into strength and take credit for the bounce you predicted after it happened.
• NEWS CYCLE EXPIRY — time stop (default 78 bars ≈ one full RTH session on 5m). After one news cycle, a newer, more beautiful crisis replaces this one and the edge is gone.
EXTRAS
• Escalation sizing — at FULL COVFEFE (2× the spike threshold) the position gets the BIGLY multiplier. Peak fear is peak walk-back probability. This is either alpha or a margin call; many people are saying both.
• Post-trade cooldown so a single escalating tweetstorm can't chain entries.
• RTH-only entries (default ON), plus an optional "Prime Posting Hours" filter (cable-news breakfast block + post-lunch Executive Time).
• "Believe Me" mode (default OFF) — experimental fade of VIX-crush euphoria, for days when everyone believes The Deal is real this time.
• ♟️ 4D CHESS MODE — reverses every signal, for users who believe there is, in fact, a plan. Exits are direction-aware, so the joke is mechanically sound. If this mode outperforms, please tell no one.
• CHAOS-O-METER™ dashboard — live chaos grade from 🏌️ GOLFING to 🚨 FULL COVFEFE, vol-curve status, a factory-floor "DAYS SINCE LAST TANTRUM" safety sign (resets constantly, as is tradition), deal accounting (Deals made / Fake news / Deals honored: TBD), net P&L denominated in $TRUMP at a peg of your choosing, and a Sharpe ratio readout that is simply THE BEST RATIO.
• 🗽 Liberation Day (April 2) is marked annually — heightened tantrum risk, observed like a holiday, because it is one now.
NO REPAINTING / NO LOOKAHEAD
The reference VIX level is yesterday's confirmed daily close, pulled with the standard non-repainting pattern (close of the daily feed with lookahead on — final the moment today starts). Signals are evaluated on confirmed chart-timeframe bars and orders fill at the next bar open. Everything the strategy decides is knowable at decision time — which is more than can be said for the policy it trades.
HOW TO USE
• Chart: an index or index future (ES1!, SPX, SPY, NQ1!...). Intraday timeframes; defaults tuned around 5m.
• Both vol symbols are inputs — swap in VXN for NQ, or your regional vol index pair for non-US indexes.
• Strategy properties: $1,000,000 initial capital (sized for index futures notional), 2 contracts per trade by default (so the half-off scale-out has a half; at the default 1.5% stop on ES this risks roughly 1% of equity per trade), $4.50/contract commission, 1 tick slippage. margin_long/margin_short are explicitly 0 — Pine v6's default of 100 silently rejects futures entries whose notional exceeds capital; if you fork this for leveraged instruments, keep that line.
DISCLAIMER
This is satire with a working strategy attached, published for education and entertainment. The VIX spikes are, regrettably, real; the edge may not be. Backtest results on manufactured dips do not guarantee future walk-backs. Not financial advice — frankly, it barely qualifies as advice.
Strategia

Pump-and-Dump / Volatility Spike FlagPump-and-Dump / Volatility Spike Flag flags abnormal single-candle volatility — not the manipulation scheme, but the classic sharp-spike-then-reverse price shape that shows up around news events (frequently seen on MCX crude oil and silver).
HOW IT WORKS
A candle is flagged only when two conditions occur together: its true range (which includes gap-opens) expands well beyond its rolling ATR, AND its volume expands well beyond its rolling average. Flagged spikes are tracked for a short window afterward — if price closes back through that candle's open before the window expires, it is separately flagged as a "Fade," indicating the initial move has started reversing.
HOW TO USE
Use the Spike flag as an early heads-up that a candle is statistically abnormal for current conditions. Use the Fade flag as the more actionable signal — it confirms the spike has already started giving back its move. This is an informational/analytical tool, not a buy or sell signal, and should be combined with your own risk management and market context.
LIMITATIONS
ATR and volume averages are backward-looking, so the first spike after a long quiet period needs a relatively larger move to trigger. This is a single-candle geometry and volume-shape detector — it cannot identify why a move happened (news, order-flow, or otherwise), and it does not predict direction after the fade.
DISCLAIMER
For educational/informational purposes only. Not financial advice. Past performance does not guarantee future results. Trade at your own risk and always use proper risk management. Indicatore

Regime Classifier [RC Tools]RC Tools — Regime Classifier
─────────────────────────────────────────────────────────────
█ OVERVIEW
Most indicators assume a single market condition and quietly fail in another. This tool doesn't generate signals — it tells you which of four market regimes you are currently in, so you can judge whether your existing tools are operating in conditions that suit them. It is a context tool, not a decision tool.
█ WHAT IT DOES
Classifies each confirmed bar into one of four states and colours the chart background accordingly:
• Trending — Expansion: directional, volatility rising
• Trending — Exhaustion: directional, volatility compressing
• Ranging — Quiet: no direction, low volatility
• Ranging — Volatile: no direction, high volatility (chop)
A table (top-right by default, repositionable) shows the current regime, how long price has been in it, and historical base rates — the average forward return and win rate seen after each regime, going back over the chart's full history.
█ THE THEORY BEHIND IT
Market behaviour is not stationary. A trend-following tool that performs well in directional expansion will bleed in volatile chop; a mean-reversion tool does the reverse. Rather than attempting to fix any single indicator, this tool identifies which environment you are in, using two independent dimensions — directionality and volatility state — that measure genuinely different properties of price behaviour rather than two correlated views of the same one.
█ HOW IT IS CALCULATED
DIRECTIONALITY — Efficiency Ratio over N bars:
ER = |close − close | ÷ Σ|close − close |
Bounded 0–1. A value near 1 means price travelled almost directly from A to B (trending); near 0 means it wandered (ranging). No fitted parameters beyond the lookback. The Efficiency Ratio was introduced by Perry Kaufman as the core input to his Adaptive Moving Average (KAMA); it is used here purely as a directionality measure, independent of any moving average.
VOLATILITY STATE — realised volatility, percentile-ranked:
RV = stdev(log(close/close ), N)
RV is then ranked as a percentile against its own trailing distribution (default: 750 bars, ≈3 years on daily). An absolute volatility threshold is meaningless across assets — percentile ranking makes the classification behave identically on BTC, gold and equities with no parameter tuning.
The two dimensions are crossed to yield the four states. Classification occurs ONLY on confirmed bar close — the background never updates mid-bar and then flips back.
The base-rate table works by recording, for every historical bar, the forward N-bar return and whether it was positive, attributed back to whichever regime was active N bars earlier. Only fully-elapsed, already-known returns are used — nothing is looked up ahead of the current bar.
█ SETTINGS & CONFIGURATION
• Efficiency Ratio Lookback (default 20) — shorter = more responsive, noisier
• Realised Volatility Lookback (default 20)
• Percentile Ranking Window (default 750 bars ≈ 3 years daily) — longer = more stable, needs more history
• Directionality Threshold (default 0.35) — the ER above which price is considered trending
• Volatility Percentile Threshold (default 50) — the split between low and high volatility states
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table position and background colours are fully configurable; the main-chart background painting can be toggled off if you only want the diagnostic pane
█ HOW TO USE IT
Use it as a filter on your existing process, not as an entry trigger. Example: if you run a breakout system, check whether it has historically performed in Ranging — Volatile; if not, consider standing aside when the background flags that state. Example: a mean-reversion system will typically show its worst results in Trending — Expansion.
Works on any asset and timeframe with sufficient history for the percentile window. Best used on daily and above, where regime persistence is greatest.
█ LIMITATIONS
This tool classifies the PRESENT. It does not predict the future, and any use of it as a forecast is a misuse.
• Regime identification is backward-looking by construction. The tool will confirm a regime change several bars AFTER it occurred. This lag cannot be removed without curve-fitting or repainting, and has not been.
• Classification is unstable near threshold boundaries; expect flickering between states when ER or volatility percentile sit close to the cut-offs.
• The percentile ranking requires substantial history. On assets with short histories, the ranking is unreliable and the tool should not be trusted.
• The base-rate table's early entries are built on fewer samples than its later ones — treat statistics as provisional until a state has accumulated a meaningful sample count.
• Four states is a deliberate simplification of a continuous reality. Markets do not actually occupy discrete regimes.
• This script does NOT repaint. All classification is computed on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any market regime does not indicate future results. Trade at your own risk.
Indicatore

Options Buyer's Edge WeeklyOverview
Options Buyer's Edge — Weekly is a decision-support panel for the weekly index option buyer. Most option tools chase directional "smart-money flow," but on retail-dominated weeklies that flow is largely uninformed — so the durable edge for a buyer isn't direction, it's the premium environment you actually pay for: is implied volatility cheap or rich, is it expanding or crushing, how hard is theta biting toward expiry, and where is the pin magnet pulling price. This script auto-builds an ATM strike ladder for the current weekly, reads the option tape directly, adds a skew-gated directional layer, and then tests every call it makes against your own history. It is a context-and-timing map for buying premium — not a signal generator.
Why these components are ONE tool (mashup justification)
This is a deliberate dependency chain, not a stack of independent indicators. Each layer answers a question the previous one leaves open, and the buyer needs all of them to price what they're doing:
IV / straddle state (primary). The buyer's number-one enemy is paying rich premium into a crush. The ATM straddle gives an IV proxy (percentiled so "rich/cheap" is relative to this instrument's own history) and its slope tells you whether IV is expanding (tailwind) or crushing (bleed). A second read, Prem vs RV, compares that implied vol against realized vol — the variance-risk-premium — so "rich" means rich relative to what the market is actually delivering, not just rich in the abstract.
Theta clock (primary). Premium decays non-linearly into expiry. The panel converts hours-to-weekly-expiry into an escalating decay zone (Normal → Elevated → High → Extreme) so you know when time decay alone makes a long option a bad trade regardless of direction.
Pin magnet (primary). Option volume concentrates at a strike that price tends to gravitate toward near expiry. The tool finds the max-volume strike and draws it — the level a buyer is fighting against.
Underlying character (confirming). Futures basis pulse and India VIX behaviour describe whether the underlying move carries conviction or is unwinding — a cross-check on the directional read.
Directional flow (secondary, gated). A delta-weighted signed CE/PE buyer-pressure imbalance, gated by option skew and trusted only when the calibration Edge for it is positive. Directional option flow predicts returns mainly from informed traders and reverses at longer horizons; on retail weeklies it may be noise — so it earns trust from measured Edge, never from assertion.
The calibration harness (the honesty layer). Two forward tests run continuously: an underlying test (did a strong directional read actually precede a k×ATR move, versus the unconditional base rate?) and a thinner option-outcome test (did the ATM option gain the target % over the horizon?). Both resolve only on confirmed bars, and both are shown as Hit / Base / Edge so you can see whether any layer is carrying information on your instrument right now.
Remove any one layer and the buyer is flying on premium they can't price. The straddle is a picture; theta and pin are mechanics; flow is a hypothesis; the harness is the proof.
How it works
The ATM strike is anchored from spot at the start of the calculation window and held constant (Pine can't mint new option symbols per bar, and request symbols must be fixed, not per-bar series). A ±3 ladder of CE/PE symbols is auto-built for the weekly expiry and each leg's price and volume are requested; invalid or illiquid strikes simply return nothing and are ignored. From the ladder the tool derives the straddle and IV proxy, the IV slope, volume PCR, the pin strike, an OTM skew read, and the delta-weighted buyer-pressure imbalance. Futures basis and India VIX add the underlying-character read, and an optional lower-timeframe slice (the finest your plan serves) sharpens it.
How to use it
Read the guidance panel top to bottom: the verdict (CE-buyable / PE-buyable / Avoid–crush or decay / Wait), the premium environment (IV cheap/rich, expanding/crushing), Prem vs RV, VIX behaviour, the theta zone, the pin, PCR, and the two Edge readings. Lean toward buying premium in a direction only when the environment is supportive and the theta zone isn't extreme. The flow-side (Option) Edge tells you whether the directional layer is working here; if it's near zero, ignore the flow and lean on IV / theta / pin. Everything is descriptive context — it never tells you to trade.
Plan-adaptive & data note
Intrabar precision auto-selects the finest slice your plan serves (seconds on Premium+, else 1-minute, else chart bar) and every stream is na-safe — any leg or feed your plan or the market doesn't serve simply contributes nothing, and the panel shows live leg coverage (x/14). The tool needs an underlying with real option data; on a symbol without it, the legs read empty. It is fully self-contained (nothing exported), so the whole request budget serves accuracy.
Non-repainting & honesty
The script works on confirmed closed bars with no higher-timeframe lookahead, and both calibration harnesses log and resolve only on confirmed bars, so their statistics never repaint intrabar. Important limits, stated plainly: NSE exposes no per-strike option OI, no tick tape and no greeks to scripts, so IV, skew and delta here are OHLCV proxies and flow is a buyer-pressure proxy. Option streams are session-anchored — re-add the script if spot travels more than ~2 strikes (a drift warning fires). The option-outcome Edge is inherently thin because a weekly contract lives only ~5 days; the underlying Edge matures faster. All Edge figures are in-sample, forward-measured at a fixed horizon, with no costs — a study aid, not a backtest.
Originality
The building blocks are public: volume-concentration (pin/max-pain) analysis, put-call flow, value-area logic, the ATM-straddle implied-volatility approximation, and the variance-risk-premium comparison. What's original is the integration for the buyer specifically — the auto-built weekly ATM ladder read directly off the option tape, the skew-gated directional layer that is trusted only on measured Edge, and the dual forward-calibration harness (underlying + option-outcome) that scores every call against its own base rate. This is a clean-room implementation; no third-party script code is reused.
Concept credits
ATM-straddle → implied-volatility approximation — Brenner & Subrahmanyam
Variance-risk-premium framing (implied vs realized vol) — standard volatility-research technique
Pin / max-pain volume concentration, put-call ratio, value-area analysis, option skew — standard public options techniques
Disclaimer
Research and education only. Not financial advice, no recommendation, no guarantee. Options carry the risk of total loss of premium, and time decay works against buyers. The Edge figures are in-sample with no costs and do not predict price. Test out-of-sample and make your own decisions. The author accepts no liability for any use of this script. Indicatore
