Market State Router [Permutation + Eigenstructure]MSR-PX is an experimental quantitative market-regime and systemic-pressure framework designed to classify the environment surrounding price rather than operate as a conventional buy/sell oscillator.
Instead of asking only whether price is rising or falling, MSR-PX evaluates several dimensions of market behavior:
Is local price action ordered or disordered ?
Is movement directionally efficient or rotational ?
Are major cross-asset markets becoming systemically coordinated ?
Is the charted asset participating in the dominant market factor?
Are local and systemic forces aligned or in conflict?
Which market-state interpretation is most consistent with the current environment?
The result is a rule-based Market State Router that classifies conditions as Trend, Breakout, Mean Reversion, Event/Systemic Risk, No Trade, or Loading Data .
🧠 CORE ENGINE 1 — LOCAL PERMUTATION STRUCTURE
MSR-PX measures local price-order dynamics using normalized permutation entropy .
Default configuration:
Embedding dimension: 4
Ordinal patterns: 24
Permutation lookback: 250 bars
Permutation entropy examines the ordering of consecutive price observations rather than simply measuring return magnitude.
Lower entropy indicates that a smaller subset of ordinal patterns is dominating recent behavior, suggesting greater local structure.
Higher entropy indicates that ordinal patterns are being expressed more uniformly, suggesting increasing disorder.
MSR-PX ranks this structural measurement against its recent historical baseline so the router can evaluate structure relative to the market's own recent behavior.
⚡ CORE ENGINE 2 — DIRECTIONAL EFFICIENCY
Directional efficiency compares:
Absolute net displacement
against
Total bar-to-bar travel
over the selected lookback.
This helps separate two environments that may have similar volatility but very different internal behavior:
Price traveling efficiently in one direction
Price covering substantial distance while repeatedly reversing and rotating
Higher efficiency supports directional Trend and Breakout states.
Lower efficiency supports rotational and Mean Reversion interpretations.
🌐 CORE ENGINE 3 — CROSS-ASSET EIGENSTRUCTURE
MSR-PX builds a rolling 5 × 5 cross-asset correlation system from synchronized observations of:
The charted asset
SPY — U.S. equity risk
TLT — long-duration Treasury exposure
DXY — U.S. dollar
VIX — implied equity volatility
The benchmark symbols are configurable.
The cross-asset network updates only from synchronized observations, helping avoid partially populated correlation samples when benchmark data is unavailable.
MSR-PX then analyzes the matrix's eigenvalue spectrum to estimate how concentrated market behavior has become around a common factor.
Diagnostics include:
Dominant eigenvalue share
Spectral entropy
Common-factor concentration
Target loading on the dominant eigenvector
When the dominant eigenvalue becomes increasingly concentrated while spectral entropy contracts, the network is behaving more like a coordinated system and less like a collection of independent markets.
🌀 CORE ENGINE 4 — SYSTEMIC ABSORPTION
Systemic Absorption is an MSR-PX composite measure of cross-asset common-factor concentration.
It incorporates:
Dominant eigenvalue concentration
Inverse spectral entropy
Historical percentile normalization
The resulting measurement is designed to distinguish between:
Decoupled environments , where local price behavior dominates
Systemically coupled environments , where a shared cross-asset factor is exerting greater control
The term Absorption here does not refer to traditional order-flow or liquidity absorption.
It specifically represents MSR-PX's estimate of systemic cross-asset concentration relative to its own historical baseline .
🎯 CORE ENGINE 5 — TARGET-ATTRIBUTED FACTOR DIRECTION
A strong systemic factor does not imply that every asset is responding to that factor in the same direction.
MSR-PX therefore adjusts the dominant factor impulse using the charted asset's loading magnitude and loading sign on the dominant eigenvector.
Conceptually:
Factor Impulse × Target Loading Strength × Target Loading Direction
This allows the router to distinguish between:
A systemic factor becoming active
The charted asset participating in that factor
The charted asset responding inversely to that factor
Local price action conflicting with the target-attributed systemic direction
This target attribution is used when evaluating directional alignment and systemic conflict.
🚦 THE MARKET STATE ROUTER
The individual engines feed a priority-based classification system.
The router does not simply select whichever condition produces the largest number. Certain environments intentionally take precedence over normal directional states.
1. EVENT / SYSTEMIC RISK
The highest-priority state.
Event/Systemic Risk requires elevated systemic concentration together with either:
A sufficiently strong systemic factor impulse
Meaningful conflict between local price direction and the target-attributed dominant factor
This state is intended to identify environments where broader cross-asset forces may be dominating normal local relationships.
When active, the router readout emphasizes reduced aggression rather than attempting to predict a specific directional trade.
2. BREAKOUT LONG / BREAKOUT SHORT
Breakout requires a stronger combination of:
Ordered local structure
Sufficient directional efficiency
Systemic participation
Strong directional impulse
Agreement between local and target-attributed factor direction
Breakout represents the router's strongest coordinated directional state.
3. TREND LONG / TREND SHORT
Trend states identify directional environments characterized by:
Ordered structure
Sufficient directional efficiency
Active local directional impulse
Directional consistency with systemic forces when systemic concentration is elevated
Trend does not require the same degree of systemic impulse as Breakout.
4. MEAN REVERSION
Mean Reversion is favored when the environment shows a combination of:
Disordered local structure
Weak or decoupled systemic absorption
Low directional efficiency
This describes an environment where rotational interpretation may be more appropriate than directional continuation.
5. NO TRADE / LOADING DATA
No Trade means the router does not find sufficient evidence for one of the primary states.
Loading Data appears while the historical buffers required for permutation structure, synchronized correlation, eigenstructure, and percentile calculations are still populating.
These are intentional router outputs rather than errors.
📊 HOW TO READ MSR-PX
TREND LONG / SHORT
Local structure and directional efficiency support continuation in the routed direction.
BREAKOUT LONG / SHORT
Local direction and systemic participation are strongly coordinated.
This is the router's strongest directional participation regime.
MEAN REVERSION
Directional efficiency is weak, structure is disordered, and systemic coupling is limited.
The environment is behaving more rotationally than directionally.
EVENT / SYSTEMIC RISK
Cross-asset concentration is elevated and systemic impulse or local/systemic conflict has become unusually strong.
Normal local relationships may be less reliable during this state.
NO TRADE
Conditions are mixed, ambiguous, or insufficient for a stronger classification.
📈 STATE SCORE
MSR-PX includes an internal State Score summarizing the strength of evidence supporting the active regime.
This score is not a calibrated probability .
For example:
An 86% State Score does not mean there is an 86% probability that a trade will succeed.
It should be interpreted only as an internal regime-strength measurement derived from the router's component conditions.
🧪 FORWARD VALIDATION LOGGER
MSR-PX includes a built-in forward transition logger for research purposes.
The logger tracks whether detected systemic fragility conditions subsequently transition into an Event / Systemic Risk state within a configurable forward horizon.
It records information including:
Total fragility transitions
Warnings that reached Event/Systemic Risk
Warnings that expired without transition
Transition rate
Average transition time
Age of the currently pending observation
This logger is a forward transition diagnostic .
It is not presented as a complete trading backtest, statistical significance test, or proof of predictive profitability.
⏱️ TIMEFRAME GUIDANCE
MSR-PX is designed primarily for intraday market-state analysis .
5 minutes is the recommended starting timeframe for the default configuration because it provides a practical balance between responsiveness and cross-asset regime stability.
1 minute: Faster regime transitions and earlier sensitivity to changing conditions, with greater exposure to short-term noise.
5 minutes: Recommended default for active intraday regime analysis.
15 minutes: Slower and smoother regime context for traders who prefer less frequent state changes.
No timeframe should be interpreted as universally or statistically optimal.
Regime behavior should be evaluated independently for the market, session, and trading horizon being studied.
🌍 SESSION AND BENCHMARK CONSIDERATIONS
The default network uses U.S.-centric equity, rates, dollar, and volatility benchmarks.
When MSR-PX is applied to:
Futures
Cryptocurrency
Overnight sessions
International markets
Assets trading outside U.S. cash-equity hours
users should consider both the trading schedules and economic relevance of the selected benchmark symbols.
Because the eigenstructure engine depends on synchronized observations, benchmark selection and session availability matter.
🔬 WHAT MSR-PX IS — AND IS NOT
MSR-PX is a market-state research and contextual framework .
It is not:
A standalone buy/sell system
A guaranteed market predictor
A calibrated probability model
A replacement for risk management
A claim of statistically optimal thresholds
The state thresholds are currently rule-based rather than statistically learned .
The purpose of the project is to explore whether combining local ordinal structure, directional efficiency, cross-asset eigenstructure, systemic concentration, and target-specific factor attribution can provide useful context about the current market environment.
🔓 OPEN-SOURCE PHILOSOPHY
MSR-PX is published open source so the methodology can be inspected, challenged, modified, and independently tested.
The research question is whether combining:
Permutation Structure
Directional Efficiency
Cross-Asset Eigenstructure
Systemic Concentration
Target-Specific Factor Attribution
provides useful market-state information beyond what any one component provides independently.
Users are encouraged to inspect the implementation, test different markets and timeframes, experiment with alternative benchmark networks, and evaluate the router's behavior independently.
⚠️ LIMITATIONS
Important limitations include:
State thresholds are rule-based and are not claimed to be universally optimal.
Correlation and eigenstructure measurements are backward-looking.
Cross-asset relationships can change through time.
Different trading sessions can produce uneven benchmark availability.
Shorter timeframes can produce noisier regime transitions.
State Score is an internal strength score, not a statistical probability.
Historical behavior does not guarantee future behavior.
Regime classification does not itself constitute a trading signal.
DISCLAIMER
This indicator is provided for educational, analytical, and research purposes only .
Nothing presented by MSR-PX constitutes financial, investment, or trading advice.
Users are responsible for independently evaluating the methodology and determining whether information produced by the indicator is appropriate for their own research or decision-making.
Gösterge

Linearity V1.0Linearity Research — Trend Quality & Move Detection
This indicator finds clean, low-chop upward price moves ("linear" moves) and scores how good each one is, then rolls those scores up into a single Linearity Score so you can quickly judge whether a stock tends to trend smoothly or in choppy, unreliable swings.
How a move is detected
- A move begins when price closes above its EMA (default length 21).
- It ends only after price closes back below the EMA and then makes a new low below the low of that breakdown bar — a two-step exit that avoids ending a move on a single EMA wick.
Qualifying a move
- Persistence = the % of bars in the move that closed above the EMA. This measures how smooth vs. choppy the move was.
Qualifying a move
- Persistence = the % of bars in the move that closed above the EMA. This measures how smooth vs. choppy the move was.
- Smooth moves (persistence ≥ the High Persistence Threshold) only need to clear a lower minimum peak-gain bar to qualify. Choppier moves must clear a higher bar. This keeps ragged-but-large rallies from scoring as well as genuinely straight-line moves.
Per-move score (0–100)
- Peak % gain — 40%
- Efficiency Ratio (net move ÷ total price path traveled; 1.0 = a straight line, lower = more back-and-forth) — 30%
- Persistence — 20%
- Max intra-move drawdown (light penalty) — 5%
- Pullback count (light penalty) — 5%
Linearity Score
Over a configurable lookback window (in years), the script averages the score, peak %, and Efficiency Ratio of every qualifying move, then adds a small bonus for having more qualifying moves (capped), producing one 0–100 Linearity Score. This, along with move count, average peak %, and average ER, is shown in an on-chart panel.
Visuals
- Green boxes mark each qualifying move, labeled with its peak % gain and score.
- Optional EMA plot.
- A configurable bottom panel shows either the Linearity summary or a detailed table of every qualifying move (dates, peak %, ER, persistence, drawdown, pullbacks, duration, score) — position, text size, and colors are all adjustable.
How to use it
Use the Linearity Score to screen for stocks whose historical rallies tend to be smooth and orderly rather than violent and choppy — useful for trend-following or momentum approaches that don't want to fight excessive volatility. Switch the bottom panel to the Detailed Table to audit exactly which historical moves are driving the score.
Note: this script only evaluates upward (bullish) moves triggered by EMA crossovers — it does not detect or score downtrends.
Gösterge

Price Gravity Research Engine [Effort and Displacement]Price Gravity Research Engine (PG-RE) is a market-state research indicator designed to measure how much normalized market effort is being consumed relative to the amount and efficiency of price movement that effort produces.
The core idea is simple:
Price becomes mechanically “heavy” when substantial effort produces little or inefficient displacement, and “light” when price travels efficiently with comparatively little resistance.
Rather than generating traditional buy/sell signals, PG-RE is built to describe the current movement environment .
Who it is for: PG-RE is especially suited to discretionary intraday, price-action, and market-structure traders who want a regime/context layer for distinguishing clean repricing from inefficient, effort-heavy travel.
What the engine measures
PG-RE evaluates three primary components:
1) Effort
Market activity is normalized relative to its expected baseline.
When usable volume is available, volume is used as the primary effort source.
A range-based activity proxy can be used as an alternative.
On intraday charts, PG-RE can normalize effort by time of day , helping prevent the open or close from being classified as abnormal simply because raw activity is naturally higher during those periods.
2) Displacement
Net price movement over the Gravity Window is measured using log returns and normalized against recent volatility.
This asks:
Has price actually traveled a meaningful distance relative to what volatility would normally imply?
3) Path Efficiency
PG-RE compares net displacement with the total path traveled over the same window.
A direct move has high path efficiency .
A back-and-forth move with little net progress has low path efficiency .
The Gravity model
PG-RE combines normalized effort, volatility-adjusted displacement, and path efficiency into one mechanical measure called Price Gravity .
In practical terms:
more effort with less progress tends to increase gravity
inefficient, rotational travel tends to increase gravity
strong, efficient displacement tends to reduce gravity
efficient movement achieved with relatively little effort represents lighter travel
Gravity is then interpreted relative to its own recent distribution , making PG-RE a regime tool , not a fixed-value oscillator.
It is designed to answer:
“How difficult is it for price to move right now, and is that difficulty changing?”
not:
“Should I buy or sell this bar?”
What is different about PG-RE
Rather than evaluating activity, volatility, or directional movement independently, PG-RE treats their relationship as the object of measurement.
Its primary output is therefore not momentum or volume itself, but the changing amount of normalized effort associated with efficient versus inefficient price travel.
Mechanical states
PG-RE classifies the current environment into several descriptive states:
PRESSURE
Elevated effort is producing unusually weak displacement while travel remains inefficient and gravity is building. Elevated activity is producing little clean progress.
VACUUM ↑ / ↓
Price is producing unusually strong and efficient displacement with comparatively low effort. Movement is encountering relatively little resistance.
ACTIVE REPRICING ↑ / ↓
Both effort and displacement are elevated while travel remains efficient. Price is moving materially and participation is substantial.
DRAG ↑ / ↓
A directional move remains underway, but gravity is increasing while path efficiency remains below the high-efficiency threshold. Progress is becoming mechanically heavier.
LIGHT TRAVEL ↑ / ↓
Displacement is strong and efficient while overall gravity is unusually low.
DEAD ROTATION
Effort and displacement are subdued while travel remains inefficient, producing little directional progress.
RELEASE ↑ / ↓
A recent high-gravity environment is followed by sharply easing gravity while path efficiency improves. Resistance that had previously constrained movement is dissipating.
NEUTRAL
No stronger mechanical condition currently dominates.
Reading the dashboard
PRICE GRAVITY
Current mechanical state.
WEIGHT
Whether gravity is currently HEAVY , NORMAL , or LIGHT relative to its recent distribution.
CHANGE
Whether gravity is BUILDING , STABLE , or EASING .
TRAVEL
Whether price movement is DIRECT , MIXED , or ROTATIONAL .
EFFORT
Whether normalized activity is HIGH , NORMAL , or LOW .
BALANCE
A directional asymmetry proxy combining close-location-weighted effort with cumulative upward versus downward path travel.
Important:
UPSIDE HEAVIER is not a bullish label, and DOWNSIDE HEAVIER is not a bearish label.
UPSIDE HEAVIER means the upward-side gravity proxy is relatively heavier than the downward-side proxy.
DOWNSIDE HEAVIER means the downward-side gravity proxy is relatively heavier than the upward-side proxy.
BALANCE should be interpreted as a relative resistance proxy , not as a direct measurement of buying/selling pressure or order flow.
Direction and gravity should therefore be interpreted separately.
How I use it
PG-RE works best as a market-structure context layer .
I primarily look for transitions between conditions such as:
HEAVY + BUILDING + ROTATIONAL
effort is being consumed without clean travel
LIGHT + DIRECT ↑/↓
price is traveling efficiently with relatively low gravity
PRESSURE → RELEASE
a previously constrained auction begins converting effort into cleaner movement
ACTIVE REPRICING → DRAG
a strong move remains active, but its mechanical efficiency is deteriorating
VACUUM → rising gravity
a low-resistance move begins encountering more opposition
Practical notes
PG-RE is adaptive and distribution-relative, so a “high” reading in one market or timeframe does not need to equal a “high” reading somewhere else in raw-value terms.
The current live bar can evolve as price, range, and volume develop.
The indicator contains no buy/sell labels and makes no forecast claim.
PG-RE measures model-implied movement difficulty from price, volatility, and volume/range data. It does not directly measure order-book liquidity, executed aggressor flow, or physical market resistance.
A warm-up period is required before distribution-relative states become available.
Its purpose is to structure the relationship between effort, displacement, path efficiency, and changing market resistance within one coherent framework.
Quick Use Guide
Start with PRICE GRAVITY and WEIGHT to judge whether the market is mechanically heavy, normal, or light.
Check CHANGE to see whether gravity is building, stable, or easing.
Use TRAVEL to separate direct movement from churn.
Use EFFORT to judge how much participation is present behind the move.
Use BALANCE to identify directional asymmetry in relative resistance.
Treat states as context , not trade arrows.
Gösterge

VIX Seasonal Analog Composite█ OVERVIEW
VIX Seasonal Analog Composite draws three lines in a separate pane: the average seasonal path of all complete years of VIX history, a composite of the historical years whose year-to-date VIX path most closely resembles the current year, and the current year's own VIX path. The script requests CBOE:VIX daily closes directly, so it displays VIX seasonality on any chart symbol: applied to an S&P 500 chart, the pane still shows the VIX. All lines are expressed as a percentage of each year's first daily VIX close, and both seasonal lines are projected forward to the end of the current calendar year. The thesis is that the remainder of a VIX year can be contextualized by the average behavior of prior years, and more specifically by the subset of prior years that have tracked the current year most closely so far.
█ HISTORY / BACKGROUND
Seasonal averaging is a long-standing technique in technical analysis: normalize each historical year to a common starting point, average across years by position in the calendar, and read the result as the instrument's typical annual path. Applied to the VIX Index, it captures the well-documented tendency of implied volatility to trough in summer and firm into autumn. Its main weakness is that every year receives equal weight, so years with no resemblance to current conditions dilute the picture.
The analog-year refinement addresses this. Instead of averaging all history, it ranks past years by their similarity to the current year's realized path and averages only the closest matches. Variants of this approach appear in institutional volatility research. The specific similarity metric, selection count, and construction details vary by practitioner and are generally not disclosed. This script implements one explicit, reproducible version of the method for the VIX with all parameters exposed as inputs.
█ HOW IT WORKS
The script runs a single accumulation pass over the chart's daily history and defers all computation and drawing to the last bar.
1. On every chart bar, the script requests the CBOE:VIX daily close through `request.security`. Calendar-year boundaries are detected with `year(time)`. The first available VIX close of each year becomes that year's anchor. Every subsequent VIX close is stored as close divided by the anchor, indexed by trading-day-of-year (0 to 252), in a persistent matrix with one row per year. Bars where the VIX returns no data, such as chart history predating 1990, are skipped.
2. On the last bar, completed years are screened for eligibility: a year must contain at least the minimum number of observations (default 200 trading days) to enter any calculation. The current year is always excluded from the historical pools.
3. The seasonal average is computed per trading-day index as the arithmetic mean of the normalized values of all eligible years at that index.
4. Analog ranking begins once the current year has at least the minimum elapsed days (default 10). For each eligible year, the script computes the root mean square error between that year's normalized path and the current year's normalized path over the trading days elapsed so far, skipping missing pairs. Years are ranked by ascending RMSE and the closest N (default 10) are selected. The analog composite is the per-day mean of the selected years across the full 253-day span, including days the current year has not yet reached.
5. Both seasonal lines are drawn as polylines anchored to bar time: actual bar times for elapsed days, then projected dates stepped one calendar day at a time with weekends skipped for the remainder of the year.
6. The current-year line is drawn over elapsed days only. By default it is linearly rescaled so that its year-to-date range maps onto the vertical range of the two seasonal curves, emulating a second axis within a single-scale pane. A label at its last point shows the true unrescaled year-to-date percentage.
7. A table in the top right lists the selected analog years and their RMSE scores.
Ranking is recomputed on every update, so the analog set can rotate as the current year develops.
█ HOW TO USE
Apply the indicator to any daily chart of a symbol that trades on the US equity session calendar, such as an S&P 500 index chart or the VIX itself. The pane always displays VIX seasonality regardless of the chart symbol, which allows the seasonal context to sit directly beneath the index you are analyzing. The logic counts trading days within calendar years using the chart's bars, so it is designed for the daily timeframe only; other resolutions will produce meaningless day indexing. VIX daily history extends to 1990, so a chart with sufficient loaded history builds seasonal pools from roughly three and a half decades of complete years.
The gray line is the unconditional seasonal script: what an average year looks like. The colored composite line is the conditional version: what years resembling this one looked like, including how they finished. The red line is the current year. Divergence between the current year and the composite indicates the year is departing from its closest historical precedents; the table shows which years those precedents are and how tight the fits are (lower RMSE means closer). A rotating analog table across weeks means the current year lacks a stable historical match, which is itself information.
The projected segments beyond the current date are historical averages extended in time. They describe how past years behaved from this calendar point onward. They are not forecasts.
█ SETTINGS
• Top analog years : number of closest historical years in the composite. Default 10.
• Min trading days for an eligible year : observation floor for a year to enter any pool. Default 200.
• Min elapsed days before analog ranking : current-year data required before ranking begins. Default 10.
• Show all-year seasonal average : toggles the gray average line. Default on.
• Show top-N analog composite : toggles the composite line. Default on.
• Show current-year YTD line : toggles the current-year path. Default on.
• Rescale YTD onto seasonal range (RHS-style) : maps the current-year line onto the seasonal
curves' vertical range for readability. Default on.
• Project remainder of year : extends the seasonal lines to year end. Default on.
• Show analog year table : toggles the analog list with RMSE scores. Default on.
• Average color , Analog composite color , YTD color : line colors.
• Line width : width of all three lines. Default 2.
█ WHAT MAKES IT ORIGINAL
Published seasonality scripts typically plot a single all-year average. This script adds a similarity-ranked analog layer computed entirely on the chart: it maintains a full year-by-trading-day matrix of normalized paths, scores every eligible historical year against the current year by RMSE on each update, and averages only the closest matches, so the composite is conditional on how the current year has actually traded rather than on the calendar alone. The construction is fully disclosed and parameterized, including the similarity metric, the selection count, and the eligibility gates. The forward projection is drawn with time-anchored polylines so both seasonal paths extend beyond the last bar to year end, and the current-year line uses an optional range-mapping transform to keep all three curves readable on a single pane scale, with a label preserving the true value.
█ NOTES / LIMITATIONS
• Daily timeframe only. The trading-day indexing that underlies every calculation assumes one bar
per trading day.
• The analog set is re-ranked on every recalculation using the current year's realized path. The
composite line therefore changes shape as the year develops, including its already-drawn portion.
This is inherent to the method, and it means the line you see today is not the line you would
have seen a month ago. Treat it as a conditional historical average, not a signal history.
• The pane always shows the VIX. The chart symbol supplies only the bar grid and timeline.
• Trading-day indexing follows the chart symbol's bars. Chart symbols whose sessions differ from
the US equity calendar, such as symbols with weekend bars or non-US holiday schedules, will
misalign the day indexing. Use a chart symbol on the US equity session.
• The seasonal pools depend on the chart's loaded bar depth and on VIX data availability from
1990. A chart with shallow history averages over fewer years, and less than two complete years
of overlap draws no seasonal lines at all. Chart bars predating 1990 contribute nothing.
• Partial first years, and any year below the observation floor, are excluded by the eligibility
gate.
• Years are capped at 253 trading days; any bars beyond that index within a year are ignored.
• Forward projection steps calendar days and skips weekends but not exchange holidays, so
projected dates drift a few days long by December. Alignment between curves is by trading-day
index and is unaffected.
• With rescaling on, the pane axis is literal for the seasonal lines only. The current-year line's
axis position is a range mapping; read its true value from the label at its endpoint. Early in
a year, a small realized range makes the rescaled line visually exaggerated.
• All output is drawn over the current calendar year plus its projection. The pane is empty over
prior history, which is expected: prior years are inputs to the curves, not drawn objects.
• The script draws with polylines, a label, and a table only, and declares no plot series, so the
pane scale derives from the drawings.
• Nothing in this script is validated as predictive. Both curves are descriptive averages of
historical paths. Gösterge

Dealer Gamma Regime Proxy** Overview:
The "Dealer Gamma Regime Proxy" provides a quantitative estimation of Market Maker / Dealer Gamma Exposure (GEX) dynamics by evaluating structural volatility compression and expansion cycles.
In options markets, Dealer Gamma position dictates how market makers hedge their underlying Delta:
- Long Gamma (+GEX): Dealers trade *against* the trend (buying dips, selling rallies), suppressing market volatility and creating mean-reverting environments.
- Short Gamma (-GEX): Dealers trade *with* the trend (selling into drops, buying into rallies), accelerating price moves and increasing volatility.
** Key Features & Methodology:
1. Volatility Ratio Proxy:
- Compares short-term ATR (14) against its long-term baseline SMA (50).
- Long Gamma Regime (Green Overlay): ATR is below baseline. Indicates volatility suppression, tight consolidations, or steady upward grinds.
- Short Gamma Regime (Red Overlay): ATR spikes above baseline. Indicates market maker delta-hedging acceleration, breakout potential, or heightened risk of sharp liquidations.
2. Integrated VWAP Bands:
- Plots Session VWAP alongside standard deviation bands to serve as high-probability mean-reversion targets during Long Gamma regimes.
3. Institutional Real-Time Dashboard:
- Displays current regime status, volatility ratio, and tactical execution environment directly on your chart overlay.
** Practical Applications:
- Long Gamma Environments (Green): Favor mean-reversion setups, grid trading, and buying VWAP band bounces.
- Short Gamma Environments (Red): Favor trend-following breakouts, momentum trades, and wider stop-losses due to increased volatility.
- Asset Compatibility: Highly effective for options-heavy assets including S&P 500 (ES1! / SPY), Nasdaq 100 (NQ1! / QQQ), and Mega-Cap Equities (AAPL, TSLA, NVDA). Gösterge

Institutional Breadth & Momentum Panel (ADD & TICK)** Overview
The **Institutional Breadth & Momentum Panel (ADD & TICK)** is a specialized real-time order flow and intermarket dashboard designed for intraday traders operating index futures (ES, NQ, YM, RTY) and major equities.
Rather than relying on traditional lagging momentum oscillators, this tool combines two core market internal metrics directly from the New York Stock Exchange (NYSE):
1. NYSE TICK ( USI:TICK ): Measures institutional aggression and order flow pressure in real time.
2. NYSE Advance-Decline Line ( USI:ADD ): Tracks broad-market participation and overall underlying market health.
** Key Components
1. NYSE TICK (Histogram)
The TICK measures the net difference between stocks trading on an uptick versus a downtick across the entire market.
- Institutional Buying Surge (+1000 Threshold):** Highlighted in solid green. Indicates aggressive institutional buying, short squeezes, or strong breakout momentum.
- Institutional Selling Panic (-1000 Threshold):** Highlighted in solid red. Indicates institutional liquidation, stop sweeps, or strong downward pressure.
- Neutral / Rotation Zone:** Softly colored histogram tracking intraday balance between buyers and sellers.
2. NYSE ADD (Orange Line)
The Advance-Decline Line provides top-down confirmation of market direction:
- An ascending ADD confirms that price rallies are backed by broad-market participation.
- A flat/descending ADD during price rallies signals divergence and potential exhaustion.
** Key Features:
Pine Script v6 Codebase: Clean, non-repainting execution utilizing historical closed bars (`close `) for intermarket symbol requests to guarantee backtest accuracy without lookahead bias.
- Built-In Alerts:** Integrated alert conditions triggered when the NYSE TICK crosses extreme institutional thresholds ($\pm 1000$).
- Customizable Symbols:** Allows custom data feed tickers (`USI:ADD`, `INDEX:ADD`, etc.) to fit your specific market data provider settings.
** Best Practices & Practical Application:
- Intraday Execution: Optimized for 1-minute, 5-minute, and 15-minute timeframes on E-mini S&P 500 (ES1!), Nasdaq (NQ1!), and SPY/QQQ.
- Breakout Confirmation:** Use extreme TICK readings (+1000 / -1000) to confirm key level breakouts.
- Exhaustion Trades:** Look for extreme TICK spikes occurring at key daily support/resistance levels to identify high-probability mean-reversion setups.
Gösterge

Signal Pro 6.1Signal Pro 6.1 — Trend Structure, ARSI Market State, and Volatility Breakout Engine
Signal Pro 6.1 is a fully customizable trend analysis and signal engine designed to help traders identify directional momentum, avoid non trending environments, and adapt the indicator to any instrument or timeframe. It combines moving average trend structure, ARSI based market state detection, and Bollinger volatility breakouts to produce a clear, technical view of bullish, bearish, and neutral conditions.
How the Signal Engine Works
Signal Pro 6.1 uses three independent components to validate BUY and SELL signals:
1. Trend Structure (MA1 vs MA2)
Directional bias is determined by two customizable moving averages:
• Bullish Trend: MA1 > MA2
• Bearish Trend: MA1 < MA2
This ensures signals only occur in the direction of momentum.
2. ARSI Market State (Bullish / Bearish / Neutral)
ARSI determines the underlying market condition:
• Bullish State: ARSI > Overbought threshold
• Bearish State: ARSI < Oversold threshold
• Neutral State: Between thresholds
ARSI is a hard filter:
• BUY signals require bullish ARSI background
• SELL signals require bearish ARSI background
• Neutral zones block all trades
This ARSI methodology is inspired by LuxAlgo’s adaptive momentum research.
3. Volatility Breakout (Outer Bollinger Band)
Signals require a volatility expansion:
• BUY: close > upper2
• SELL: close < lower2
This prevents signals during compression and improves trend reliability.
Signal Logic (Matches the Code Exactly)
BUY Signals
Generated only when:
• MA1 > MA2
• ARSI is bullish (background green)
• Close breaks above the outer Bollinger band (close > upper2)
• BUY labels enabled
• In session
• No active position
SELL Signals
Generated only when:
• MA1 < MA2
• ARSI is bearish (background red)
• Close breaks below the outer Bollinger band (close < lower2)
• SELL labels enabled
• In session
• No active position
EXIT Signals
Exits are based on price crossing MA1:
• Long Exit: close < MA1
• Short Exit: close > MA1
This keeps exits responsive and avoids lag.
Recommended Default Settings (Based on Author Back Testing)
These settings provide a balanced, responsive structure suitable for most markets:
ARSI Settings
• ARSI Length: 10 (acceptable range 10–14)
• ARSI Signal Length: 3 (acceptable range 3–8)
• ARSI Overbought: 60 (acceptable range 50–70)
• ARSI Oversold: 40 (acceptable range 30–50)
Moving Averages
• MA1: EMA 8
• MA2: EMA 13
• MA3: EMA 50
• MA4: EMA 200
• MA5: EMA 500
These values create a clear trend hierarchy and help visually confirm directional bias.
Trend Alignment and MA Stacking
Although the indicator generates signals automatically, traders should also pay attention to the broader trend structure. Strong trends often show:
• EMA 8 > EMA 13 > EMA 50 > EMA 200 (bullish stacking)
• EMA 8 < EMA 13 < EMA 50 < EMA 200 (bearish stacking)
When moving averages are stacked cleanly and fanning out, trend strength is high. When they compress or cross repeatedly, the market is entering a range and signals become less reliable.
Signal Pro intentionally reflects this visually: trending markets appear clean and aligned, while range bound markets become noisy. This is a built in warning system.
Customization Is Required
Signal Pro 6.1 is not intended to be used “out of the box.” It is a modular system that must be configured for the specific instrument, timeframe, and trading objective.
Users can customize:
• Moving averages (type, length, visibility)
• Bollinger Bands (inner/outer, multipliers, lengths)
• ARSI thresholds and methods
• Background shading
• Candle colors
• Trend colors
• Session windows
• BUY/SELL/EXIT label visibility
• Momentum circles
• Chart clutter level
Because of this flexibility, the indicator may not look correct until properly tuned. Once configured, it becomes a stable and reliable trend clarity tool.
Versatility Across Markets
With correct settings, Signal Pro 6.1 can be used for:
• Futures scalping
• 0DTE options
• Intraday stock trading
• Swing trading
• Crypto
• Forex
There are no restrictions on where it can be applied. The key is adjusting the session window, timeframe, and indicator parameters to match the behavior of the chosen market and back testing accordingly.
Summary
Signal Pro 6.1 combines trend direction, ARSI market state, and volatility breakout logic to highlight high probability directional moves and warn against trading in non trending environments. Every component — moving averages, bands, colors, signals, and market state filters — is fully customizable, allowing traders to adapt the indicator to any market or timeframe.
Gösterge

Macro Regime Engine - Institutional DashboardEnglish Description:
The "Macro Regime Engine" is an institutional-grade quantitative tool designed to identify market regimes using cross-asset intermarket dynamics.
Rather than relying on traditional lagging technical indicators, this dashboard evaluates the Volatility-Adjusted Momentum Score (VAMS) across six key financial pillars: Equity Markets, Crypto Assets, Energy/Commodities, the US Dollar, Volatility, and Interest Rates.
** How It Works:
The engine applies a non-repainting VAMS calculation across six major intermarket assets:
1. **S&P 500 (SPX)** - Equity Growth
2. **Bitcoin (BTCUSDT)** - High-Beta / Liquidity Appetite
3. **WTI Crude Oil (USOIL)** - Inflationary Pressures / Demand
4. **US Dollar Index (DXY)** - Global Liquidity & Dollar Strength
5. **CBOE Volatility Index (VIX)** - Market Risk Perception
6. **10-Year Treasury Yield (US10Y)** - Cost of Capital & Rates Environment
Based on a voting mechanism, the indicator classifies the market into 4 primary economic regimes:
- Goldilocks (Green): Stable growth, low volatility. Optimal environment for equities and long positions.
- Reflation (Blue): Economic expansion with moderate price increases. Bullish bias.
- Inflation (Orange): Rising commodity and yields pressure. Caution and position reduction recommended.
- Deflation (Red): Spiking volatility and broader market contraction. Risk-off regime.
** Key Features:
- Non-Repainting Logic: Uses closed-bar data (`close `) for intermarket requests to ensure historical accuracy without lookahead bias.
- **Regime Confirmation Filter:** Implements a confirmation threshold to filter out short-term market noise (whipsaws).
- **Customizable Dashboard:** Fully customizable visual table overlay and background regime highlighting.
** Best Uses:
Optimized as a top-down contextual filter for S&P 500 Futures (ES1!), SPY, NQ1!, and BTC. Use this dashboard to align your tactical short-term setups with the broader macro regime.
Gösterge

Range Compression Percentile - Hour RankedThis indicator gives no directional signal. It answers a single question: will the amplitude of the coming hours be large enough to be worth paying a round turn?
What makes it different
Intraday amplitude on a futures contract varies by a factor of 3 to 4 across the trading day. Any absolute threshold — "range below 50 points means compression" — therefore mostly measures what time it is, not the state of the market. A quiet 10:00 in New York and a busy 02:00 can show the same raw range while meaning opposite things.
This script ranks the current range as a percentile against the history of the same hour of the day. That hour-for-hour ranking is the part I have not seen elsewhere, and it is what makes the reading comparable at any time of day.
How it is calculated
The range of the last N bars (default 78, which is 6h30 on a 5-minute chart, one full RTH session) is measured as (highest high − lowest low) / close, expressed in basis points so it is comparable across instruments and across price levels.
Once per elapsed hour, that value is stored in a circular buffer belonging to that hour of the day. Each of the 24 hours keeps its own history, 120 observations by default — roughly six months of sessions.
The current range is then ranked against that hour's stored history. The result is a percentile from 0 to 100, plotted as a histogram and coloured by quintile.
A second reading divides the current range by a user-supplied round-turn cost, giving an amplitude-to-cost ratio.
What the measurements show
Tested on MNQ 5-minute data (12 months, 317 sessions) and GC 5-minute data (5.6 years, 1,737 sessions). Range of the following 2 hours, grouped by the quintile this indicator reports, computed causally — ranking only against hours already elapsed, exactly as the script does live:
MNQ: 39.3 / 43.4 / 47.0 / 53.8 / 64.4 bp from Q1 to Q5
GC: 35.2 / 37.9 / 41.0 / 44.2 / 59.8 bp from Q1 to Q5
Monotonic on both instruments. The bottom quintile runs at roughly 0.6x the amplitude of the top quintile.
The effect also survives a control for the last hour's range, which is the amplitude predictor already widely known: adding the compression indicator to a regression already containing the one-hour range gives it a coefficient of −10.65 bp (t = −8.65) on MNQ and −4.58 bp (t = −7.27) on gold, with hour-of-day fixed effects and standard errors clustered by session.
The result runs against the common belief. Compression does not announce expansion here. It announces more quiet.
What it does not do
It carries no directional information, and I would rather state that plainly than let the histogram suggest otherwise. On the same samples, the signed return of the 2 hours following a compression is indistinguishable from zero (MNQ −0.47 bp, t = −0.55). A range breakout traded as a symmetric bracket loses about the same amount whether traded with the break or against it (−0.241 R versus −0.258 R) — two opposite directions losing the same amount is what no information looks like.
Use it to decide whether conditions are worth trading, never which way.
How to use it
Bottom quintile (red, below 20): the next hours are likely to stay quieter than usual for this time of day. Fixed costs buy less movement.
Top quintile (green, above 80): wide amplitude relative to this hour.
The amplitude-to-cost ratio is the absolute check, and it is independent of the percentile. A market can be compressed for its hour and still offer plenty of room. Both readings are shown because they answer different questions.
Settings
Range window: number of bars in the measured range. 78 is the value the effect was measured on.
Closed bars only: freezes the range on the previous bar so the value stops moving inside the forming bar.
Reference time zone: used only to split the day into hours.
Observations kept per hour, and minimum before displaying: control how much history is required before a percentile is shown.
Round-turn cost in basis points: commission plus slippage against notional. Reference points measured on micro futures: MNQ 0.98, MES 1.89, MYM 2.06, MGC 3.00 to 3.44 depending on the price of gold. This figure depends on price and is never constant over time, so it is an input rather than a constant.
Notes and limitations
No repainting. The percentile is computed only against hours that are over and closed.
The indicator needs history before it displays anything: 20 observations for a given hour by default, so about 20 sessions.
The numbers quoted above come from two instruments over the periods stated. They are measurements on that data, not a guarantee of future behaviour.
Designed and measured on 5-minute futures charts. On other timeframes or asset classes the window length should be reconsidered. Gösterge

Gösterge

Price Gravity Research Engine [Effort & Displacement]Price Gravity Research Engine (PG-RE) is a market-state research indicator designed to measure how much normalized market effort is being consumed relative to the amount and efficiency of price movement that effort produces.
The core idea is simple:
Price becomes mechanically “heavy” when substantial effort produces little or inefficient displacement, and “light” when price travels efficiently with comparatively little resistance.
Rather than generating traditional buy/sell signals, PG-RE is built to describe the current movement environment .
Who it is for: PG-RE is especially suited to discretionary intraday, price-action, and market-structure traders who want a regime/context layer for distinguishing clean repricing from inefficient, effort-heavy travel.
What the engine measures
PG-RE evaluates three primary components:
1) Effort
Market activity is normalized relative to its expected baseline.
When usable volume is available, volume is used as the primary effort source.
A range-based activity proxy can be used as an alternative.
On intraday charts, PG-RE can normalize effort by time of day , helping prevent the open or close from being classified as abnormal simply because raw activity is naturally higher during those periods.
2) Displacement
Net price movement over the Gravity Window is measured using log returns and normalized against recent volatility.
This asks:
Has price actually traveled a meaningful distance relative to what volatility would normally imply?
3) Path Efficiency
PG-RE compares net displacement with the total path traveled over the same window.
A direct move has high path efficiency .
A back-and-forth move with little net progress has low path efficiency .
The Gravity model
PG-RE combines normalized effort, volatility-adjusted displacement, and path efficiency into one mechanical measure called Price Gravity .
In practical terms:
more effort with less progress tends to increase gravity
inefficient, rotational travel tends to increase gravity
strong, efficient displacement tends to reduce gravity
efficient movement achieved with relatively little effort represents lighter travel
Gravity is then interpreted relative to its own recent distribution , making PG-RE a regime tool , not a fixed-value oscillator.
It is designed to answer:
“How difficult is it for price to move right now, and is that difficulty changing?”
not:
“Should I buy or sell this bar?”
What is different about PG-RE
Rather than evaluating activity, volatility, or directional movement independently, PG-RE treats their relationship as the object of measurement.
Its primary output is therefore not momentum or volume itself, but the changing amount of normalized effort associated with efficient versus inefficient price travel.
Mechanical states
PG-RE classifies the current environment into several descriptive states:
PRESSURE
Elevated effort is producing unusually weak displacement while travel remains inefficient and gravity is building. Elevated activity is producing little clean progress.
VACUUM ↑ / ↓
Price is producing unusually strong and efficient displacement with comparatively low effort. Movement is encountering relatively little resistance.
ACTIVE REPRICING ↑ / ↓
Both effort and displacement are elevated while travel remains efficient. Price is moving materially and activity is substantial.
DRAG ↑ / ↓
A directional move remains underway, but gravity is increasing while path efficiency remains below the high-efficiency threshold. Progress is becoming mechanically heavier.
LIGHT TRAVEL ↑ / ↓
Displacement is strong and efficient while overall gravity is unusually low.
DEAD ROTATION
Effort and displacement are subdued while travel remains inefficient, producing little directional progress.
RELEASE ↑ / ↓
A recent high-gravity environment is followed by sharply easing gravity while path efficiency improves. Resistance that had previously constrained movement is dissipating.
NEUTRAL
No stronger mechanical condition currently dominates.
Reading the dashboard
PRICE GRAVITY
Current mechanical state.
WEIGHT
Whether gravity is currently HEAVY , NORMAL , or LIGHT relative to its recent distribution.
CHANGE
Whether gravity is BUILDING , STABLE , or EASING .
TRAVEL
Whether price movement is DIRECT , MIXED , or ROTATIONAL .
EFFORT
Whether normalized activity is HIGH , NORMAL , or LOW .
BALANCE
A directional asymmetry proxy combining close-location-weighted effort with cumulative upward versus downward path travel.
Important:
UPSIDE HEAVIER is not a bullish label, and DOWNSIDE HEAVIER is not a bearish label.
UPSIDE HEAVIER means the upward-side gravity proxy is relatively heavier than the downward-side proxy.
DOWNSIDE HEAVIER means the downward-side gravity proxy is relatively heavier than the upward-side proxy.
BALANCE should be interpreted as a relative resistance proxy , not as a direct measurement of buying/selling pressure or order flow.
Direction and gravity should therefore be interpreted separately.
How I use it
PG-RE works best as a market-structure context layer .
I primarily look for transitions between conditions such as:
HEAVY + BUILDING + ROTATIONAL
effort is being consumed without clean travel
LIGHT + DIRECT ↑/↓
price is traveling efficiently with relatively low gravity
PRESSURE → RELEASE
a previously constrained auction begins converting effort into cleaner movement
ACTIVE REPRICING → DRAG
a strong move remains active, but its mechanical efficiency is deteriorating
VACUUM → rising gravity
a low-resistance move begins encountering more opposition
Practical notes
PG-RE is adaptive and distribution-relative, so a “high” reading in one market or timeframe does not need to equal a “high” reading somewhere else in raw-value terms.
The current live bar can evolve as price, range, and volume develop.
The indicator contains no buy/sell labels and makes no forecast claim.
PG-RE measures model-implied movement difficulty from price, volatility, and volume/range data. It does not directly measure order-book liquidity, executed aggressor flow, or physical market resistance.
A warm-up period is required before distribution-relative states become available.
Its purpose is to structure the relationship between effort, displacement, path efficiency, and changing market resistance within one coherent framework.
Quick Use Guide
Start with PRICE GRAVITY and WEIGHT to judge whether the market is mechanically heavy, normal, or light.
Check CHANGE to see whether gravity is building, stable, or easing.
Use TRAVEL to separate direct movement from churn.
Use EFFORT to judge how much participation is present behind the move.
Use BALANCE to identify directional asymmetry in relative resistance.
Treat states as context , not trade arrows.
Gösterge

Stockbee Anticipation SetupSTOCKBEE ANTICIPATION SETUP
Finds stocks that have already run, then gone quiet — tight range, drying volume, holding near the highs of a small base. It marks the coil BEFORE the breakout, while the stop is still small.
THE IDEA
Pradeep Bonde (Stockbee) trades short, violent moves: a stock breaks out and delivers most of its gain in three to five days. His Momentum Burst entry takes that breakout on the day it happens, typically a 4% up-day on expanding volume.
Anticipation is the same trade entered earlier. Instead of paying for the breakout day, you buy during the dull consolidation that precedes it, while the range is tight and volume has dried up. You give up confirmation; in exchange your stop sits just underneath a very tight base, so the position risks a fraction of what a breakout-day entry risks.
That trade-off only works if the base is genuinely tight. A wide, sloppy consolidation forces a distant stop, and then anticipating buys you nothing over simply waiting. The indicator is built around that constraint.
The pattern in one line: a real prior advance, then a short narrow base, volume drying up, price holding in the upper half of that base, and a stop you can place within a few percent.
HOW IT DECIDES
Nine conditions are evaluated on every bar. ALL must pass. There is no partial credit — one failure and the bar is not a setup, no matter how good the rest look.
1. Prior advance >= 15% over 40 bars
Anticipation continues a move. Without a prior thrust you are just buying a quiet stock.
2. Base width <= 10%
High to low of the last 10 bars. The best single proxy for whether the coil is real.
3. Average daily range <= 5%
Individual bars must be small, not just the envelope. Catches wide bars inside a narrow box.
4. Volume dry-up <= 0.85 x baseline
Base volume against the 50-day average. Supply exhausting is the tell.
5. Close location >= 50% of base
Price holding the upper half. A tight base sagging to its lows is a failed base.
6. Risk to stop <= 5%
The whole premise. If the stop cannot be placed tight, the setup is rejected outright.
7. Trend close > MA20 and MA50
Keeps you on the right side. Optional, can be switched off.
8. Not already fired day gain < 4%
A 4% day IS the Momentum Burst trigger. Past that you are no longer anticipating.
9. Liquidity >= $5 and 100k shares
Standard floor. Tight stops are unusable in illiquid names.
Why the risk gate is a rejection and not a penalty: every other quality can be traded off against the rest through the score. Stop distance cannot. A 12% stop on an anticipation entry is a different trade with a different expectancy, not a slightly worse version of the same one.
THE SCORE
Bars that clear all nine gates are graded 0-100. The score ranks candidates against each other; it never overrides a gate.
20 Base tightness — narrower than the cap scores higher
15 Close location within the base
15 Volume dry-up depth
15 Size of the prior advance
15 Risk distance — tighter stop, more points
10 Range contraction — last 3 bars vs the base
10 Trend alignment above both MAs
Grades:
85-100 A Everything lines up. Chart-review candidate.
75-84 A- Strong, usually one soft component.
65-74 B Playable smaller, or watch for improvement.
55-64 Watch Valid but unremarkable. Watchlist only.
under 55 — Not flagged. Nothing is drawn.
The 55 floor is an input, so you can raise it to see only the best coils.
READING THE CHART
Nothing is drawn unless a bar clears every gate and meets the score floor. A clean chart means no setup — that is the normal state.
Triangle below bar First bar of a new setup. Marks the transition into the
state, so one coil produces one triangle, not a cluster.
Shaded zone Every bar where the setup remains valid. Its width shows
how long the coil has held.
Solid teal line Base high — where the Momentum Burst would trigger.
Anchored to the base that produced the signal and
spanning its full length.
Dotted line Base low. Reference only, this is NOT the stop.
Solid red line The actual stop, from the selected stop mode. Usually
well inside the base low.
Metrics table (values are for the most recent bar; each gate metric turns red when it fails, so a glance tells you what is blocking the setup):
Anticipation Rating and score. Grey header means no setup on this bar.
Base width % High to low of the base, as a percentage of the low.
Avg range % Mean daily high-low range across the base.
Vol ratio Base volume / 50-day baseline. Below 1.0 means drying up.
Prior advance % Rise from the pre-base low up to the base high.
Close loc % Where the close sits in the base. 100 = at the high.
Entry (close) The anticipation entry — you buy inside the base.
Stop Stop price per the selected mode.
Risk % Entry to stop. Red above the max-risk input.
Breakout lvl Base high plus one tick — the Momentum Burst trigger.
R to breakout Distance from entry to that trigger, in units of risk.
R to breakout is the number that justifies the trade. It answers: how much do I make, in R, just getting to the point where a breakout trader would enter? At 1.5R or more, anticipating is genuinely paying you for the earlier entry. Below 0.5R you are taking extra uncertainty for very little head start, and waiting for the breakout is the better trade.
INPUTS
BASE / CONSOLIDATION
Base lookback (bars) 10 Length of the consolidation window. 10 is about two
weeks. Bonde's bases run one to three weeks, so 5-15
is the useful band.
Max base width % 10.0 Rejects bases wider than this. The main tightness
control — lower finds fewer, better coils.
Max avg daily range % in base 5.0 Rejects bases built from wide individual bars. Raise
for high-ADR small caps, lower for large caps.
Min close location in base % 50.0 How high in the base price must close. 70+ demands
price pinned near the highs.
PRIOR ADVANCE
Prior-advance lookback (bars) 40 Window searched for the pre-base low. Longer accepts
older, slower advances.
Min prior advance % 15.0 Required thrust into the base. Raise to demand real
momentum; set to 0 to disable.
VOLUME
Volume baseline length 50 Averaging period the base volume is compared against.
Max base/baseline vol ratio 0.85 Dry-up threshold. 0.85 is mild; 0.6 demands a
pronounced volume collapse.
RISK / STOP
Stop reference Recent low Recent low = under the last N bars, the tight
Stockbee-style stop. Base low = under the whole base,
safest but widest. ATR multiple = volatility-scaled.
Fixed % = a flat percentage.
Recent-low lookback 3 Bars used by Recent low mode. 2-3 is tight, 5+
approaches the base low.
ATR length / ATR multiple 14/1.5 Used only in ATR mode.
Fixed stop % 4.0 Used only in Fixed % mode.
Max risk to stop % 5.0 HARD REJECTION. Setups needing a wider stop are
discarded. The most consequential input here.
FILTERS
Min price 5.0 Excludes low-priced names.
Min avg volume 100000 Liquidity floor on the volume baseline.
Require close above 20 & 50MA on Trend filter. Turn off to find bases forming under
the averages — a different, lower-probability trade.
Exclude if today gain % >= 4.0 Keeps anticipation separate from the breakout it
precedes.
OUTPUT
Min score to flag 55 Score floor. Raise to 70+ for high-grade coils only.
Show base high / low lines on Base boundary lines.
Show stop line on The red stop level.
Shade anticipation zone on Background tint over valid bars.
Extend levels right (bars) 0 Projects the lines forward N bars. Useful when
planning an entry.
TABLE
Show metrics table on Toggles the table.
Position Top right Any of the nine chart corners and edges.
Text size Normal Tiny through Huge. Raise it on large monitors.
TUNING
The defaults are a starting point, not settled numbers. Bonde does not publish exact thresholds, so these were chosen to match the described behaviour and should be adjusted to your universe.
Too few setups:
- Raise Max base width % to 12-14. This is the most common blocker.
- Raise Max risk to stop % to 6-7, accepting looser trades knowingly.
- Lower Min prior advance % to 10 for slower, larger names.
- Lower Min score to flag to 45 to see marginal coils.
Too many setups:
- Lower Max base width % to 7-8.
- Lower Max base/baseline vol ratio to 0.65 for real volume collapse.
- Raise Min close location % to 65-70.
- Raise Min score to flag to 70.
Volatility: high-ADR small caps need Max avg daily range % around 7-8 and a wider Max risk to stop %, or nothing will ever qualify. Large caps can run tighter than the defaults on both. Switching Stop reference to ATR multiple makes stop distance self-adjusting across a mixed watchlist.
These thresholds have not been backtested. Changing them changes which trades you take, and the only way to know whether a change helps is to test it against outcomes over a meaningful sample.
ALERTS
One alert condition is exposed, "Stockbee Anticipation", firing on the first bar of a new setup rather than on every bar it stays valid.
Right-click the chart, Add alert, choose Stockbee Anticipation Setup as the condition, and set it to Once Per Bar Close. On daily bars you are notified after the close, which is when the signal is final. Firing intrabar produces alerts that vanish by the close.
WHAT IT CANNOT DO
- It is not a signal service. It flags a chart state. Every candidate still
needs a look at the chart before it becomes a trade.
- It has no view on news or fundamentals. A tight base ahead of an earnings
date is a very different proposition and the script cannot see the date.
- It does not size positions or track exposure. It gives you entry, stop and
risk %; converting that into share count is your job.
- It does not know the market regime. Anticipation setups fail in bulk when
the broad market is under distribution. Check the market first.
- It has not been backtested. The thresholds are reasoned from the method as
described, not fitted to outcomes.
- One symbol at a time. Pine indicators evaluate the chart's symbol only.
Scanning a universe requires a screener.
Implements the Anticipation setup as taught by Pradeep Bonde (Stockbee). Not affiliated with or endorsed by him. Nothing here is financial advice — the indicator describes chart geometry, and decisions about risk remain entirely yours. Gösterge

Gösterge

Return Dispersion Matrix Strategy [The Quant Science]This is a simple buy and sell strategy developed using the Dispersion Return Matrix indicator.
Before proceed, if you are new to Dispersion Return Matrix
About Dispersion Return Matrix:
This strategy script highlights the potential of Pine Script, which makes it easy to incorporate quantitative ideas into your trading strategy. In this example, the algorithm decides which type of entry to choose based on the current market conditions.
🚦🟢 When Quadrant Q1 is dominant , the market is in a strong trend phase and is suitable for trend-following and bullish breakout strategies. Strat will use a trend-following approach for entries in this market phase.
🚦🟢 When Quadrant Q2 indicates a mean reverting market where buyers step in immediately when prices fall, suitable for accumulation strategies on pullbacks. In this phase, we will use RSI oversold entries.
🚦❌ When Quadrants Q2 and Q3 dominate the market , no trading is conducted, as there are no trading opportunities for our strategy during this phase.
What is it for?
To test the indicator's functionality within a trading strategy.
To demonstrate how to structure a trading strategy by integrating the Dispersion Return Matrix into your code.
The algorithm monitors the market and trades only when quadrants Q1 and Q2 are the winners , ensuring that it trades during a favorable market condition. The algorithm never trades when Q3 and Q4 dominate the market.
Depending on the winning quadrant, the algorithm applies two different entry strategies:
🏆 Q1 Win: Trend following strategy
🟢 Entry condition: closing price higher than the previous closing price and price above the 20-period SMA.
trend_following_strat_entry = close > close and close > sma
🏆 Q2 Win: Mean reverting strategy
🟢 Entry Condition: The RSI(14) indicator crosses below the oversold level of 35.
mean_revert_strat_entry = ta.crossunder(rsi, 35)
Exits are always calculated using a take-profit and a fixed percentage stop-loss. The take-profit and stop-loss values are calculated based on the entry price of the opening trade.
The values set in the code are 🟢 5% for the take-profit and 🔴 15% for the stop-loss.
tp = 5
sl = 15
The capital used for trading is 10% of the initial capital.
qty_order := (strategy.initial_capital * 10)/100
Opens only one trade at a time.
The algorithm highlights in white on the chart the market periods when Q3 and Q4 dominate the market, making it easy to assess the strategy's reliability in the past.
Strateji

Reballo Regime Detector - ER + RelVol + AutocorrelationWhat it measures
Most indicators try to tell you which way price is going. This one asks a different question: is the market in a mood where trend-following works, or one where fading works?
You get one number, the Regime Score, from 0 (ranging / choppy) to 1 (trending). Under the hood it blends three different ways of looking at price, each measured at three speeds (16 / 32 / 64 bars by default).
The three components
1. Efficiency Ratio (Kaufman)
How straight is the path? Net distance ÷ total distance travelled. Move 10 points in 10 points of wiggle: score 1.0. Wander 50 points to end up 10 higher: score 0.2. High = directional, low = chop.
2. Relative Volatility
Short-window vol ÷ long-window vol (4× the short window). Quiet, compressing vol usually goes with clean trends. Expanding vol usually means transitions and churn. Capped at 2 and flipped so that "quiet" scores high.
3. Lag-1 Autocorrelation
Does today's move tend to follow yesterday's? Positive = follow-through (momentum-friendly). Negative = snap-back (mean-reversion-friendly).
Components 2 and 3 get averaged into one "RelVol+AC" number. Then both that and the ER get percentile-ranked over the last year , so a 0.8 on BTC means the same thing as a 0.8 on a sleepy utility stock, and 4H reads the same as daily.
Putting it together
Default mix is 40% Efficiency Ratio / 60% RelVol+AC, smoothed with a 16-bar EMA so it doesn't flip on every bar. Above 0.60 = trending (green). Below 0.40 = ranging (red). The middle is left grey on purpose: that's the "don't know, don't force it" zone.
What's hiding in the Data Window
Each component's rank on its own, so you can see what is actually moving the score.
Two derived weights, Divergence Multiplier and Convergence Multiplier (range 1 ± strength). If you run trend and mean-reversion signals side by side, these are meant to tilt between them: scale trend signals by Divergence, counter-trend signals by Convergence. At strength 0.5, a fully trending regime gives trend signals 1.5× weight and counter-trend signals 0.5×.
Ways to use it
As a filter: only take breakouts / momentum entries when it's green, only fade when it's red.
As a sizing knob: use the multipliers to lean in or out instead of switching strategies on and off.
As a sanity check: when it flips, peek at the Data Window to see whether vol, path efficiency or autocorrelation moved first.
Two alerts built in: regime → Trending and regime → Ranging.
Honest limitations
Needs about a year of bars (252 by default) before the ranking means anything.
It tells you what the regime is , not when it's going to change.
It doesn't care about direction. A clean crash scores as "trending" too.
Settings
Fast / Medium / Slow — 16 / 32 / 64 — speeds for all three measures
Weight: ER / RelVol+AC — 0.4 / 0.6 — how much each side counts
Percentile Rank Lookback — 252 — the "last year" window
Score Smoothing — 16 — EMA on the final score
Trending Above / Ranging Below — 0.60 / 0.40 — where the shading kicks in
Multiplier Strength — 0.5 — only touches the hidden multipliers
Open source. Fork it, break it, tell me what you find. Gösterge

TF: Gold Macro Bias (GMB)TradingFlow: Gold Macro Bias (GMB)
GMB is a macro model that reads the broader environment for gold using volatility, dollar strength, and real yields. It normalizes VIX, GVZ, DXY, and real yield data into a composite score, then uses a MACD-style momentum histogram to show whether the macro backdrop is improving or deteriorating for gold. Its purpose is to give a structured macro context so gold-related decisions can be made with a clearer view of the underlying drivers.
The indicator is not based on gold's price and does not predict price direction. It describes the macro conditions that tend to support or restrict gold, and how quickly those conditions are changing.
Core Concept
GMB combines four macro inputs:
• VIX: broad equity risk aversion. Higher VIX usually reflects stronger demand for protection.
• GVZ: implied volatility in gold. Shows whether gold itself is responding to macro stress.
• DXY: U.S. dollar strength. A stronger dollar is typically a headwind for gold.
• Real Yield: 10-year, 30-year, or a blended rate. Higher real yields increase the opportunity cost of holding gold.
The core comparison is between GVZ and VIX. When broad market stress (VIX) is elevated but gold volatility (GVZ) is relatively calm, the model reads this as a potentially supportive backdrop — equity stress may eventually drive catch-up demand for gold. When gold volatility is elevated relative to VIX, the model reads this as less favorable.
Dual-Speed Architecture: Regime and Tactical
GMB runs two parallel scores:
• Regime: the slow-moving macro trend. This is the primary line for reading the overall backdrop and drives the zone logic and alerts.
• Tactical: a faster-responsive overlay for entry timing. It reacts more quickly to sudden policy shifts or market shocks.
Momentum Histogram (MACD-style)
The histogram shows the difference between Tactical and Regime scores. It works like a MACD histogram:
• Positive bars: Tactical above Regime — macro backdrop is improving.
• Negative bars: Tactical below Regime — macro backdrop is deteriorating.
• Growing bars: momentum is accelerating.
• Shrinking bars: momentum is decelerating — possible inflection point.
The histogram uses four colors to distinguish these states:
• Bright gold — improving, accelerating
• Light gold — improving, decelerating
• Bright red — deteriorating, accelerating
• Light red — deteriorating, decelerating
The background shading follows the same logic, using transparent versions of these colors.
Z-Score Normalization and Capping
All inputs are converted to Z-Scores over their respective normalization windows. This puts VIX, GVZ, DXY, and real yield on a common scale so they can be combined into a single composite.
Z-Scores are capped at plus or minus 3.5. This prevents extreme black-swan outliers from distorting the normalized composite. During events like a VIX spike, uncapped Z-Scores could reach 5 or beyond, which would pull the entire model out of proportion. The cap keeps the composite stable under stress.
Adjustable Component Weights
Each component has an independent weight:
• VIX-GVZ Gap weight
• DXY weight
• Real Yield weight
Weights are kept fixed and manual for transparency. Adaptive auto-weighting can reduce interpretability — it becomes harder to understand why the model changed its behavior. Fixed weights let you see exactly how each factor contributes.
Real Yield Modes
The real yield input can be set to:
• 10Y: only the 10-year real yield (FRED:DFII10).
• 30Y: only the 30-year real yield (FRED:DFII30). More sensitive to fiscal dominance and long-end liquidity events.
• Blended: a weighted combination of both.
The 30Y option captures long-end dynamics that the 10Y alone may miss, particularly during periods of fiscal expansion or Treasury buyback operations.
Contribution Table
An optional table in the top-right corner shows each component's current Z-Score:
• VIX-GVZ Gap
• DXY
• Real Yield
This helps identify which factor is driving the composite at any given moment — whether the score is being pushed by the dollar, real yields, or the volatility gap.
How to Read
1. The Regime Composite Score is the primary read. Sustained positive readings (with invert ON) suggest a supportive macro backdrop for gold.
2. The Tactical Score can signal earlier shifts when the Regime line is slow to react.
3. The histogram shows the direction and acceleration of change. A shift from negative to positive histogram bars suggests the backdrop is improving.
4. Background shading follows the histogram — gold-tinted means improving, red-tinted means deteriorating.
5. The contribution table shows which factor is dominant.
Use the composite as a backdrop filter, not a trade signal. Supportive readings confirm tailwinds for gold; restrictive readings suggest caution or the need for stronger price confirmation.
Alerts
Eight alerts across three categories:
• Momentum Shifts: histogram crosses above or below zero — earliest signal that the macro backdrop is changing direction.
• Acceleration Starts: improvement or deterioration begins to gain strength.
• Regime Level: Regime score enters the gold-friendly or headwind zone, or crosses the neutral line.
All alerts trigger at bar close. For live use, "Once Per Bar Close" is recommended.
Important
GMB is a macro context tool. It reads the structural environment for gold — volatility dynamics, dollar pressure, and real yield conditions — and presents them as a single composite with a momentum overlay. It does not predict price, generate trade signals, or replace chart analysis.
Settings may behave differently across instruments and timeframes. The model inputs (VIX, GVZ, DXY, real yields) are daily-frequency data, so on intraday charts the script falls back to daily resolution. Minimum practical timeframe is 1h; 4h or Daily is recommended.
Always combine the output with broader market analysis, price structure, and risk management.
---
TradingFlow: Gold Macro Bias (GMB)
GMB 是一個宏觀模型,用於判斷黃金所處的宏觀環境。它將 VIX、GVZ、DXY 和實際收益率數據標準化為一個綜合分數,再透過 MACD 風格的動量柱狀圖顯示宏觀背景正在改善還是惡化。目的是提供結構化的宏觀脈絡,讓黃金相關的判讀能在更清楚的背景下進行。
此指標並非以黃金價格為依據,也不預測價格方向。它描述的是傾向支持或限制黃金的宏觀條件,以及這些條件變化的速度。
核心概念
GMB 結合四項宏觀輸入:
• VIX: 整體股票市場的風險規避程度。VIX 越高,通常代表避險需求越強。
• GVZ: 黃金的隱含波動率。顯示黃金本身是否正在對宏觀壓力作出反應。
• DXY: 美元強度。美元越強,通常對黃金越不利。
• 實際收益率: 10 年期、30 年期或混合利率。實際收益率越高,持有黃金的機會成本越大。
核心比較在於 GVZ 與 VIX 之間。當整體市場壓力(VIX)偏高但黃金波動率(GVZ)相對平靜時,模型解讀為可能有利於黃金——股票壓力 eventually 可能帶動黃金的追漲需求。當黃金波動率相對於 VIX 偏高時,模型解讀為較不利。
雙速度架構:Regime 與 Tactical
GMB 同時運行兩條分數:
• Regime: 慢線,反映宏觀大趨勢。這是判讀整體背景的主要線條,驅動區域邏輯和警報。
• Tactical: 快線,用於尋找進場時機。對突發政策衝擊或市場變化的反應更快。
動量柱狀圖(MACD 風格)
柱狀圖顯示 Tactical 與 Regime 分數之間的差值,運作方式類似 MACD 柱狀圖:
• 正柱: Tactical 在 Regime 上方——宏觀背景正在改善。
• 負柱: Tactical 在 Regime 下方——宏觀背景正在惡化。
• 柱子變高: 動量正在加速。
• 柱子變矮: 動量正在減速——可能接近轉折點。
柱狀圖使用四種顏色區分以上狀態:
• 亮金色——改善中、加速中
• 淺金色——改善中、減速中
• 亮紅色——惡化中、加速中
• 淺紅色——惡化中、減速中
背景底色使用相同邏輯的半透明版本。
Z-Score 標準化與截斷
所有輸入在各自的標準化窗口內轉換為 Z-Score,讓 VIX、GVZ、DXY 和實際收益率能在同一尺度上組合成單一綜合分數。
Z-Score 截斷在正負 3.5 之內。這防止極端黑天鵝事件的離群值扭曲綜合分數。在 VIX 飆升等事件中,未截斷的 Z-Score 可能達到 5 或更高,會把整個模型拉偏。截斷確保模型在壓力環境下仍保持穩定。
可調組件權重
每個組件有獨立的權重:
• VIX-GVZ Gap 權重
• DXY 權重
• 實際收益率權重
權重保持固定且手動設定,以確保透明度。自動適應權重會降低可解釋性——難以理解模型為何改變行為。固定權重讓你清楚看到每個因子的貢獻。
實際收益率模式
實際收益率輸入可設定為:
• 10Y: 僅使用 10 年期實際收益率(FRED:DFII10)。
• 30Y: 僅使用 30 年期實際收益率(FRED:DFII30)。對財政主導和長端流動性事件更敏感。
• Blended: 兩者的加權組合。
30Y 選項能捕捉 10Y 單獨可能遺漏的長端動態,特別是在財政擴張或國債回購操作期間。
貢獻度面板
右上角的可選面板顯示各組件的當前 Z-Score:
• VIX-GVZ Gap
• DXY
• 實際收益率
這能幫助你一眼看出是哪個因子在驅動綜合分數——是美元、實際收益率還是波動率缺口。
判讀方式
1. Regime 綜合分數是主要依據。持續的正讀數(invert 開啟時)代表宏觀背景有利於黃金。
2. Tactical 分數可以在 Regime 線反應較慢時,提前信號顯示環境轉變。
3. 柱狀圖顯示變化的方向和加速度。柱狀圖從負轉正,代表背景正在改善。
4. 背景底色跟隨柱狀圖——金色調代表改善,紅色調代表惡化。
5. 貢獻度面板顯示哪個因子占主導。
將綜合分數作為背景過濾器,而非交易信號。有利的讀數確認黃金的順風;不利的讀數代表需要謹慎或要求更強的價格確認。
警報
共八個警報,分為三類:
• 動量轉向: 柱狀圖穿越零軸——宏觀背景方向改變的最早信號。
• 加速啟動: 改善或惡化開始增強。
• Regime 區域: Regime 分數進入有利或不利區域,或穿越中性線。
所有警報在 K 線收盤後觸發。即時使用時,建議選擇「Once Per Bar Close」。
重要說明
GMB 是一個宏觀背景工具。它讀取黃金的結構性環境——波動率動態、美元壓力和實際收益率條件——並以單一綜合分數搭配動量疊加呈現。它不預測價格,不產生交易信號,也不取代圖表分析。
不同市場和時間週期的表現可能不同。模型輸入(VIX、GVZ、DXY、實際收益率)均為日頻數據,因此在日內圖表上會自動回落至日線解析度。最低建議時間框架為 1h,推薦使用 4h 或日線。
使用時仍要結合更廣泛的市場分析、價格結構和風險管理。
---
TradingFlow: Gold Macro Bias (GMB)
GMBは、金を取り巻くマクロ環境を読み取るためのモデルです。ボラティリティ、ドルの強さ、実質利回りを組み合わせ、VIX・GVZ・DXY・実質利回りのデータをZ-Scoreで正規化した上で一つのコンポジットスコアにまとめます。MACDスタイルのモメンタムヒストグラムにより、マクロ環境が金にとって改善方向なのか悪化方向なのかを視覚的に示します。金に関する判断に、背景となるマクロ構造をより明確に把握できるようにすることが目的です。
このインジケーターは金の価格を基盤とせず、価格を予測もしません。金を支援したり制限したりするマクロ条件と、その変化の速度を示すものです。
コンセプト
GMBは4つのマクロ入力を組み合わせます:
• VIX: 株式市場全体のリスク回避度。VIXが高いほど、 Safe-haven需要が強くならないこともあります。
• GVZ: 金の Implied Volatility。金自体がマクロのストレスに反応しているかどうかを示します。
• DXY: 米ドルの強さ。ドルが強くなると、通常は金の追い風ではなくなります。
• 実質利回り: 10年国債、30年国債、またはそれらのブレンド。実質利回りが高いほど、金を保有する機会コストが大きくなります。
中心となるのはGVZとVIXの比較です。市場全体のストレス(VIX)が高まっているにもかかわらず、金のボラティリティ(GVZ)が比較的落ち着いている場合、モデルはこれを金にとって好材料と読みます。株式市場のストレスが金への追加需要につながる可能性があるためです。逆に、GVZがVIXに対して高水準にある場合、モデルはこれをやや不利と読みます。
デュアルスピードアーキテクチャ:Regime と Tactical
GMBは2つのスコアを並行して算出します:
• Regime: スローなマクロトレンド。全体的な環境を読むための主要なラインで、ゾーンロジックとアラートを駆動します。
• Tactical: 高速なオーバーレイ。エントリータイミングの把握に活用します。突然の政策変更や市場の衝突にもより早く反応します。
モメンタムヒストグラム(MACDスタイル)
ヒストグラムはTacticalとRegimeのスコア差を表示し、MACDのヒストグラムと同じように機能します:
• 正のバー: TacticalがRegimeを上回る — マクロ環境が改善方向にあることを示します。
• 負のバー: TacticalがRegimeを下回る — マクロ環境が悪化方向にあることを示します。
• バーが伸びる: モメンタムが加速中。
• バーが縮む: モメンタムが減速中 — 転換点に近づいている可能性があります。
ヒストグラムは4色で状態を区別します:
• 明るいゴールド — 改善・加速中
• 薄いゴールド — 改善・減速中
• 明るい赤 — 悪化・加速中
• 薄い赤 — 悪化・減速中
背景の塗りつぶしは同じロジックの半透明版を使用します。
Z-Scoreの正規化とキャップ
すべての入力はそれぞれの正規化期間においてZ-Scoreに変換されます。これにより、VIX・GVZ・DXY・実質利回りが同じスケールで比較可能となり、一つのコンポジットスコアにまとめることができます。
Z-Scoreは±3.5にキャップされます。これにより、ブラックスワンイベントによる極端な外れ値がコンポジットを歪めるのを防ぎます。VIXの急騰などでは、キャップなしのZ-Scoreは5を超えることもあり、モデル全体のバランスを崩す可能性があります。キャップにより、ストレス環境下でもモデルは安定した動作を保ちます。
コンポーネント重みの調整
各コンポーネントには独立した重みが設定できます:
• VIX-GVZ Gap 重み
• DXY 重み
• 実質利回り 重み
重みは透明性を保つため、固定で手動設定とします。適応的な自動重み付けは解釈性を損なう可能性があります — モデルの挙動がなぜ変化したかが分かりにくくなるためです。固定重みにより、各因子がどのように寄与しているかを明確に把握できます。
実質利回りモード
実質利回りの入力は以下から選択できます:
• 10Y: 10年国債の実質利回りのみ(FRED:DFII10)。
• 30Y: 30年国債の実質利回りのみ(FRED:DFII30)。フィッスカル・ドミナンスや長端の流動性イベントにより敏感です。
• Blended: 両者の加重平均。
30年国債を選択することで、財政拡大やTreasuryリパッチェス(買戻し)オペレーションの時期など、10年国債だけでは捉えきれない長端の動向を把握できるようになります。
コンポーネント寄与テーブル
右上に表示されるオプションのテーブルは、各コンポーネントの現在のZ-Scoreを一覧で示します:
• VIX-GVZ Gap
• DXY
• 実質利回り
これにより、コンポジットスコアをどの因子が駆動しているかを一目で把握できます — ドルなのか、実質利回りなのか、ボラティリティギャップなのか。
読み方
1. Regimeコンポジットスコアが主要な判断材料です。持続的な正の値(invert ON時)は、マクロ環境が金にとって好環境であることを示します。
2. Tacticalスコアは、Regimeが反応に遅れがちな場面で、環境の変化を先行して捉えることができます。
3. ヒストグラムは変化の方向と加速度を示します。負から正への転換は、環境が改善途上にあることを示します。
4. 背景の塗りつぶしはヒストグラムに連動します — ゴールド系は改善、レッド系は悪化。
5. 寄与テーブルは、どの因子が支配的かを示します。
コンポジットスコアはバックグラウンドフィルターとしてお使いください。トレードシグナルではありません。好材料の読みは金の追い風を確認し、不利な読みは慎重さを求めたり、より強い価格の確認を要求したりします。
アラート
3カテゴリ、計8つのアラートがあります:
• モメンタムシフト: ヒストグラムがゼロラインをクロス — マクロ環境の方向転換に関する最も早いシグナル。
• 加速開始: 改善または悪化の勢いが増し始めたことを示します。
• Regimeゾーン: Regimeスコアがゴールドフレンドリー圏またはヘッドウインド圏に入侵、またはニュートラルラインをクロスします。
すべてのアラートはバーの確定時に発火します。リアルタイムで使用する場合は「Once Per Bar Close」の選択を推奨します。
重要な注意
GMBはマクロのコンテキストを読むためのツールです。金の構造的な環境 — ボラティリティの動向、ドルの圧力、実質利回りの状況 — を一つのコンポジットスコアとモメンタムオーバーレイとして表示します。価格を予測したり、トレードシグナルを生成したり、チャート分析の代わりになるものではありません。
銘柄や時間足によって挙動が異なる場合があります。モデルの入力(VIX、GVZ、DXY、実質利回り)は日足データであるため、インtradayチャートでは日足解像度にフォールバックします。最低推奨時間足は1hで、4hまたは日足が推奨されます。
より広範な市場分析、価格構造、適切なリスク管理と組み合わせてご使用ください。
Gösterge

Gösterge

Intraday Volatility ClockThe Concept
A stop is a distance, and every distance is really a bet about how much the market can move before you are wrong. But intraday volatility is nowhere near constant — it is loud at the open, quiet through the middle of the session, and wakes up again into the close. On liquid intraday instruments the gap between the busiest and calmest half-hours is routinely four to five times in variance, which is roughly double in standard deviation. A stop set on the session's average volatility is therefore far too tight in the first half hour and needlessly wide at midday. Same number of points, completely different meaning. Volatility Clock measures that shape from the instrument's own history and hands it back as a single number per time slot, so you can see which part of the day you are standing in before you decide what a distance is worth.
What It Shows
🕐 Time-of-Day Multiplier — a stepped line showing how much variance this slot of the session normally carries, expressed against the session average. 1.00 is a typical slot for this market; 3.00 means this slot usually runs three times as hot
📊 Curve Table — the fitted profile slot by slot, with the number of sessions behind each one so you can see which parts of the day are well measured and which are thin. Long sessions cut into small slots can outrun the table; when that happens it says how many slots were left off rather than quietly dropping the tail
📐 Sigma Mode — the same curve as a standard-deviation multiplier rather than a variance one, for scaling stop distances and expected move directly
⚖️ Session Average Line — the 1.00 reference. Above it the market is normally more active than its own daily baseline, below it less
🎛️ Fit Controls — slot width, how many sessions to measure over, and how hard to shrink thinly-observed slots toward neutral
How It Is Built
Squared log returns are pooled into time-of-day slots, one row per session. Each session's slots are divided by that session's own average before anything is compared across days, so a violent session contributes its shape and not its scale — otherwise one wild day writes the curve for every other. The statistic across sessions is the median, for the same reason. Thin slots are shrunk toward 1.00 in log space, so a slot with three observations degrades to "no opinion" rather than to a confident wrong number. The finished curve is renormalised to average 1.00, which is what makes it orthogonal to whatever volatility estimate you already use: applying it moves variance around inside the day without changing the overall level.
Slots are measured from the session open , not from midnight. On a market that opens at 09:15, a midnight grid would produce a first slot labelled 09:00 holding only fifteen minutes of trading — the hottest fifteen minutes of the day, reading high for the wrong reason. Anchoring to the open keeps every slot the same width and keeps sessions that run past midnight in the right order.
How To Use
Add it to an intraday chart with a decent number of completed sessions and read it as context, not as a trigger. It has no bullish or bearish opinion and never will.
• Scale distances, do not shift them. Switch on Sigma Mode and treat the number as a multiplier on whatever stop or target width you already use. A 2.00 reading means the same setup deserves roughly twice the room it would get at midday
• Mind the trough. The quietest part of the session is where fixed-distance stops look safest and are actually the loosest relative to what the market is doing. It is also where a trade needs the most time to travel anywhere
• Respect the open. The first slot is usually the largest number on the chart by a wide margin. Positions taken there carry far more range than the rest of the day, whichever way it goes
• Check the sample column. A slot backed by three sessions is a guess; one backed by forty is a measurement. Thin slots are deliberately pulled toward 1.00 rather than shown as confident extremes
• Compare instruments. The shape is not universal. Index futures, single stocks and commodities each have their own profile, and a commodity trading across two continents' hours can look nothing like an index
• Match the slot to the chart. Slot width must be at least the bar interval, and works best as an exact multiple of it. The script says so in the table rather than fitting a curve on a broken grid
Using It In A Trade
Everything below is one idea: the multiplier tells you what a point is worth right now, so anything you measure in points should be read through it. None of it is a signal, and none of it says which way to face.
1. Stops. Turn on Sigma Mode. If your working stop is X points and the reading is 1.80, the comparable stop in that slot is about 1.8X — not because the trade needs more room emotionally, but because the market covers that distance 1.8 times as easily there. Running one fixed number all day means you are unknowingly trading a tight stop at the open and a loose one at lunch.
2. Targets and the ratio you are actually getting. Scaling the stop without scaling the target quietly changes your risk-reward. If both move with the multiplier, the ratio survives. If only the stop moves, a 1:2 setup at midday is something else entirely at the open.
3. Position size. The inverse of the sigma multiplier is a size scalar. Half the size at a 2.00 slot and full size at a 1.00 slot puts roughly the same rupee risk on the table in both, which is usually what you meant by "fixed risk" in the first place.
4. Time budget for a trade. A trade needs the market to travel. In a 0.60 slot it travels slowly, so the same target takes materially longer and the trade will sit through more time doing nothing. If you scalp with a time-based exit, the exit is worth scaling too.
5. Choosing when to be in the market. Some approaches want movement — breakouts, momentum, anything paid by range. Those live in the peaks. Others want stillness — mean reversion, range fades, anything that assumes price comes back. Those live in the trough. The curve tells you which regime the clock has put you in before the chart does.
6. Breakout filtering. The same size of break means different things at different times. A move that clears yesterday's high in a 0.50 slot required real force to happen there. The identical move in the opening slot is inside what the market does routinely without meaning anything. Comparing break size against the local multiplier is a cheap sanity check.
7. Options and anything short premium. Premium sellers are paid for time and punished by movement, and the two are not distributed the same way through the day. The peaks are where a written position takes its damage; the trough is where decay does its work relatively undisturbed. Stop distances on short-premium positions are exactly the kind of fixed number that this curve says should not be fixed.
8. Comparing a session to its own norm. Take the realised movement of the current slot and divide by what the curve says that slot normally carries. Above one means today is running hot for that time of day, below one means it is quiet — a cleaner read on "is today unusual" than comparing against a flat daily average that has the time-of-day shape baked into it.
Works on any symbol on intraday timeframes. Larger bar intervals let the chart hold more sessions, which usually gives a steadier profile than squeezing more detail out of fewer days.
Notes
This measures where volatility concentrates, not where price goes. Nothing here forecasts direction, and no combination of settings will make it do so. It is a description of how the instrument distributes its movement across the trading day.
Non-repainting. The profile is recalculated once at each session open using completed sessions only, and only completed bars are ever added to the sample. The value displayed on any bar was knowable before that session began, and history is not redrawn as the current session develops.
Regular session only, by default. Pre-market and auction prints are not ordinary trading. Left in the sample, a single auction gap can double the opening slot on its own. The setting can be turned off, but the profile it produces should be read with that in mind.
History requirement. The profile needs several completed sessions before it will display anything. Below that it shows how many sessions it has gathered so far rather than drawing a curve nobody should trust. On non-intraday timeframes it says so and draws nothing. A slot with no observations behind it draws nothing rather than defaulting to 1.00.
A profile is not a promise. Any individual session can ignore the shape entirely — news, expiry and holidays all override it. The curve describes the central tendency of many days, not the obligation of the next one.
No alerts in this version.
Gösterge

Adaptive MA Ribbon [StrixEDGE]📊 WHAT IT DOES
StrixEDGE Adaptive MA Ribbon plots three of the most advanced low-lag moving averages — Hull MA, Arnaud Legoux MA, and Kaufman Adaptive MA — with automatic period adjustment based on current volatility. A consensus score (0-6) instantly shows whether all three agree on trend direction.
🔬 WHY IT'S DIFFERENT
Traditional MA ribbons use fixed periods that work in one market condition and fail in another. This ribbon automatically shortens its period when volatility spikes (for faster reaction) and lengthens it when markets are calm (to avoid whipsaws). The three MAs used — HMA, ALMA, and KAMA — are specifically chosen because each adapts to the market differently, so their agreement carries more weight than three similar MAs agreeing.
⚙️ HOW IT WORKS
The volatility ratio (current ATR / 50-period average ATR) dynamically adjusts the base period. This adjusted period feeds into all three MAs simultaneously. The consensus score counts two things: how many MAs are below price (0-3 points) and how many are rising (0-3 points). A score of 6 means all three MAs are below price AND rising — the strongest possible bullish configuration.
📈 HOW TO USE
• Consensus 5-6 (green fill): Strong uptrend — buy pullbacks to the ribbon
• Consensus 0-1 (red fill): Strong downtrend — sell rallies to the ribbon
• Consensus 2-4 (gray fill): Mixed — avoid trend strategies
• Diamond markers at consensus flips = key entry/exit signals
• Ribbon twist (MAs crossing) = early warning of trend change
• Works best on 4H and Daily timeframes
🎛️ INPUTS & DEFAULTS
Base Period: 21 | Min: 8, Max: 55 | ALMA Offset: 0.85, Sigma: 6.0
═══════════════════════════════════════════════════════
🔧 CUSTOMIZATION
All parameters are fully adjustable through the indicator settings panel. Inputs are grouped logically:
• ⚙️ Core Parameters — main calculation settings
• 📊 Table Settings — table size (Tiny to Huge), position (4 corners), visibility toggle
• 🎨 Visual Settings — colors, show/hide elements
• 🔔 Alert Settings — threshold values for notifications
📊 DATA TABLE
A built-in data table displays all key metrics in real-time. Adjust the table size from Tiny to Huge to match your chart layout. Position it in any corner. Toggle visibility on/off.
🔔 ALERTS
Pre-built alert conditions for all major signals. Set up alerts via TradingView's alert dialog — select this indicator and choose from the available conditions.
⏱️ RECOMMENDED TIMEFRAMES
Works on all timeframes. Recommended: 1H, 4H, Daily for best signal quality. Lower timeframes produce more signals but with higher noise. Weekly/Monthly for position trading context.
✅ COMPLIANCE
• No repainting — all signals based on confirmed bar close data
• No future data references
• Open-source code — verify the logic yourself
⚠️ DISCLAIMER
This indicator is a technical analysis tool, not financial advice. It does not predict future price movements. Past patterns and signals do not guarantee future results. Trading involves substantial risk of loss. Always use proper risk management, including stop losses and appropriate position sizing. Never risk more than you can afford to lose. Gösterge

RC Tools - CUSUM Drift Detector────────────────────────────────────────────────────────────────────
█ OVERVIEW
Most trend tools measure a single bar or a moving-average deviation, so a slow, persistent drift that never produces one dramatic bar can slip under their radar. This tool applies CUSUM — Cumulative Sum Control Chart, a classical statistical process control technique — to detect exactly that: a sustained departure from "no drift" that accumulates over many small moves rather than one large one.
█ WHAT IT DOES
Tracks two running sums of log returns — one for upward drift, one for downward — and flags a directional regime once the accumulated drift breaches a volatility-scaled threshold. Colours the chart background Bullish or Bearish Drift accordingly, plots the two accumulating sums against their threshold lines in a dedicated pane, and shows a table with the current state, how long price has been in it, and historical base rates (average forward return and win rate) for each state.
█ THE THEORY BEHIND IT
CUSUM was developed by E.S. Page in 1954 for detecting a persistent shift in a manufacturing process mean — the same statistical question as "has this market started drifting in a new direction," just applied to price instead of a factory line. The key property that separates it from a moving average or a single-bar threshold: CUSUM accumulates. A string of small, consistent moves in one direction builds up and eventually crosses the detection threshold, even if no individual bar looks remarkable. Pure noise — moves that cancel out — never accumulates at all, because a small "allowance" is subtracted from every observation before it's added to the running sum.
Critically, the reference point CUSUM measures departure from is fixed at zero, not a rolling average of the same series. A rolling mean would chase the trend and cancel out the very drift being measured — anchoring at a fixed "no drift" baseline is what makes the classical test work.
█ HOW IT IS CALCULATED
1. Compute log returns of the selected source.
2. Estimate sigma — the rolling standard deviation of those log returns over the Window Length — as the local noise scale.
3. Two running sums accumulate each bar:
S+ = max(0, S+ prev + (log return − k)) — accumulates upward drift
S− = min(0, S− prev + (log return + k)) — accumulates downward drift
where k (the Drift Allowance) is a small multiple of sigma, subtracted out so ordinary noise never builds a signal.
4. When S+ crosses above the threshold h (a larger multiple of sigma), a sustained upward drift is declared, the background flips Bullish, and S+ resets to zero to begin monitoring fresh. S− works symmetrically for downward drift.
5. Between detections, the classification holds — this is deliberate persistence, not a bug: CUSUM is built to answer "has the regime changed," not to flicker every bar.
Classification occurs ONLY on confirmed bar close — the plotted sums, the background colour and the table all update together, so nothing here can disagree mid-bar or flip back and forth as the current bar forms.
█ SETTINGS & CONFIGURATION
• Source (default close)
• Window Length (default 14) — rolling window for the sigma (noise-scale) estimate
• Decision Threshold h (default 2.0σ) — how much accumulated drift is required before a regime shift is declared
• Drift Allowance k (default 0.2σ) — moves smaller than this are subtracted out and never accumulate
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table position and colours are fully configurable; the main-chart background painting can be toggled off if you only want the CUSUM pane
█ HOW TO USE IT
Use it as a slow-drift filter alongside faster tools, not as a standalone entry trigger. Because CUSUM only flips after drift has genuinely accumulated, it tends to confirm a regime later than a fast oscillator but with fewer false starts in choppy conditions — the trade-off is lag for reliability. Check the base-rate table's sample count before treating any single state as meaningfully predictive.
Works on any asset and timeframe with sufficient history for the Window Length.
█ LIMITATIONS
• CUSUM detects a PERSISTENT departure from zero drift, not a magnitude or overbought/oversold level. Any use of it as a precise reversal forecast is a misuse.
• The fixed zero reference is directional-agnostic to any trend that existed before the current accumulation window began — it only measures drift accumulated since the last reset.
• h and k are both expressed in sigma multiples; a poorly-fit Window Length will misclassify ordinary volatility as drift, or vice versa.
• Resets on trigger mean the tool can flip again quickly after one large accumulation event, then need to rebuild before flipping a second time.
• Historical base-rate stats need a meaningful sample count (check N) before being trusted, especially in a low-frequency-flip regime or on a short history.
• This script does NOT repaint. All classification updates on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any drift state does not indicate future results. Trade at your own risk.
Gösterge

Gösterge

BTC IV Term Structure (60D - 30D)This indicator measures the spread between Bitcoin's 60-day implied volatility and its 30-day implied volatility. When the spread is positive (contango), the market is pricing more uncertainty further out than near-term, which is the default, calm-market state. When the spread goes negative (backwardation), near-term fear has overtaken longer-term fear, which typically signals a stress event is actively unfolding, whether that's a sharp selloff, a macro catalyst, or a liquidation cascade working through the market.
The histogram color tells you the regime at a glance. Teal means contango, red means backwardation. The intensity matters too: a bright bar means the spread is outside the rolling mean plus or minus one standard deviation band, which flags a statistically extreme reading rather than just a directional one. Those extremes are where the indicator earns its keep. A deep red bar at an extreme low is the market pricing in panic, and historically those episodes tend to mean revert once the catalyst clears. A bright teal bar at an extreme high signals the opposite, complacency that can precede a volatility expansion.
The EMA line smooths the raw spread and is the cleanest signal to watch for regime transitions. A crossover from below zero to above zero (or vice versa) marks the point where the term structure has flipped regimes. Crossovers that happen at or near the band extremes carry more weight than crossovers near the mean. The percentile rank label on the last bar gives you immediate context: a reading in the 10th percentile means the spread is as compressed as it has been roughly 90% of the time over the past year, which is a meaningful signal on its own.
The most practical use is as a filter layered on top of an entry signal from another strategy. When backwardation is at an extreme and your directional indicator is signaling a long, the IV structure is corroborating the setup, the market is fearful and mean reversion conditions are favorable. When the spread is in extreme contango and everything looks calm, that is often the wrong time to be adding aggressive long exposure, because volatility tends to be cheapest right before it expands. Use this indicator to contextualize risk environment, not as a standalone entry trigger. Gösterge

Momentum Rotor | Basket Breakout & Leadership RotationWhat it does
Momentum Rotor ranks a basket of correlated symbols (default: AAPL, MSFT, NVDA, GOOGL, AMZN, META, TSLA, AVGO — fully user-editable) by N-bar rate-of-change momentum, recalculated every bar via request.security(). It only opens a long position on the chart's own symbol when that symbol is simultaneously the strongest performer in the basket (rank #1 by momentum) and breaking its own N-bar price high. If the held symbol later loses the #1 rank to another basket member, the strategy closes the position — it "rotates out" of a fading leader rather than holding through a reversal.
Core features
Live leaderboard table — ranks the full basket by momentum every bar, with gradient-colored scores and trend glyphs (↑/↓) so you can see who's strengthening or fading at a glance
Regime/leadership dashboard — shows your symbol's current rank, how many bars the leader has held the top spot, and basket-wide breadth (% of symbols with positive momentum) as a quick risk-on/risk-off gauge
Risk-based position sizing — position size is calculated from a fixed % of equity risked against an ATR-based stop distance, not a fixed share count
ATR stop + R-multiple take-profit — stop distance and profit target both scale with volatility instead of using static price offsets
Optional rotation-confirmation filter — require the leader to lose #1 rank for N consecutive bars before exiting, to reduce whipsaw from brief rank flickers
Optional regime filter — require price above a long SMA before taking new entries, to avoid trading breakouts in a broader downtrend
Realistic backtest defaults — includes commission, slippage, and margin settings out of the box rather than assuming frictionless, infinite-leverage fills
How the strategy works
Each bar, the script pulls the N-bar ROC (rate of change) for every symbol in the basket and sorts them from strongest to weakest. Your chart's symbol only becomes eligible to trade when it holds rank #1 and closes above its own N-bar high — combining a relative-strength filter with an absolute breakout trigger, so entries require both "stronger than its peers" and "breaking out on its own chart" to align. Exits are twofold: an ATR stop/target pair from the entry, and a rotation exit that closes the trade the moment (or, with the confirmation filter on, N bars after) another basket member overtakes it in the momentum ranking.
What makes it distinct
Most retail breakout scripts evaluate a single symbol in isolation. Momentum Rotor brings relative-strength rotation — a concept used by institutional sector/factor rotation strategies — into a single-chart script by polling an entire basket with request.security() and gating trade eligibility on relative rank, not just absolute price action. The live leaderboard turns that ranking process into something visible and auditable on the chart itself, rather than a black-box filter.
Tips for use
Chart the strategy on one of the basket's own symbols (or add your target symbol to the basket inputs) — the "am I #1" check only works when your chart's ticker matches a basket entry
This instance only manages a position on its own chart's symbol; it does not automatically route orders to whichever symbol becomes the new leader. To rotate capital across the whole basket, run separate instances on each symbol
Momentum/breakout systems are inherently prone to false breakouts and whipsaws in choppy markets — the optional regime filter and rotation-confirmation delay are there to dampen that; test both on/off for your instrument and timeframe
Sector ETFs (lower dispersion, steadier trends) and mega-cap tech names (higher dispersion, sharper momentum swings) behave differently in this framework — adjust lenMom/lenBreak accordingly
Backtest results depend heavily on commission, slippage, and margin assumptions set in Properties — review and adjust these to match your actual broker before drawing conclusions
Limitations
This is an educational strategy template, not a production-ready system or financial advice. It has not been optimized or validated for any specific instrument, timeframe, or market regime. Past performance in this backtest does not indicate future results. Strateji
