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.
インジケーター

インジケーター

GMS Ultimate Structure + Price ActionGMS Ultimate Indicator is a customizable multi timeframe market structure and price action tool designed to help traders stay aligned with the dominant side of the market.
It analyzes the Daily, 4H, 1H, 15M, 5M, and 1M trends using HH/HL and LH/LL structure, while identifying pullbacks, consolidation, liquidity sweeps, BOS, CHOCH, protected structure, reaction zones, retests, and rejection candles. Its setup engine helps locate higher probability entries within the broader trend, with adjustable alerts, dashboard layouts, and display settings.
For analysis and educational purposes only. Use proper risk management and backtesting. インジケーター

インジケーター

Smart Money Concepts Liquidity Sweep, Order Block & FVGOVERVIEW
Every Smart Money indicator draws order blocks and tells you they work. This one scores them 0–100 and then forward-tests whether the score is actually true — on your instrument, on your timeframe.
It maps liquidity, detects stop-hunts, builds entry zones from the displacement that follows, confirms them with real order flow, and grades every zone that price returns to. Instead of "here is an order block, trust me", the panel tells you something like:
Tier-A zones returned +0.23R vs +0.08R for a matched control, n=61, t=2.1 — PROVEN
...or, just as usefully, NOT PROVEN. It is built to be able to tell you it doesn't work.
This is a research and framing tool. It is NOT a strategy, NOT a signal service, and NOT a validated edge.
WHY THESE PARTS ARE ONE TOOL (mashup rationale)
The Smart Money / ICT model is a SEQUENCE. Each step is meaningless on its own, and that is why they are combined here rather than sold as separate scripts:
1. LIQUIDITY POOLS — Stops cluster above equal highs (buy-side) and below equal lows (sell-side). Swing points within an ATR tolerance are clustered into a single pool; the more swings, the more stops resting there. A pool is not a signal. It is a magnet and a target.
2. THE SWEEP — Price wicks THROUGH the pool and closes back INSIDE it. That is a stop-hunt, and it is the only part of the sequence that reveals intent. A sweep alone is still not a trade.
3. DISPLACEMENT — An impulsive, ATR-normalised move away from the swept level. This is what separates a SWEEP (reversal) from a RUN (continuation).
4. THE ZONE — Displacement leaves footprints: a FAIR VALUE GAP (a three-bar imbalance) and an ORDER BLOCK (the last opposing candle before the impulse). Where an FVG sits INSIDE an order block, two independent structures agree — flagged as a confluence zone.
5. LOCATION — The zone is then judged on WHERE it sits. Against the VOLUME PROFILE (value area, point of control, and untested "naked" POCs), and against the DEALING-RANGE EQUILIBRIUM. A bullish zone in DISCOUNT is a zone you are being paid to buy; the same zone in premium is not.
6. ORDER FLOW — The question structure cannot answer: did anyone actually show up? Intrabar delta signs each lower-timeframe bar's volume by its own direction. A bullish zone born on NEGATIVE delta is a vacuum, not a footprint — and scores nothing for it.
7. THE ENTRY — Price is never chased. The engine arms only when price RETRACES into a fresh zone, then frames entry / stop / target — the target being THE NEXT OPPOSING POOL OF STOPS, because that is where the next batch of liquidity is resting.
8. THE CALIBRATION — Without it, everything above is folklore.
Remove any one of these and the tool marks noise, chases price, targets nothing, ignores where value actually is, or reports a confidence it has not earned.
THE SCORE (0–100, eight measurable components, no discretion)
Displacement strength ...... impulse body ÷ ATR — the energy behind the zone
Participation (RVOL) ....... volume at formation vs its own recent average
Born from a sweep .......... did a stop-hunt precede it? (the core ICT claim)
Imbalance size ............. FVG height ÷ ATR
HTF alignment .............. does the higher timeframe agree?
Premium / discount ......... bullish zone in DISCOUNT? bearish zone in PREMIUM?
Volume-profile location .... at value, at the POC, or at an untested POC?
Order flow (delta) ......... was the displacement backed by real aggressive flow?
Tiers: A (70+) · B (40–69) · C (below 40). Every weight is an input — if you think the sweep matters more than I do, turn it up, and let the calibration tell you whether you were right.
THE CALIBRATION — AND WHY IT IS HONEST
Every zone trade is paired with a MATCHED CONTROL: the same bar, the same direction, and the SAME R:R — but entered at market with an ATR stop instead of at the zone. This isolates exactly one variable: does entering AT THE ZONE beat entering anywhere else on identical geometry? Under a random walk, this control has zero expectancy, so anything the zones earn is real.
Each tier is tested against its OWN control, because an A-zone may carry a very different R:R from a C-zone, and a trade's hit rate depends on its R:R.
Results are reported as EXPECTANCY IN R, not hit rate. When R:R varies from trade to trade, a hit rate on its own is meaningless: a 6R winner at 20% is +0.4R (excellent), while a 1R winner at 55% is +0.1R (barely worth the commission).
A Welch t-test decides whether the difference is real or luck. The panel does not say "proven" unless t > 1.96.
The panel also answers the one question that matters most: DOES TIER A BEAT TIER C? If the scoring model has any value, A-grade zones must outperform C-grade zones. If they don't, the score is noise — and it will say so.
Conventions are deliberately chosen so the tool cannot flatter itself:
· Both barriers touched on the same bar → the STOP is assumed first.
· Expired trades are marked to market, not counted as wins or losses.
· Everything is logged and resolved on confirmed bars only.
HOW TO USE IT
1. Read the bias, the liquidity map, and the premium/discount shading. Pools above are buy-side, pools below are sell-side, and price usually travels from one to the other.
2. Wait for a SWEEP, then for a zone to be created by the displacement that follows.
3. Do NOT chase. The engine arms an entry only when price RETRACES into a fresh zone.
4. Watch for ABSORPTION at the zone — heavy volume, a small range, price holding. Someone is soaking up the aggression. That is a defended zone, and it is the best live confirmation available.
5. READ THE CALIBRATION BEFORE YOU WEIGHT ANY OF IT. If Tier A is not proven on your instrument and timeframe, a zone is a LOCATION, not a PROBABILITY — treat it as context only.
6. Entry / stop / target and the resulting R:R are drawn on the chart. They are arithmetic, not advice.
Do not tune the weights until the numbers turn green. That is curve-fitting, and the calibration exists to catch it — not to be defeated by it.
ORIGINALITY
The underlying SMC concepts are public and credited below. What is assembled here is the specific synthesis: an eight-component measurable score, the fusion of SMC structure with auction-theory location (volume profile and premium/discount), true intrabar order-flow confirmation, a per-tier matched control, expectancy-in-R reporting, and a significance test that can — and frequently does — return "not proven".
Clean-room implementation. No third-party Pine code is reused.
UNIVERSAL / DATA REQUIREMENTS
Works on any symbol and any timeframe — the engine is ATR-normalised throughout, so it adapts to the instrument rather than assuming point values.
Volume improves the score but is NOT required. On a symbol without real volume, the RVOL, volume-profile and order-flow components neutralise and the panel says so, rather than blanking or pretending.
Intrabar delta requires a timeframe strictly below the chart's. The script AUTO-MAPS this (1m→5s, 3m→15s, 5m→30s, 15m→1m, and so on) because if the intrabar timeframe equals the chart timeframe there is only ONE intrabar — the bar itself — and delta degenerates to ±100% on every bar. Where true intrabar data is unavailable, the script falls back to a close-location proxy AND LABELS IT AS A PROXY in the panel.
NON-REPAINTING
Pools, sweeps, displacement, zones, the volume profile, absorption and entries are ALL computed on confirmed bars only.
Swing points use ta.pivot* and are therefore known only AFTER their confirmation bars. This is why a liquidity pool appears a few bars after its swing. That delay is the honest cost of not repainting, and it is paid deliberately — a level that moves after the fact is worse than no level at all.
The higher-timeframe read uses lookahead_off with a live-bar offset. The calibration harness logs AND resolves on confirmed bars, so its statistics cannot inflate intrabar. Nothing here is drawn and then moved.
HONEST LIMITATIONS — PLEASE READ
Smart Money Concepts is a popular framework, not a proven one. That is precisely why this script measures it instead of asserting it.
The calibration figures are IN-SAMPLE, close-to-close, with NO costs or slippage, and they use overlapping windows. A proven in-sample edge is NOT a guarantee of out-of-sample results.
The rolling volume profile is an APPROXIMATION — each bar's volume is spread uniformly across the bins its range covers. It is not tick data.
Small samples are unreliable. A tier with a low "n" is provisional even if it looks good.
If the edge is near zero, negative, or unstable across timeframes, the honest conclusion is that this model carries no edge on that instrument. The tool is designed to be able to tell you that, and you should believe it when it does.
Nothing here predicts price.
CONCEPT CREDITS
Smart Money / ICT concepts — liquidity pools, stop-hunts, displacement, fair value gaps, order blocks, premium/discount and optimal trade entry — are public trading concepts popularised by Michael J. Huddleston (Inner Circle Trader) and the wider SMC community.
Market Profile, the point of control and the value area — J. Peter Steidlmayer and the CBOT.
Market structure theory — Charles Dow.
Average True Range — J. Welles Wilder.
Wilson score interval — Edwin B. Wilson.
Triple-barrier forward labelling — Marcos López de Prado.
Welch's t-test — B. L. Welch.
The zone-scoring model, the order-flow fusion, the per-tier matched control and the tier calibration are the author's own. Not affiliated with, nor endorsed by, any of the above.
DISCLAIMER
This is a research and educational tool only. It is NOT financial advice, NOT a recommendation, and offers NO guarantee of profitability or accuracy. Indicators describe past behaviour; they do not predict the future. Entry, stop and target output is arithmetic, not advice. Trading carries a risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use of this script. インジケーター

PulseBox TraderPulseBox Trader is a multi-timeframe trading assistant designed for both scalping and swing trading. It helps traders see when a possible long or short setup is forming, what filters are active, where the trade box entry is, where the swing-based stop loss is, and where ATR-based profit targets may sit. It also may help trail or stay in the Trade to maximise gains.
This tool is provided for educational and decision-support purposes only. It is not financial advice, does not guarantee profitable trades, and should be tested carefully before any live use. Please feel free to use it for Non Commercial purposes.
The indicator combines several entry ideas:
1. Supertrend flip after candle close
2. Supertrend continuation with VWAP or EMA200 trend alignment
3. RSI trigger candle breakout
4. Doji breakout
5. Flat base or flat top breakout
Filters:
1.VWAP / EMA200 Lead Filter
Auto mode uses VWAP on timeframes up to 15 minutes.
Auto mode uses EMA200 on timeframes above 15 minutes.
Helps decide whether long or short trade boxes are allowed.
2.Supertrend Direction Filter
Longs are preferred when Supertrend is bullish.
Shorts are preferred when Supertrend is bearish.
3.ADX / DMI Momentum Filter
Blocks weaker trade boxes when momentum is low.
Uses ADX plus +DI / -DI.
The lead filter automatically adapts to the chart timeframe:
- On lower timeframes up to 15 minutes, VWAP can guide the trade direction.
- On higher timeframes above 15 minutes, EMA200 can guide the trade direction.
This means the same tool can be used for short-term scalping as well as higher-timeframe swing trading.
The trade box is designed to make the setup easier to understand visually. When a valid setup appears, the box shows:
- Entry price
- Swing-based stop loss
- TP1 at 0.5 ATR
- TP2 at 1 ATR
- TP3 at 1.5 ATR
- TP4 at 2 ATR
- Approximate percentage profit for each target
The panel and settings is built to help newer traders understand what is happening without needing to inspect every setting. It shows:
- Whether a long or short trade box is active
- Which entry method triggered
- Which filters are active
- Any caution, such as price moving against the entry
- Current market session
- Long, short, and total win-rate statistics
- Entry, stop loss, and target levels
The indicator also includes optional market session tools :
- Asian session
- UK session
- Indian session
- US session
- Session open and close lines
- Optional opening range box shading
These session tools are turned off by default, so the chart stays clean unless the trader wants them.
PulseBox Trader is not a buy/sell guarantee. It is a structured decision-support tool . It attempts to combine trend direction, candle triggers, volatility targets, and session awareness into one readable chart overlay. The SL's may be large, please use discretion. Traders should still use risk management, check market context, and test settings before using it live. Capital Appreciation and Capital preservation both are important.
This indicator includes concepts inspired by common technical-analysis methods such as Supertrend, VWAP, EMA200 trend filtering, RSI trigger candles, ATR-based targets, swing-based stop placement, session markers, opening range concepts, doji candles, and marubozu breakout logic.
parts of the script design, organization, wording, panel layout, and Pine Script implementation were developed with AI assistance using OpenAI Codex.
インジケーター

Trident Screener - Stocks, Themes, Sectors [Galin]Trident Screener
What it does
One screener, three universes. Run it in the Pine Screener on individual stocks, on thematic and industry ETFs, and on the sector SPDRs — same columns, same saved filters, three watchlists. It combines a Minervini-style trend template, an IBD-style weighted relative strength score, a three-condition leadership flag with same-day rotation detection, and setup-ripeness columns: contraction, volume dry-up, extension. Every plot becomes a filterable, sortable column — the answer arrives as a ranked table, not a chart to eyeball.
The columns
Trend
MM — 0 to 8, one point per rule when true: 1) close above the 150 and 200 SMA · 2) 150 SMA above 200 SMA · 3) 200 SMA rising vs 22 bars ago · 4) 50 SMA above the 150 and 200 · 5) close above the 50 SMA · 6) at least 25% above the 260-bar low · 7) within 25% of the 260-bar high · 8) weighted price-momentum composite above 70. Rule 8 uses a price composite, not an IBD-style rating — that job belongs to RS Score below.
Relative strength
RS Score — IBD-style weighted relative strength vs the benchmark, in percentage points: 40% × 3M + 20% × 6M + 20% × 9M + 20% × 12M. Zero means the symbol moves with the benchmark; leaders typically read +20 to +80. It is a margin, not a 0–99 percentile — sorting the column gives you the ranking over your own watchlist, which is the honest version of a ranking anyway.
RS 1W % / RS 1M % / RS 3M % — relative performance vs the benchmark per window, computed as the change of the symbol/benchmark ratio.
Leadership & rotation
A+ — 1/0. Above the 200-day SMA AND beats the benchmark over 1 month AND over 3 months. Each condition catches what the other two miss: a "strong month" inside a downtrend is a bounce, not a leader.
A+ streak — consecutive days with the A+ flag. 1 = promoted today: your rotation alert. Sort descending to rank the most established leaders. Tip: check RS 1W on fresh promotions — a green week means an organic promotion; a deep red week means the calendar just rolled a crash out of the 1-month window.
Improving — above the 200 SMA and beating the benchmark on 1M but not yet on 3M: the waiting room for tomorrow's leaders.
Early accumulation
RS NH — the RS line (symbol ÷ benchmark) is at a 252-bar high.
RS NH lead — RS NH while price is still more than 2% below its own 260-bar high. Relative strength breaking out before price is a classic accumulation tell: someone is buying the base hard enough to outrun the index without a breakout.
Setup ripeness
xFrom50 — extension from the 50 SMA measured in daily ATRs: the "too extended to chase" gauge.
% vs 20SMA — the pullback radar: an extended leader near its 20 SMA is offering an entry instead of demanding a chase.
% from 20D High / % from 60D High — proximity to the recent high and to the base high.
Tight5 (xATR) — the 5-day range measured in ATRs. Small = contraction.
Vol 5D/50D — volume dry-up ratio; below ~0.8 = quiet base.
Suggested setups (set once — filters stick to the indicator)
Stocks: MM = 8 · xFrom50 0 to 4 · % from 60D High −8 to 0 · Tight5 < 3 · Vol 5D/50D < 0.8 → sort RS Score descending. Result: tight, dry leaders sitting just under their highs. Loosen the last three by ~30% for an "almost ready" second pass.
Themes / sectors: A+ = 1 → sort RS Score descending. The row count is a daily breadth curve — log it. A+ streak = 1 → fresh promotions. Improving = 1 → the waiting room.
Weekly: RS NH lead = 1 → the names where the money arrived before the breakout.
Settings
Benchmark — default SPY. Compare sectors vs SPY, growth themes vs QQQ, breadth vs RSP, or a stock vs its own sector ETF.
Notes
Run the screener on the 1D timeframe — required, because A+ streak and RS NH count chart bars, so one bar must equal one day. Plots are hidden on the chart by design; this is a screener tool. All windows are trading days (5/21/63/126/189/252). Symbols younger than ~12 months show empty RS Score cells until the history exists. MM criteria adapted from the Minervini Trend Template by yogy.frestarahmawan (MPL 2.0). Volume confirms what the screener nominates — for entry confirmation, pair it with my Relative Volume At Time indicator. インジケーター

インジケーター

ICT Liquidity Sweep & Structure [JOAT]ICT Liquidity Sweep and Structure
A smart-money workflow that maps resting liquidity, detects stop-hunt sweeps, and reads market structure shifts on one clean overlay.
What it is
This tool organises several well-known smart-money / ICT concepts into one coherent, non-repainting engine and — importantly — explains how the pieces reinforce each other rather than just stacking them. The premise: price is drawn to pools of resting orders (old highs and lows), often sweeps them to trigger stops, and then reveals its true intent through a structure break. The indicator makes each of those steps visible and gates its signals on their confluence.
How it works
• Liquidity levels — confirmed swing highs and lows (pivots) are drawn as buy-side liquidity (above old highs) and sell-side liquidity (below old lows) lines, each labelled with its price. These mark where stops are likely resting.
• Liquidity sweeps — a sweep is detected when price trades through one of these levels and then closes back on the original side, i.e. the level was raided but not accepted. This is the classic stop-hunt footprint and is the setup trigger.
• Market structure (BOS / CHoCH) — the engine tracks the live sequence of swings. A Break of Structure confirms trend continuation; a Change of Character is the first counter-break that flips the internal bias. Both are labelled on confirmed closes.
• Fair value gaps — three-bar imbalances left by displacement are drawn as zones and used as entry confluence, since price often rebalances them.
• Confluence gate — a Buy requires a bullish sequence (a sweep of sell-side liquidity followed by a bullish structure shift, optionally aligned with a fair-value gap); a Sell is the mirror. Buy and Sell are made mutually exclusive so both never print on the same bar, and a minimum-spacing control prevents clustering.
Trade levels
Each signal renders a red risk box from entry to stop and a green reward box from entry to the third target, with inner target dividers and right-edge labels for entry, stop and each take-profit at your R multiples. The stop is anchored to the structure that produced the signal, not to a fixed distance.
The dashboard
An adjustable panel summarises the current structural bias, the most recent liquidity event, the nearest untapped level, a conviction estimate, the active signal, and a live first-target-before-stop tally computed only on closed bars.
How to use it
• Suitable for any asset and timeframe; the concepts are scale-independent, though very low timeframes produce more noise.
• Use the liquidity lines to anticipate where price may be drawn next, and wait for a sweep-plus-structure confluence rather than acting on a raw level touch.
• Combine with a higher-timeframe bias for directional filtering.
Settings
Pivot strength, liquidity extension, sweep sensitivity, fair-value-gap minimum size, structure options, risk multiple and target R multiples, plus full colour and dashboard controls.
Originality and usefulness
Rather than plotting isolated ICT drawings, this engine chains them into a single logical sequence — liquidity, sweep, structure shift, imbalance — and only signals when that sequence agrees. The description of why those components belong together, and the confirmed-bar evaluation that keeps them honest, is what distinguishes it from a generic structure plotter.
Notes and limitations
• Structure and sweeps are defined algorithmically; discretionary traders may mark them slightly differently.
• Signals confirm on bar close, which trades a small amount of immediacy for stability and no repainting.
• The on-chart tally reflects only past bars on the current chart and is not a prediction.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
インジケーター

Sphinx DOL & Gamma ConfluenceSphinx DOL & Gamma Confluence
A positioning map that clusters draw-on-liquidity (DOL) levels together with options gamma levels, then grades each zone by how much confluence sits there - so the levels that matter stand out from the noise.
DOL LEVELS (computed automatically from price)
Prior day, week, and month high/low (PDH/PDL, PWH/PWL, PMH/PML); prior Asia and London session high/low; and overnight high/low (18:00-09:30, frozen at the RTH open). Each is tracked as tested or still naked (untested), and untested levels are weighted higher as live magnets. All toggleable.
GAMMA LEVELS (optional, entered by the user)
Gamma levels are price levels derived from options positioning that tend to act as support/resistance because of how dealers hedge:
- Call wall (CW): a strike with heavy call interest, usually above price - dealer hedging tends to lean against rallies there, so it often acts as a ceiling (red border).
- Put wall (PW): a strike with heavy put interest, usually below price - hedging tends to support dips there, so it often acts as a floor (green border).
- Flip (zero-gamma): the regime divider. Above it (positive gamma), hedging dampens moves - price tends to pin and walls tend to hold (fade environment). Below it (negative gamma), hedging amplifies moves - price tends to trend and walls tend to break into targets (trend environment).
Enter these per expiry (0/7/30 DTE) either as individual fields or as a pasted string; the tool auto-detects the chart symbol (ES/NQ/RTY/GC and micros).
HOW ZONES RENDER
Nearby levels merge into one translucent band. Fill color = confluence strength: extreme (a gamma wall stacked on a DOL level), major, or minor. Border color = direction: red ceiling, green floor, yellow pin (both), gray for pure liquidity. Labels list the members and tag / / , with (naked) on untested levels. A table shows price, the 0/7/30 DTE flips with a positive/negative gamma read, the current regime, an extreme-zone count, and a snapshot-time stamp you set.
The value is combining two different mechanisms: DOL shows where liquidity rests (reactive), gamma shows where hedging flow will occur (anticipatory) - where they align is the highest-conviction zone.
IMPORTANT - DATA SOURCE
This tool does not source, provide, or connect to any options/gamma data. Gamma levels are entered manually by each user from whatever external source they choose, and their accuracy is entirely the user's responsibility. DOL levels work with no gamma input at all. Gamma tendencies are probabilistic, not guarantees - walls hold more often in positive gamma but can break.
This is a context/mapping tool, not a signal generator: no entries, no alerts, no automation. For educational purposes only; nothing here is financial advice. Verify all levels against your own sources. インジケーター

インジケーター

Market Cycle# Market Cycle (SMA200 Slope / ATR)
**A regime classifier for long-term investors.** It labels the market as **UPTREND**, **DOWNTREND**, or **SIDEWAYS** by reading the *slope* of the Daily 200-period SMA, normalized by ATR so the reading is comparable across any symbol regardless of price or volatility. A hysteresis band and directional memory keep the state stable — it commits to a regime and holds it until the trend genuinely turns, instead of flipping on every wiggle.
## How it works
1. **ATR-normalized slope.** The per-bar change of the Daily SMA200 over a lookback window is divided by ATR (and ×100 for readability). This expresses the trend's strength in "ATRs per bar," a volatility-neutral unit that behaves the same on a $5 stock and a $5,000 index.
2. **Hysteresis state machine.** Entering a trend requires the slope to cross an **enter threshold**; leaving it only happens once the slope falls back through a lower **exit threshold**. The gap between the two creates a sticky band that filters noise and prevents whipsaw.
3. **Directional memory (continuation discount).** After a pause, re-entering the *same* direction the market just came from is treated as continuation and needs a smaller threshold, while a full reversal still requires the complete enter threshold. This makes the indicator resume established trends quickly but stay skeptical of reversals.
4. **Daily-locked & multi-timeframe consistent.** The signal and the entire state machine run inside the Daily context. The committed regime on a closed Daily bar is therefore **identical whether you view the Daily, Weekly, or Monthly chart** — no timeframe disagreement.
## Features
- **Regime coloring** — green (uptrend), red (downtrend), gray (sideways) applied to the SMA200 line and an optional background tint.
- **Sideways memory color** — optionally keep the prior trend's color during a pause, so you can see which trend the sideways phase came out of.
- **Trend age counter** — Daily bars since the last reversal (shown in the status line), continues counting through sideways pauses and only resets on a genuine trend flip.
- **Status line readout** — normalized slope value and trend age, without cluttering the price scale.
- **No repaint on history** — history is leak-free (`lookahead_off`); the current forming Daily bar updates in real time and locks at the Daily close.
## Inputs
- **SMA length / Slope lookback / ATR length** — the core signal parameters.
- **Enter & Exit thresholds** — width of the hysteresis band (in ATR/bar ×100).
- **Re-entry factor** — how much cheaper continuation is versus a fresh entry (0–1).
- **Visualization toggles** — SMA200 line, background tint, and sideways-color behavior.
## How to use
Use it as a **top-down regime filter**: take long-side setups only while the state is UPTREND, stand aside or reduce risk in SIDEWAYS, and treat DOWNTREND as a defensive/cash regime. Because the state is Daily-locked, it pairs well with a Weekly or Monthly chart for position-level context while you execute on lower timeframes.
*This indicator is a market-condition tool, not a buy/sell signal. It does not account for fundamentals, news, or risk management. Past regime behavior does not guarantee future results — always do your own research.*
インジケーター

Options Decision Dashboard CPR, Expected Move & Day TypeOverview
An index option buyer loses to theta unless the day actually moves. So the first question isn't "which way?" — it's "will this session trend at all, and is implied volatility cheap enough to pay for the ride?"
This dashboard answers that in one panel, before the session gets going:
DAY TYPE — from the Central Pivot Range. Narrow CPR historically precedes trending days; wide CPR precedes rangebound ones.
DIRECTION — from where price sits against the CPR, plus the two-day pivot-range relationship.
THE PRICE OF THE BET — from the volatility index: the expected move it's charging you for.
TIME — days to expiry, and the theta context.
It then states a plain-language verdict — BUY CE / BUY PE / SELL PREMIUM / STAY OUT — with the CPR and floor-pivot levels drawn on price, targets and invalidation marked.
What makes it different
Every CPR script asserts that a narrow CPR means a trending day. None of them check.
This one forward-tests its own core claim. Each session's CPR type is logged at the open, and at the close the day is scored as trending or not (by directional efficiency: how much of the day's range price actually closed away from its open). The panel then reports the trend-day hit rate for narrow-CPR sessions against the unconditional base rate, with a Wilson 95% lower bound.
If narrow CPR carries no edge on your instrument, the dashboard says so — and you should discount its day-type logic accordingly. It is built to be able to tell you it doesn't work.
Why the four layers are ONE tool
An option-buying decision needs all four at once:
Day type without volatility pricing tells you to buy an option that may be too expensive.
Volatility pricing without day type tells you it's cheap without telling you whether it will move.
Either without the levels gives you no entry, target or invalidation.
All three without the calibration is just another confident indicator.
Remove one and the decision isn't decidable.
How it works
CPR — Pivot = (H+L+C)/3 · BC = (H+L)/2 · TC = 2·Pivot − BC, from the prior session. Width is normalised as a % of the pivot and rank-scored against its own recent history, so "narrow" means narrow for this instrument — not a hard-coded point value. (10 points is narrow on NIFTY and wide on a mid-cap.)
Two-day relationship — higher / lower / overlapping / inside / outside value: the classic Pivot-Boss classifications, used as the directional prior.
Expected move — EM = Spot × (IV/100) × √t, shown for the day and to expiry, and drawn as a band. If the session stays inside that band, an option buyer typically loses to theta — which is exactly the trap this tool exists to flag.
Verdict — combines day type, direction, IV percentile and days-to-expiry into one call. Expensive IV can veto a buy; expiry-day theta can veto it too.
How to use it
Read it top-down at the open. Day type tells you whether to buy options at all. Direction tells you which side. Expected move tells you whether the premium is worth it. The verdict is the summary; the levels are your entry, target and invalidation.
Then — before you trust any of it — read the calibration row. If narrow CPR has no proven edge on this symbol, the day-type logic isn't carrying its weight here.
This is decision support. It does not place trades and it is not advice.
Data & scope
Built for NSE:NIFTY / BANKNIFTY index futures on intraday timeframes (5m or 15m is the CPR norm). Needs a volatility index for the expected-move layer (NSE:INDIAVIX by default); without one, that layer switches off cleanly and the rest still works.
Strike step, expiry weekday and volatility symbol are all inputs — so it runs on any index-options market. Set the expiry weekday to match your contract: the exchange has changed the index expiry day before, and this script does not assume, it asks.
On a daily+ chart the panel tells you to switch to intraday rather than showing a confident verdict built on a meaningless CPR.
Non-repainting
Prior-session values are requested as on the daily series, so they're settled before the session opens and never move. The calibration harness logs at the session open and resolves at the session close, on confirmed bars only — a session is graded on the first bar of the next session, from completed data. Intraday readings (price vs level, day-so-far range) update as the session forms; that's a live read, not a repaint.
Concept credits
Central Pivot Range and the two-day pivot-range relationships — Frank Ochoa (Secrets of a Pivot Boss). Floor pivots (R1–R3 / S1–S3) — long-standing public trading-floor practice. Expected move from implied volatility — standard option-pricing arithmetic (Black-Scholes-Merton lineage). Wilson score interval — Edwin B. Wilson. ATR — J. Welles Wilder.
The day-type calibration harness, the expected-move comparison and the verdict engine are the author's own. No third-party Pine code is reused.
Honest limits
The CPR day-type claim is folklore until measured — which is exactly why this script measures it. Calibration figures are in-sample, with no costs, and a proven in-sample edge is not a guarantee out-of-sample. The expected move is a one-standard-deviation estimate under a lognormal assumption; real index returns have fat tails and gaps. The verdict describes conditions — it is not a recommendation — and it says nothing about strike selection, position sizing or risk.
Options carry the risk of TOTAL loss of premium. Nothing here predicts price.
Disclaimer
Research and educational tool only. Not financial advice, not a recommendation, no guarantee of results. Options trading carries a risk of total loss. Test out-of-sample and make your own decisions. The author accepts no liability. インジケーター

Momentum Tide @darshaksscMomentum Tide is an adaptive gradient-fill RSI oscillator. Instead of a smoothed RSI line
with fixed overbought/oversold zone colors, momentum is visualized as a single "tide" — a
continuous gradient fill between the smoothed RSI and the midline, where fill intensity
scales with distance from midline rather than using discrete zone bands.
🔶 HOW IT WORKS
RSI is smoothed with an EMA, then plotted against an adaptive overbought/oversold reference
calculated from the rolling standard deviation of RSI (not fixed 70/30 levels), so the tool
self-adjusts across instruments and timeframes. An ATR-based volatility filter suppresses
signals during low-momentum chop.
🔶 HOW TO USE
- Green tide + rising = building bullish momentum. Red tide + falling = building bearish momentum.
- Triangle markers = confirmed midline momentum shift (bar-close confirmed, non-repainting).
- Circle markers = reversal signal from the adaptive extreme zone.
- Dashboard (top-right) shows live RSI value, tide state, and momentum strength %.
🔶 SETTINGS
RSI Length, Smoothing Length, ATR Filter Length/Ratio, Adaptive Lookback, Adaptive Band Width.
🔶 LIMITATIONS
This is a momentum-visualization tool, not a standalone entry system. Best combined with
structure/S-R context. Can flip state more frequently in low-volatility, range-bound sessions.
For educational/informational purposes only. Not financial advice. Past performance does
not guarantee future results. Always use proper risk management. インジケーター

Stochastic Triple FilterStochastic Triple Filter
Overview
The Stochastic Triple Filter is an enhanced version of the classic Stochastic Oscillator designed to address its most fundamental weakness: the generation of excessive false signals during ranging markets and counter-trend conditions.
This script integrates three independently validated technical analysis components into a single unified system, where each filter serves a specific and complementary role in signal validation. The result is a significant reduction in low-quality crossover signals, keeping only those that occur within a confirmed trending environment with real directional momentum.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE PROBLEM WITH THE CLASSIC STOCHASTIC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The classic Stochastic Oscillator generates crossover signals regardless of broader market context. A crossover in oversold territory looks identical whether the broader trend is strongly bullish, strongly bearish, or completely flat and ranging.
This context-blindness is the primary reason most Stochastic-based approaches underperform in live market conditions. The indicator fires during:
- Trending markets
- Ranging markets
- High-volatility periods
- Low-momentum consolidations
...treating all of them identically.
The Triple Filter addresses this by adding two additional layers of validation that specifically target the two most common failure modes:
- Trading against the dominant trend
- Trading during low-momentum, choppy market conditions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHY THESE THREE COMPONENTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The combination of the Stochastic Oscillator, the Gaussian Channel, and the Choppiness Index was chosen deliberately. Each component addresses a different dimension of market behavior that the others cannot measure on their own:
- Stochastic Oscillator — measures momentum and overbought/oversold conditions
- Gaussian Channel — measures trend direction with minimal lag
- Choppiness Index — measures whether the market is trending or ranging
Together, they form a three-dimensional filter that validates signals from three independent angles simultaneously: momentum, direction, and market structure.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPONENT 1: STOCHASTIC OSCILLATOR — THE SIGNAL GENERATOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Stochastic Oscillator, originally developed by George Lane in the 1950s , measures the position of the closing price relative to its high-low range over a defined lookback period.
- %K line — the raw stochastic value
- %D line — a smoothed version of %K, used as a signal line
Signal rules:
- Long signal — %K crosses above %D in the oversold zone (below threshold, default 20)
- Short signal — %K crosses below %D in the overbought zone (above threshold, default 80)
Default settings used in this script:
- %K Length: 21
- %K Smoothing: 3
- %D Smoothing: 5
These settings produce a smoother, less reactive version of the Stochastic compared to the classic defaults of 14, 1, and 3 — reducing the number of low-quality crossovers generated before any additional filtering is applied. All parameters are fully configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPONENT 2: GAUSSIAN CHANNEL — THE TREND FILTER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Gaussian Channel, originally developed and published on TradingView by © DonovanWall , applies a recursive Gaussian filter to price data to produce an extremely smooth trend estimate.
Unlike a simple moving average, the Gaussian filter uses a weighted multi-pole recursive calculation that minimizes lag while preserving directional accuracy.
The f_filt9x() recursive filter function and the f_pole() pole aggregation function used in this script are directly derived from DonovanWall's original published work. All mathematical credit for the Gaussian filter implementation belongs to DonovanWall.
How it works in this script:
Only the midline of the Gaussian Channel is used as a trend direction signal:
- Midline rising (current value > previous value) → trend is bullish → longs allowed
- Midline falling (current value < previous value) → trend is bearish → shorts allowed
- If the Stochastic fires a crossover but the Gaussian Channel disagrees → signal is blocked
Optional modes:
- Reduced Lag Mode — applies a lag correction to the source before filtering, making trend detection more reactive
- Fast Response Mode — blends the filtered output with the first-pole result to increase responsiveness at the cost of some smoothness
Both modes are optional and disabled by default .
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPONENT 3: CHOPPINESS INDEX — THE MOMENTUM FILTER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Choppiness Index, based on the concept originally introduced by E.W. Dreiss in 1993 , measures the degree of market trendiness versus choppiness by comparing the sum of individual candle true ranges to the total true range over a lookback period.
The formula produces a normalized value:
- Lower values (~38.2) → strong directional trending behavior
- Higher values (~100) → choppy, non-directional price action
How it works in this script:
A user-configurable threshold (default 50 ) defines the boundary:
- Choppiness Index below threshold → market is trending → signals allowed
- Choppiness Index above threshold → market is choppy → all signals blocked , regardless of Stochastic crossover or Gaussian Channel direction
This prevents trading during low-momentum consolidation periods — historically the most damaging environment for crossover-based systems.
The Choppiness Index filter can be independently enabled or disabled by the user.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW THE THREE COMPONENTS WORK TOGETHER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Valid LONG signal requires all three:
- %K crosses above %D within the oversold zone
- Gaussian Channel midline is rising
- Choppiness Index is below the threshold
Valid SHORT signal requires all three:
- %K crosses below %D within the overbought zone
- Gaussian Channel midline is falling
- Choppiness Index is below the threshold
Crossovers that satisfy the Stochastic condition but fail one or both additional filters are displayed as small white cross markers on the panel — allowing traders to observe exactly which signals were blocked and why.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
VISUAL ELEMENTS AND PANEL LAYOUT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Inside the indicator panel:
- %K line — changes color dynamically: green in oversold zone, red in overbought zone, grey in neutral zone. Color intensity is proportional to the distance from each threshold.
- %D line — follows the same color logic at reduced opacity.
- Overbought/Oversold lines — horizontal dashed lines at configurable thresholds.
- Midline — dotted line at level 50.
- Zone background — faint green when %K is oversold, faint red when overbought.
- Gaussian Channel dots — a row of colored circles below the Stochastic lines: green when rising, red when falling, grey when flat.
- Choppiness line — a horizontal line just below the GC dots: green when market is trending (below threshold), grey when choppy (above threshold).
- Signal triangles — green upward triangles for valid longs, red downward triangles for valid shorts.
- Filtered signal markers — small white crosses for signals blocked by the GC or Choppiness filters.
- Status table — bottom right corner, updated in real time, showing the current state of all three filters simultaneously.
On the price chart (optional):
- BUY/SELL labels — appear directly on the price chart at the moment of each valid signal using force_overlay.
- Bar color — candles colored according to Gaussian Channel direction and Choppiness state: bright green when trending up, bright red when trending down, grey when choppy.
- Background flash — optional faint background highlight on the price chart at signal bars.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS AND INPUTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Stochastic:
- %K Length (default: 21)
- %K Smoothing (default: 3)
- %D Smoothing (default: 5)
- Overbought Level (default: 80)
- Oversold Level (default: 20)
📡 Gaussian Channel:
- Enable/Disable GC Filter
- Source (default: HLC3)
- Poles 1–9 (default: 4)
- Sampling Period (default: 144)
- Multiplier (default: 1.414)
- Reduced Lag Mode
- Fast Response Mode
📊 Choppiness Index:
- Enable/Disable Chop Filter
- Chop Length (default: 14)
- Chop Threshold (default: 50)
📍 Signals on Price Chart:
- Show BUY/SELL labels on chart
- Show Filter Status Table
- Color bars by signal state
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CREDITS AND ATTRIBUTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Gaussian Channel — Original concept and full implementation by © DonovanWall , published on TradingView as "Gaussian Channel " . The f_filt9x() and f_pole() functions in this script are directly derived from DonovanWall's original work. All mathematical credit belongs to DonovanWall.
- Choppiness Index — Original concept by E.W. Dreiss (1993) . Standard public domain implementation.
- Stochastic Oscillator — Original concept by George Lane (1950s) . Standard public domain implementation.
The combination of these three components into a unified signal filtering system — including all visual design, panel layout, filter logic, position management, and status table — was developed independently by © AlgoTrade_Pro .
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This script is published for educational and informational purposes only. It is not financial advice and does not guarantee any specific trading results. Past performance in backtesting does not guarantee future results in live markets. Always conduct your own research and testing before making any trading decisions. Trading involves significant risk of loss. インジケーター

Hosoda Equilibrium Chikou Distance TK Convergence# Hosoda Equilibrium — Chikou Distance & Tenkan-Kijun Convergence
## 📊 Opis
Wskaźnik oparty na teorii fal Hosody (twórcy Ichimoku Kinko Hyo), analizujący dwa kluczowe aspekty równowagi rynkowej, które standardowy wykres Ichimoku pokazuje jedynie wizualnie — tutaj są precyzyjnie zmierzone i znormalizowane.
**Chikou Span (linia opóźniona)** to bieżące zamknięcie przesunięte 26 okresów wstecz. Zgodnie z teorią Hosody, jej duża odległość od ceny historycznej oznacza silne **naruszenie równowagi rynkowej** — rynek jest "rozciągnięty" i rośnie ryzyko korekty lub gwałtownego ruchu powrotnego.
**Tenkan-sen i Kijun-sen** (linia konwersji i linia bazowa) to krótko- i średnioterminowa równowaga cenowa. Gdy te dwie linie **zbliżają się do siebie**, oznacza to wygasający impet trendu — rynek wchodzi w fazę niezdecydowania. Samo **przecięcie linii (TK Cross)** jest klasycznym sygnałem zmiany kierunku: Dead Cross (Tenkan przecina Kijun od góry) sugeruje osłabienie i potencjalny spadek, Golden Cross — odwrotnie.
## ⚙️ Jak to działa
Wskaźnik liczy dwie wartości i normalizuje je względem ATR, dzięki czemu progi działają spójnie niezależnie od instrumentu (akcje, forex, krypto) i interwału czasowego:
- **Odległość Chikou od ceny** (histogram) — im dalej od zera, tym silniejsze zachwianie równowagi
- **Odległość Tenkan-Kijun** (żółta linia) — im bliżej zera, tym słabszy trend
Dodatkowo wskaźnik oznacza:
- 🔻 **Dead Cross** — Tenkan przecina Kijun w dół (sygnał spadkowy)
- 🔺 **Golden Cross** — Tenkan przecina Kijun w górę (sygnał wzrostowy)
- 🔴 **Czerwone tło** — sygnał złożony: duże odchylenie Chikou WYSTĘPUJE JEDNOCZEŚNIE ze zbliżeniem Tenkan-Kijun — podwyższone ryzyko odwrócenia trendu
## 🔔 Alerty
Wskaźnik zawiera 5 gotowych warunków alertów, które można aktywować niezależnie:
1. Naruszenie równowagi (duża odległość Chikou)
2. Słabnący trend (zbliżenie Tenkan-Kijun)
3. Dead Cross
4. Golden Cross
5. Sygnał złożony (oba warunki naraz)
## 🛠️ Ustawienia
- Standardowe okresy Ichimoku (Tenkan 9 / Kijun 26 / przesunięcie Chikou 26) — w pełni edytowalne
- Próg "duże odchylenie Chikou" — domyślnie 1.5× ATR
- Próg "zbliżenie Tenkan-Kijun" — domyślnie 0.3× ATR
- Okres ATR do normalizacji — domyślnie 14
## ⚠️ Zastrzeżenie
Wskaźnik ma charakter analityczny i edukacyjny. Nie stanowi rekomendacji inwestycyjnej. Sygnały należy zawsze weryfikować z pełnym kontekstem chmury Kumo, strukturą rynku oraz zarządzaniem ryzykiem. Autor nie ponosi odpowiedzialności za decyzje inwestycyjne podjęte na podstawie tego narzędzia. インジケーター

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. インジケーター

インジケーター

インジケーター

インジケーター

Fractal Support & Resistance Zones invincible]Fractal Support & Resistance Zones
Fractal Support & Resistance Zones is an advanced market-structure and price-reaction framework designed to identify, evaluate, and dynamically manage support and resistance zones derived from confirmed fractal pivots.
Unlike traditional support and resistance indicators that simply draw horizontal levels at swing highs and lows, this indicator treats every zone as a dynamic market structure object. Each zone develops through its own lifecycle based on price interaction, independent retests, reaction strength, penetration, estimated buying and selling activity, structural confirmation, trend alignment, and eventual support/resistance role reversal.
The objective is not simply to show where price previously turned.
The objective is to evaluate which zones are still technically relevant, which have gained confirmation, which are weakening, and which may provide better structural trade locations.
---------------------------------------------------------------------------------------------
Fractal-Based Zone Detection
The indicator identifies two independent classes of fractal pivots:
Weak Fractals
Shorter-length pivots designed to capture local price reactions and minor structural turning points.
Major Fractals
Higher-strength pivots based on a larger fractal window. These represent more significant swing highs and swing lows and receive greater importance within the zone-quality model.
Fractal support zones are created from confirmed pivot lows, while fractal resistance zones are generated from confirmed pivot highs.
The detection timeframe can be independently selected, allowing zones from a higher timeframe to be displayed on a lower-timeframe chart.
Higher-timeframe fractal data is requested with lookahead disabled to prevent future data from being intentionally introduced into the pivot calculation.
---------------------------------------------------------------------------------------------
Dynamic Support and Resistance Zones
The indicator creates price zones rather than single horizontal lines.
Markets rarely react from one exact price. Orders, liquidity, and previous positioning are often distributed across a price range. The zone model therefore attempts to represent the broader reaction area surrounding a fractal pivot.
Three zone-width methods are available:
ATR
Zone width is calculated from Average True Range and automatically adapts to market volatility.
Pivot Candle
The structure of the original fractal candle is used to determine the zone width.
Hybrid Candle + ATR
Combines pivot-candle structure with an ATR-based volatility limit.
The hybrid method is designed to prevent unusually large pivot candles from creating excessively wide support or resistance areas.
A minimum tick-based width can also be configured for instruments with very small price movements.
---------------------------------------------------------------------------------------------
Fractal Zone Clustering
Markets frequently produce several nearby fractal pivots around the same price area.
Drawing every pivot independently can create overlapping boxes and unnecessary chart congestion.
The indicator therefore includes a fractal clustering engine.
Nearby same-side fractals may be merged into a common structural zone when:
* They are within the configured ATR merge distance.
* The resulting merged zone does not exceed the maximum permitted ATR width.
* The maximum cluster count has not been exceeded.
* Fresh major zones are not being merged into previously tested or damaged zones when protection is enabled.
The cluster count becomes one component of the zone-quality model.
A cluster does not automatically mean a zone is strong. It simply indicates that multiple independent fractal structures developed around a similar price area.
---------------------------------------------------------------------------------------------
Independent Retest Detection
A major feature of the indicator is the distinction between bars inside a zone and independent zone retests.
If price remains inside a support or resistance area for several candles, those candles are not counted as multiple tests.
A new test is counted only after price:
1. Interacts with the zone.
2. Moves sufficiently away from the zone.
3. Travels the configured ATR reset distance.
4. Returns to the zone again.
This creates a more realistic retest model and avoids artificially increasing the test count during sideways congestion.
The label displays the number of independent tests recorded for each selected zone.
---------------------------------------------------------------------------------------------
ATR-Based Reaction Measurement
After an independent zone retest, the indicator measures how strongly price reacts away from the zone.
Reaction strength is normalized using ATR.
For a support zone, the engine measures upward movement from the reaction anchor.
For a resistance zone, the engine measures downward movement from the reaction anchor.
The strongest reaction generated by the zone is stored as its **Best Reaction ATR**.
Two configurable reaction thresholds are used:
Verified Reaction
The zone has produced the minimum ATR reaction required for technical validation.
Proven Reaction
The zone has generated a stronger ATR reaction and has also accumulated sufficient independent testing.
This prevents a zone from receiving a high structural status simply because price briefly touched it.
The market must demonstrate an actual directional response.
---------------------------------------------------------------------------------------------
Dynamic Zone Status System
Every zone is continuously classified according to its current structural condition.
FRESH
A newly created major zone that has not yet received an independent retest.
Fresh zones may represent relatively untouched structural areas.
WEAK
A zone originating from the shorter weak-fractal detection model.
Weak zones can still produce valid reactions but receive a lower fractal-grade contribution in the quality model.
VERIFIED
A zone that has been tested and remains structurally active.
Reaction behaviour and zone validation contribute dynamically to its score.
PROVEN
A zone that has accumulated multiple independent tests and generated a reaction exceeding the configured Proven Reaction ATR threshold.
Proven zones represent areas with demonstrated historical reaction behaviour.
DAMAGED
Price has penetrated a configurable percentage of the zone.
A damaged zone has not necessarily broken, but deeper penetration reduces its quality score.
BROKEN
Price has invalidated the zone according to the selected break-confirmation method.
Break confirmation can use either:
* Close Beyond Zone
* Full Candle Beyond Zone
Broken zones may optionally remain visible for historical analysis.
FLIPPED SUPPORT / FLIPPED RESISTANCE
A previously broken zone has confirmed a structural role reversal.
Previous support may become resistance.
Previous resistance may become support.
The indicator does not immediately flip a zone when price crosses it. A separate role-reversal confirmation process is required.
---------------------------------------------------------------------------------------------
Zone Damage and Penetration Tracking
Zone quality is not binary.
A support or resistance area may gradually weaken before it completely breaks.
The indicator continuously measures the maximum percentage of zone penetration.
For support, penetration is measured downward through the support area.
For resistance, penetration is measured upward through the resistance area.
When penetration exceeds the configured damage threshold, the zone is classified as ** DAMAGED
Damage also applies a progressive penalty to the quality score.
This means a deeply penetrated zone may remain technically valid while receiving a lower structural ranking.
---------------------------------------------------------------------------------------------
Support and Resistance Role Reversal
The indicator contains a dedicated zone-flip engine.
After a support or resistance zone breaks, the engine monitors whether price moves sufficiently beyond the former zone.
The broken zone must first establish separation from price using a configurable ATR distance.
Price must then return to the previous structural area.
Depending on the selected confirmation mode, the indicator can require:
Zone Reclaim Only
The opposite-side retest itself is sufficient.
Close Away
Price must close a configurable ATR distance away from the zone.
Rejection or Engulfing
The retest can be confirmed through rejection behaviour, an engulfing candle, or a sufficiently strong close away from the zone.
Once confirmed:
* Broken support can become resistance.
* Broken resistance can become support.
The zone is then reset into a new lifecycle as a flipped structural area.
---------------------------------------------------------------------------------------------
Estimated Buy and Sell Activity
The indicator includes an estimated directional volume model.
Because standard TradingView volume does not directly provide true executed bid and ask volume for every market, buying and selling activity is estimated from candle position within the candle range.
A close nearer the candle high allocates a greater portion of volume to estimated buying activity.
A close nearer the candle low allocates a greater portion of volume to estimated selling activity.
The model can use:
* Pivot volume only.
* Pivot volume plus independent retest activity.
Selected zone labels display estimated activity as:
B 64% | S 36%
This should be interpreted as an estimated directional participation model rather than true exchange-level order-flow delta.
---------------------------------------------------------------------------------------------
Multi-Factor Zone Quality Model
Every zone receives a dynamic quality score from 0 to 10.
The score is not based on a single condition.
The model combines several structural factors.
Fractal Grade
Major fractals receive a stronger contribution than weak fractals.
Rejection Wick
The pivot candle's rejection wick is normalized against ATR.
Larger relative rejection can increase the origin score.
Independent Retests
The model evaluates how many genuinely independent zone tests have occurred.
Importantly, unlimited retests do not continuously improve quality.
Excessive testing can weaken a zone.
Reaction Strength
The strongest measured ATR reaction contributes to zone validation.
Estimated Volume Confirmation
Pivot volume participation and directional estimated activity contribute to the score.
Fractal Cluster
Multiple nearby fractals can increase structural confidence.
Freshness
Newer zones receive a greater freshness contribution.
As a zone ages, this component gradually decreases.
The weight of every major quality component can be adjusted by the user.
---------------------------------------------------------------------------------------------
Origin Score and Validation Score
Internally, the quality engine separates zone evaluation into two conceptual stages.
Origin Quality
Evaluates how the zone was created.
This includes:
* Fractal grade.
* Pivot rejection wick.
* Pivot volume participation.
* Fractal clustering.
* Zone freshness.
Validation Quality
Evaluates what price did after the zone was created.
This includes:
* Independent retests.
* Reaction strength.
* Directional estimated activity.
Fresh zones are influenced more heavily by origin quality.
As price begins interacting with a zone, validation behaviour receives greater influence.
This allows the quality score to evolve with market behaviour rather than remaining permanently fixed at zone creation.
---------------------------------------------------------------------------------------------
Retest Exhaustion Penalty
A common assumption is that more support or resistance tests always make a zone stronger.
This indicator does not use that assumption.
Repeated interaction may gradually consume resting liquidity around a price area.
After the configured number of retests, the indicator begins applying an excess retest penalty.
The penalty increases with each additional independent test.
As a result, a heavily tested zone may receive a lower quality score even if it has not formally broken.
---------------------------------------------------------------------------------------------
Congestion Penalty
Price remaining inside a zone for an extended period may indicate balance, absorption, or structural deterioration.
The indicator tracks consecutive bars interacting with each zone.
After the configured congestion threshold, a progressive quality penalty is applied.
This helps distinguish a clean rejection from prolonged price acceptance inside the area.
---------------------------------------------------------------------------------------------
Trend Regime Alignment
An optional EMA-based trend regime is included in the quality model.
Support zones located in an unfavourable bearish regime can receive a counter-trend penalty.
Resistance zones located in an unfavourable bullish regime can also receive a penalty.
The trend filter does not automatically delete zones.
Instead, it modifies their relative quality.
This allows historically valid support and resistance areas to remain visible while acknowledging the current directional regime.
---------------------------------------------------------------------------------------------
Market Structure Break Detection
The indicator includes an independent Market Structure Break, or **MSB**, engine.
Confirmed swing highs and swing lows are detected using a configurable pivot length.
A bullish MSB occurs when price closes above the latest eligible structural high with sufficient momentum confirmation.
A bearish MSB occurs when price closes below the latest eligible structural low with sufficient negative momentum confirmation.
Momentum is normalized using a Z-score calculated from recent price changes.
This reduces the number of minor structural crossings classified as meaningful breaks.
Each structural pivot can generate only one MSB event, preventing repeated labels from appearing after the same swing has already been broken.
---------------------------------------------------------------------------------------------
Zone-to-Structure Confirmation
Market Structure Breaks can also validate previously tested zones.
When a bullish MSB occurs, the indicator searches for a recently touched support zone.
When a bearish MSB occurs, it searches for a recently touched resistance zone.
The most recent eligible zone can receive structural confirmation.
A configurable quality bonus is then applied.
This creates a basic structural sequence:
Zone interaction → Price reaction → Market Structure Break
The intention is to distinguish zones that merely produced a temporary bounce from zones followed by a measurable structural shift.
---------------------------------------------------------------------------------------------
Premium and Discount Trade Location
The indicator uses the latest structural swing high and swing low to estimate the current swing midpoint.
The midpoint represents the 50% equilibrium level of the structural range.
When Premium/Discount grading is enabled:
* Support zones are favoured when positioned in the discount portion of the swing.
* Resistance zones are favoured when positioned in the premium portion of the swing.
This condition contributes to the displayed Trade Grade.
It does not remove zones from the chart.
---------------------------------------------------------------------------------------------
Trade Grade System
Selected zones receive a simplified structural trade grade.
Grade A+
Reserved for high-quality zones with strong alignment between:
* Zone quality.
* Trend regime.
* Premium/discount location.
* Low structural damage.
* Limited retest exhaustion.
Grade A
Strong-quality zones with favourable trend alignment and low damage.
Grade B
Moderate-to-strong structural zones that are not classified as weak fractals.
Grade C
Lower-quality but still technically visible zones.
Grade D
Zones with poor overall structural quality.
The Trade Grade is a contextual ranking system.
It is not an automatic buy or sell signal.
---------------------------------------------------------------------------------------------
Star-Based Quality Display
To make the detailed labels easier to read, the numerical quality model is represented using stars.
★★★★★ = Quality 8.0 or higher
★★★★ = Quality 6.0 to 7.99
★★★ = Quality 4.0 to 5.99
★★ = Quality 2.0 to 3.99
★ = Quality below 2.0
The stars provide a quick visual representation of the underlying 0–10 quality score.
---------------------------------------------------------------------------------------------
Compact Detailed Labels
Selected zones can display compact one-line labels such as:
VERIFIED SUP | B 64% | S 36% | ★★★★ | Tests: 2 | Grade A
The label contains:
* Current zone status.
* Support or resistance classification.
* Estimated buying activity.
* Estimated selling activity.
* Quality stars.
* Independent retest count.
* Structural Trade Grade.
Because displaying a detailed label on every zone can create significant chart congestion, two label modes are available.
Nearest + Strongest
Prioritizes the nearest support, nearest resistance, and the highest-quality remaining zones.
All Visible Zones
Displays labels for every currently visible zone.
The maximum number of detailed labels can also be controlled.
---------------------------------------------------------------------------------------------
Nearest Zone Highlighting
The indicator continuously identifies:
* The nearest active support below price.
* The nearest active resistance above price.
These zones can receive stronger border highlighting.
This makes the most immediately relevant structural areas easier to identify without removing historical zones from the chart.
---------------------------------------------------------------------------------------------
Structural Equilibrium Zone
The latest confirmed structural swing high and swing low are used to calculate a 50% equilibrium area.
The indicator plots:
* Swing origin.
* Swing destination.
* 50% midpoint.
* Configurable equilibrium zone thickness.
Before price interacts with the equilibrium area, the zone is displayed as the current structural midpoint.
After price touches the area, the indicator changes its state to:
Equilibrium touched · wait for structure
This is intended to remind the trader that equilibrium interaction alone is not necessarily directional confirmation.
Additional market structure may be required.
---------------------------------------------------------------------------------------------
Alert Conditions
The indicator provides alert conditions for important zone and market-structure events:
* New fractal support zone.
* New fractal resistance zone.
* Independent zone retest.
* Zone verified by ATR reaction.
* Zone reaching Proven status.
* Zone becoming Damaged.
* Zone break.
* Support/resistance role reversal.
* Bullish Market Structure Break.
* Bearish Market Structure Break.
These alerts can be used to monitor structural changes without continuously watching the chart.
---------------------------------------------------------------------------------------------
Suggested Interpretation
This indicator is designed as a market context and structural analysis tool.
A possible analytical workflow is:
1. Identify the nearest active support and resistance.
2. Review the zone's current status.
3. Check estimated buy/sell activity.
4. Evaluate the quality stars.
5. Review the independent test count.
6. Check whether the zone is fresh, validated, damaged, or exhausted.
7. Evaluate trend alignment.
8. Check premium or discount location.
9. Observe whether price produces a structural break after the zone reaction.
10. Use the Trade Grade as an additional contextual ranking.
No single factor should be interpreted independently.
A five-star zone can still break.
A damaged zone can still generate a reaction.
A weak fractal can still become structurally relevant.
The purpose of the model is to organize multiple price-action variables into a consistent framework.
---------------------------------------------------------------------------------------------
Important Volume Note
The Buy and Sell percentages displayed by this indicator are estimated directional volume statistics.
They are calculated by allocating candle volume according to the closing position within the candle's high-low range.
They do not represent true bid/ask volume, footprint delta, or exchange-level aggressive buying and selling.
The values should therefore be used as a relative activity estimate only.
---------------------------------------------------------------------------------------------
Non-Repainting Considerations
Fractal pivots require confirmation bars.
A zone is created only after the corresponding pivot has been confirmed by the selected fractal length.
Higher-timeframe fractal calculations use `lookahead_off`.
Therefore, historical zones should be interpreted from the point at which the fractal became technically confirmed rather than assuming the pivot was known at the exact swing candle in real time.
Market Structure Break conditions are also evaluated using confirmed price and momentum conditions.
---------------------------------------------------------------------------------------------
Final Note
Fractal Support & Resistance Zones is designed for traders who prefer **dynamic structural zones instead of static support and resistance lines**.
The indicator combines fractal structure, volatility-normalized zone construction, independent retests, reaction measurement, damage analysis, estimated directional activity, structural breaks, trend regime, premium/discount location, and role reversal into a unified zone lifecycle model.
It is intended to help answer three practical questions:
Where is the important price structure?
How has price behaved around that structure?
Is the zone gaining validation, remaining fresh, or gradually losing structural quality?
This indicator is intended for technical analysis and research purposes only. It does not constitute financial advice. Traders should independently evaluate market conditions and apply appropriate risk management.
インジケーター

Market Zone [Jannu]1. Description
Markets do not move in straight lines. Price frequently departs from equilibrium through gaps, rapid displacement, or impulsive expansion from compressed bases. These departures leave behind areas of unresolved imbalance; zones where the auction process was incomplete. Market Zone is the foundational Imbalance component of the ET Massif Framework research suite. It identifies three distinct forms of such imbalance and renders them as dynamic, self-managing zones on the chart.
2. Features
The indicator combines three detection methods:
Fair Value Gaps (FVGs)
Three-candle imbalances where a qualifying middle candle displaces price fast enough that the gap between the outer candles remains unfilled. Detection requires ATR expansion, minimum gap size, VWAP position relative to the gap, volume, and candle body proportion.
Session Gaps
Price discontinuities between consecutive session closes and opens, filtered by ATR magnitude.
Points of Interest (POI)
The consolidation base that preceded a significant impulsive move. Once an impulse exceeding a defined ATR multiple is confirmed, the indicator locates the tight-range candle immediately before the expansion and uses its high/low as the zone boundary.
3. Detection Logic
A. Fair Value Gaps (FVG)
Detected using a qualified three-candle imbalance structure.
Criteria:
Low > High (Bullish) or High < Low (Bearish)
Middle candle range > 1.1× ATR
Gap size > 1.0× ATR
Middle candle VWAP above High (Bullish) or below Low (Bearish)
Volume > 1.2× 180-bar average volume
Candle body > 65% of total range
Qualifying FVGs display a diamond marker at the middle candle VWAP. Diamond size scales with relative volume. Boxes extend forward with each new bar and contract as candle bodies close into the zone. Zones are removed once fully covered.
B. Session Gaps (FVG)
Detects price discontinuities between the current open and the prior close.
Criteria:
Absolute gap > 1.5× ATR
Gap boxes are drawn between the prior close and the current open, extend forward, and contract as candle bodies close into them. Zones are removed once fully covered.
C. Points of Interest (POI)
Identifies the consolidation base preceding a significant directional expansion.
Criteria:
An impulsive move within the previous 5 bars exceeding 2.0× ATR
Majority of bars within the move are directional
Once an impulse is confirmed, the indicator searches the preceding bars for the first candle whose range is below 0.5× ATR. That candle's high and low define the POI zone. A 20-bar cooldown prevents overlapping detections. Zones are invalidated when a candle body closes through the zone boundary. Invalidated zones remain on the chart in grey. All criteria are configurable via settings. Use stricter rules for lower timeframes or volatile assets.
4 . Use
Jannu is a structural reference tool. The zones mark where price departed from equilibrium; Determining which outcome is unfolding requires the broader analytical context in which the indicator is used.
The same zone type can carry different interpretations depending on context. On the CRWD daily chart in early 2026, a cluster of large bearish FVGs formed during a sharp sell-off, yet price reversed immediately and never returned to those zones. The imbalance was not evidence of sellers in control; it was the mechanism through which aggressive selling exhausted supply before buyers drove price upward. Contrast this with the series of bearish FVGs that formed during ADBE's long decline from late 2024. Same structure, different character. The indicator marks the zone; contextual analysis is required.
日本語概要 (Japanese Summary)
Jannuは、価格が均衡から乖離した領域を可視化するリファレンス指標であり、ET Massifインジケーターフレームワークの一部として開発されました。セッションギャップ、フェアバリューギャップ(FVG)、ポイント・オブ・インタレスト(POI)の3種類の価格不均衡を検出し、動的なゾーンとしてチャート上に表示します。これらのゾーンは、ローソク足の実体が内部に進入するにつれて縮小し、完全に埋まった時点で自動的に削除されます。市場構造の参照フレームワークとして機能します。
中文概要(Chinese Summary)
Jannu 是一款將價格偏離均衡的區域進行視覺化呈現的參考指標,作為 ET Massif 指標框架的一部分所開發。本指標可偵測三種價格失衡類型:開盤缺口(Session Gap)、合理價值 gap(FVG)以及關注區域(POI),並將其作為動態區間顯示於圖表上。這些區間會隨著 K 線實體進入而縮減,並在完全填補時自動刪除。本指標作為市場結構的參考框架使用。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk. インジケーター

Forward P/E: Price-Reactive and Reported [Pro]How to Interpret the Forward P/E: Price-Reactive and Reported Indicator and Table:
What this indicator does
This indicator compares two versions of forward P/E:
Term
Meaning
Reactive
Daily price-adjusted forward P/E using the latest anchored forward EPS
Reported
TradingView’s reported forward P/E from its financial data source
The chart itself plots the Reactive Forward P/E, while the table shows both Reactive / Reported valuation context.
The main question it answers is:
Has the stock’s valuation moved too far compared with its own history?
Best default settings
Setting
Suggested
Financial Period Mode
Auto FY then FQ
Historical Lookback
3 Years or 5 Years
Require Full Lookback History
Off
Minimum Valid Bars
63 or 126
Smoothing Type
EMA
Smoothing Length
10
Signal Length
20
Percentile / Z-Score Source
Raw Price-Reactive P/E
Show Reported Line
Off
Show Reactive Adaptive Bands
On
Fill Extreme Zones
On
For newer stocks, use 6 Months, 1 Year, or 2 Years.
Main table readings
Reactive / Reported P/E
Example:
42.5x / 38.9x
This means:
Side
Meaning
Reactive P/E
Price-adjusted forward P/E based on current price
Reported P/E
TradingView’s reported forward P/E
If Reactive P/E is much higher than Reported P/E, the stock price may have run up since the last reported valuation update.
Smoothed Reactive P/E
This is the smoother plotted value.
Use it to read the trend, not the exact current valuation.
Reading
Best use
Reactive P/E
Current valuation estimate
Smoothed Reactive P/E
Cleaner visual trend
Anchored Forward EPS
This is the estimated forward EPS base used to calculate the Reactive P/E.
Reactive P/E = Current Price / Anchored Forward EPS
If the anchored EPS is stale, the Reactive P/E may still move daily with price, but the earnings base may be outdated.
Reactive / Reported Rank
This is one of the most important rows.
Example:
91% / 78%
Side
Meaning
Reactive Rank
Where the price-adjusted P/E ranks versus its own history
Reported Rank
Where the reported P/E ranks versus its own history
Interpretation:
Percentile Rank
Meaning
95%+
Extremely expensive
90–95%
Expensive / stretched
75–90%
Above-normal valuation
25–75%
Normal valuation range
10–25%
Below-normal valuation
5–10%
Historically cheap
Below 5%
Deep valuation discount
A major warning setup is:
Reactive Rank above 90%
Reported Rank much lower
That can mean price has moved ahead of the last reported valuation update.
Reactive / Reported Median
Example:
31.0x / 29.5x
This shows the stock’s historical “normal” P/E level for each method.
Use this to see whether the current valuation is above or below its own normal range.
Reactive / Reported Premium
Example:
+37% / +28%
This means valuation is above its historical median.
Reading
Meaning
+50%
Very rich versus normal
+20%
Above normal
0%
Near median valuation
-20%
Below normal
-40%
Potentially cheap
This is one of the easiest rows to use.
Reactive / Reported P95
This shows each method’s historical expensive zone.
Example:
52x / 48x
If the Reactive P/E is near or above its P95, the stock is historically expensive based on current price movement.
Reactive / Reported P05
This shows each method’s historical cheap zone.
Example:
18x / 16x
If the Reactive P/E is near or below P05, the stock is historically cheap versus its own valuation history.
Reactive / Reported Yield
This converts forward P/E into earnings yield.
Forward Earnings Yield = 100 / Forward P/E
Examples:
P/E
Earnings Yield
10x
10.0%
20x
5.0%
40x
2.5%
80x
1.25%
Lower yield means richer valuation.
Reactive Room to P95
This shows how much room remains before the Reactive P/E reaches its historical expensive zone.
Reading
Meaning
Positive
Still below historical expensive extreme
Near zero
Near historical expensive extreme
Negative
Already above historical expensive extreme
Example:
Reactive Room to P95: -3.5x
The stock is already above its historical 95th percentile valuation level.
Reactive Room above P05
This shows how far the Reactive P/E is above its historical cheap zone.
Reading
Meaning
Large positive
Not cheap
Near zero
Near historical cheap zone
Negative
Below historical cheap extreme
EPS / Multiple Trend
This shows whether the anchored EPS base and valuation multiple are rising, falling, or stable.
Reading
Meaning
Rising / Expansion
EPS anchor rising and multiple rising
Rising / Compression
EPS anchor rising while valuation gets cheaper
Falling / Expansion
EPS anchor falling while valuation rises — riskier
Falling / Compression
EPS anchor falling and multiple falling
Stable / Stable
Little change
Most concerning:
Falling / Expansion
That means investors are paying a higher multiple while the earnings base is worsening.
Driver
This explains what is mostly driving the valuation move.
Driver
Meaning
Price-Led Multiple Expansion
Price is pushing valuation higher
Price-Led Multiple Compression
Price decline is compressing valuation
EPS Anchor Improved
Earnings base improved
EPS Anchor Deteriorated
Earnings base worsened
Stable
No major change
For overextension, watch for:
Price-Led Multiple Expansion
especially when Reactive Rank is above 90%.
PEG / Fwd P/S
These are supplemental checks.
Metric
Use
PEG
P/E adjusted for growth
Forward P/S
Useful when earnings are unstable or distorted
A high P/E is less concerning if growth is strong and PEG is reasonable. A high P/E with a high PEG is more concerning.
Data Quality
This row tells you whether the indicator has enough usable history.
Message
Meaning
Full reactive history
Most reliable
Limited reactive history
Usable, but be cautious
Too little reactive history
Percentiles are weak
No valid reported P/E
TradingView does not have usable forward P/E
Bars since anchor
How long since the reported P/E last updated
If “bars since anchor” is very high, the Reactive P/E is still useful for price movement, but the earnings base may be stale.
Status readings
Reactive Status
This is the main status because the chart is price-reactive.
Status
Meaning
Extreme Expensive
Reactive Rank 95%+
Expensive / Stretched
Reactive Rank 90–95%
Above Normal Valuation
Reactive Rank 75–90%
Normal Valuation Range
Reactive Rank 25–75%
Below Normal Valuation
Reactive Rank 10–25%
Historically Cheap
Reactive Rank 5–10%
Deep Valuation Discount
Reactive Rank below 5%
Limited / Building History
Not enough data yet
Reported Status
This is the slower TradingView-reported valuation status.
Use it as confirmation.
Best warning setup:
Reactive Status = Expensive / Stretched
Reported Status = Normal Valuation Range
That can mean the stock price has moved ahead of the last reported valuation update.
How to use it practically
Avoid chasing
Be cautious when you see:
Reactive Rank above 90%
Reactive Premium strongly positive
Reactive Room to P95 near zero or negative
Driver = Price-Led Multiple Expansion
That means valuation is stretched mainly because price has moved up.
Look for possible value
Look closer when you see:
Reactive Rank below 10%
Reactive Premium negative
Reactive Room above P05 near zero or negative
Reported Status also cheap
That means the stock may be cheap versus its own history.
Best long setup
The healthier setup is often:
Reactive Rank 25–75%
EPS trend Rising
Multiple Stable or Compressing
Price trend improving
That means the stock may not be overextended, and the earnings base may be improving.
Main takeaway
Use this indicator as a stock-specific valuation stretch tool.
The most important rows are:
Reactive / Reported P/E
Reactive / Reported Rank
Reactive / Reported Premium
Reactive Room to P95
Reactive Status
Reported Status
Data Quality
The key idea:
Reactive = what valuation looks like today after price movement.
Reported = what TradingView’s financial data currently reports.
Here is the source code:
//@version=6
indicator("Price-Reactive Forward P/E Extremes ", shorttitle="PRFPE+", overlay=false, max_bars_back=3000)
//====================================================
// INPUTS
//====================================================
grp1 = "Forward Valuation Settings"
financialMode = input.string("Auto FY then FQ", "Financial Period Mode", options= , group=grp1)
minValidPE = input.float(0.1, "Minimum Valid Forward P/E", minval=0.0, step=0.1, group=grp1)
maxValidPE = input.float(500.0, "Maximum Valid Forward P/E", minval=1.0, step=5.0, group=grp1)
grp2 = "Historical Lookback Settings"
lookbackChoice = input.string("5 Years", "Historical Lookback", options= , group=grp2)
requireFullHistory = input.bool(false, "Require Full Lookback History?", group=grp2)
minValidBars = input.int(63, "Minimum Valid Bars in Limited-History Mode", minval=20, maxval=1260, group=grp2)
usePriorHistoryOnly = input.bool(true, "Rank Current Reading vs Prior History Only?", group=grp2)
grp3 = "Smoothing Settings"
smoothType = input.string("EMA", "Price-Reactive P/E Smoothing Type", options= , group=grp3)
smoothLen = input.int(10, "Smoothing Length", minval=1, group=grp3)
signalLength = input.int(20, "Signal Line Length", minval=1, group=grp3)
rankSource = input.string("Raw Price-Reactive P/E", "Percentile / Z-Score Source", options= , group=grp3)
grp4 = "EPS / Multiple Trend Settings"
epsTrendLen = input.int(63, "EPS / Multiple Trend Lookback", minval=1, group=grp4)
trendThreshold = input.float(2.5, "Trend Threshold %", minval=0.0, step=0.5, group=grp4)
grp5 = "Visuals & UI"
showHistogram = input.bool(false, "Show Price-Reactive P/E Histogram?", group=grp5)
showReportedLine = input.bool(false, "Show Reported Forward P/E Step Line?", group=grp5)
showAdaptiveBands = input.bool(true, "Show Reactive Adaptive Percentile Bands?", group=grp5)
showZoneFills = input.bool(true, "Fill Extreme Zones?", group=grp5)
showFixedBands = input.bool(false, "Show Fixed Forward P/E Bands?", group=grp5)
showTable = input.bool(true, "Show Current Reading Table?", group=grp5)
showBgHighlight = input.bool(false, "Highlight Extreme Background?", group=grp5)
fixedUpper1 = input.float(30.0, "Fixed Upper Band 1", step=0.5, group=grp5)
fixedUpper2 = input.float(45.0, "Fixed Upper Band 2", step=0.5, group=grp5)
fixedLower1 = input.float(15.0, "Fixed Lower Band 1", step=0.5, group=grp5)
fixedLower2 = input.float(10.0, "Fixed Lower Band 2", step=0.5, group=grp5)
//====================================================
// LOOKBACK CONVERSION
//====================================================
historyBars = lookbackChoice == "6 Months" ? 126 : lookbackChoice == "1 Year" ? 252 : lookbackChoice == "2 Years" ? 504 : lookbackChoice == "3 Years" ? 756 : lookbackChoice == "4 Years" ? 1008 : 1260
requiredBars = requireFullHistory ? historyBars : minValidBars
//====================================================
// REPORTED FINANCIAL DATA
//====================================================
peFY = request.financial(syminfo.tickerid, "PRICE_EARNINGS_FORWARD", "FY", barmerge.gaps_off, true)
peFQ = request.financial(syminfo.tickerid, "PRICE_EARNINGS_FORWARD", "FQ", barmerge.gaps_off, true)
pegFY = request.financial(syminfo.tickerid, "PEG_RATIO", "FY", barmerge.gaps_off, true)
pegFQ = request.financial(syminfo.tickerid, "PEG_RATIO", "FQ", barmerge.gaps_off, true)
psFY = request.financial(syminfo.tickerid, "PRICE_SALES_FORWARD", "FY", barmerge.gaps_off, true)
psFQ = request.financial(syminfo.tickerid, "PRICE_SALES_FORWARD", "FQ", barmerge.gaps_off, true)
f_valid_pe(_v) =>
not na(_v) and _v >= minValidPE and _v <= maxValidPE ? _v : na
validPEFY = f_valid_pe(peFY)
validPEFQ = f_valid_pe(peFQ)
float reportedPE = na
string effectivePeriod = "n/a"
if financialMode == "FY"
reportedPE := validPEFY
effectivePeriod := "FY"
else if financialMode == "FQ"
reportedPE := validPEFQ
effectivePeriod := "FQ"
else if financialMode == "Auto FY then FQ"
if not na(validPEFY)
reportedPE := validPEFY
effectivePeriod := "FY"
else
reportedPE := validPEFQ
effectivePeriod := "FQ"
else
if not na(validPEFQ)
reportedPE := validPEFQ
effectivePeriod := "FQ"
else
reportedPE := validPEFY
effectivePeriod := "FY"
pegRatioData = effectivePeriod == "FY" ? pegFY : effectivePeriod == "FQ" ? pegFQ : na
forwardPSData = effectivePeriod == "FY" ? psFY : effectivePeriod == "FQ" ? psFQ : na
//====================================================
// PRICE-REACTIVE FORWARD P/E
//====================================================
reportedUpdated = not na(reportedPE) and (na(reportedPE ) or reportedPE != reportedPE )
var float anchoredForwardEPS = na
if reportedUpdated and reportedPE > 0.0
anchoredForwardEPS := close / reportedPE
else
anchoredForwardEPS := anchoredForwardEPS
priceReactivePE = not na(anchoredForwardEPS) and anchoredForwardEPS > 0.0 ? close / anchoredForwardEPS : na
barsSinceReportedUpdate = ta.barssince(reportedUpdated)
//====================================================
// SMOOTHING
//====================================================
f_smooth(_src, _len) =>
if smoothType == "None" or _len <= 1
_src
else if smoothType == "SMA"
ta.sma(_src, _len)
else if smoothType == "EMA"
ta.ema(_src, _len)
else
ta.rma(_src, _len)
smoothedReactivePE = f_smooth(priceReactivePE, smoothLen)
rankReactivePE = rankSource == "Raw Price-Reactive P/E" ? priceReactivePE : smoothedReactivePE
signalLine = f_smooth(smoothedReactivePE, signalLength)
//====================================================
// HISTORICAL STATS FUNCTIONS
//====================================================
f_array_percentile(_arr, _pct) =>
int _n = array.size(_arr)
float _result = na
if _n > 0
float _pos = (_pct / 100.0) * (_n - 1)
int _lo = int(math.floor(_pos))
int _hi = int(math.ceil(_pos))
float _weight = _pos - _lo
float _loVal = array.get(_arr, _lo)
float _hiVal = array.get(_arr, _hi)
_result := _loVal + ((_hiVal - _loVal) * _weight)
_result
f_hist_stats(_series, _x, _len, _priorOnly) =>
array _values = array.new_float(0)
float _sum = 0.0
float _sumSq = 0.0
int _start = _priorOnly ? 1 : 0
int _finish = _priorOnly ? _len : _len - 1
for i = _start to _finish
_v = _series
if not na(_v)
array.push(_values, _v)
_sum += _v
_sumSq += _v * _v
int _n = array.size(_values)
float _p95 = na
float _p90 = na
float _p75 = na
float _p50 = na
float _p25 = na
float _p10 = na
float _p05 = na
float _rank = na
float _mean = na
float _stdev = na
if _n > 0
array.sort(_values, order.ascending)
_p95 := f_array_percentile(_values, 95)
_p90 := f_array_percentile(_values, 90)
_p75 := f_array_percentile(_values, 75)
_p50 := f_array_percentile(_values, 50)
_p25 := f_array_percentile(_values, 25)
_p10 := f_array_percentile(_values, 10)
_p05 := f_array_percentile(_values, 5)
if not na(_x)
float _countBelowOrEqual = 0.0
for j = 0 to _n - 1
if array.get(_values, j) <= _x
_countBelowOrEqual += 1.0
_rank := (_countBelowOrEqual / _n) * 100.0
_mean := _sum / _n
if _n > 1
float _variance = (_sumSq - ((_sum * _sum) / _n)) / (_n - 1)
_stdev := _variance >= 0.0 ? math.sqrt(_variance) : na
//====================================================
// REACTIVE HISTORICAL STATS
//====================================================
= f_hist_stats(rankReactivePE, rankReactivePE, historyBars, usePriorHistoryOnly)
hasEnoughReactiveHistory = not na(priceReactivePE) and reactiveHistoryCount >= requiredBars
rP95 = hasEnoughReactiveHistory ? rP95Raw : na
rP90 = hasEnoughReactiveHistory ? rP90Raw : na
rP75 = hasEnoughReactiveHistory ? rP75Raw : na
rP50 = hasEnoughReactiveHistory ? rP50Raw : na
rP25 = hasEnoughReactiveHistory ? rP25Raw : na
rP10 = hasEnoughReactiveHistory ? rP10Raw : na
rP05 = hasEnoughReactiveHistory ? rP05Raw : na
reactivePercentRank = hasEnoughReactiveHistory ? rRankRaw : na
reactiveZScore = hasEnoughReactiveHistory and not na(rStdevRaw) and rStdevRaw != 0.0 ? (rankReactivePE - rAvgRaw) / rStdevRaw : na
//====================================================
// REPORTED HISTORICAL STATS
//====================================================
= f_hist_stats(reportedPE, reportedPE, historyBars, usePriorHistoryOnly)
hasEnoughReportedHistory = not na(reportedPE) and reportedHistoryCount >= requiredBars
reportedP95 = hasEnoughReportedHistory ? fP95Raw : na
reportedP90 = hasEnoughReportedHistory ? fP90Raw : na
reportedP75 = hasEnoughReportedHistory ? fP75Raw : na
reportedP50 = hasEnoughReportedHistory ? fP50Raw : na
reportedP25 = hasEnoughReportedHistory ? fP25Raw : na
reportedP10 = hasEnoughReportedHistory ? fP10Raw : na
reportedP05 = hasEnoughReportedHistory ? fP05Raw : na
reportedPercentRank = hasEnoughReportedHistory ? fRankRaw : na
reportedZScore = hasEnoughReportedHistory and not na(fStdevRaw) and fStdevRaw != 0.0 ? (reportedPE - fAvgRaw) / fStdevRaw : na
//====================================================
// VALUATION CONTEXT
//====================================================
reactivePremiumToMedian = not na(rP50) and rP50 != 0.0 and not na(rankReactivePE) ? ((rankReactivePE - rP50) / rP50) * 100.0 : na
reportedPremiumToMedian = not na(reportedP50) and reportedP50 != 0.0 and not na(reportedPE) ? ((reportedPE - reportedP50) / reportedP50) * 100.0 : na
reactiveRoomToP95 = not na(rP95) and not na(rankReactivePE) ? rP95 - rankReactivePE : na
reportedRoomToP95 = not na(reportedP95) and not na(reportedPE) ? reportedP95 - reportedPE : na
reactiveRoomAboveP05 = not na(rP05) and not na(rankReactivePE) ? rankReactivePE - rP05 : na
reportedRoomAboveP05 = not na(reportedP05) and not na(reportedPE) ? reportedPE - reportedP05 : na
reactiveEarningsYield = not na(priceReactivePE) and priceReactivePE > 0.0 ? 100.0 / priceReactivePE : na
reportedEarningsYield = not na(reportedPE) and reportedPE > 0.0 ? 100.0 / reportedPE : na
anchoredEPSChangePct = not na(anchoredForwardEPS ) and anchoredForwardEPS != 0.0 ? ((anchoredForwardEPS - anchoredForwardEPS ) / math.abs(anchoredForwardEPS )) * 100.0 : na
reactivePEChangePct = not na(rankReactivePE ) and rankReactivePE != 0.0 ? ((rankReactivePE - rankReactivePE ) / math.abs(rankReactivePE )) * 100.0 : na
priceChangePct = not na(close ) and close != 0.0 ? ((close - close ) / close ) * 100.0 : na
//====================================================
// DATA QUALITY
//====================================================
string reactiveDataQualityText = "n/a"
if na(reportedPE)
reactiveDataQualityText := "No valid reported P/E"
else if na(anchoredForwardEPS)
reactiveDataQualityText := "No anchored EPS yet"
else if reactiveHistoryCount < minValidBars
reactiveDataQualityText := "Too little reactive history: " + str.tostring(reactiveHistoryCount, "#") + " bars"
else if requireFullHistory and reactiveHistoryCount < historyBars
reactiveDataQualityText := "Need full reactive lookback: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
else if reactiveHistoryCount < historyBars
reactiveDataQualityText := "Limited reactive history: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
else
reactiveDataQualityText := "Full reactive history: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
string reportedDataQualityText = "n/a"
if na(reportedPE)
reportedDataQualityText := "No valid reported P/E"
else if reportedHistoryCount < minValidBars
reportedDataQualityText := "Too little reported history: " + str.tostring(reportedHistoryCount, "#") + " bars"
else if requireFullHistory and reportedHistoryCount < historyBars
reportedDataQualityText := "Need full reported lookback: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
else if reportedHistoryCount < historyBars
reportedDataQualityText := "Limited reported history: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
else
reportedDataQualityText := "Full reported history: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
//====================================================
// STATUS LOGIC
//====================================================
f_status(_hasEnough, _rank, _valueIsValid) =>
string _status = "Neutral"
if not _valueIsValid
_status := "No Forward P/E Data"
else if not _hasEnough
_status := "Limited / Building History"
else if _rank >= 95
_status := "Extreme Expensive"
else if _rank >= 90
_status := "Expensive / Stretched"
else if _rank >= 75
_status := "Above Normal Valuation"
else if _rank <= 5
_status := "Deep Valuation Discount"
else if _rank <= 10
_status := "Historically Cheap"
else if _rank <= 25
_status := "Below Normal Valuation"
else
_status := "Normal Valuation Range"
_status
reactiveStatusText = f_status(hasEnoughReactiveHistory, reactivePercentRank, not na(priceReactivePE))
reportedStatusText = f_status(hasEnoughReportedHistory, reportedPercentRank, not na(reportedPE))
isReady = hasEnoughReactiveHistory and not na(reactivePercentRank)
isExtremeExpensive = isReady and reactivePercentRank >= 95
isExpensive = isReady and reactivePercentRank >= 90 and reactivePercentRank < 95
isAboveNormal = isReady and reactivePercentRank >= 75 and reactivePercentRank < 90
isDeepDiscount = isReady and reactivePercentRank <= 5
isCheap = isReady and reactivePercentRank > 5 and reactivePercentRank <= 10
isBelowNormal = isReady and reactivePercentRank > 10 and reactivePercentRank <= 25
string epsTrendText = "n/a"
if not na(anchoredEPSChangePct)
if anchoredEPSChangePct > trendThreshold
epsTrendText := "Rising"
else if anchoredEPSChangePct < -trendThreshold
epsTrendText := "Falling"
else
epsTrendText := "Flat"
string multipleTrendText = "n/a"
if not na(reactivePEChangePct)
if reactivePEChangePct > trendThreshold
multipleTrendText := "Expansion"
else if reactivePEChangePct < -trendThreshold
multipleTrendText := "Compression"
else
multipleTrendText := "Stable"
string driverText = "n/a"
if not na(priceChangePct) and not na(reactivePEChangePct)
if priceChangePct > trendThreshold and reactivePEChangePct > trendThreshold
driverText := "Price-Led Multiple Expansion"
else if priceChangePct < -trendThreshold and reactivePEChangePct < -trendThreshold
driverText := "Price-Led Multiple Compression"
else if priceChangePct > trendThreshold and reactivePEChangePct < -trendThreshold
driverText := "EPS Anchor Improved"
else if priceChangePct < -trendThreshold and reactivePEChangePct > trendThreshold
driverText := "EPS Anchor Deteriorated"
else
driverText := "Stable"
color dynamicColor = color.gray
if isReady
if reactivePercentRank > 50
dynamicColor := color.from_gradient(reactivePercentRank, 50, 100, color.new(color.gray, 45), color.new(color.red, 0))
else
dynamicColor := color.from_gradient(reactivePercentRank, 0, 50, color.new(color.blue, 0), color.new(color.gray, 45))
color statusColor = color.gray
if isReady
if isExtremeExpensive
statusColor := color.red
else if isExpensive
statusColor := color.orange
else if isAboveNormal
statusColor := color.yellow
else if isDeepDiscount
statusColor := color.blue
else if isCheap
statusColor := color.aqua
else if isBelowNormal
statusColor := color.teal
else
statusColor := color.gray
//====================================================
// PLOTS — PRICE-REACTIVE ONLY
//====================================================
plot(showHistogram ? smoothedReactivePE : na, title="Smoothed Price-Reactive Forward P/E Histogram", style=plot.style_columns, color=color.new(dynamicColor, 45))
plot(showReportedLine ? reportedPE : na, title="Reported Forward P/E Step Line", color=color.new(color.white, 65), linewidth=1, style=plot.style_stepline)
plot(smoothedReactivePE, title="Price-Reactive Forward P/E", color=dynamicColor, linewidth=3)
plot(signalLine, title="Price-Reactive Forward P/E Signal Line", color=color.new(color.yellow, 0), linewidth=2)
p95Plot = plot(showAdaptiveBands ? rP95 : na, title="Reactive 95th Percentile", color=color.new(color.red, 20), linewidth=2)
p90Plot = plot(showAdaptiveBands ? rP90 : na, title="Reactive 90th Percentile", color=color.new(color.red, 65), linewidth=1)
p75Plot = plot(showAdaptiveBands ? rP75 : na, title="Reactive 75th Percentile", color=color.new(color.gray, 75), linewidth=1)
p50Plot = plot(showAdaptiveBands ? rP50 : na, title="Reactive 50th Percentile / Median", color=color.new(color.gray, 20), linewidth=2)
p25Plot = plot(showAdaptiveBands ? rP25 : na, title="Reactive 25th Percentile", color=color.new(color.gray, 75), linewidth=1)
p10Plot = plot(showAdaptiveBands ? rP10 : na, title="Reactive 10th Percentile", color=color.new(color.blue, 65), linewidth=1)
p05Plot = plot(showAdaptiveBands ? rP05 : na, title="Reactive 5th Percentile", color=color.new(color.blue, 20), linewidth=2)
fill(p95Plot, p90Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.red, 88) : na, title="Reactive Expensive Zone Fill")
fill(p10Plot, p05Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.blue, 88) : na, title="Reactive Cheap Zone Fill")
fill(p75Plot, p25Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.gray, 94) : na, title="Reactive Normal Zone Fill")
plot(showFixedBands ? fixedUpper1 : na, title="Fixed Upper Band 1", color=color.new(color.orange, 45), linewidth=1)
plot(showFixedBands ? fixedUpper2 : na, title="Fixed Upper Band 2", color=color.new(color.red, 45), linewidth=1)
plot(showFixedBands ? fixedLower1 : na, title="Fixed Lower Band 1", color=color.new(color.aqua, 45), linewidth=1)
plot(showFixedBands ? fixedLower2 : na, title="Fixed Lower Band 2", color=color.new(color.blue, 45), linewidth=1)
bgcolor(showBgHighlight and isExtremeExpensive ? color.new(color.red, 90) : showBgHighlight and isDeepDiscount ? color.new(color.blue, 90) : na)
//====================================================
// TABLE
//====================================================
f_x(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##") + "x"
f_pct(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##") + "%"
f_num(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##")
f_price(_value) =>
na(_value) ? "n/a" : str.tostring(_value, format.mintick)
f_bars(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#")
var table infoTable = table.new(position.top_right, 2, 18, border_width=1, border_color=color.new(color.gray, 75))
if showTable and barstate.islast
table.cell(infoTable, 0, 0, "Metric", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(infoTable, 1, 0, "Current", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(infoTable, 0, 1, "Reactive / Reported P/E", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 1, f_x(priceReactivePE) + " / " + f_x(reportedPE), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 2, "Smoothed Reactive P/E", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 2, f_x(smoothedReactivePE), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 3, "Anchored Forward EPS", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 3, f_price(anchoredForwardEPS), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 4, "Reactive / Reported Rank", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 4, f_pct(reactivePercentRank) + " / " + f_pct(reportedPercentRank), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 5, "Reactive / Reported Median", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 5, f_x(rP50) + " / " + f_x(reportedP50), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 6, "Reactive / Reported Premium", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 6, f_pct(reactivePremiumToMedian) + " / " + f_pct(reportedPremiumToMedian), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 7, "Reactive / Reported P95", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 7, f_x(rP95) + " / " + f_x(reportedP95), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 8, "Reactive / Reported P05", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 8, f_x(rP05) + " / " + f_x(reportedP05), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 9, "Reactive / Reported Yield", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 9, f_pct(reactiveEarningsYield) + " / " + f_pct(reportedEarningsYield), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 10, "Reactive Room to P95", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 10, f_x(reactiveRoomToP95), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 11, "Reactive Room above P05", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 11, f_x(reactiveRoomAboveP05), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 12, "EPS / Multiple Trend", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 12, epsTrendText + " / " + multipleTrendText, text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 13, "Driver", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 13, driverText, text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 14, "PEG / Fwd P/S", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 14, f_x(pegRatioData) + " / " + f_x(forwardPSData), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 15, "Data Quality", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 15, reactiveDataQualityText + " / " + effectivePeriod + " / " + f_bars(barsSinceReportedUpdate) + " bars since anchor", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 16, "Reactive Status", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 16, reactiveStatusText, text_color=color.white, bgcolor=color.new(statusColor, 20))
table.cell(infoTable, 0, 17, "Reported Status", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 17, reportedStatusText, text_color=color.white, bgcolor=color.new(color.black, 50))
if not showTable and barstate.islast
table.clear(infoTable, 0, 0, 1, 17)
//====================================================
// ALERTS — PRICE-REACTIVE ONLY
//====================================================
crossOver95 = ta.crossover(reactivePercentRank, 95)
crossUnder95 = ta.crossunder(reactivePercentRank, 95)
crossOver90 = ta.crossover(reactivePercentRank, 90)
crossUnder90 = ta.crossunder(reactivePercentRank, 90)
crossUnder5 = ta.crossunder(reactivePercentRank, 5)
crossOver5 = ta.crossover(reactivePercentRank, 5)
crossUnder10 = ta.crossunder(reactivePercentRank, 10)
crossOver10 = ta.crossover(reactivePercentRank, 10)
crossOverMedian = ta.crossover(rankReactivePE, rP50)
crossUnderMedian = ta.crossunder(rankReactivePE, rP50)
peCrossAboveSignal = ta.crossover(smoothedReactivePE, signalLine)
peCrossBelowSignal = ta.crossunder(smoothedReactivePE, signalLine)
enteredExtremeExpensive = isReady and crossOver95
exitedExtremeExpensive = isReady and crossUnder95
enteredExpensive = isReady and crossOver90
exitedExpensive = isReady and crossUnder90
enteredDeepDiscount = isReady and crossUnder5
exitedDeepDiscount = isReady and crossOver5
enteredCheap = isReady and crossUnder10
exitedCheap = isReady and crossOver10
expensiveMultipleCompression = isReady and reactivePercentRank >= 90 and peCrossBelowSignal
cheapReRating = isReady and reactivePercentRank <= 10 and peCrossAboveSignal
alertcondition(enteredExtremeExpensive, title="Entered Extreme Expensive Zone", message="Price-reactive forward P/E entered its 95th percentile extreme expensive zone.")
alertcondition(exitedExtremeExpensive, title="Exited Extreme Expensive Zone", message="Price-reactive forward P/E exited its 95th percentile extreme expensive zone.")
alertcondition(enteredExpensive, title="Entered Expensive Zone", message="Price-reactive forward P/E entered its 90th percentile expensive zone.")
alertcondition(exitedExpensive, title="Exited Expensive Zone", message="Price-reactive forward P/E exited its 90th percentile expensive zone.")
alertcondition(enteredDeepDiscount, title="Entered Deep Discount Zone", message="Price-reactive forward P/E entered its 5th percentile deep discount zone.")
alertcondition(exitedDeepDiscount, title="Exited Deep Discount Zone", message="Price-reactive forward P/E exited its 5th percentile deep discount zone.")
alertcondition(enteredCheap, title="Entered Historically Cheap Zone", message="Price-reactive forward P/E entered its 10th percentile historically cheap zone.")
alertcondition(exitedCheap, title="Exited Historically Cheap Zone", message="Price-reactive forward P/E exited its 10th percentile historically cheap zone.")
alertcondition(crossOverMedian, title="Reactive P/E Crossed Above Median", message="Price-reactive forward P/E crossed above its historical median.")
alertcondition(crossUnderMedian, title="Reactive P/E Crossed Below Median", message="Price-reactive forward P/E crossed below its historical median.")
alertcondition(expensiveMultipleCompression, title="Expensive Multiple Compression Warning", message="Price-reactive forward P/E is historically expensive and crossed below its signal line.")
alertcondition(cheapReRating, title="Cheap Re-Rating Warning", message="Price-reactive forward P/E is historically cheap and crossed above its signal line.") インジケーター
