Strategy

Indicator

CQ_Auto Fibonacci Retracement================================================================================
CQ AUTO FIBONACCI RETRACEMENT — USER MANUAL
Fib.Retracement core is from pulsewire built-in FBR -> upgrade new-type GUI,
and performance tuned / CQuevedo345
================================================================================
OVERVIEW
--------
CQ Auto Fibonacci Retracement is an automatic Fibonacci retracement
indicator built for PulseWire in Pine Script v6. It detects swing pivots
(highs and lows) in real time and draws a full Fibonacci scale between them,
including a live gauge that shows where the current price sits within the
retracement range.
The indicator is fully color-coded by market bias: teal for bullish swings
(last confirmed pivot is a low) and orange for bearish swings (last confirmed
pivot is a high). All elements — the trend line, fib level lines, scale labels,
and the gauge — switch color together the moment a new pivot is confirmed.
--------------------------------------------------------------------------------
SECTION 1 — MASTER CONTROL
--------------------------------------------------------------------------------
Enable Indicator (toggle)
Master on/off switch. When disabled, all drawing is suppressed but the
indicator remains on the chart. Use this to quickly hide the overlay
without removing it.
How Far (integer, default 10, range 1–100)
Lookback depth for pivot detection. Controls how many bars to the left
and right of a candidate bar must be lower (for a high pivot) or higher
(for a low pivot) before that bar qualifies as a pivot. Lower values
produce more frequent, shorter swings. Higher values produce fewer,
larger swings.
Wave Size (float, default 10, step 0.5, min 1)
Sensitivity multiplier applied to the ATR-based deviation threshold. A
new pivot is only confirmed when price has moved at least this multiple
of the normalized ATR from the previous pivot. Higher values require a
larger price move to flip the swing direction, filtering out noise.
Lower values make the indicator more reactive.
Fibonacci Level Toggles (25% / 40% / 50% / 60% / 75% / 90%)
Six individual checkboxes to show or hide specific intermediate fib
levels. The 0% and 100% anchor levels and all extension levels are
always visible and cannot be individually toggled.
--------------------------------------------------------------------------------
SECTION 2 — COLOR SETTINGS
--------------------------------------------------------------------------------
THEME COLORS
Bullish (▲) (color picker, default teal #26A69A)
Color applied to all elements when the last confirmed pivot is a LOW,
meaning price swung upward from it. Affects: trend line, pivot circles,
all fib level lines, scale labels, gauge box, gauge highlight bar, and
the extreme price label.
Bearish (▼) (color picker, default orange #FF8A3D)
Color applied to all elements when the last confirmed pivot is a HIGH,
meaning price swung downward from it. Same scope as the bullish color.
The indicator flips both colors simultaneously the moment a new pivot is
confirmed. Historical drawings retain the color they had when drawn.
TREND LINE
Show Trend Line (toggle, default on)
Shows or hides the dotted line connecting consecutive pivot points.
Width (integer, default 3)
Stroke width of the dotted trend line in pixels.
Show Pivot Points (toggle, default on)
Shows or hides the hollow circle markers (◯) drawn at each pivot
endpoint.
GAUGE
Gauge Highlight ▲ (color picker, default teal at 40% opacity)
Color of the moving highlight bar inside the gauge when bullish. This
bar tracks the current close price within the gauge range.
Gauge Highlight ▼ (color picker, default orange at 40% opacity)
Same as above for bearish swings.
Draw Gauge ⌈∥⌉ (toggle, default on)
Shows or hides the vertical gauge element entirely. When off, the gauge
box, highlight bar, range cap lines, and extreme price label are all
suppressed.
LAYOUT
Gauge X-Offset (integer, default -2)
Shifts the gauge and all associated labels left or right along the
x-axis, measured in bars. Negative values move it left; positive values
move it right. Adjust this to prevent overlap with candles or other
indicators.
Level Tick Length (Right) (integer, default 1, range 1–9)
Length in bars of the small horizontal tick marks drawn to the right of
the gauge for each fib level. Increase to make the scale easier to read.
Show Price on Labels (toggle, default on)
When on, each fib scale label shows two lines: the percentage level on
top and the absolute price below. When off, only the percentage is shown.
Label Size (dropdown, default Small)
Font size for all scale labels, extension labels, and the extreme price
label. Options: Tiny / Small / Normal / Large / Huge.
Gauge at Line End (vs Current Bar) (toggle, default off)
Controls where the gauge and its labels are anchored on the x-axis.
OFF (default): The gauge follows the current bar, always at the right
edge of the chart. Labels and tick marks update every bar.
ON: The gauge is pinned to the x2 endpoint of the dotted trend line —
the most recent confirmed pivot bar. The gauge stays fixed at that
historical position until a new pivot is confirmed. Useful for a less
cluttered look when price has moved far from the pivot.
--------------------------------------------------------------------------------
SECTION 3 — VISUAL ELEMENTS EXPLAINED
--------------------------------------------------------------------------------
TREND LINE (dotted)
Connects the last two confirmed pivot points. Direction indicates the
current swing: rising line = last pivot was a low (bullish); falling
line = last pivot was a high (bearish).
PIVOT CIRCLES (◯)
Hollow circles drawn at each pivot point on the trend line. The start
circle marks the older pivot; the end circle marks the more recent one.
FIBONACCI LEVEL LINES
Horizontal lines drawn at each active fib level across the chart.
The 0% line sits at the most recent pivot price (the base). The 100%
line sits at the previous pivot price (the target). Intermediate levels
are drawn between them. Extension levels (above 100% or below 0%) appear
automatically when price breaks outside the retracement range.
Line visibility:
- 0% and 100% lines are always solid and fully opaque.
- Intermediate lines are dotted and fully opaque when price is near
that level; they fade to 70% transparency when price is far away.
- Extension lines only appear when price has moved beyond the
corresponding boundary.
SCALE LABELS (right side of gauge)
Each fib level has a small label showing the level percentage and,
optionally, the absolute price. Labels are color-matched to the current
theme. The label for each level is positioned at the gauge x-offset
and updates every bar.
EXTENSION LABELS (auto mode)
When price moves beyond the 0%–100% range, extension levels are drawn
automatically at -0.25, -0.50, -1.00, -1.50, -2.00 (below 0%) and
1.25, 1.50, 2.00 (above 100%). These carry their own labels and short
tick marks at the gauge position.
--------------------------------------------------------------------------------
SECTION 4 — THE GAUGE
--------------------------------------------------------------------------------
The gauge is a vertical bar drawn at the gauge position (either the current
bar or the trend line endpoint, depending on the Gauge at Line End setting).
It is the most information-dense element of the indicator.
GAUGE BACKGROUND BOX (faint filled rectangle)
Spans from the lowest low to the highest high reached since the last
pivot. This is the full price range of the current swing, not just the
0%–100% fib span. It visually shows how far price has traveled relative
to the fib boundaries.
TOP CAP LINE (thin white horizontal line)
Marks the highest high reached since the pivot. Drawn at the top of the
gauge background box.
BOTTOM CAP LINE (theme-colored horizontal line)
Marks the lowest low reached since the pivot. Drawn at the bottom of
the gauge background box.
GAUGE BODY (semi-transparent filled box, theme color)
A narrower vertical bar spanning from the current close price to the
pivot price (fb_pLast). This shows the current unrealized move from the
pivot in absolute price terms.
HIGHLIGHT BAR (wide line, gauge highlight color)
A thick horizontal line at the current close price that moves every bar.
This is the "needle" of the gauge — it shows at a glance where price
sits within the full range.
EXTREME PRICE LABEL (left side of gauge)
Displayed to the left of the gauge. Shows:
- A directional arrow (▲ for bullish, ▼ for bearish)
- The extreme price reached since the pivot (highest high if bullish,
lowest low if bearish)
- The percentage change from the pivot price to that extreme
Example (bullish): ▲ 109,432.50
+8.43%
Example (bearish): ▼ 94,210.00
-6.71%
The label updates every bar as price extends the move. The percentage
is always calculated from fb_pLast (the most recent confirmed pivot
price), not from the entry price or any other reference.
PROFIT LABEL (at 0% level, gauge position)
A small label at the 0% fib level showing the raw price difference
between the current close and the pivot price. Displayed as a signed
dollar amount (e.g., +$4,230 or -$2,180).
--------------------------------------------------------------------------------
SECTION 5 — PIVOT LOGIC
--------------------------------------------------------------------------------
A pivot is confirmed when:
1. A bar exists such that all bars within the lookback depth (How Far) to
its left and right are lower (for a high pivot) or higher (for a low
pivot).
2. The price deviation from the previous pivot exceeds the Wave Size
threshold: (ATR_20 / close * 100 * Wave Size).
When both conditions are met:
- The trend line moves from the previous pivot to the new one.
- The Fibonacci levels recalculate based on the new pivot pair.
- The theme color switches (teal if the new pivot is a low, orange if high).
- The gauge resets its range tracking.
If a new pivot is in the same direction as the current one (e.g., a higher
high when the last pivot was already a high), the trend line simply extends
to the new extreme rather than creating a new swing.
--------------------------------------------------------------------------------
SECTION 6 — FIBONACCI LEVELS REFERENCE
--------------------------------------------------------------------------------
Level Description
------- ---------------------------------------------------------------
-2.000 Extension: 200% below 0% (deep extension)
-1.500 Extension: 150% below 0%
-1.000 Extension: 100% below 0% (mirror of full range)
-0.500 Extension: 50% below 0%
-0.250 Extension: 25% below 0%
0.000 Base — most recent pivot price (always shown)
0.250 25% retracement (optional)
0.400 40% retracement (optional)
0.500 50% retracement (optional)
0.600 60% retracement (optional, uses key line color)
0.750 75% retracement (optional)
0.900 90% retracement (optional)
1.000 Target — previous pivot price (always shown)
1.250 Extension: 125% above 100%
1.500 Extension: 150% above 100%
2.000 Extension: 200% above 100%
Negative levels appear when price drops below the 0% base.
Levels above 1.000 appear when price exceeds the 100% target.
Extensions are shown automatically based on where price is relative to the
retracement range; they do not need to be toggled on.
--------------------------------------------------------------------------------
SECTION 7 — TIPS & RECOMMENDED SETTINGS
--------------------------------------------------------------------------------
For higher timeframe swing trading (4H, Daily):
- How Far: 20–30
- Wave Size: 15–20
- This captures major structural swings and ignores intraday noise.
For intraday scalping (5m, 15m):
- How Far: 5–10
- Wave Size: 5–8
- This picks up shorter swings with faster pivot confirmation.
Reducing clutter:
- Enable "Gauge at Line End" to pin the gauge to the pivot bar instead
of the live candle. This keeps the right side of the chart cleaner.
- Disable "Show Price on Labels" if the chart is zoomed out and labels
overlap. Percentage-only labels are narrower.
- Set Label Size to Tiny on zoomed-out views.
- Reduce Level Tick Length to 1 if the tick marks extend too far right.
Overlapping indicators:
- Use Gauge X-Offset (negative values) to push the gauge further left,
away from other indicators drawn at the chart edge.
--------------------------------------------------------------------------------
SECTION 8 — KNOWN BEHAVIORS
--------------------------------------------------------------------------------
Pivot repainting
Pivot confirmation requires a full lookback depth of bars to the right
of the candidate bar, so the most recent pivot is always fb_depth/2
bars in the past. The indicator does not repaint confirmed pivots; only
the live trend line endpoint moves as price discovers new extremes in
the same direction.
Color on historical bars
Historical segments retain the color they carried at the time they were
drawn. Only the current active segment updates its color live.
Extension level auto-visibility
Extension lines and labels appear and disappear dynamically based on
whether price has crossed the corresponding boundary. This is
intentional — the chart only shows the levels that are currently
relevant to where price is trading.
Gauge range vs fib range
The gauge background box shows the full high-to-low range since the
pivot, which will often be wider than the 0%–100% fib span. This is
correct: the gauge tracks actual price excursion, while the fib levels
track the retracement within the defined swing.
First bar initialization
On the very first bars of a chart or after a long gap, fb_pLast
initializes to 0 and fb_lineLast to na. The indicator will not draw
until at least one valid pivot pair has been confirmed.
================================================================================
END OF MANUAL
CQ Auto Fibonacci Retracement / CQuevedo345
================================================================================
Indicator

Strategy

Indicator

Indicator

Long-Term Cycle Valuation MapLong-Term Cycle Valuation Map is an educational indicator designed to visualize long-term crypto market valuation and cycle conditions.
The script does not generate buy or sell signals. It does not predict exact tops or bottoms. Its purpose is to help users observe whether the market is in a deeper reset, rebuild, neutral, late expansion, or exhaustion-risk environment.
The indicator combines several long-term market-regime components into one normalized Cycle Valuation Score.
The model uses:
1. 365D Moving Average Multiple
This measures price relative to its 365-day moving average. It helps visualize whether price is extended above or depressed below a long-term mean.
2. RSI(100) on 2D
This measures slower momentum conditions using a long RSI setting on a 2-day timeframe.
3. Long-Term Bollinger Bandwidth
This measures long-term volatility compression and expansion using a 365-day Bollinger Bandwidth structure.
4. Market Attention Proxy
This is not Google Trends data.
It is a market-based activity proxy using volume, volatility, and range expansion. Its purpose is to estimate whether market activity is quiet, normal, elevated, or overheated from price and volume behavior.
Customization:
Each component can be turned on or off.
Users can also adjust the relative strength of each component through percentage inputs.
The default public configuration is:
365D Moving Average Multiple: 30%
RSI(100) on 2D: 30%
Long-Term Bollinger Bandwidth: 30%
Market Attention Proxy: 10%
The weights do not need to add up to exactly 100. The script automatically normalizes the active components.
If a component is disabled, or if it does not have enough historical data yet, it is excluded from the active score.
The table shows how many components are active.
The final output is a normalized Cycle Valuation Score between 0 and 100.
General interpretation:
Below 15:
Deep reset zone
15-90:
Broad cycle range. This can include rebuild, neutral, and late expansion conditions.
Above 90:
Exhaustion-risk zone
The score should not be used as a standalone trading system.
A low score does not mean price must immediately rise.
A high score does not mean price must immediately fall.
Markets can remain in the same regime for extended periods.
The script is intended for higher-timeframe market-structure analysis. It is best used on multi-day, weekly, and monthly charts.
On early historical bars, the score may use fewer available components until all long-term calculations have enough history. The table shows how many components are active.
This indicator combines common long-term market measures into a single normalized framework. Its usefulness comes from organizing valuation, momentum, volatility, and market-activity conditions into one cycle-regime score.
Repainting:
The script does not use future data or lookahead logic.
Values on the currently open candle may update until that candle closes.
Limitations:
The script does not forecast future prices.
It does not guarantee cycle tops or bottoms.
It does not provide trade entries or exits.
It should not be used as a standalone trading decision tool.
Intended use:
Educational long-term market-structure and cycle-valuation analysis. Indicator

Reversal & Continuation Index$$I. OVERVIEW AND OBJECTIVE$$
The Reversal & Continuation Index (RCI) is a dual-engine Digital Signal Processing (DSP) tool designed to simultaneously measure two conflicting market forces: macro-level directional persistence and micro-level kinematic snapbacks.
Traditional oscillators often blend short-term momentum and long-term trend into a single output, resulting in a loss of nuance. The RCI architecture separates these elements, providing a clear structural wave (Continuation) overlaid with a highly responsive signal blade (Reversion) to identify high-probability turning points.
The Mechanism: The CI acts as the foundational structural anchor of the indicator. It measures the long-range efficiency of the market.
The Math: It calculates the net price displacement over a macro lookback period (default 34 bars) and divides it by the total absolute path distance traveled in that same period. This efficiency ratio is then smoothed via a Weighted Moving Average (default 5 bars) to eliminate micro-structural noise.
Interpretation:
Onset (Accelerating): When the absolute value of the CI is expanding, directional persistence is increasing. The trend is structurally sound and accelerating (visualized by bright green or bright red fills).
Exhaustion (Decelerating): When the absolute value of the CI is contracting, the trend's directional efficiency is mathematically decaying, even if the price is still slowly grinding in the trend's direction. This is an early warning of structural weakness (visualized by darker, muted colors).
The Mechanism: The RI acts as the fast, piercing kinematic blade. It operates on the same mathematical foundation as the CI but measures acute bar-to-bar snapbacks over a much tighter window (default 9 bars) without any artificial smoothing.
The Math: It normalizes the short-term sum of price differences by the absolute sum of those differences, bounding the result strictly between -100 and +100.
Interpretation: The RI identifies overextended, short-term kinematic momentum. It whips rapidly between extremes, highlighting the exact moments when acute price momentum is overbought or oversold.
The true power of the RCI lies in the convergence of its two independent indices. The indicator does not generate signals based purely on overbought/oversold levels, but rather on the interaction between macro exhaustion and micro reversion.
Bullish Convergence Reversal:
Occurs when the macro Bearish Trend enters a state of Exhaustion (the negative CI wave begins contracting toward zero), AND the fast Reversion Index simultaneously crosses above the zero line. This indicates that the long-term selling pressure is mathematically exhausted just as short-term momentum shifts bullish.
Bearish Convergence Reversal:
Occurs when the macro Bullish Trend enters a state of Exhaustion (the positive CI wave begins contracting toward zero), AND the fast Reversion Index simultaneously crosses below the zero line. This indicates that the long-term buying pressure is mathematically exhausted just as short-term momentum shifts bearish.
$$V. CONCLUSION$$
The Reversal & Continuation Index moves beyond basic momentum tracking. By explicitly tokenizing when a macro trend loses its directional persistence and timing the entry with a short-term kinematic fracture, the RCI provides a rigorous framework for identifying institutional phase shifts. Indicator

TradeFlow Full SystemTradeflow— Full Trading System
A complete all-in-one trading indicator built for active intraday options traders. Replaces the need for multiple paid indicators by combining trend detection, key levels, entry signals, exit warnings, and expiry guidance in a single overlay.
What it does:
Automatically detects market trend state — Uptrend, Downtrend, or Choppy — using a triple EMA system (13/48/200) with Bollinger/Keltner squeeze filter. No manual inputs required. Just add it to your chart and it reads the market for you.
Entry signals fire automatically for:
13 EMA pullback entries (price touches EMA, closes back on trend side with volume)
Break and retest of Premarket High/Low (PMH/PML)
Break and retest of Previous Day High/Low (PDH/PDL)
Opening Range Breakout (ORB) retest
13 EMA reclaim after breakdown
All breakout entries require a confirmed retest — no chasing, no fakeouts.
Exit warnings fire once on state change:
BUY CALL or BUY PUT when all conditions align
CUT CALL or CUT PUT when EMA breaks on candle close
0DTE mode: exits after 3 bars with no bounce — no waiting for candle close
Time stop when trade stalls
2pm cutoff for 0DTE entries
Built-in levels drawn automatically:
PMH/PML — Premarket High/Low
PDH/PDL — Previous Day High/Low
ORB — Opening Range levels
Today's High/Low
Auto Supply and Demand zones
Auto Support and Resistance pivots
Additional features:
VWAP (session anchored)
Saty Volume Stack logic — buyers vs sellers confirmation on every signal
Multi-timeframe trend check (5min + 15min) for confluence
Expiry suggestion — tells you whether current conditions favour 0DTE, Weekly, or LEAPS based on timeframe alignment and trend strength
Bollinger/Keltner squeeze filter — suppresses signals during low volatility chop
One toggle only: 0DTE mode (tighter stops, 3-bar bounce rule, 2pm cutoff) or Weekly mode (candle close stops, more room).
Best used on the 2-minute chart for entries with 5-minute and 15-minute context visible in the table. Indicator

TradeGuard FullHere's a description you can use:
TradeGuard — Full Trading System
A complete all-in-one trading indicator built for active intraday options traders. Replaces the need for multiple paid indicators by combining trend detection, key levels, entry signals, exit warnings, and expiry guidance in a single overlay.
What it does:
Automatically detects market trend state — Uptrend, Downtrend, or Choppy — using a triple EMA system (13/48/200) with Bollinger/Keltner squeeze filter. No manual inputs required. Just add it to your chart and it reads the market for you.
Entry signals fire automatically for:
13 EMA pullback entries (price touches EMA, closes back on trend side with volume)
Break and retest of Premarket High/Low (PMH/PML)
Break and retest of Previous Day High/Low (PDH/PDL)
Opening Range Breakout (ORB) retest
13 EMA reclaim after breakdown
All breakout entries require a confirmed retest — no chasing, no fakeouts.
Exit warnings fire once on state change:
BUY CALL or BUY PUT when all conditions align
CUT CALL or CUT PUT when EMA breaks on candle close
0DTE mode: exits after 3 bars with no bounce — no waiting for candle close
Time stop when trade stalls
2pm cutoff for 0DTE entries
Built-in levels drawn automatically:
PMH/PML — Premarket High/Low
PDH/PDL — Previous Day High/Low
ORB — Opening Range levels
Today's High/Low
Auto Supply and Demand zones
Auto Support and Resistance pivots
Additional features:
VWAP (session anchored)
Saty Volume Stack logic — buyers vs sellers confirmation on every signal
Multi-timeframe trend check (5min + 15min) for confluence
Expiry suggestion — tells you whether current conditions favour 0DTE, Weekly, or LEAPS based on timeframe alignment and trend strength
Bollinger/Keltner squeeze filter — suppresses signals during low volatility chop
One toggle only: 0DTE mode (tighter stops, 3-bar bounce rule, 2pm cutoff) or Weekly mode (candle close stops, more room).
Best used on the 2-minute chart for entries with 5-minute and 15-minute context visible in the table. Indicator

Jack and Jill
I. LIMITATIONS OF TRADITIONAL MOVING AVERAGES
Traditional moving averages (SMA, EMA, WMA) serve as foundational market tools, but they exhibit specific mathematical constraints when applied to highly volatile data:
Lag: By inherently averaging historical data, they naturally trail the current market state.
Aliasing (Cyclic Contamination): They often struggle to distinguish between underlying macro trends and temporary cyclical market waves, which can result in whipsaws and delayed signals.
To address these challenges and more accurately model continuous-time price movement, advanced Digital Signal Processing (DSP) can be deployed as an alternative framework.
II. THE DUAL-STATE SOLUTION
John Ehlers' "Jack and Jill" concept separates the market data into two distinct components. Instead of blending short-term fluctuations and long-term trends into a single average, they are isolated using specialized mathematical models:
► JACK: A fast, low-lag price tracker.
► JILL: A slower trend line, filtered to remove cyclical noise.
III. JACK: THE FAST PRICE TRACKER
The Mechanism: A 2nd-Order Infinite Impulse Response (IIR) SuperSmoother.
The Execution: Jack tracks short-term price movements. By applying a 2nd-order SuperSmoother, Jack efficiently filters out high-frequency noise and erratic intraday price spikes. It follows the price closely with minimal lag, providing a clearer view of the immediate trend direction.
IV. JILL: THE TREND DECYCLER$$
The Mechanism: A 2-Pole High-Pass Decycler coupled with smoothing.
The Execution: Instead of standard averaging, Jill uses a 2-Pole High-Pass filter to identify the market's dominant cycle and subtracts that cyclic data from the price to isolate the broader macroeconomic trend. A half-length SuperSmoother is then applied to stabilize the output, resulting in a smooth baseline that minimizes temporary cyclical fluctuations.
V. THE PHASE CONVERGENCE OSCILLATOR (PCO)
The Mechanism: Momentum Divergence.
The Execution: While Jack and Jill map the spatial topology on the primary chart, the Phase Convergence Oscillator (PCO) operates in a decoupled, isolated matrix. It measures the exact delta (Jack - Jill) and tracks its momentum.
Expanding Delta: The trend is structurally intact and accelerating.
Contracting Delta: Trend momentum is decelerating, which may serve as an early indication of exhaustion before Jack actually crosses Jill.
VI. TOPOLOGICAL GRADIENT RENDERING
The space between Jack and Jill represents the maturity of the trend. The visual matrix applies a 6-stage continuous opacity gradient—highly transparent at the edge of Jack (where price is volatile and untested) and reaching maximum density as it anchors onto Jill (the established structural core).
VII. CONCLUSION
The Jack and Jill indicator is designed as a continuous-time convergence engine rather than a conventional crossover tool. When the PCO accelerates and Jack crosses the structural decycler, a potential phase shift is identified.
This framework represents a rigorous application of signal processing techniques to financial trend analysis. Indicator

Indicator

Indicator

Strategy

Strategy

Markov Forecaster PRO🟦 Markov Forecaster PRO is a regime-classification and probability-forecasting engine built on a discrete-time Markov chain over three states — Bull, Bear, Sideways. Every bar is labelled from its rolling N-bar log return; the labels feed a 3×3 transition matrix that is power-iterated for the stationary distribution and exponentiated for forward-probability cones (P¹, P³, P⁵, P^horizon). Unlike the dozens of textbook Markov indicators on PulseWire, this one layers four original refinements on top of the standard chain construction — each addressing a well-known weakness of the memoryless Markov assumption.
The indicator integrates seven analytical layers — adaptive regime classification, semi-Markov duration tracking, sample-size disclosure, pending-regime early warning, forward-probability forecasting, look-ahead-free backtesting with fees and slippage, and multi-timeframe confluence — each rendered on a single overlay chart through a regime ribbon, three-layer neon glow signals, and four theme-aware dashboard panels.
Built with statistical honesty in mind. The backtest charges configurable commission and slippage on every entry and exit, the transition matrix flags rows with insufficient data, the duration-conditional probabilities are shown alongside the unconditional ones, and the documentation is explicit about what the model can and cannot predict.
🟦 HOW THE CORE ENGINE WORKS
**Regime Classification**
Each bar, the engine measures the rolling N-bar log return:
logRet = log(close / close )
The bar is labelled by comparing this return against the configured boundary:
- `logRet > +threshold` → BULL
- `logRet < −threshold` → BEAR
- otherwise → SIDEWAYS
The classification runs every bar with no look-ahead. The choice of threshold determines how reactive the regime label is, and this is where the first refinement enters.
**Adaptive Threshold (k · σ · √N)**
Traditional Markov regime indicators use a fixed percentage cut — e.g. "±5 % over 20 bars". This collapses on real markets: the same 5 % is trivial in a 2017 mania and never reached in 2023 chop. The fix is to scale the boundary with realised volatility:
threshold_adaptive = k × σ × √N
where σ is the per-bar log-return standard deviation over a configurable window (default 100 bars). Under a random walk, k = 1.0 cuts at the 16th / 84th percentiles; k = 2.0 at the 2.5th / 97.5th percentiles. The default k = 1.5 reproduces classic ±1.5-sigma thresholds.
Fixed-percentage mode is still available for users who want to lock the threshold deliberately.
**Regime Confidence**
Once classified, the move's strength is normalised relative to the active boundary:
confidence = |logRet| / threshold
| Confidence | Tier | Visual |
|---|---|---|
| < 1.0× | weak | ▱▱▱ |
| 1.0× – 2.0× | moderate | ▰▱▱ |
| 2.0× – 3.0× | strong | ▰▰▱ |
| ≥ 3.0× | stretched | ▰▰▰ |
The confidence value drives the ribbon transparency (in Adaptive Intensity mode), feeds the High Confidence alert (≥ 2.5× trigger), and is reported in the Status dashboard.
🟦 SEMI-MARKOV DURATION BUCKETS
**The Memoryless Problem**
A standard Markov chain says: "Given I'm in Bull, the probability of staying Bull tomorrow is X — regardless of whether Bull started yesterday or 200 bars ago." This is the memoryless property, and on real markets it's wrong. A 200-day-old Bull regime carries different mean-reversion risk than a 5-day-old one.
**The Refinement**
Markov Forecaster PRO additionally builds two CONDITIONAL transition matrices:
- `P_young` — transitions counted when the source regime's age was below its empirical average duration
- `P_mature` — transitions counted when the source regime's age was at or above the average
Both matrices are constructed in parallel with the main P, using the same per-bar bucketing logic and updated continuously. The self-transition probabilities for the current regime are then surfaced in the Status dashboard:
P young / mature 91% / 64%
The user reads this as: "When this regime was young (under its avg duration), it continued 91 % of the time. When mature, only 64 %." On a long-running regime this is the canonical signal that mean-reversion risk is rising — without the rest of the chain math being polluted.
A minimum of 10 samples per bucket is required before a value is shown; below that the cell reports "—" rather than display an unreliable probability.
🟦 FORWARD PROBABILITY CONE
**Matrix Exponentiation**
The 3×3 transition matrix P encodes one-bar-ahead probabilities. To project further out, the matrix is multiplied by itself:
P¹ = P — next bar
P³ = P × P × P — 3 bars out
P⁵ = P × P × P × P × P — 5 bars out
P^h = repeated h times — user-configured horizon
The Forecast Cone panel renders all four horizons for each of the three destination regimes, conditioned on the current regime. A trader reading the row "BULL" sees the probability the market will be in Bull at each horizon, given the current regime.
**Stationary Distribution**
Power-iterating the matrix to convergence yields the stationary distribution — the long-run probability of being in each regime, independent of starting state. With 50 iterations (default), any well-behaved 3×3 stochastic matrix is essentially converged.
stat + stat + stat = 1.0
This is rendered as the "long-run" row in the Forecast panel and the "Long-run share" cell in the Status panel.
**Honest Limitation**
The cone uses the UNCONDITIONAL matrix (averaged over all regime ages). For duration-conditional probabilities, the Status panel's P cell is the relevant readout. This split is explicit in both the cone footer label and the Forecast input tooltip.
🟦 SAMPLE-SIZE DISCLOSURE
A probability is only as reliable as the data behind it. Markov Forecaster PRO surfaces sample size in three places:
**Per-row sample count in the Transition Matrix**
A fifth column "n" in the matrix panel reports the number of transitions from each source regime. The cell is colored by reliability tier:
| Sample N | Tier | Color |
|---|---|---|
| ≥ 100 | high | foreground |
| 30 – 99 | moderate | dim |
| < 30 | low | divergent (warning) |
A row with fewer than 30 transitions is flagged because three-decimal probabilities derived from sparse data are noise, not signal.
**Total Sample N in the Status panel**
The Status dashboard's "Sample N" cell sums all transition counts and reports a global reliability tier:
| Total N | Tier |
|---|---|
| ≥ 200 | high (full color) |
| 50 – 199 | moderate (foreground) |
| < 50 | low (divergent warning) |
**Matrix footer**
The matrix panel's footer also shows the total N in compact notation (e.g. "N = 1.8k") for at-a-glance check.
The goal of this layer is honesty: a freshly-loaded chart with 30 bars of history should NOT display the same matrix as a 10-year chart, and the reliability tier makes the difference obvious without the user having to inspect counts manually.
🟦 PENDING-REGIME EARLY WARNING
**The Lookback Lag**
Because the regime is classified from log(close / close ), the official regime label inherently lags — by the time the threshold is crossed, the move is already N bars old. This is a structural feature of the model, not a bug, but it can be partially mitigated.
**Pending Logic**
Inside Sideways, when the log return reaches 70 % of either boundary, the dashboard fires an early-warning cue:
distance_fraction = max(|logRet| / threshold, ...)
isPending = (regime == SIDE) AND (distance_fraction ≥ 0.70)
The Status panel's "Pending" cell displays the direction the return is leaning toward and the current fraction:
⚠ ▲ BULL 87%
Color matches the leaning regime. The Pending Regime alert (default OFF, opt-in) fires on the first bar a pending state is entered.
This is not a regime change signal — it's a "watch this" cue, triggered roughly 30 % before the official threshold is crossed. Used alongside the official regime change, it gives the user advance notice without compromising the threshold's strictness.
🟦 LOOK-AHEAD-FREE BACKTEST
**The Look-Ahead Trap**
`regime` is derived from `log(close / close )`, which contains today's close. Allocating today's return to today's regime is look-ahead bias — the strategy would "know" today's regime before today's close, which is impossible in real-time trading. Most published Markov backtests have this bug.
**The Fix**
Markov Forecaster PRO allocates positions on the PRIOR bar's confirmed regime:
regForAlloc = regime // yesterday's confirmed regime
If yesterday's regime was Bull, we are long today. The strategy is realisable in real time because the previous bar's regime is known when the current bar opens.
This means the strategy is delayed by one bar relative to the regime label — and that's the correct, honest treatment. If a Bull→Bear flip happens on bar t, the strategy takes bar t's loss (still long from regime =Bull) and exits at bar t+1.
**Fees and Slippage**
Every Bull entry and exit pays the configured per-fill cost:
costFrac = feesPct/100 + slippageBps/10000
costPerFill = log(1 − costFrac) // negative log-space cost
The cumulative cost is debited from the Bull log-return total:
Bull gross = exp(bullLogR) − 1
Bull net = exp(bullLogR + bullCostLogR) − 1
A round-trip pays the fee + slippage twice. With defaults (0.10 % fee, 5 bps slippage), each round-trip costs roughly 0.30 % of equity in log space.
**Display**
The Backtest panel renders:
| Field | Value |
|---|---|
| Per-regime rows | GROSS cumulative log return (no fees) |
| Strategy row | NET cumulative (fees applied) vs Buy-and-Hold |
| Methodology footer | trade count · fee % · slippage bps |
The headline strategy result is the NET number — the realistic outcome a trader would have experienced. The gross numbers are kept for diagnostic comparison.
**What This Is Not**
This is a diagnostic backtest, not a tradable strategy. There is no position sizing, no risk management, no overnight financing, no shorting. It tells you whether "long when prior bar was Bull, flat otherwise" would have beaten buy-and-hold after fees — nothing more.
🟦 MULTI-TIMEFRAME CONFLUENCE
The same regime logic runs on a user-configured higher timeframe via `request.security` with `lookahead = barmerge.lookahead_off` and `gaps = barmerge.gaps_off` (anti-repaint mandatory). The result is reported in the Status dashboard's HTF block:
| State | Display | Color |
|---|---|---|
| HTF regime matches LTF regime | ✓ ALIGNED | bull |
| HTF regime differs from LTF | ⚠ DIVERGENT | bear |
| Insufficient HTF data | — | foreground |
Divergent regimes are common at trend turns — the LTF flips before the HTF catches up. Aligned regimes carry higher conviction. A separate alert ("MTF Confluence") fires on regime entries only when the HTF agrees.
Recommended pairings:
| Chart | HTF |
|---|---|
| 1H | D |
| 4H | W |
| D | W |
Use at least 3× your chart timeframe — anything closer and the two regimes track each other with no information gain.
🟦 VISUAL LAYER
**Regime Ribbon**
The chart background is tinted to the current regime color with three style options:
| Style | Behaviour |
|---|---|
| Subtle | Fixed 92 % transparency (price stays hero) |
| Bold | Fixed 75 % transparency (easy to scan from far) |
| Adaptive Intensity | Transparency scales with confidence (60 % – 95 %) |
In Adaptive Intensity mode, a strong directional move (confidence ≥ 3×) renders the ribbon at full intensity; a weak move stays faint. The ribbon doubles as a visual confidence meter.
**Three-Layer Neon Glow Signals**
On every confirmed regime change (after the Min Hold filter), the indicator drops a three-layer halo on the chart:
| Layer | Size | Transparency | Purpose |
|---|---|---|---|
| Outer | size.large | 80 % | Soft halo |
| Middle | size.normal | 50 % | Mid-glow |
| Core | size.small | 0 % | Bright center |
Bull markers (▲) render below the bar; Bear (▼) and Sideways (◆) render above. The Min Hold input (default 4 bars) requires a new regime to persist before its flip is drawn — kills label spam in choppy zones without affecting the underlying transition counts.
**Confidence Tags (optional)**
An off-by-default toggle adds the confidence multiplier to each signal arrow ("BULL 2.3×"), useful for screen captures and analysis.
🟦 DASHBOARDS
Four theme-aware panels, each independently togglable and positionable:
**Status Panel** (default: Bottom Left)
Compact live readout — current regime, age, confidence, pending direction, average duration, young/mature bucket, P young vs mature, expected remaining bars, long-run share, sample size, and HTF alignment. 16 rows base, 19 with HTF block enabled.
**Transition Matrix Panel** (default: Top Right)
3×3 next-bar P matrix with diagonal-highlighted self-transition cells. The fifth column reports per-row sample size with reliability tier coloring. Matrix footer shows total N.
**Forecast Cone Panel** (default: Middle Right)
Forward probability for each destination regime at horizons +1, +3, +5, and +configured. Steady-state row shows the long-run distribution. Current regime is reported at the bottom for context.
**Backtest Panel** (default: Bottom Right)
Per-regime gross cumulative return, average per-bar, and the bar count. Strategy row shows NET return vs buy-and-hold. Methodology footer lists trade count, fee, and slippage.
All four panels share the same theme palette and adapt to Dark / Light display mode. Text size is independently configurable (Tiny / Small / Normal / Large).
🟦 COLOR THEMES
Ten cohesive palettes tuned to the Apex design system, each defining three regime axes (Bull, Bear, Sideways):
| Theme | Character | Bull | Bear | Sideways |
|---|---|---|---|---|
| Prism | Classic | Forest green | Crimson | Slate grey |
| Focus | Default | Cyan steel | Deep orange | Cool blue-grey |
| Solar | Warm | Amber | Indigo red | Lavender grey |
| Frost | Cool | Sky blue | Soft lavender | Pale steel |
| Laser | Neon | Lime green | Hot crimson | Charcoal grey |
| Aurora | Bright | Gold | Scarlet | Warm beige |
| Plasma | Electric | Aqua | Magenta | Slate teal |
| Bloom | Soft | Mint | Hot pink | Blue-grey |
| Eclipse | Deep | Navy | Dark crimson | Steel grey |
| Carbon | Minimal | Near-white | Mid-grey | Dark grey |
One theme selection drives every visual component: ribbon, glow signals, all four dashboard headers, regime-colored cells, diagonal matrix highlights, and HTF alignment color.
**Dark / Light Display Mode**
Dashboard chrome (background, foreground, borders, section dividers) flips between dark-on-bright and bright-on-dark. The regime axis colors remain consistent across modes — only the panel chrome changes.
🟦 ALERT SYSTEM
Six alert conditions, each independently togglable:
| Alert | Condition |
|---|---|
| Bull Regime Entry | Regime flipped to BULL (after Min Hold confirmation) |
| Bear Regime Entry | Regime flipped to BEAR |
| Sideways Regime Entry | Regime flipped to SIDEWAYS (default OFF) |
| High Confidence | confidence ≥ 2.5× threshold, first bar of crossing |
| MTF Confluence | Regime change + HTF agrees |
| Pending Regime | Inside Sideways, log return ≥ 70 % of either boundary (default OFF) |
All alerts fire on confirmed bar close and use the standard `alertcondition` mechanism. The Min Hold filter applies to entry alerts — a new regime must persist Min Hold bars before its entry alert fires, matching the on-chart glow markers.
The Sideways and Pending alerts are default-off because they can fire more frequently than the other types — opt-in by design.
🟦 SETTINGS REFERENCE
**Theme**
- Theme — One of 10 Apex palettes. Default: Focus
- Display Mode — Dark / Light. Default: Dark
**Regime Logic**
- Threshold Mode — Adaptive (k·σ·√N) / Fixed (%). Default: Adaptive
- Lookback Window — Bars for the rolling log return. Default: 20
- Adaptive k — Sigma multiplier. Default: 1.5
- Fixed Bull Threshold — Used only in Fixed mode. Default: 5.0 %
- Fixed Bear Threshold — Used only in Fixed mode. Default: 5.0 %
- Volatility Window — Bars for the per-bar stdev. Default: 100
- Min Hold — Bars a new regime must persist for label drawing. Default: 4
**Forecast**
- Forecast Horizon — Bars projected by the right-most cone column. Default: 10
- Stationary Power — Power-iteration count. Default: 50
**Regime Ribbon**
- Show Regime Ribbon — Toggle. Default: ON
- Ribbon Style — Subtle / Bold / Adaptive Intensity. Default: Adaptive Intensity
**Signal Labels**
- Show Regime Change Signals — Toggle. Default: ON
- Glow Effect — Three-layer halo toggle. Default: ON
- Show Confidence on Signal — Adds multiplier tag (e.g. "BULL 2.3×"). Default: OFF
**Multi-Timeframe**
- Enable HTF Confluence — Toggle. Default: ON
- HTF Resolution — Higher timeframe. Default: D
**Backtest**
- Trading Fee (% per fill) — Per-side commission. Default: 0.10 %
- Slippage (bps per fill) — Per-side slippage in basis points. Default: 5
**Dashboards**
- Show Status / Matrix / Forecast / Backtest — Independent toggles. Default: all ON
- Dashboard Size — Tiny / Small / Normal / Large. Default: Small
**Panel Positions**
- Status Panel — 9-position grid. Default: Bottom Left
- Matrix Panel — Default: Top Right
- Forecast Panel — Default: Middle Right
- Backtest Panel — Default: Bottom Right
**Alerts**
- Bull / Bear / Sideways Regime Entry — Independent toggles
- High Confidence — Default: ON
- MTF Confluence — Default: ON
- Pending Regime — Default: OFF
🟦 COMPATIBILITY
Works on all asset classes and all timeframes in PulseWire Pine Script v6.
- Crypto: Spot, futures, perpetual contracts
- Forex: All pairs
- Equities: Stocks, ETFs, indices
- Commodities: Metals, energy, agriculture
- Timeframes: 1m through Monthly
The adaptive threshold normalises by per-bar realised volatility, making the regime classification volatility-agnostic across assets without manual recalibration. The same default settings work on BTCUSDT daily, SPY weekly, and EURUSD 4H — only the HTF resolution input should be adjusted to match the chart timeframe.
🟦 TECHNICAL NOTES
- Pine Script v6
- `max_labels_count = 500`, `max_lines_count = 100`, `max_bars_back = 5000`
- No repainting — all regime classifications are computed on confirmed bar close. The HTF request uses `lookahead = barmerge.lookahead_off` and `gaps = barmerge.gaps_off`
- Regime change debouncing uses `ta.barssince` to avoid runtime-indexed history reads (which can trip "cannot determine max_bars_back" in Pine v6)
- Heavy computation (matrix exponentiation, stationary distribution, dashboard rendering) is gated on `barstate.islast` to run once per chart render
- Transition counting uses `barstate.isconfirmed` to avoid double-counting the live bar
- Backtest accumulators charge fees at trade boundaries — entries and exits detected by `regForAlloc != regForAlloc `
- Duration buckets use the SOURCE regime's age at the time of transition for classification; the threshold is the empirical average duration of that regime, computed continuously
- Matrix multiplication is implemented as an unrolled 3×3 flat-array routine for portability and speed
- Empty-row fallback to uniform 1/3 in the transition matrix prevents NaN propagation when a regime has not appeared in visible history
🟦 LIMITATIONS — READ THIS
This indicator is statistically honest about what it can and cannot do. Three known limitations:
1. **The Markov assumption is partially violated.** Markets are not memoryless. The duration buckets (Section: Semi-Markov Duration Buckets) mitigate this but do not eliminate it.
2. **Forward probabilities are not predictions.** They are conditional probabilities under the chain assumption. A "Bull 58 % at +10 bars" reading does not mean "58 % chance the next 10 bars are bullish" — it means "given a long-run sample of similar starting states, 58 % were in Bull at +10 bars". Use the cone as ONE input alongside other analysis.
3. **The regime label lags by N bars.** This is structural — the rolling log return necessarily looks back. The Pending early warning partially mitigates this but cannot eliminate the lag. Treat the official regime change as a confirmation, not a leading signal.
🟦 DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. The hypothetical backtest is a diagnostic tool — there is no position sizing, no risk management, and no consideration of overnight financing, dividends, or other real-world frictions beyond the configured fee and slippage. Always conduct your own analysis and apply proper risk management. Indicator

Indicator

Indicator

Indicator

Indicator

Institutional Volatility Structure EngineWhat is This Indicator?
This is a professional-grade volatility term structure analyzer designed to show how institutional traders view market fear across different time horizons.
Instead of just looking at the regular VIX, this indicator tracks:
• VIX1D (1-day implied vol)
• VIX9D (9-day)
• VIX (30-day)
• VIX3M (3-month)
• VIX6M (6-month)
• VVIX (Volatility of Volatility)
It analyzes the shape of the volatility curve and classifies the market into clear regimes, helping you understand whether the market is calm, stressed, coiled, or about to explode.
🎨 Main Visual Elements
1. Colored Lines (Term Structure)
Red: VIX1D (shortest term fear)
Orange: VIX9D
White: VIX (standard)
Aqua: VIX3M
Blue: VIX6M
Fuchsia: VVIX (how volatile volatility itself is)
2. Value Labels (New Feature)
Real-time price labels on the right side of each line so you can instantly see current values without checking the scale.
3. Background Heatmap
Red = Full Backwardation (Extreme fear/stress)
Orange = Front-End Inversion (Short-term trouble brewing)
Green = Compression Regime (Market is calm but coiled → high probability of volatility expansion)
Teal/Blue = Healthy Contango (Normal bull market behavior)
Purple = Volatility Expansion
Gray/Yellow = Transition
4. Curve Oscillator (Area Plot)
Red = Medium-term fear building
Green = Fear easing
5. Compression Score (Yellow Line)
Low = Terms are very close together (coiled spring)
High = Volatility is spreading out
📊 Dashboard Table (Top Right)
Gives you an instant professional summary:
Current values of all VIX terms
Z-Scores (how extreme current levels are)
Front Ratio (VIX1D ÷ VIX)
Breadth (how many terms are rising together)
Regime status
Percentile rankings
🔍 How to Use It Profitably (Practical Guide)
1. Regime Trading (Highest Edge)
Green Background (Compression) → Best environment for buying volatility (long VIX futures, UVXY, VXX, or long options). The market is quiet but tension is building.
Red/Orange Background → High caution or short volatility setups after the event passes (volatility crush).
Purple (Expansion) → Volatility is already expanding — trend days or big moves likely.
2. Key Signals to Watch
Front Shock (VIX1D >> VIX): Sudden short-term panic.
VVIX Explosion: Volatility of volatility spiking → dangerous for short vol strategies.
Vol Crush: All front terms falling fast → good for premium selling.
Trend Day Warning: Front inversion + rising curve oscillator → expect strong directional move.
3. Best Timeframes
Daily: Best for understanding overall regime
4H / 1H: Excellent for tactical entries and exits
Weekly: Great for long-term portfolio hedging decisions
⚙️ Key Inputs Explained
Show Value Labels on Lines: Toggle the numbers that appear next to each line.
Compression Threshold: Lower = more sensitive to "coiled" markets.
Z-Score Lookback: How many bars used for statistical extremes (50 is good default).
Alert toggles: Enable only the alerts you care about.
💡 Pro Tips for New Users
Start Simple: First just watch the background color and the regime label.
Combine with Price Action: Green background + bullish candlestick pattern = strong setup.
Use Alerts: Set alerts for regime changes and front shocks so you don’t have to stare at the chart.
Context Matters: This indicator is extremely powerful around earnings seasons, FOMC meetings, and major news events.
Low VIX Environment (<15): Even small inversions become very meaningful.
🎯 Ideal Use Cases
• Options Traders: Know when to sell premium vs buy volatility
• Day Traders: Spot potential trend days early
• Swing Traders: Identify high-probability volatility expansion setups
• Portfolio Managers: Decide when to add tail-risk hedges
Bottom Line:
This indicator turns complex institutional volatility data into clear, actionable regimes. The background color is your main "mood of the market" indicator. Indicator

Volatility Flow & Cycle DivergencesVolatility Flow & Cycle Divergences
General Description
Volatility Flow & Cycle Divergences is an intermarket quantitative analysis tool designed to map liquidity flows, risk regimes, and structural anomalies between the US stock market (S&P 500 / ES) and the options market, represented by the CBOE Volatility Index (VIX).
The indicator is built on the premise that the physiological relationship between the S&P 500 and the VIX is historically inverse (moving in opposite directions roughly 80% of the time). This script does not merely calculate the raw ratio between the two assets; it mathematically isolates the rare moments of monetary asynchrony where this correlation breaks down. These anomalies are frequently the precursors to lasting cyclical reversals or the exhaustion of the primary trend.
Core Features and Filtering Logic
To overcome the issue of false signals typical of traditional oscillators on intermediate timeframes, the script integrates three concurrent proprietary filters:
Intermarket Relative Strength Ratio (VIX/SPX): It calculates the relative speed between the demand for protective insurance (Put options) and the spot price of the equity basket.
Asymmetric Cyclical Pivot Filter: The algorithm for detecting relative highs and lows uses an asymmetric lookback/lookahead range (calibrated by default to 8 periods on the left and 5 on the right). This isolates true macro turning points and eliminates microscopic, temporary intraday spikes.
Momentum Validation (Anti-Inertia Filter): Divergences are not generated purely on a mathematical basis. A divergence on market highs is validated only if the S&P 500 is in a true zone of strength/overbought territory (RSI > 55), while a divergence on market lows requires actual panic selling pressure (RSI < 45). If the market is in a neutral congestion phase, the signal is discarded at the source.
Algorithmic Transparency (Under the Hood)
The indicator executes its analysis by processing three integrated algorithmic engines within the code:
Geometric Pivot Algorithm (ta.pivothigh/low): Constantly scans the historical series of the VIX/SPX Ratio to isolate cyclical peaks and troughs, validating them only if they are surrounded by a precise asymmetry of bar-index (8 to the left, 5 to the right).
Momentum Algorithm (Wilder's RSI): Monitors the first derivative of the S&P 500 price. It does not calculate the classic relative strength on the Ratio itself, but uses the RSI algorithm on the underlying equity index to act as a logical switch (Gatekeeper) for the signals.
Pattern Matching Algorithm (Conditional Logic): A conditional control structure that crosses the spatial-temporal coordinates of price pivots with those of volatility, filtering out false signals based on overbought/oversold regimes.
H ow to Read the Signals on the Chart
The script provides a clean graphical visualization using compact "badges" on the lower panel so it does not obscure the price action:
DD (Distribution Divergence - Red): The S&P 500 prints a new relative high, but the VIX/SPX Ratio shows a higher low or an anomalous support. This means that despite the price rally, institutional investors are accumulating protective hedges due to an ongoing distribution. Potential pullback ahead.
DA (Accumulation Divergence - Green): The S&P 500 updates its period lows amid panic, but the Ratio registers a lower peak compared to the previous one. Implied volatility pressure is exhausting: "smart money" is stopping the hedging process and beginning to accumulate spot positions. Potential cyclical low/bounce in formation.
User Interface (UI) Elements
Integrated Information Dashboard: Positioned at the bottom left with a transparent background to preserve chart real estate. It shows the real-time macro state of the market (RISK-ON or RISK-OFF) based on the position of the Ratio relative to its 20-period moving average, serving as an operational reminder for the divergence rules.
View Toggle: Through the indicator settings panel, you can hide or show the dashboard with a single click.
Operational Advice and Timeframes
This indicator expresses its maximum performance when integrated into a cyclical and multi-day flow analysis logic:
Best Timeframe: 2 Hours (2H) to capture operational swings and cycles lasting 2-3 days.
Macro / Swing Analysis: Daily (1D) to map structural medium-to-long term risk regimes.
Technical Note: We advise against using this on fast timeframes (below the 2-hour chart) due to the algorithmic noise generated by short-term option expirations (0DTE) and the lack of reliable spot VIX calculation during overnight sessions (Globex).
I mportant Disclaimer & Operational Risk Warning
Critical Note: Never use a single indicator to make standalone trading decisions. Always contextualize what the indicator suggests within a broader market framework and combine it with other validation techniques (e.g., Price Action, Market Structure, Volume Profile, or Order Flow). No indicator is infallible, and intermarket divergences represent shifts in probability, not guaranteed certainties.
Italiano
Descrizione Generale
Volatility Flow & Cycle Divergences è uno strumento di analisi intermarket quantitativa progettato per mappare i flussi di liquidità, i regimi di rischio e le anomalie strutturali tra il mercato azionario statunitense (S&P 500 / ES) e il mercato delle opzioni, rappresentato dal CBOE Volatility Index (VIX).
L'indicatore si basa sul presupposto che la relazione fisiologica tra l'S&P 500 e il VIX sia storicamente inversa (circa l'80% delle volte si muovono in direzioni opposte). Questo script non si limita a calcolare il rapporto puro tra i due asset, ma isola matematicamente i rari momenti di asincronia monetaria, in cui questa correlazione si spezza. Tali anomalie sono spesso il precursore di inversioni cicliche durature o di esaurimenti del trend principale.
Caratteristiche Principali e Logica di Filtraggio
Per superare il problema dei falsi segnali tipici degli oscillatori tradizionali sui timeframe intermedi, lo script integra tre filtri proprietari concorrenti:
Rapporto di Forza Relativa Intermarket ($VIX/SPX$):
Calcola la velocità relativa tra la domanda di coperture assicurative (opzioni Put) e il prezzo spot del paniere azionario.
Filtro Ciclico Asimmetrico sui Pivot:
L'algoritmo di rilevamento dei massimi e minimi relativi utilizza un raggio d'azione asimmetrico (calibrato di default a 8 periodi a sinistra e 5 a destra). Questo isola i reali punti di svolta macro ed elimina i microscopici spike estemporanei intra-day.
Validazione del Momentum (Filtro Anti-Inerzia):
Le divergenze non vengono generate su base puramente matematica. Una divergenza sui massimi viene convalidata solo se l'S&P 500 si trova in una reale zona di ipercomprato/forza relativa (RSI > 55), mentre una sui minimi esige una reale pressione di panico (RSI < 45). Se il mercato si trova in una fase di congestione neutra, il segnale viene scartato all'origine.
Come Leggere i Segnali sul Grafico
Lo script restituisce una visualizzazione grafica pulita mediante "badge" compatti sul pannello inferiore per non occultare l'azione del prezzo:
DD (Divergenza di Distribuzione - Rossa): L'S&P 500 stampa un nuovo massimo relativo, ma il Ratio VIX/SPX mostra un minimo crescente o un supporto anomalo. Significa che, nonostante il rialzo del prezzo, gli investitori istituzionali stanno accumulando coperture protettive a causa di una distribuzione in corso. Potenziale storno in arrivo.
DA (Divergenza di Accumulazione - Verde): L'S&P 500 aggiorna i minimi di periodo nel panico, ma il Ratio fa registrare un picco inferiore rispetto al precedente. La pressione della volatilità implicita si sta esaurendo: le "mani forti" smettono di proteggersi e iniziano ad accumulare posizioni spot. Potenziale minimo ciclico/rimbalzo in formazione.
Elementi di Interfaccia Utente (UI)
Dashboard Informativa Integrata:
Posizionata in basso a sinistra con uno sfondo trasparente per preservare il chart real estate. Mostra in tempo reale lo stato macro del mercato (RISK-ON o RISK-OFF) in base alla posizione del Ratio rispetto alla sua media mobile a 20 periodi, fungendo da memorandum operativo per le regole di divergenza.
Interruttore di Vista: Tramite il pannello delle impostazioni è possibile nascondere o mostrare la dashboard con un solo clic.
Consigli Operativi e Timeframe
Questo indicatore esprime il massimo delle sue performance se integrato in una logica di analisi ciclica e di flusso plurigiornaliera:
Timeframe d'elezione: 2 Ore (2H) per catturare oscillazioni e cicli operativi di 2-3 giorni.
Analisi Macro / Swing: Giornaliero (1D) per mappare i regimi di rischio strutturali di medio-lungo termine.
Nota tecnica: Si sconsiglia l'utilizzo sui timeframe rapidi a causa del rumore algoritmico generato dalle scadenze opzioni a brevissimo termine (0DTE) e della mancanza di calcolo del VIX spot durante le sessioni notturne.
Avvertenza Importante e Rischio Operativo
Nota Critica : Non utilizzare mai un singolo indicatore per prendere decisioni operative autonome. Contestualizza sempre ciò che l'indicatore suggerisce all'interno di un quadro di mercato più ampio e combinalo con altre tecniche di validazione (ad es. Price Action, Struttura di Mercato, Volume Profile o Order Flow). Nessun indicatore è infallibile e le divergenze intermarket rappresentano variazioni nelle probabilità, non certezze garantite. Indicator

Indicator
