Zeiierman Trend Pressure (Zeiierman)█ Overview
Zeiierman Trend Pressure (Zeiierman) is a multi-layer trend pressure and exhaustion oscillator designed to visualize short-term momentum, persistent trend structure, directional pressure, and exhaustion states within a normalized 0 to -100 range.
Instead of relying on a single oscillator calculation, the indicator separates market behavior into three distinct components:
• Z-Pulse = fast reactive pressure
• Z-Trend = slower macro-weighted trend pressure
• Pressure Core = broader directional pressure and regime structure
Z-Pulse reacts quickly to changes in local range position, while Z-Trend blends fast, structural, and macro range measurements with a strong weighting toward the longer-term trend. The Pressure Core then evaluates candle position, candle body, wick behavior, and recent impulse to provide an additional view of directional pressure.
The indicator also contains a persistent Pressure Exhaustion model. When both Z-Pulse and Z-Trend reach an extreme region, an exhaustion state can become active. Instead of disappearing immediately when either line moves slightly away from the extreme, the state uses confirmation and release logic to remain active until pressure has meaningfully weakened.
Pressure Core coloring identifies the broader directional environment:
• Core Bull = positive directional pressure
• Core Bear = negative directional pressure
• Core Neutral = mixed or insufficient directional pressure
Dots show active pressure states, while triangles identify the beginning of an upper or lower pressure event. Price boxes can also be projected directly onto the chart while an exhaustion state remains active.
█ How It Works
⚪ Z-Pulse
Z-Pulse is the indicator's fast component. It first measures where the current close sits inside the recent price range using a Williams-style normalized range calculation.
rangePosition = 100 * (close - highest) / (highest - lowest)
A stochastic transformation of this fast range reading is then blended back into the original value.
Z-Pulse Raw =
rangePosition * 0.72
+ stochasticPulse * 0.28
The result is smoothed with an EMA to create Z-Pulse. This gives the indicator a responsive line that can quickly detect changes in local market pressure while staying within the 0 to -100 oscillator range.
⚪ Z-Trend
Z-Trend is designed to represent the more persistent side of market pressure.
Three normalized range measurements are calculated using the Pulse Range, Trend Range, and Macro Trend lengths. These readings are combined using fixed internal weights, with the macro component receiving the largest influence.
Z-Trend Target =
Fast Range * 0.10
+ Trend Range * 0.18
+ Macro Range * 0.72
The engine then measures agreement between the three range layers and the efficiency of recent price movement.
When the market is moving efficiently and the range layers agree, Z-Trend becomes more resistant to short counter-trend movements. Persistent occupation of the upper or lower oscillator region also increases the Trend Persistence effect.
This makes Z-Trend slower and more stable than Z-Pulse, allowing it to represent the underlying directional structure instead of reacting to every short-term fluctuation.
⚪ Pressure Core
Pressure Core measures each candle's internal structure relative to a larger price range.
It combines five components:
• closing location inside the range
• average candle location
• candle-body direction
• upper versus lower wick pressure
• recent five-bar price impulse
pressure =
closeLocation * 0.42
+ meanLocation * 0.23
+ bodyBias * 0.13
+ wickBias * 0.12
+ impulse * 0.10
A reactive pressure model and a slower regime model are then combined using the Regime Weight setting.
Pressure Core =
Regime Pressure * Regime Weight
+ Reactive Pressure * (1 - Regime Weight)
This creates a third view of market pressure that is independent of the Z-Pulse / Z-Trend relationship.
⚪ Pressure Exhaustion
Pressure Exhaustion begins when both Z-Pulse and Z-Trend occupy the same extreme region.
upperPressure = Z-Pulse >= upperLevel
and Z-Trend >= upperLevel
lowerPressure = Z-Pulse <= lowerLevel
and Z-Trend <= lowerLevel
The state does not use a simple one-bar threshold cross. It includes entry confirmation and a separate release distance so temporary fluctuations do not immediately terminate a persistent pressure state.
This creates a hysteresis effect, where entry and release conditions are intentionally different.
At normal and higher sensitivity settings, both Z-Pulse and Z-Trend must move away from the extreme before the state is released. At the lowest sensitivity settings, the state is deliberately allowed to become much less stable.
█ How to Use
Zeiierman Trend Pressure can be used in three main ways: Trend Trading, Continuation Trading, and Reversal Trading.
Z-Pulse reacts faster to short-term changes in pressure, while Z-Trend shows the slower and more persistent trend direction. Pressure Core can then be used as an additional confirmation of the broader market bias.
⚪ Trend Trading
Use Z-Trend and Pressure Core to identify the main directional environment.
When Z-Trend is holding in the upper half of the oscillator and Pressure Core is Bull-colored, bullish pressure is dominant. This favors looking for long setups.
When Z-Trend is holding in the lower half , and Pressure Core is Bear-colored, bearish pressure is dominant. This favors looking for short setups.
⚪ Continuation Trading
For continuation setups, look for temporary pullbacks within an already established trend.
• Bullish Continuation Setup
During a bullish trend, Z-Trend and Pressure Core should remain bullish while Z-Pulse temporarily moves lower. This shows that short-term pressure has weakened, but the broader trend structure is still intact.
• Z-Trend remains bullish
• Pressure Core remains Bull-colored
• Z-Pulse drops lower during the price pullback
• Z-Pulse then turns higher again
• Price begins continuing in the direction of the broader bullish trend
• Bearish Continuation Setup
During a bearish trend, Z-Trend and Pressure Core should remain bearish while Z-Pulse temporarily moves higher. This shows that short-term pressure has strengthened against the trend, but the broader bearish structure is still intact.
• Z-Trend remains bearish
• Pressure Core remains Bear-colored
• Z-Pulse temporarily pushes higher during a price bounce
• Z-Pulse then turns lower again
• Price begins continuing in the direction of the broader bearish trend
The important distinction is that Z-Pulse is allowed to move against the trend temporarily. That is the pullback. As long as Z-Trend and Pressure Core remain aligned with the broader direction, the move can be treated as a potential continuation setup rather than a full trend reversal.
⚪ Reversal Trading
The pressure boxes highlight areas where the market has remained under extreme directional pressure for a period of time.
The box itself shows the price range formed while the pressure state is active. The triangle at the end of the box marks the Pressure Release, which is the important confirmation for a potential reversal.
• Bullish Reversal
A blue box forms when Z-Pulse and Z-Trend remain under strong downside pressure.
While the box is active, bearish pressure is still present, so the box alone is not a buy signal.
When the blue triangle appears, the Lower Pressure state has been released. This shows that downside pressure is weakening and can mark a potential bullish reversal area.
• Blue Box = downside pressure is active
• Blue Triangle = downside pressure has released
• Bearish Reversal
A red box forms when Z-Pulse and Z-Trend remain under strong upside pressure.
While the box is active, bullish pressure is still present, so the box alone is not a sell signal.
When the red triangle appears, the Upper Pressure state has been released. This shows that upside pressure is weakening and can mark a potential bearish reversal area.
• Red Box = upside pressure is active
• Red Triangle = upside pressure has released
The key idea is to wait for the pressure release rather than trying to predict the reversal while the box is still developing.
█ Settings
Pulse Range: Controls the primary range window used by Z-Pulse.
Pulse Stochastic: Controls the stochastic transformation applied to the fast range reading.
Pulse Smoothing: Controls EMA smoothing of Z-Pulse. Higher values create a smoother and slower response.
Trend Range: Controls the medium-term structural range used by Z-Trend.
Macro Trend: Controls the longest range component used by Z-Trend. This component has the largest internal weighting.
Trend Smoothing: Controls the final smoothing of Z-Trend.
Trend Persistence: Controls how strongly persistent occupation of an extreme region influences Z-Trend.
Exhaustion Zone: Controls the base location of the upper and lower pressure regions.
Sensitivity: Controls exhaustion selectivity, confirmation, release distance, and state persistence. Lower values are looser and more inconsistent, while higher values are stricter and more persistent.
Reactive Smoothing: Controls smoothing of the reactive component inside Pressure Core.
Regime Weight: Controls how much influence the slower Pressure Core regime receives relative to reactive pressure.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indikator

EMA + RSI + VWAP Targets🚀 EMA + RSI + VWAP Trading Indicator | Smart Buy & Sell Signals
Trade with confirmation, not guesswork. 📊
This indicator combines EMA trend direction, RSI momentum, and VWAP price positioning into one clean trading system designed to help identify potential BUY and SELL opportunities.
🔥 Key Features:
🟢 BUY & 🔴 SELL signals
📈 EMA trend filter
⚡ RSI momentum confirmation
🎯 VWAP market positioning
🎯 Automatic Target 1, Target 2 & Target 3
🛑 Configurable Stop Loss
🔔 BUY/SELL alerts
👀 Clean and easy-to-read chart
⚙️ Customizable settings for different markets and timeframes
💡 How it works:
BUY signals look for bullish conditions when price is above the EMA and VWAP with RSI confirmation.
SELL signals look for bearish conditions when price is below the EMA and VWAP with RSI confirmation.
🎯 Multiple targets help you plan potential trade exits, while the configurable Stop Loss helps define risk.
Perfect for traders looking for a simple, confirmation-based approach across crypto, forex, stocks, and other markets.
⚠️ Disclaimer: This indicator is an analytical tool, not financial advice. No indicator can guarantee profits. Always use proper risk management and test the settings on your market and timeframe before trading live.
⭐ Like, follow, and share if you find this indicator useful! Indikator

Indikator

24-hour Volumeoppock Curve Multi-Filter is a trend and momentum-based indicator designed to identify potential high-probability Long and Short opportunities. It combines the Coppock Curve with multiple confirmation filters to determine market bias and provides visual Entry, Stop Loss, TP1, TP2 and TP3 levels.
Use the indicator alongside market structure, support/resistance and price action for confirmation. It is designed as a decision-support and risk-management tool, not a guaranteed signal generator. Always apply proper risk management.
If you want, I can also write you a much more professional TradingView publication description with sections like “How It Works,” “Buy Conditions,” “Sell Conditions,” “Risk Management,” and “Settings,” tailored specifically to your script.
Indikator

FCP | Market Pulse | Multi Symbol Volatility ScannerMarket Pulse ranks up to 40 symbols by how violent their current candle is relative to their own recent behaviour.
THE METRIC
For every symbol on a fixed scan timeframe:
ratio = (high − low) / ATR(14)
The ATR is read from the previous bar, so an explosive candle cannot inflate its own baseline and cancel itself out. Because the range is divided by that symbol's own ATR, the number is unitless — a 2.5 on EURUSD and a 2.5 on BTCUSDT mean the same thing. One threshold works for FX, indices, metals and crypto at once, which a pip- or percent-based filter cannot do.
A symbol is listed when its ratio reaches the trigger multiple. Anything below it is ignored, so the panel stays empty most of the time and only fills up when something is actually happening.
READING THE PANEL
SYMBOL — the live scan period, sorted by ratio, strongest first
PREVIOUS — the same list for the last closed period, so a chart opened mid-period still shows what just moved
xATR — how many times its own average range the candle has covered
CHG% — direction and size of the move, (close − open) / open
▲ ▼ — green for an up candle, red for a down candle
"quiet" means nothing crossed the threshold. That is the normal state.
Nothing is stored between periods. A symbol drops off by itself as soon as it cools down, and markets that are closed are excluded so a frozen quote is never reported as a live burst.
SETTINGS
Scan timeframe — every symbol is measured on this timeframe regardless of the chart. Keep the chart at the same timeframe or lower.
ATR length — default 14.
Trigger at N x ATR — 2.0 to 2.5 catches ordinary bursts, 5 catches only major shocks.
Symbols — 40 slots, each a checkbox plus a symbol picker. Untick a slot to drop it from the panel and the alert. Retarget any slot to your own data provider.
ALERTS
Create the alert with "Any alert() function call". One alert fires per closed scan bar and lists every symbol over the threshold, in the same order the panel shows them.
The Telegram JSON option formats the message as a ready-to-post sendMessage payload. Enter your own chat id, then point the alert webhook at the Telegram sendMessage API endpoint for your bot.
Webhooks require a paid TradingView plan with two-factor authentication enabled. Your bot token lives only in the webhook URL — it is never part of this script. Never share it or screenshot the alert dialog; if it leaks, revoke it in BotFather.
Turn the option off if you route alerts through your own relay server instead.
LIMITS
40 symbols is a hard ceiling — Pine allows no more than 40 data requests per script. Indikator

On Balance VolumeOverview
This indicator is based on On Balance Volume (OBV) and is designed to analyze the relationship between price and volume, helping traders identify potential accumulation, distribution, trend confirmation, and changes in volume flow.
In addition to the traditional OBV, the indicator allows users to apply different moving-average types to smooth the OBV and, optionally, add Bollinger Bands around the smoothed OBV.
The indicator also uses dynamic colors, making it easier to visually identify the direction of both the OBV and its moving average.
1. On Balance Volume (OBV)
OBV accumulates or subtracts volume according to price movement:
If the current closing price is higher than the previous close, volume is added to OBV.
If the current closing price is lower than the previous close, volume is subtracted from OBV.
If there is no change in price, OBV remains unchanged.
Interpretation
Rising OBV:
May indicate increasing buying pressure, accumulation, or confirmation of an uptrend.
Falling OBV:
May indicate increasing selling pressure, distribution, or confirmation of a downtrend.
OBV should not be used in isolation. Combining it with price action, trend structure, support and resistance, and other technical factors may improve the quality of the analysis.
2. OBV Dynamic Colors
The main OBV line uses three colors:
🟢 Green
OBV is increasing compared with the previous period.
This indicates positive volume flow.
🔴 Red
OBV is decreasing compared with the previous period.
This indicates negative volume flow.
🟡 Yellow
OBV has not changed compared with the previous period.
3. Smoothing
The Type setting allows users to apply a moving average to the OBV.
Available options:
None
SMA
SMA + Bollinger Bands
EMA
SMMA (RMA)
WMA
VWMA
Smoothing can be used to reduce short-term fluctuations and make the underlying direction of OBV easier to identify.
4. Moving Average Type
None
No moving average is applied.
Only the original OBV is displayed.
Useful for:
Faster analysis;
Immediate identification of OBV changes;
Traders who prefer raw volume-flow information.
SMA — Simple Moving Average
Calculates the arithmetic average of OBV over the selected number of periods.
Characteristics:
Smoother than the raw OBV;
Slower to react to sudden changes;
Useful for identifying the broader direction of volume flow.
SMA + Bollinger Bands
Applies an SMA to OBV and adds Bollinger Bands.
This option displays:
A central moving average;
An upper Bollinger Band;
A lower Bollinger Band.
The bands help identify periods when OBV is moving relatively far from its recent average.
EMA — Exponential Moving Average
The EMA gives greater weight to recent OBV values.
Characteristics:
Responds faster to changes in OBV;
Useful for short- and medium-term analysis;
Generally more responsive than an equivalent SMA.
SMMA (RMA)
The SMMA/RMA is a smoother moving average designed to reduce short-term fluctuations.
It can be useful for traders who want a more stable view of the underlying OBV trend.
WMA — Weighted Moving Average
The WMA assigns greater weight to more recent values.
It generally responds faster to changes in OBV than an equivalent SMA.
VWMA — Volume Weighted Moving Average
The VWMA weights values according to volume.
Because OBV itself is already volume-based, this option may produce a different smoothing behavior compared with traditional moving averages and should be evaluated according to the trader's strategy.
5. Length
The Length parameter determines the number of periods used to calculate the moving average.
The default value is:
14 periods
Shorter Length
Examples: 5, 9, or 10.
The moving average becomes faster and more sensitive.
Potentially useful for:
Short-term trading;
Faster detection of changes in volume flow;
Scalping and intraday strategies, depending on the market.
However, shorter lengths can also generate more noise and false signals.
Longer Length
Examples: 20, 50, or 100.
The moving average becomes slower and smoother.
Potentially useful for:
Trend analysis;
Swing trading;
Identifying the dominant volume-flow direction.
The longer the length, the greater the delay in reacting to changes in OBV.
6. Moving Average Dynamic Colors
The OBV moving average also changes color dynamically.
🟢 Green
The moving average is rising.
🔴 Red
The moving average is falling.
🟡 Yellow
The moving average is unchanged.
This allows traders to quickly identify the direction of the smoothed OBV.
7. Bollinger Bands
Bollinger Bands are available only when:
Type = SMA + Bollinger Bands
The bands are calculated using the standard deviation of OBV.
The indicator displays:
Upper Bollinger Band
SMA / Middle Band
Lower Bollinger Band
The distance between the bands expands or contracts according to changes in OBV volatility.
8. BB StdDev
The BB StdDev parameter controls the distance of the Bollinger Bands from the moving average.
Default value:
2.0
Lower value
Example: 1.0–1.5.
The bands become narrower.
This increases sensitivity and causes OBV to reach the bands more frequently.
Higher value
Example: 2.5–3.0.
The bands become wider.
This reduces the frequency of band touches and can help highlight more extreme OBV movements.
9. How to Interpret the Indicator
The indicator can primarily be used for four types of analysis:
1. Trend Confirmation
During an uptrend:
Price rising + OBV rising
may indicate volume confirmation of the bullish trend.
During a downtrend:
Price falling + OBV falling
may indicate confirmation of selling pressure.
2. Bullish Divergence
A potential bullish divergence occurs when:
Price makes lower lows while OBV makes higher lows.
This may indicate weakening selling pressure and a possible loss of bearish momentum.
3. Bearish Divergence
A potential bearish divergence occurs when:
Price makes higher highs while OBV makes lower highs.
This may indicate weakening buying pressure.
Important: Divergences do not guarantee a reversal. They should be considered warning signals and ideally confirmed by price action or other technical factors.
10. Using Bollinger Bands on OBV
When Bollinger Bands are enabled, they can help identify unusual movements in volume flow.
OBV near or above the Upper Band
May indicate an unusually strong positive OBV movement relative to its recent average.
OBV near or below the Lower Band
May indicate an unusually strong negative OBV movement.
However, touching or crossing a Bollinger Band does not automatically mean buy or sell.
During strong trends, OBV may remain near one of the bands for extended periods.
11. Suggested Settings
There is no universally optimal configuration. The appropriate settings depend on the asset, timeframe, volatility, and trading strategy.
Short-Term Analysis
A possible starting configuration:
Type: EMA
Length: 9 or 14
This provides a faster response to changes in OBV.
Medium-Term Analysis
A possible starting configuration:
Type: SMA
Length: 20
This provides a balance between responsiveness and smoothing.
Longer-Term Trend Analysis
A possible starting configuration:
Type: SMA
Length: 50
This provides greater smoothing and reduces sensitivity to short-term fluctuations.
Bollinger Band Analysis
A possible starting configuration:
Type: SMA + Bollinger Bands
Length: 20
BB StdDev: 2.0
These settings are reference points for testing and are not investment recommendations.
12. Practical Usage
One possible approach is to use the indicator together with price structure.
Potential Bullish Setup
Look for a combination such as:
Price showing a bullish market structure;
OBV rising;
OBV moving average turning green;
OBV confirming upward price movements;
A breakout or recovery of an important price level.
Potential Bearish Setup
Look for a combination such as:
Price showing a bearish market structure;
OBV falling;
OBV moving average turning red;
OBV confirming downward price movements;
A breakdown or rejection of an important price level.
The indicator is best used as a confirmation tool, rather than as the sole reason to enter a trade.
13. Recommended Starting Configuration
For traders who are new to the indicator, a simple starting configuration is:
Type: SMA
Length: 14
Then compare it with:
Type: EMA
Length: 14
Observe which configuration better represents the behavior of the asset and timeframe being analyzed.
For Bollinger Band analysis:
Type: SMA + Bollinger Bands
Length: 20
BB StdDev: 2.0
14. Important Notes
OBV is a cumulative indicator. Therefore, its absolute values can vary significantly depending on the available historical data and the asset being analyzed.
Signals should be interpreted in the context of:
Market trend;
Price structure;
Support and resistance;
Volume;
Volatility;
Timeframe;
Overall market conditions.
No parameter should be considered universally superior.
It is recommended to test different configurations using historical data, Bar Replay, and paper trading before applying any strategy to live trading.
This indicator is a technical analysis tool and does not constitute financial, investment, or trading advice. Indikator

Macro Regime Dashboard█ OVERVIEW
Macro Regime Dashboard is a market-timing checklist for US equities. It evaluates five regime conditions on every daily bar: elevated volatility, a non-rising Fed policy rate, contracting margin debt, the presence of a leading sector, and earnings confirmation from bellwether stocks. It plots the count of conditions met as a stepline in a separate pane, renders a live checklist table, and marks the bars where all conditions and the enabled fail-safes align. The thesis: durable market bottoms tend to form when fear is high, the Fed is not tightening, leverage has been flushed, and a leading theme keeps delivering earnings through the panic.
█ HISTORY / BACKGROUND
The five-condition checklist and its fail-safes are the market-timing framework described by the YouTuber, Defiant Gatekeeper, who distilled it from his buy decisions around volatility spikes. The framework itself synthesizes established concepts: the VIX as a fear gauge, Federal Reserve policy as the dominant liquidity driver, margin debt as a measure of speculative leverage, sector leadership as the engine that attracts institutional capital, and earnings surprises as confirmation that the leading theme is insulated from the broader panic.
The fail-safes address the framework's known failure modes, which the author identifies from historical episodes: leading-sector fundamentals breaking down, systemic accounting fraud destroying trust in reported earnings, a credit freeze that policy easing cannot offset, and inflation high enough to remove the Fed's ability to support asset prices. Two of these are quantifiable and are implemented here as the high-yield credit spread and CPI fail-safes. The concept is his; this Pine implementation, the data-series selections, and the proxy choices are original to this script.
█ HOW IT WORKS
On each daily bar the script requests six external series and evaluates five boolean conditions plus two fail-safes.
Condition 1: Fear. The CBOE Volatility Index (CBOE:VIX) must exceed the threshold input (default 30).
Condition 2: Fed not on an upward trajectory. The effective federal funds rate (FRED:DFF) today must be at or below its value from the lookback number of trading days earlier, with a 0.01 tolerance. The table also flags when the 2-year Treasury yield (TVC:US02Y) sits below the funds rate, indicating that the bond market is pricing cuts; this flag is informational and does not gate the condition. Because the policy trajectory is partly qualitative (guidance, projections), an override input can force this condition to pass or fail.
Condition 3: Margin debt declining. The reference framework uses the monthly FINRA margin debt statistic, which TradingView does not carry. The script substitutes the Federal Reserve Z.1 series for margin accounts at brokers and dealers (FRED:BOGZ1FL663067003Q), requested at 3-month resolution. The condition passes when the latest quarterly value is below the prior quarterly value.
Condition 4: Leading sector. The script loops over eleven S&P sector ETFs plus a semiconductor ETF, computes each one's return over the lookback window, and subtracts the SPY return over the same window. The strongest relative-strength value must exceed the threshold input (default 3 percentage points over 63 days). The table names the current leader.
Condition 5: Bellwether earnings beats. For up to three user-selected bellwether symbols representing the leading theme, the script pulls reported and estimated earnings per share through the earnings request feed and marks a beat when actual is at or above estimate for the most recent report. The condition passes when a majority of the symbols with available data beat. When no earnings data exists for any bellwether, the condition passes neutrally rather than failing, so that missing history does not veto the count. An override input can force this condition either way.
Fail-safes. The ICE BofA US High Yield Option-Adjusted Spread (FRED:BAMLH0A0HYM2) must sit below its threshold (default 10 percent), and CPI year-over-year, computed from FRED:CPIAUCSL as the ratio of the monthly index to its value twelve months earlier, must sit below its threshold (default 2.5 percent). Each fail-safe passes when its data is unavailable. Two toggle inputs decide whether each fail-safe vetoes the composite signal or only displays as a warning. By default the credit fail-safe gates and the CPI fail-safe warns.
Composite. The buy state is true when all five conditions hold and every enabled gate is clear. The script plots the raw condition count (0 to 5) as a stepline, draws a dotted horizontal reference at 5, shades the pane background green while the buy state is active, and prints a green triangle on the first bar of each signal window. A table in the top right shows each condition's current value and pass state, both fail-safe readings, and a composite verdict row. Two alerts are provided: one on the first bar of a new buy signal, and one when the credit spread crosses above its threshold.
█ HOW TO USE
Apply the indicator to a broad US index such as SPX or SPY on the daily timeframe . All inputs and thresholds are calibrated to daily bars; the conditions describe the whole market, so the chart symbol only supplies the bar grid.
Read the stepline as regime pressure. A count of 3 or 4 during a selloff means the setup is forming; a touch of 5 with the background shading and a triangle means every condition and enabled gate aligned on that bar. A count of 5 without shading means a fail-safe is blocking, which is exactly the bull-trap situation the fail-safes exist to flag. The table gives the per-condition diagnosis at a glance.
Using the dashboard in tandem with the Stock Screener
The dashboard times entry and sizing. It does not select stocks. The reference framework pairs it with a fundamental selection layer keyed to the liquidity regime, and most of that layer maps directly onto TradingView's Stock Screener fields: revenue growth, EPS growth, forward price-to-earnings, and debt to EBITDA. The workflow:
Determine the liquidity quadrant. The dashboard's Fed condition covers the rate trajectory. Check the Fed balance sheet direction separately by charting FRED:WALCL: rising means expansion, falling means contraction.
Rate falling and balance sheet rising (maximum liquidity): screen for revenue growth above 50 percent and ignore valuation and leverage fields. Unprofitable hypergrowth is the target profile in this quadrant.
Mixed quadrants (one lever easing, one tightening): screen for revenue growth in the 10 to 20 percent range, a moderate forward price-to-earnings, and debt to EBITDA below roughly 3 to 5 depending on which lever is easing.
Rate rising and balance sheet falling (minimum liquidity): screen for forward price-to-earnings below 15, debt to EBITDA below 1.5, and positive earnings. Stability over growth.
When the dashboard signals, run the screener preset for the current quadrant, restricted to the leading sector the table names, to surface candidates.
The final validation step in the reference framework, a regression of price-to-earnings against expected EPS growth across roughly ten same-industry peers with an R-squared above 0.8, is not screenable and is performed outside TradingView in a spreadsheet.
█ SETTINGS
VIX threshold (default 30): level the volatility index must exceed for condition 1.
Fed rate lookback (default 63 trading days): comparison window for the funds-rate trajectory in condition 2.
Fed trajectory override (default Auto): forces condition 2 to pass or fail when guidance contradicts the rate proxy.
Sector RS lookback (default 63 days): return window for the relative-strength computation in condition 4.
RS outperformance vs SPY (default 3 percent): margin by which the leading sector must beat SPY.
Bellwether 1, 2, 3 (defaults are three large semiconductor names): symbols whose earnings reports confirm the leading theme. Change these whenever the leading theme rotates.
Earnings override (default Auto): forces condition 5 to pass or fail.
HY OAS max (default 10 percent): credit-spread ceiling for the credit fail-safe.
CPI YoY max (default 2.5 percent): inflation ceiling for the CPI fail-safe.
Credit fail-safe gates signal (default on): when on, an elevated credit spread vetoes the composite signal.
CPI fail-safe gates signal (default off): when on, elevated inflation vetoes the composite signal; when off it displays as a warning only.
█ WHAT MAKES IT ORIGINAL
The script consolidates a cross-asset macro checklist into a single gated, auditable pane: an equity volatility index, the policy rate, the Treasury 2-year, a quarterly flow-of-funds leverage series, sector ETF relative strength, per-symbol earnings surprise data, a credit spread, and a computed inflation rate. Each series exists elsewhere in isolation; the contribution here is the joint evaluation with explicit pass/fail logic, the separation of hard vetoes from soft warnings through the gate toggles, and two implementation choices that make the framework computable on TradingView at all: the Z.1 quarterly margin-account series as a proxy for the unavailable monthly FINRA margin debt statistic, and the earnings-beat condition built from the earnings request feed on user-configurable bellwethers, with missing data treated as neutral rather than as a veto.
█ NOTES / LIMITATIONS
Designed for the daily timeframe on a broad US index. Other resolutions misalign the lookbacks and the higher-timeframe requests; other symbol classes add no information because every condition is market-wide.
The margin-debt proxy is quarterly. Monthly FINRA data can show a deleveraging turn up to one quarter before the Z.1 series reflects it, so condition 3 is the slowest leg and produces a step-shaped response.
Monthly and quarterly requests update when those periods complete. Within a forming month or quarter the CPI and margin readings can change until the period closes.
Earnings history depth varies by symbol and generally thins in earlier years. On older bars condition 5 frequently passes neutrally for lack of data, and the override and bellwether inputs are static across the whole chart, so the plotted historical count is indicative rather than point-in-time. Treat the history as illustration, not as a backtest.
Economic series have distinct start dates, and all external requests ignore invalid symbols. Missing data renders as n/a in the table, fail-safes pass when their series is absent, and a sector whose ticker fails to resolve is silently skipped in the relative-strength scan.
The checklist table reflects the last bar only.
The Fed condition is a proxy for a qualitative judgment. During fast easing cycles the fixed lookback can briefly misread the trajectory, which is what the override input is for.
Indikator

Indikator

Adaptive Range Opportunity Hunter [SMI] v1.3Adaptive Range Opportunity Hunter
This indicator was created as an experimental tool to help identify potential entry opportunities near the end of a trading session, with the intention of evaluating positions that may be held for at least the following trading day rather than relying on frequent same-day scalping.
The underlying idea is simple: instead of evaluating price using a fixed absolute threshold, the script measures where the current price is located inside its own recent local range.
By default, the indicator uses the highest and lowest prices of the previous 40 bars as a local price reference. This value was selected empirically after observing that, on many charts, approximately 40 bars often contain around one or two recent price cycles. It should therefore be understood as a practical local reference rather than a universal cycle length.
The main metric, Distance from Local Low %, represents the normalized position of the current close relative to the lowest price in that local range:
0% means price is at the local low.
3% means price is inside the lowest 3% of the local range.
50% represents approximately the middle of the range.
100% corresponds to the local high.
The complementary Distance from Local High % provides the symmetric measurement from the upper extreme. Both values are continuously displayed so users can experiment with their own thresholds.
The default research condition combines two elements:
SMI <= -40
Distance from Local Low <= 3%
This identifies situations where momentum is in an oversold SMI region while price is simultaneously located very close to the lower extreme of its recent local range.
The 3% threshold is not a predicted loss, stop-loss, or expected downside. It simply describes the price's normalized location within the recent high-low range.
The indicator also calculates a Standardized Benefit to Local High %. This represents the hypothetical percentage distance from the configured lower-range threshold to the current local high. It is intended to help compare simultaneous opportunities between different symbols. It is not an expected return or price target.
Intended use
My initial research use is to review signals near the end of the trading day and evaluate whether the resulting positions can be held into at least the following session. The goal is to explore a slower operational approach than habitual intraday scalping and reduce reliance on repeated same-day round trips.
The indicator exposes both the raw measurements and combined SMI conditions, allowing users to test different ideas such as:
Distance from Local Low below 1%, 2%, 3%, 5%, etc.
Local-range proximity without SMI confirmation.
Local-range proximity combined with SMI oversold conditions.
Symmetric conditions near the local high.
Alerts are included so users can monitor multiple symbols and be notified when a new condition appears.
Experimental status
This is a research indicator, not a trading system and not a recommendation to buy or sell. The default values of 40 bars, 3%, and SMI ±40 are intentionally kept as an initial reference rather than presented as universally optimal parameters.
Community feedback is especially welcome regarding different symbols, markets, timeframes and threshold values. One of the purposes of publishing the script is to evaluate whether the observed behavior remains useful outside the instruments and historical examples used during its development.
Credits
The Stochastic Momentum Index calculation is based on the original TradingView implementation by UCSgears. The original source also credits Surjith S M for part of the overbought/oversold visualization.
This adaptation adds the local rolling-range framework, normalized distance measurements, configurable opportunity conditions, standardized local-range comparison, alerts and dashboard. Indikator

Indikator

Institutional Quant Correlation Grid Suite Slide 1: Title
Institutional Quant Correlation Grid Suite
Pine Script v6 Indicator
Purpose: A professional-grade quantitative analysis tool that evaluates a ticker's relationship to a benchmark (e.g., SPY) across multiple dimensions — correlation, volatility, momentum, and risk-adjusted performance — all presented in an intuitive visual dashboard.
Author: Quant Trading Team
Version: 6.0
Slide 2: Problem Statement & Solution
The Challenge:
Retail traders lack institutional-grade quant tools inside TradingView.
Evaluating a stock's true relationship to the market (or sector ETF) requires looking beyond simple price correlation.
Key metrics (Beta, Alpha, Z-scores, Relative Strength) are scattered across different indicators.
Our Solution:
An all-in-one indicator that computes, visualizes, and alerts on:
Multi-asset correlations (Price, RSI, ATR, Volume, Volume-Weighted)
Risk metrics (Beta, Annualized Alpha)
Mean-reversion signals (Spread Z-Score)
Relative strength momentum (RS Ratio)
Timeframe returns (1D, 1W, 1M)
Automated Buy/Hold/Sell conditions
Slide 3: Core Inputs – Quant Settings
Input Default Description
Lookback Window 30 bars Rolling window for all correlations & statistics. Adjustable 10–500.
Reference Symbol SPY Benchmark ETF. Dropdown includes 40+ sector/thematic ETFs (XLF, SMH, ARKG, GDX, JETS, etc.)
Correlation Metric Close Which data series to screen against the benchmark (Close, Open, High, Low, Volume, RSI, ATR).
Correlation Threshold 0.70 Minimum absolute correlation to be considered "aligned".
Z-Score Extremes Threshold 2.00 Level at which the spread is considered overextended (mean-reversion signal).
Slide 4: Oscillator & Indicator Parameters
The suite uses standard technical indicators for its multi-dimensional analysis:
Indicator Parameter Default
RSI Length 14
MACD Fast / Slow / Signal 12 / 26 / 9
Stochastic Length / Smooth 14 / 3
CCI Length 20
Williams %R Length 14
ATR Length 14
These are used to compute correlations across different market regimes (momentum, volatility, volume) — not just price.
Slide 5: Core Calculations – Correlation Suite
The indicator computes 6 distinct correlation metrics against the reference symbol over the lookback window:
Correlation Methodology
Price Corr Standard Pearson correlation of Close prices.
Selected Metric Corr Correlation of the user-chosen metric (e.g., RSI, Volume) against the benchmark's equivalent.
RSI Corr Correlation of RSI values.
ATR Corr Correlation of Average True Range (volatility alignment).
Volume Corr Correlation of raw volume (detects relative liquidity/interest).
VW-Corr Volume-Weighted correlation — weights daily returns by volume, giving more importance to high-volume days.
Slide 6: Core Calculations – Risk & Performance
Beta & Alpha (Annualized)
Beta = Covariance(asset, benchmark) / Variance(benchmark)
Alpha = (Mean_Asset_Return - Beta × Mean_Benchmark_Return) × 100 × 252
Interpretation: Beta > 1 = higher volatility than benchmark; Alpha > 0 = outperformance.
Relative Strength (RS) Momentum
RS Ratio = Close_Asset / Close_Benchmark
RS Momentum = (RS_Ratio / SMA(RS_Ratio, length) - 1) × 100
Positive = asset is strengthening relative to benchmark.
Spread Z-Score (Mean-Reversion)
Log Spread = ln(Close_Asset / Close_Benchmark)
Z = (Log_Spread - Mean(Log_Spread)) / StdDev(Log_Spread)
Extreme positive = asset is overextended vs benchmark (sell signal).
Slide 7: Grid 1 – Quant Heatcard (Visual Dashboard)
Position Options: 9 positions (Top/Bottom + Left/Center/Right)
Text Size: Tiny, Small, Normal
Top Row (6 cards):
Card Display Color Logic
Beta Value vs 1.0 Green if ≥ 1.0
Alpha (Ann.) Annualized % Green if positive, Red if negative
Price Corr Correlation Green if ≥ threshold
VW-Corr Volume-Weighted Corr Gold if ≥ threshold
RS Momentum % vs benchmark Green if positive, Red if negative
Spread Z-Score Z value Gold if ≥ Z-threshold (overextended)
Slide 8: Grid 1 – Quant Heatcard (Continued)
Bottom Row (6 cards):
Card Display Color Logic
Return 1D % change Green if positive, Red if negative
Return 1W % change (weekly close) Green if positive, Red if negative
Return 1M % change (monthly close) Green if positive, Red if negative
Quant Signal "ALPHA PASS" or "NEUTRAL" PASS if: corrClose ≥ threshold AND RS Momentum > 0 AND Beta > 0.8
Benchmark Symbol text (e.g., "SPY") Cyan highlight
Lookback e.g., "30 bars" Muted display
Slide 9: Grid 2 – Detailed Breakdown Table
Position Options: 9 positions (separate from Grid 1)
Text Size: Tiny, Small, Normal
Row Col 0 Col 1 Col 2 Col 3
Row 0: Correlations Price Corr RSI Corr ATR Corr Volume Corr
Row 1: Structure Beta Alpha Spread Z-Score RS Momentum
Row 2: Selected Metric Selected Metric Name Correlation of Selected Metric PASS/FAIL (≥ threshold) Lookback (e.g., "30B")
Color Coding:
Green = Strong/Positive
Red = Weak/Negative
Cyan = Informational
Gold = Extreme/Warning
Slide 10: Plots & Screener Exports
The indicator also plots directly on the chart pane (below price):
Plot Color Display
Price Correlation (%) Blue (linewidth 2) Main chart pane
VW-Correlation (%) Yellow (linewidth 1) Main chart pane
Threshold Upper/Lower Green/Red dashed lines ±70% bands
Beta Teal Data Window + Status Line
Alpha (%) Green Data Window + Status Line
RS Momentum (%) Purple Data Window + Status Line
Z-Score Orange Data Window + Status Line
Return 1D/1W/1M Purple/Orange/Red Data Window + Status Line
These enable screeners and multi-ticker comparisons using TradingView's Data Window.
Slide 11: Alert Conditions – Automated Signals
The indicator generates 3 distinct alert conditions for automated trading notifications:
Signal Condition
BUY / Accumulation corrClose ≥ threshold AND corrVW ≥ threshold AND RS Momentum > 0 AND Beta > 0.8 AND Z-Score < zThreshold
HOLD / Neutral corrClose ≥ threshold AND RS Momentum ≤ 0.5 AND Z-Score < zThreshold
SELL / Divergence RS Momentum < 0 OR corrClose < 0.20 OR Z-Score ≥ zThreshold
Alert Messages include: Ticker name and clear reasoning (e.g., "High correlation, positive RS momentum against benchmark, and stable Z-score.")
Slide 12: Use Cases & Applications
Scenario How the Indicator Helps
Sector Rotation Compare a stock to sector ETF (e.g., AAPL vs. XLK). High correlation + positive RS = sector leader.
Pair Trading Z-Score tells you when spread is overextended — mean-reversion entry/exit points.
Risk Management Beta tells you if stock is riskier than market; ATR correlation shows volatility alignment.
Factor Screening The "Quant Signal" (ALPHA PASS) quickly flags stocks with strong fundamentals vs benchmark.
Momentum Investing RS Momentum identifies stocks gaining relative strength.
Earnings / Event Analysis 1D/1W/1M returns show immediate impact vs benchmark.
Slide 13: Technical Implementation Highlights
Lookahead Handling: Uses barmerge.lookahead_off for reference security to avoid repainting.
Rolling Windows: All statistics use TradingView's ta.correlation, ta.sma, ta.stdev for consistency.
Volume-Weighted Correlation: Custom computation using volume-weighted returns for more robust correlation.
Dynamic Tables: Uses table.new with position constants, allowing users to place grids anywhere on screen.
Alerts: Built-in alertcondition() for automated strategy integration.
Compatibility: Requires Pine Script v6. Works on all timeframes (1min to monthly).
Slide 14: Customization Options Summary
Group Parameter Options
Core Quant Lookback, Reference Symbol, Correlation Metric, Thresholds 10-500, 40+ ETFs, 7 metrics, 0.05 steps
Grid 1 (Heatcard) Show/Hide, Position, Text Size 9 positions, 3 sizes
Grid 2 (Details) Show/Hide, Position, Text Size 9 positions, 3 sizes
Oscillators RSI, MACD, Stochastic, CCI, Williams, ATR lengths User-adjustable
Result: A fully configurable tool adaptable to any trading style — from day trading to long-term investing.
Slide 15: Demonstration – Example Output
Ticker: AAPL
Benchmark: SPY
Lookback: 30 bars
Metric Value Signal
Beta 1.12 High volatility
Alpha +2.3% Positive outperformance
Price Corr 0.85 Strong alignment
VW-Corr 0.81 Volume-confirmed correlation
RS Momentum +1.2% Gaining relative strength
Z-Score +0.45 Within normal range
Quant Signal ALPHA PASS Bullish
Alert: BUY condition triggered.
Slide 16: Summary & Value Proposition
What this indicator delivers:
✅ Institutional-grade quant dashboard in a single script
✅ Multi-dimensional analysis — not just price, but volatility, volume, momentum, and risk
✅ Visual clarity with two customizable data grids
✅ Actionable alerts for systematic trading
✅ Screener-ready outputs via Data Window
✅ Fully configurable to fit any strategy or timeframe
Ideal for: Swing traders, sector rotators, pair traders, risk managers, and quantitative researchers using TradingView.
FOR EDUCATIONAL PURPOSES ONLY
NOT A FINANCIAL ADVICE Indikator

New Highs/Lows Market BreadthNew Highs/Lows Market Breadth
This indicator is intended as a daily market breadth and participation tool. It is most useful for confirming the internal strength or weakness behind U.S. equity market price trends, monitoring changes in breadth momentum, and identifying periods when participation is expanding or contracting.
New Highs/Lows Market Breadth measures the difference between the number of securities making new highs and new lows across several major U.S. indices and exchanges.
The core calculation is:
Net Breadth = New Highs − New Lows
Positive readings indicate that new highs are outnumbering new lows, while negative readings indicate that new lows are dominating. This provides a view of participation beneath the surface of the market and can help identify strengthening or deteriorating internal conditions that may not be obvious from price alone.
Market Universes
The indicator supports multiple breadth universes from a single dropdown:
Indices
Nasdaq Composite
Nasdaq 100
S&P 500
Exchanges
NYSE
AMEX
Nasdaq
NYSE + AMEX + Nasdaq combined
The combined exchange option sums the new-high and new-low counts from all three exchanges before calculating Net Breadth, providing a broader measure of U.S. exchange-level participation.
Lookback Periods
Breadth can be evaluated using:
1 Month
3 Months
6 Months
52 Weeks
These selections refer to the lookback used to define a new high or new low, not the chart timeframe. For example, the 1 Month setting measures securities making new one-month highs and lows during the applicable trading session.
Shorter lookbacks generally respond more quickly to changes in participation, while longer lookbacks provide a broader view of intermediate- and long-term market strength or weakness.
Breadth Display
By default, the indicator plots Net New Highs/Lows as a column histogram around the zero line.
The entire Highs/Lows histogram can be disabled independently. This allows the indicator pane to display only the moving average, background condition, or other enabled components.
An optional Display Highs and Lows Separately setting replaces the net histogram with separate positive columns for new highs and negative columns for new lows. This makes it easier to see whether changes in Net Breadth are being driven by expanding highs, expanding lows, or both.
Moving Average
An optional moving average can be applied directly to Net New Highs/Lows to smooth short-term fluctuations and make changes in breadth direction easier to identify.
Available moving average types include:
SMA
EMA
WMA
RMA
Length, line width, and color are customizable.
The moving average can also be colored according to its slope:
Rising MA = user-defined rising color
Falling MA = user-defined falling color
Flat MA = default MA color
Slope coloring focuses on whether breadth momentum is improving or deteriorating rather than simply whether breadth is above or below zero.
For example, Net Breadth can remain negative while its moving average begins rising. This indicates that internal conditions are improving even though new lows may still exceed new highs. Conversely, a falling moving average above zero can indicate weakening participation before Net Breadth becomes negative.
Background Breadth Streaks
An optional background highlight identifies sustained periods of positive or negative Net Breadth.
The number of consecutive bars required to activate the background is user-defined, with 3 bars as the default.
Once the selected threshold is reached:
Consecutive positive Net Breadth bars activate the positive background color.
Consecutive negative Net Breadth bars activate the negative background color.
The background remains active while the qualifying streak continues.
This feature is designed to distinguish persistent breadth conditions from isolated positive or negative readings.
Highs/Lows Table
An optional table displays the current number of securities making Highs and Lows for the selected market universe and lookback period.
This provides the underlying counts behind the Net Breadth calculation without requiring the Highs/Lows histogram to remain visible.
Confirmed Bars and Repainting
Repaint is disabled by default.
With Repaint disabled, the indicator displays only confirmed chart bars. This applies to the breadth plots, moving average, background conditions, and table updates.
Enabling Repaint allows the current unconfirmed chart bar to update as incoming data changes. Values displayed on an open bar can therefore change until that bar is confirmed.
Usage and Limitations
Use a standard 1-day chart for the intended calculation. The underlying TradingView New High/New Low market-statistics series used by this indicator are daily-session breadth data. The indicator requests those series using the chart's current timeframe, so 1D is the recommended and intended chart timeframe.
Intraday timeframes are not recommended. The source breadth series are based on daily market statistics rather than true intraday New High/New Low counts. Depending on the selected source and data availability, intraday charts may show unavailable, repeated, incomplete, or otherwise misleading values.
Weekly and monthly charts change the meaning of the display. Because the script requests the breadth source at the chart timeframe, using a weekly or monthly chart does not produce the same bar-by-bar series as a daily chart. Moving-average length and consecutive-background settings will also operate on weekly or monthly bars rather than trading days. Use 1D when you want the indicator to behave as designed.
Use a time-based chart rather than synthetic/non-time-based chart types. Standard candles, bars, or lines on a daily timeframe provide the clearest alignment with the daily breadth source data. Renko, Range, Kagi, Point & Figure, and similar synthetic chart types can distort the relationship between chart bars and daily breadth observations.
Repaint should normally remain disabled for confirmed analysis. Enabling it allows the current unconfirmed chart bar to change before closing. Historical bars remain confirmed, but the most recent open bar should not be treated as final.
Data availability is dependent on TradingView's underlying market-statistics symbols. Historical coverage may vary by index, exchange, and breadth lookback, and missing source data cannot be reconstructed by the indicator.
Credit: This indicator is based on the open-source Net New Highs/Lows script by Fred6724, with substantial modifications and additional functionality. Indikator

Liquidity Sweep Buy/Sell [v6]# Liquidity Sweep Buy/Sell
## Overview
**Liquidity Sweep Buy/Sell ** is a price-action indicator designed to identify potential **liquidity sweeps** around important swing highs and swing lows.
The indicator looks for situations where price moves beyond a previous high or low, takes the available liquidity, and then closes back inside the previous level.
It can help traders identify potential **reversal areas, BUY/SELL opportunities, entries, and exits**.
> **Important:** This indicator is a technical analysis tool, not a guarantee of future price movement. Always use proper risk management and confirm signals with your own analysis.
---
## 🔹 What Is Liquidity?
In simple terms, **liquidity** is an area where many orders may be located.
Common liquidity areas include:
* Previous swing highs
* Previous swing lows
* Equal highs
* Equal lows
* Previous session highs/lows
* Important support and resistance levels
For example:
If price forms a previous high and later moves above that high, traders may interpret this move as a **liquidity sweep**.
If price then quickly closes back below the previous high, it can indicate that the breakout failed and that price may potentially reverse.
---
# 🟢 How the BUY Signal Works
The indicator searches for a previous swing low.
When price moves below that liquidity level and then closes back above it, the indicator can generate a **BUY signal**.
### Example:
**Previous Low → Price Sweeps Below → Price Closes Back Above → BUY**
This can indicate that sell-side liquidity below the previous low has been taken.
The indicator can then display:
**🟢 BUY**
and
**BUY ENTRY**
---
# 🔴 How the SELL Signal Works
The indicator searches for a previous swing high.
When price moves above that liquidity level and then closes back below it, the indicator can generate a **SELL signal**.
### Example:
**Previous High → Price Sweeps Above → Price Closes Back Below → SELL**
This can indicate that buy-side liquidity above the previous high has been taken.
The indicator can then display:
**🔴 SELL**
and
**SELL ENTRY**
---
# 📈 EMA Trend Filter
The indicator includes an optional **EMA Trend Filter**.
By default, it uses the **200 EMA**.
### Bullish Environment
When price is above the EMA, the indicator favors BUY signals.
### Bearish Environment
When price is below the EMA, the indicator favors SELL signals.
This filter can help reduce signals that go against the broader market direction.
You can disable the EMA filter from the settings if you want to use pure liquidity-sweep signals.
---
# 📊 Volume Filter
An optional **Volume Filter** is also available.
When enabled, the indicator compares current volume with the average volume.
This can help traders focus on liquidity sweeps that occur with relatively stronger market activity.
The volume filter is disabled by default.
---
# 🎯 How to Use the Indicator
## Step 1 — Add the Indicator
Open TradingView and add:
**Liquidity Sweep Buy/Sell **
to your chart.
---
## Step 2 — Identify the Market Trend
First look at the 200 EMA.
### Price Above EMA
Focus more on:
**🟢 BUY signals**
### Price Below EMA
Focus more on:
**🔴 SELL signals**
---
## Step 3 — Look for Liquidity
Watch the red and green liquidity levels.
### Red Level
Represents a previous swing high and potential **buy-side liquidity**.
### Green Level
Represents a previous swing low and potential **sell-side liquidity**.
---
## Step 4 — Wait for the Sweep
Do not enter simply because price touches a liquidity level.
Wait for price to **sweep the level and close back through it**.
This is the important part of the setup.
---
## Step 5 — Confirm the Signal
A stronger setup can occur when:
**Liquidity Sweep + Trend Direction + Strong Candle + Volume**
all support the same direction.
For example:
**Price above 200 EMA → price sweeps a previous low → candle closes back above the low → BUY signal**
This gives you a more structured setup instead of entering randomly.
---
# 🧠 How Beginners Can Learn It
If you are new to liquidity trading, learn these concepts in this order:
### 1. Market Structure
Learn:
* Higher High
* Higher Low
* Lower High
* Lower Low
### 2. Support & Resistance
Understand how previous highs and lows can become important areas.
### 3. Liquidity
Learn why traders watch:
* Previous highs
* Previous lows
* Equal highs
* Equal lows
### 4. Liquidity Sweeps
Understand the difference between:
**Breakout**
and
**Liquidity Sweep**
A sweep moves through a level but then returns back inside it.
### 5. Confirmation
Learn to wait for the candle close rather than entering immediately when price touches a level.
---
# 💡 Simple Strategy Example
### BUY Setup
1. Price is above the 200 EMA.
2. A previous swing low is visible.
3. Price moves below that low.
4. Price closes back above the low.
5. BUY signal appears.
6. Look for confirmation before entering.
7. Place your stop-loss according to your own risk-management rules.
8. Target a logical resistance/liquidity area.
### SELL Setup
1. Price is below the 200 EMA.
2. A previous swing high is visible.
3. Price moves above that high.
4. Price closes back below the high.
5. SELL signal appears.
6. Look for confirmation before entering.
7. Place your stop-loss according to your own risk-management rules.
8. Target a logical support/liquidity area.
---
# ⚙️ Recommended Settings
### Beginner
* Swing Length: **5**
* EMA Filter: **ON**
* EMA Length: **200**
* Volume Filter: **OFF**
### More Signals
Reduce the swing length.
For example:
**3–5**
This can make the indicator more sensitive.
### Stronger / Fewer Signals
Increase the swing length.
For example:
**7–10**
This focuses more on larger swing points.
---
# ⏱️ Timeframe
The indicator can be used on multiple timeframes.
For beginners, consider studying:
* 5-minute
* 15-minute
* 1-hour
* 4-hour
Do not assume that a signal on a lower timeframe is automatically stronger than a signal on a higher timeframe.
A useful approach is to identify the larger trend on a higher timeframe and then look for liquidity sweeps on a lower timeframe.
---
# 🚨 Important Risk Warning
No indicator can predict the market with 100% accuracy.
Liquidity sweeps can fail, especially during:
* High-impact news
* Extremely volatile markets
* Low-liquidity periods
* Strong trend continuation
* Sudden market manipulation or large orders
Always use:
**Risk Management + Stop Loss + Position Sizing + Market Analysis**
Never risk money you cannot afford to lose.
---
# 🔔 Alerts
The indicator includes TradingView alert conditions for:
* 🟢 Liquidity BUY
* 🔴 Liquidity SELL
* Exit LONG
* Exit SHORT
You can create alerts from TradingView's **Create Alert** menu after adding the indicator to your chart.
---
# 📚 How to Practice
Before using this indicator with real money, open a TradingView chart and study historical examples.
For every signal, ask yourself:
1. Where was the liquidity?
2. Did price actually sweep the level?
3. Did the candle close back through the level?
4. What was the trend?
5. Was price above or below the 200 EMA?
6. Was there strong volume?
7. Where would the stop-loss logically go?
8. Where was the next liquidity/support/resistance area?
Keep a trading journal and record both winning and losing setups.
The goal is not to take every signal.
The goal is to **understand why the signal appeared**.
---
# ⭐ Final Note
**Liquidity Sweep Buy/Sell ** is designed to make liquidity-based price action easier to visualize.
Use the indicator as a **confirmation and analysis tool**, not as an automatic trading system.
The best results come from combining the indicator with:
**Market Structure + Liquidity + Trend + Confirmation + Risk Management.**
Trade smart. Protect your capital. Learn the setup before trading it live.
Indikator

Indikator

Multi Symbol Participation Pulse [Pineify]Multi Symbol Participation Pulse
Overview
Multi Symbol Participation Pulse tests whether a chart move has broad support across a custom basket. Its pulse combines return breadth, EMA trend breadth, dispersion, and data coverage. It describes participation, not a forecast or trade signal.
Problem Definition
A simple advance ratio can hide synchronized movement, a few extreme outliers, or a thin sample caused by closed sessions. A one-bar vote also misses established trend position. This script keeps only valid observations in the denominator, separates fast return and slower trend votes, and lowers confidence when votes disagree, dispersion rises, or coverage falls. It measures a finite equal-weight basket, not official exchange breadth.
Design Rationale
Symbols are requested on the chart timeframe with gaps exposed and lookahead disabled. One-bar return direction supplies the fast vote; close versus a configurable EMA supplies slower context. Return dispersion is divided by its rolling EMA, so fragmentation is judged against the basket's recent scale instead of a fixed percentage. Coverage and vote agreement modulate amplitude. This structure suppresses incomplete or internally split evidence even when the raw advance ratio looks decisive.
Key Features
Ten configurable symbol slots with missing and invalid-symbol handling.
Return breadth, trend breadth, coverage, and normalized dispersion.
Confirmed broad-positive, broad-negative, fragmented, and neutral states.
Optional components, halo, rail, divergence markers, dashboard, and alerts.
How It Works
For each valid symbol, the script calculates one-bar return and tests whether close is above its EMA. Positive-return count gives fast participation; above-EMA count gives trend participation. Both ratios are mapped from 0–100% into -100 to +100.
Cross-sectional return standard deviation is divided by its rolling EMA to measure unusual dispersion. Coverage, agreement between the two votes, and dispersion-derived coherence form a bounded confidence term. The pulse blends return and trend votes 55/45 and reduces amplitude when evidence is weak. High relative dispersion also widens the halo.
States update only on confirmed bars. Broad states require the pulse threshold and both votes on the same side of 50%; hysteresis limits threshold chatter. Too few active symbols, low coverage, or warm-up produces no pulse. Invalid symbols return missing data rather than terminating the script. A lower rail maps dispersion into a fixed visual zone.
How Multiple Indicators Work Together
The components form one causal chain. Return breadth detects current participation but can chatter. Trend breadth adds persistence but lags. Dispersion reveals whether votes are compact or split by outliers. Coverage tests whether the sample is representative. Removing a component could make the result lag, overreact, hide fragmentation, or overstate a thin sample; their roles are not interchangeable.
Trading Ideas and Insights
Use the pulse as context, not an entry command. Broad states test whether a move is shared by selected proxies. Fragmentation flags disagreement between headline direction and internal distribution. Fixed-window divergence markers identify price/pulse disagreement for review, not a promised reversal. Compare similar sessions and build the basket around one coherent question.
Unique Aspects
Common breadth plots stop at an advance percentage or advance-decline difference. Here, fast and slow votes remain visible, dispersion is normalized to the basket's history, missing coverage reduces confidence, and confirmed hysteresis limits threshold chatter. Halo width exposes dispersion instead of hiding uncertainty behind the composite line, while the lower rail keeps fragmentation in a stable visual location.
How to Use
Choose a coherent basket and disable unused slots.
Check active coverage before interpreting the pulse.
Read sign and state color, then inspect component separation and halo width.
Use confirmed alerts beside price structure, liquidity, and risk controls.
The default US ETF basket is only an example.
Customization
EMA length controls the slower vote, while the dispersion baseline defines ordinary spread. Minimum active symbols and coverage set the evidence floor. Broad threshold and hysteresis balance sensitivity against stability. Fragmentation and agreement settings govern conflict states. Divergence settings control markers. Visual layers can be hidden without changing calculations.
Assumptions and Limitations
Every enabled symbol receives one vote; there are no constituent weights, official breadth, order flow, or membership data. Sessions, holidays, stale markets, delayed feeds, and permissions can reduce coverage or desynchronize timestamps. Gaps are exposed, so the active subset may change. EMA and dispersion baselines lag and depend on parameters. Pulse, halo, and divergence can change intrabar; states and alerts confirm at bar close. Fixed-window divergence is descriptive, not a reversal prediction. The script does not estimate probability, expected return, sizing, execution, or profitability.
Conclusion
Multi Symbol Participation Pulse turns a custom basket into an auditable breadth portrait. It separates fast and trend participation, dispersion, and coverage, then displays direction and uncertainty together. Use it while respecting asynchronous equal-weight data limits.
Indikator

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. Indikator

MSL Crypto BreadthWHAT IT DOES
Your chart shows one coin at a time. This indicator watches a basket of 20 coins at once and answers the question a single chart cannot: out of those 20, how many are actually taking part in the move you are looking at right now.
That answer changes what the same candle means. If Bitcoin gains five percent and 17 of the 20 coins gain with it, the whole market is moving and the move has something under it. If Bitcoin gains the same five percent while only 3 coins follow, one name is carrying everything and the rest of the market has already turned away. On a price chart those two days look identical. Here they do not, and that difference is the entire product.
Two lines do the work. The first is participation: how many coins of the basket are trading above their own moving average, drawn as a percentage from 0 to 100. Fifty means half the market is holding up, ten means almost nothing is. The second is pressure: on every bar it counts how many coins closed up against how many closed down and adds that difference up over time, so it reacts far sooner than the first line, often weeks sooner.
The indicator then watches Bitcoin and participation together. While they move the same way, nothing is drawn. When they split and go opposite ways, the stretch of time between them is shaded red or green and stays shaded until they come back together. Red means price is being pulled up while fewer and fewer coins follow it. Green means price is falling while more and more coins are quietly recovering underneath it.
One example from the daily chart of Bitcoin: the reference gained 2.5 percent across the comparison window while participation fell 15 points, which is two coins out of twenty losing their average. Both numbers are printed in the table on the chart, so every shaded stretch states its own reason instead of leaving you to guess it.
None of this tells you where to buy. It tells you whether the trade your own system just found deserves full size, half size, or nothing at all.
HOW TO USE IT
Participation above 50 and rising
Means: the market is broad, most of the basket holds its average.
Do: take your signals at full size. The only state where adding makes sense.
Participation between 30 and 50
Means: the move is carried by a few names.
Do: half size, closer targets.
Participation below 30
Means: breakouts in the basket mostly fail.
Do: stand aside, or trade the reference symbol alone.
Participation above 80
Means: everybody is already in, advances are crowded.
Do: not a place to open. Reduce and tighten the stop.
A red band opens
Means: the reference is being carried while participation leaks away.
Do: stop adding, protect what is open. A warning, not an exit, and it can run for weeks.
A green band opens while participation is below 20
Means: the reference is falling while more members repair underneath it.
Do: prepare, do not enter yet. This stage can last weeks.
Participation then crosses 50 upward
Means: the repair is confirmed by the state, not only by pressure.
Do: the entry window of the reversal sequence. Late by design, verified by design.
A band closes
Means: the pair moved the same way again, the disagreement is resolved.
Do: the warning is lifted.
Participation crosses 50 downward
Means: most of the basket has lost its average.
Do: the last and bluntest exit reason.
Five alerts cover this without watching the screen: participation crossing above and below half, the two divergence conditions, and the bar an open disagreement closes.
A WORKED EXAMPLE, THE DAY THIS WAS PUBLISHED
In the middle of May a green stretch opened on the daily chart of Bitcoin. The reference had lost 4.4 percent across the comparison window while participation rose 10 points against it, which is two coins out of twenty regaining their average while price was falling. Both numbers sit in the Event Gap row of the table.
Price then kept sliding into June and spent the next two months going sideways near its lows. The shading stayed on the entire time, because the two measurements never pointed the same way again. That is the length doing its job: this was not a three bar flicker, it was a repair that took a quarter to play out underneath a price chart that looked dead.
On the day of this publication the stretch ended. Bitcoin closed 4.7 percent higher and participation rose with it, so the pair agreed again, the band closed on that bar and the table switched to closed.
Now read the states above against this exact picture. Participation is 45 percent, nine coins of twenty above their average. That is the half size row, not the full size one. The reversal sequence has completed two of its three steps, the washed out low and the repair, and the third one, participation crossing 50 from below, has not happened yet.
That is the entire use of the tool in one screen. It does not say what the next bar does. It says the move that just printed a large green candle is still not broad, and it says so with a count anyone can check.
A bearish disagreement on the daily chart of Bitcoin, October 2025. Price makes its high while the share of the basket above its own average falls away underneath it.
THE TWO LINES
Participation is a state. It moves only when a member crosses its average, which is a large event, so the line is slow and honest.
Pressure reacts on every bar and needs no threshold, so it turns while participation is still standing still. It counts members, not money: a coin up a tenth of a percent and a coin up twelve percent cast one vote each. There is no volume in it and no order flow. That is a limitation worth stating plainly, and it is also why one large member cannot distort it.
The gap between them is the point. Participation on the floor while pressure climbs is a market being bought before it looks bought. Participation high while pressure rolls over is a rally already finished. Neither statement can be made from one line.
THE DIVERGENCE
One window, two measurements, no pivots. The reference symbol, Bitcoin by default, must travel at least the configured percentage across the window while participation moves the other way by at least the configured number of points.
The event is measured on participation alone. The pressure line takes no part in it: hide it and not one band, glyph or alert changes. Participation sits on a fixed scale where ten points has a stated meaning, two members out of twenty changing sides, while pressure is normalised against its own recent range, where ten points would mean nothing statable. Thresholds that cannot be explained in plain language have no business triggering anything. Read together, a band with pressure agreeing is a warning confirmed twice, a band against it is the narrow kind that more often dissolves.
A disagreement is a stretch, not a moment. A vertical line marks the bar it opened and a band runs until the pair comes back together, which happens when both measurements point the same way again. The length is the part worth reading: one that closes after three bars was noise, one that holds for two months is the story of that market.
Agreement produces nothing at all. Both sides moving up together, or both down, is what a healthy market looks like, and it is exactly what closes an open band. A move too small to clear either threshold does nothing either, so an open band is never cancelled by noise.
Nothing is drawn against a candle and nothing sits at a price level. A shape placed on a bar is read as an entry whatever the description says, and this indicator produces no entries.
READING THE PANE
Horizontal is a level and is drawn in neutral grey: dotted lines at 80 and 20, dashed at the halfway mark, soft shading in the two extreme regions. Vertical is an event in time and owns the colour, so a coloured column always means the same thing.
HOW IT IS BUILT
Each member is requested on the selected timeframe with lookahead disabled, and its moving average is computed inside its own context, on its own data. Both readings a member contributes come back as one tuple, so the basket costs one request per symbol rather than two.
Three details decide whether a breadth reading is honest or decorative. A member that has not returned data contributes nothing: it leaves both sides of the division rather than being counted as a coin below its average, because counting silence as weakness is the usual way these readings drift toward zero for reasons unrelated to the market. No share is published at all until a minimum number of members have answered, since a percentage built on three coins is noise wearing the clothes of a statistic. And the cumulative count is detrended before it is drawn, because stretching a raw cumulative line between the extremes of a window pins it against one edge and flattens the recent swing into a thread.
THE SETTINGS
Core. Basket Timeframe, empty follows the chart and higher keeps a slow reading on a fast chart. MA Length, 200 for a long term reading and 50 for a swing one. MA Type across SMA, EMA, WMA and RMA. Coins Counted, how many of the twenty slots take part. Minimum Live Feeds, the smallest sample that may be published at all.
Basket. Twenty symbol slots. Any symbol your plan can open works and the basket does not have to be crypto, so the same engine measures a sector, an index or a watchlist.
Divergence. Reference Symbol, Comparison Window, Reference Move percent and Breadth Gap Points, the two thresholds that define an event.
Visuals. The second line and its swing window; how events are drawn, as line and band, band only, line only or glyph only; the arrow on the edge; on chart explanations and how many are kept; whether events show in the pane, on the chart or both; four colours.
Dashboard. Table on or off, its corner out of eight, and the text size.
THE TABLE, ROW BY ROW
Above MA. The share, with the regime named: broad, healthy, narrow or washed out. Reads warming up while the sample is too small.
Coins. How many members are above their average out of how many actually answered.
Advancing. Up against down on the last bar, the input to the cumulative line.
Cum A/D. The untouched cumulative count, since the plotted line is normalised and says nothing about level.
Reference. What the reference symbol did on the last bar.
Divergence. Direction of the last event, how many bars ago, and whether it is still open.
Event Gap. The two measurements that produced it, for example ref plus 2.5 percent against breadth minus 15 points.
Feeds. How many slots answered and on what timeframe. Turns red when a slot is silent.
The same engine on Ethereum, four hours. The basket does not change with the chart, so the reading is about the market rather than the instrument in front of you.
TIMEFRAMES AND LIMITS
H1 and above. On H1 the lines work but divergences almost never fire, because a genuine disagreement between a whole basket and Bitcoin inside a day is rare. Divergence is a 4h and daily tool.
Members are read through the chart, so their history begins where the chart history begins. A 200 length average needs 200 chart bars before the first reading exists; scroll left to load more or shorten the length.
TradingView allows 40 unique data requests per script and 127 tuple elements. This script spends 21 requests and 42 elements. All 20 slots are requested whatever the counted number is, because requests are fixed at compile time, so lowering it changes the statistic and not the load.
WHAT IT IS NOT
Breadth describes the crowd, not the next bar. A thin market can stay thin for weeks while price grinds higher on two names, and a disagreement can run far longer than a position survives. Low participation is not a reason to short on its own.
Advance decline counting and participation measures are classic market internals from the stock market and belong to nobody. The implementation here is original: the per member context calculation, the exclusion rules, the minimum sample gate, the detrended cumulative and the paired open and close events are what the code actually is. Nothing was reused from another script.
Indikator

OBV Attention Consensus Ribbon [FibonacciFlux]An experiment in reading On-Balance Volume across four timeframes at once. Published with what the measurement actually found, including the part that says the previous default could not work.
WHAT IT DOES
Inside each of four timeframes (15m, 1H, 4H, 1D by default) it builds OBV, takes the per-bar slope as the difference of two linear regressions, and standardizes that slope by the rolling standard deviation of OBV over the same timeframe. The result is a z sensor per timeframe. OBV is cumulative, so its level depends on where the chart's history begins - the slope difference and the standard deviation are both invariant to that origin, which is what makes the four timeframes comparable at all.
The white line is the weighted mean of the four z sensors. The ribbon is the weighted dispersion around that mean, so it narrows when the timeframes agree and widens when they do not. Its colour is a geometric mean of three terms: concentration (how tight the dispersion is), side agreement (how much weight sits on one sign), and acceleration agreement (how much weight is moving further in that direction). An audit table prints every sensor's z, its one-bar change, its weight, the consensus, the dispersion, the concentration, both strengths and the current state.
WHAT THE MEASUREMENT FOUND
Two things, both on 6,000 bars of BINANCE:BTCUSDT 15m (5,949 bars after warm-up, 2026-06-17 01:15Z to 2026-08-18 13:00Z), repeated identically on ETHUSDT.
First: the previous default threshold could never be reached. The strength is a geometric mean of three fractions, and the acceleration term keeps it small. Measured over the whole window, the strength peaks at 34.5 on BTCUSDT and 36.0 on ETHUSDT, with a median of 20.1 and a 99th percentile of 31.0. The shipped threshold was 60. So the coloured ribbon never appeared on a single bar, both alerts fired zero times, and the branch that paints the ribbon was unreachable code. That is a calibration error, not a conservative setting, and it is fixed here: the default is now 30, where the coloured state covers 137 of 5,949 bars on BTCUSDT and 173 of 5,949 on ETHUSDT - roughly one bar in forty.
Second: the whole scale is far smaller than the script's own furniture suggested. The consensus never leaves ±0.141 and the dispersion never exceeds 0.132, while the sensor clips at ±3 and the pane drew guide lines at ±1.5. The clip has never once bound. The guides are now at ±0.10, just above the 99th percentile of |consensus| (0.114 on BTCUSDT, 0.116 on ETHUSDT), so they mark something the series actually reaches.
Neither of those is a claim about returns. There is none here: no forward-return figure, no hit rate, no edge. What the indicator offers is a picture of whether four OBV slopes are pointing the same way and how tightly, and the honest reading of the numbers above is that the picture is a low-amplitude one.
HOW THE NUMBERS WERE CHECKED
The whole computation was reimplemented outside Pine and cross-checked against this chart's Data Window: eight quantities on ten bars, with the individual sensors switched on so nothing was left as na. All 80 values round-trip to the exact three decimals TradingView printed. The worst raw disagreement is 4.9e-4, which is the rounding floor of indicator(precision = 3) rather than a modelling error.
That check discriminates. Near-miss variants a careless port would land on fail loudly against the same 80 values: reading the higher timeframes in developing rather than confirmed mode misses 79 of 80, a slope length of 21 instead of 20 misses 73 of 80, and a flipped regression orientation is off by two orders of magnitude more than the tolerance.
SETTINGS
The HTF data mode is the one that changes the meaning rather than the tuning. Confirmed only reads the last closed bar of each requested timeframe, which is why the higher-timeframe sensors are step functions that hold their value across the chart bars inside one higher-timeframe bar. Developing HTF reacts earlier and changes until that bar closes.
The four attention weights are normalized onto a simplex, so only their ratios matter, and an all-zero entry falls back to 0.10 / 0.20 / 0.40 / 0.30.
WHAT CHANGED IN THIS VERSION
The threshold and the guide lines were recalibrated against the measured output range, as described above. The audit table that the settings already promised did not exist in the code - the helper functions for it were written and left unused - and it is now implemented. An MPL header and a leftover compile sentinel plot were added and removed respectively. No computation was changed: every plotted series is identical to the version the 80-value cross-check was run against, which is why the figures above still apply.
Open source under MPL 2.0. Nothing here is a forecast, a signal service, or a claim of profitability. Indikator

Sector/Theme Performance DashboardThis indicator renders a customizable matrix directly on your chart to track sector, sub-industry, and thematic ETF performance across key lookback periods without switching tabs.
Key Features:
Multi-Timeframe Metrics: Track 1-Day, 1-Week, 1-Month, and YTD performance side-by-side.
Theme Mapping: Displays explicit thematic descriptions alongside each ticker (e.g., Capital Markets, Semiconductors, Cloud, Cyber, Volatility).
Visual Customization: Toggle individual timeframe columns on/off, adjust matrix sizing, and set custom color palettes.
Bypassing the 40-Ticker Script Limit:
Because TradingView caps each script to 40 data calls, ETFs are organized into select group batches in the settings.
To display 120+ ETFs simultaneously:
1. Load multiple instances of the indicator onto your chart.
2. Assign a different group batch to each instance.
3. Set the screen placement (Left, Center, Right) in the settings to render side-by-side panels. Indikator

Breadth Topping SyndromeThis indicator plots a normalized breadth deterioration score in a separate pane and fires a discrete topping signal when several independent NYSE internal breadth conditions assemble while the market is still rising. The thesis is that major tops are a syndrome, not a single event: internal bifurcation, weakening participation and fading leadership tend to appear together near distributive peaks, and their conjunction inside an uptrend carries more information than any one of them alone.
█ OVERVIEW
Breadth Topping Syndrome (BTS) condenses four warning conditions into one framework:
- C1: a Miekka style divergence, where NYSE new 52 week highs and new 52 week lows are
simultaneously elevated as a percentage of advances plus declines.
- C2: Norman Fosback's High Low Logic Index at a high percentile of its own trailing history.
- C3: weak S&P 500 participation (percentage of constituents above their 200 day moving
average) while the trend reference index is in an uptrend.
- C4: a weighted deterioration score built from the same normalized components exceeding
a threshold.
When a configurable minimum number of these conditions has been observed within a short synchronization span and the trend gate is up, a trigger fires and opens a signal window. Inside the window the syndrome is Active only while the McClellan Oscillator is negative. Repeated triggers within a trailing lookback are counted as a cluster.
█ HISTORY / BACKGROUND
The components have documented lineages. The simultaneous new highs and new lows divergence condition follows James R. Miekka's Hindenburg Omen specification (1995), itself derived from work by Martin Zweig and Norman Fosback: both extremes elevated at once, measured against advances plus declines, valid only in an uptrend, with the McClellan Oscillator acting as an activation gate inside a fixed window rather than as a co equal trigger. The High Low Logic Index is Fosback's, published in 1976: the minimum of new highs and new lows relative to total issues isolates the disagreement component of breadth. Percentage of stocks above the 200 day moving average is a standard participation measure. The McClellan Oscillator is the 19/39 period EMA differential of net advances, per Sherman and Marian McClellan.
The syndrome architecture that combines them is novel and is described in full below. The conceptual basis is that each component captures a different failure mode of an advance, so requiring several to appear near simultaneously filters the false positives that any single measure produces on its own.
█ HOW IT WORKS
The script requests seven external series at the chart timeframe: NYSE advancing issues, declining issues, new 52 week highs, new 52 week lows, a trend reference index, and a primary plus fallback participation symbol. All requests use ignore_invalid_symbol, and a data integrity gate suppresses every signal when any core feed returns no value.
On each bar the script computes:
- The Miekka ratios: new highs and new lows each divided by advances plus declines, times 100.
C1 is true when both meet the threshold.
- The High Low Logic Index: the minimum of new highs and new lows divided by advances plus
declines, times 100, smoothed with an EMA, then converted to a percentile rank over the
normalization lookback. C2 is true when the percentile meets the warning level.
- The participation percentile: the participation series (gap filled with its last valid value so feed
gaps do not distort the distribution) percentile ranked over the same lookback. C3 is true when
the percentile is at or below the warning level while the trend reference index is above its close
a configurable number of bars ago. This is the divergence conjunction: price rising, participation
weak relative to its own recent history.
- The leadership share: new highs divided by new highs plus new lows, times 100, percentile
ranked and inverted.
- The deterioration score: the weighted average of the HLLI percentile, the inverted participation
percentile and the inverted leadership percentile, scaled 0 to 100. If both participation symbols
fail to resolve, the score reweights automatically over the two remaining components. C4 is true
when the score meets its threshold.
Each condition contributes to the syndrome if it was true on any bar within the synchronization span. When the count of contributing conditions reaches the required minimum while the uptrend gate is true, a trigger fires on the first such bar (edge triggered, so a persisting syndrome does not retrigger). The trigger opens a signal window measured in trading days. Within the window, the syndrome is Active while the McClellan Oscillator, computed as the fast EMA minus the slow EMA of net advances, is below zero, and deactivates when it turns positive without closing the window. The cluster count is the number of triggers within the trailing cluster lookback.
█ HOW TO USE
The script is designed for the 1D timeframe. The breadth feeds are daily series, the window and cluster inputs are specified in trading days, and the Miekka and McClellan parameters are daily conventions, so daily resolution matches the granularity of the logic.
- Blue score line: current breadth deterioration, 0 to 100, against a dashed threshold line and a
dotted midline at 50. The line turns orange above the threshold and red while the syndrome
is Active. Gray indicates missing core data.
- Faint purple line: the HLLI percentile, shown separately because it is the slowest moving and
most historically studied component.
- Red triangle at the top of the pane: a syndrome trigger fired on that bar.
- Small maroon diamond: the Miekka condition alone was true on that bar without a full trigger,
useful for tracking the classical signal inside the broader framework.
- Maroon background: syndrome Active (inside a signal window with the McClellan Oscillator
negative). Orange background: window open but the oscillator is positive, so the syndrome is
temporarily deactivated and will reactivate if the oscillator turns negative before the window
expires.
- Status table (top right): overall state, each condition's current value and contribution, the
syndrome count, the oscillator value, bars remaining in the window, and the cluster count.
A single trigger is a caution flag. Two or more triggers within the cluster lookback have historically been the more serious configuration for divergence based breadth signals, and the script exposes a dedicated alert for that case. Four alerts are provided: trigger fired, syndrome turned Active, clustered trigger, and score crossing above its threshold.
█ SETTINGS
- Conditions Required (N of 4): syndrome count needed to trigger. Default 3.
- Condition Sync Span: bars within which a condition still counts toward the syndrome. Default 5.
- Signal Window: trading days a trigger keeps the window open. Default 30.
- Cluster Lookback: trailing trading days over which triggers are counted. Default 60.
- C1 Miekka NH/NL Threshold: minimum percent of advances plus declines for both new highs
and new lows. Default 2.8.
- C2 HLLI Warning Percentile: percentile of the smoothed HLLI that flags bifurcation. Default 90.
- C3 Participation Warning Percentile: participation percentile at or below which weakness is
flagged in an uptrend. Default 25.
- C4 Deterioration Score Threshold: score level that flags composite weakness. Default 75.
- Uptrend Lookback: bars over which the trend reference must have risen. Default 50.
- HLLI EMA Length: smoothing applied to the raw HLLI ratio. Default 50.
- Percentile Rank Lookback: window for all percentile ranks. Default 252.
- Score weights for the bifurcation, participation and leadership components. Default 33.3 each.
- MCO Fast EMA and Slow EMA: McClellan Oscillator periods. Defaults 19 and 39.
- Data Symbols: all seven feeds are exposed as string inputs and can be substituted.
- Show Status Table: toggles the table. Default on.
█ WHAT MAKES IT ORIGINAL
The individual components are public domain methods. What this script does differently is the combination architecture. First, every component is percentile ranked against its own trailing distribution before use, so the warning levels adapt to the prevailing breadth regime instead of relying on fixed absolute thresholds calibrated to a decades old NYSE universe. Second, the conditions are fused through an N of M syndrome count with a synchronization span, not a same bar AND, which acknowledges that breadth deterioration components rarely align to the exact day. Third, the trigger inherits the two phase Miekka mechanism but generalizes it: the syndrome, not a single divergence, opens the window, and the McClellan Oscillator gates activation inside it. Fourth, trigger clustering is quantified directly on the chart rather than left to visual inspection. This conjunction of adaptive normalization, tolerant multi condition assembly, windowed gating and cluster counting does not correspond to any single published method and is the substance of the script.
█ NOTES / LIMITATIONS
- The breadth feeds have limited historical depth. No signals can exist before the feeds begin,
and because every percentile rank requires the full normalization lookback (default 252 bars),
the first year of available feed history produces unreliable ranks and should be disregarded.
- The logic is designed for daily resolution. On other timeframes the external series return
whatever the feeds report at that resolution, and the day denominated windows lose their
intended meaning.
- All values on the developing realtime bar update until the bar closes. Signals should be
evaluated on closed bars. The script uses same timeframe requests with lookahead off and
does not reference future data.
- If neither participation symbol resolves, condition C3 can never contribute. With the default
requirement of 3 of 4, all three remaining conditions must then assemble, which makes
triggers strictly rarer. The table marks participation as N/A in that state.
- Data is pulled from fixed external symbols regardless of the chart symbol. The chart symbol
only determines the bar grid, so the indicator belongs on a US equity index chart at 1D.
- Breadth divergence signals of this family have a documented false positive history. This tool
flags conditions that have accompanied past tops. It is a risk assessment input, not a
standalone trading signal, and no claim is made about future results. Indikator

Composite Valuation Standard Score█ OVERVIEW
Composite Valuation Standard Score (CVSS) plots a single 0 to 100 line that measures how expensive the broad US equity market is against its own entire recorded history, by combining up to six valuation ratios through point-in-time statistics. The thesis: one valuation metric can mislead in isolation, but the average anchored z-score of several independent lenses (earnings, cyclically adjusted earnings, book value, sales, output, replacement cost) gives a robust reading of how uniformly stretched or depressed valuations are, without using any future data at any bar.
█ HISTORY / BACKGROUND
Averaging the historical percentile of many valuation ratios into one composite is a long-standing practice in institutional market research. The individual components carry their own lineage: the cyclically adjusted price to earnings ratio was developed by Robert Shiller, the market capitalization to GDP ratio is widely associated with Warren Buffett, and the ratio of corporate equity value to corporate net worth descends from James Tobin's Q. The specific construction used here, an expanding winsorized z-score per component with a minimum-history admission gate and a composite-level percentile mapping, is a novel method built for this script. Its conceptual basis is that every observation should be judged only against the history that existed when it printed, and that a metric making new all-time highs should keep conveying magnitude instead of freezing at the top of a percentile scale.
█ HOW IT WORKS
All series are sampled once per calendar month through request.security at the 1M timeframe with lookahead off. Two of the six components are ratios computed from a numerator and denominator symbol: Market Cap / GDP (a total market index divided by nominal GDP) and the Q Ratio proxy (nonfinancial corporate equities at market value divided by nonfinancial corporate net worth). Because every series is immediately transformed to ranks and z-scores, absolute units and level calibration are irrelevant; only the shape of each series matters.
The algorithm, step by step:
1. On each new monthly bar, each enabled component's value is inserted into that component's
sorted history array. The arrays only ever grow; nothing is discarded.
2. A component becomes "live" once its array holds at least the minimum-history gate
(default 120 monthly observations). Before that it accumulates data but does not
contribute, which prevents thin early samples from producing meaningless statistics.
3. Each live component's current value is converted to an anchored z-score against the
expanding mean and standard deviation of its own array, then winsorized by clamping
to plus or minus 3 (adjustable).
4. The composite z is the equal-weight average of all live winsorized z-scores, computed
whenever at least the minimum number of components (default 2) is live.
5. The composite z is itself inserted into an expanding array and converted to its own
expanding percentile rank. That rank is the 0 to 100 headline line.
6. Separately, each live component's expanding percentile rank is compared with the
extreme threshold (default 90). The share of live components above the threshold
is plotted as the extremes-breadth columns.
An optional Excess CAPE Yield series (100 divided by CAPE, minus the 10-year Treasury yield) can be plotted and is always available in the table when enabled.
█ HOW TO USE
Apply the script on a Monthly chart of a symbol with deep monthly history. The chart symbol only supplies the time axis; the valuation data comes from the configured feeds. Charting the trailing P/E series itself, or a long-history index, exposes the full record back to the late 19th century. On a short-history chart symbol the statistics rank against a short window and the reading is not comparable.
Reading the pane is simple:
• The teal line is the market's expensiveness rank from 0 to 100. A reading of 96 means
the current composite valuation is richer than 96 percent of everything that came
before it. A reading of 5 means cheaper than 95 percent of prior history.
• Above the dotted 90 line with a red background: valuations are in their most expensive
historical decile. Below the dotted 10 line with a green background: cheapest decile.
• The orange columns show agreement. At 100, every live metric is simultaneously in its
own extreme zone; at 0, none is. High teal with low orange means the composite is
stretched but the stretch is concentrated in few metrics.
• The table in the top right shows each component's status (off, gated with progress,
or live), its current percentile, and its z-score, plus the composite row and the
Excess CAPE Yield row.
This is a slow macro positioning gauge, not a timing signal. Elevated readings can persist for years. Its practical use is context: sizing long-term risk, framing regime, and flagging when many independent valuation lenses agree at an extreme.
█ SETTINGS
• Components group: six on/off toggles, each with editable symbol fields. Trailing P/E
(default on), Shiller CAPE (default on), Price / Book (default on), Price / Sales
(default on), Market Cap / GDP with numerator and denominator symbols (default on),
Q Ratio proxy with numerator and denominator symbols (default on).
• Minimum-history gate: monthly observations a component needs before it contributes.
Default 120.
• Winsorize z at +/-: clamp magnitude for component z-scores. Default 3.
• Minimum live components: fewest live components required for the composite to plot.
Default 2.
• Extreme threshold (percentile): level defining the expensive zone for the background,
and the per-component extreme used by the breadth columns. Default 90.
• Cheap threshold (percentile): level defining the cheap zone for the background.
Default 10.
• Plot Excess CAPE Yield: adds the ECY series in percent to the pane and status line.
Default off. Its 10-year yield symbol is editable.
• Show component table: toggles the status table. Default on.
█ WHAT MAKES IT ORIGINAL
Published valuation scripts overwhelmingly track a single ratio, and existing multi-series composites in other domains rank each input over a fixed rolling window or against full-sample statistics. This script differs in four specific, verifiable ways. First, every statistic is point-in-time: each bar is ranked and scored only against observations that existed at that bar, so no early reading benefits from data that had not yet occurred. Second, the primary transform is a winsorized anchored z-score rather than a percentile, so a component that breaks above all prior history continues to register increasing magnitude up to the clamp instead of pinning at 100 and going silent. Third, a minimum-history admission gate handles the unequal start dates of the underlying feeds explicitly: short-history components accumulate until they are statistically meaningful, and the effective composition of the composite changes transparently over time, disclosed live in the table. Fourth, the extremes-breadth columns quantify cross-metric agreement, separating a composite driven by one distorted ratio from one where independent valuation lenses are stretched simultaneously.
█ NOTES / LIMITATIONS
• Sample depth is bounded by the chart symbol's bar history, because expanding statistics
can only accumulate on bars that exist on the chart. Use a deep-history monthly chart.
• The effective component set varies by era. Only the two earnings-based series reach the
19th century; book value and sales feeds begin near 2000, and the market cap and Q feeds
clear the gate later still. Early readings are a two-component composite. The table
always shows which components are live.
• Components whose feeds return no data stay gated and are excluded; the composite
requires the configured minimum of live components or it plots na.
• The value on the developing monthly bar updates until that bar closes. On timeframes
below monthly the current month's reading evolves intraperiod. No lookahead is used
and completed bars do not repaint from the script's side.
• The underlying economic feeds are revised at the source. National accounts and flow of
funds series can be restated historically, which changes past values of the affected
components when the data provider updates them.
• Quarterly feeds repeat their value across the months of a quarter, which mildly smooths
the expanding distributions.
• This indicator describes valuation rank relative to history. It makes no claim about
future returns or the timing of any reversal. Indikator

Index Peak Dispersion█ OVERVIEW
Index Peak Dispersion plots, in a separate pane, two normalized series computed across a configurable universe of up to twelve equity indexes: the calendar-day dispersion of their all-time-high dates, expressed as a percent of a topping window, and the share of indexes that printed a fresh all-time high within a short recent window. The thesis is that healthy advances register all-time highs across indexes nearly simultaneously, while major distributive tops fragment, spreading index peak dates across weeks or months.
█ HISTORY / BACKGROUND
The concept descends from the non-confirmation principle of Dow Theory as developed by Charles Dow, William Hamilton and Robert Rhea, in which a new high in one average unaccompanied by a new high in another warns that the trend is losing sponsorship. Classic non-confirmation is measured in the price domain: one index fails to exceed its prior peak while another does.
Market historians and technicians, including Robert Prechter, have documented a related phenomenon in the time domain: at major tops, the final all-time highs of the major indexes scatter across the calendar rather than clustering. At the 2000 top, the Dow Industrials peaked in January, the S&P 500 and NASDAQ Composite in March, and the NYSE Composite in September. At the 2007 top, the Dow Jones Composite peaked in July while the Dow Industrials and S&P 500 peaked in October. This script converts that qualitative observation into a mechanical, reproducible statistic.
█ HOW IT WORKS
The script performs the following steps on each bar:
• For each of up to twelve enabled symbols, one same-timeframe request.security() call evaluates a function inside the requested symbol's context. The function maintains a running maximum of closing prices over the symbol's loaded history and records the timestamp of the bar on which that maximum was last exceeded. This running maximum is point-in-time by construction: no future data enters the calculation, and lookahead is off.
• On the chart symbol, each recorded timestamp is converted to an age in calendar days: current bar time minus the all-time-high time, divided by the number of milliseconds in a day.
• Each enabled index with data is classified. An age at or below the fresh window makes it Fresh. An age at or below the topping window makes it part of the in-window set. An age beyond the topping window makes it Stale.
• When the in-window set contains at least the minimum required count of indexes, the dispersion span equals the maximum in-window age minus the minimum in-window age, in calendar days. The plotted dispersion value is that span divided by the topping window length, times 100. When the in-window count is below the minimum, the dispersion plot returns na.
• The participation value equals the count of Fresh indexes divided by the count of enabled indexes with data, times 100, plotted as columns.
• The fractured top condition is true when the dispersion value is at or above the warning threshold while at least one index is Fresh. The pane background is shaded on those bars, and an alert fires on the first bar of each new occurrence. A second alert fires when every enabled index with data is simultaneously Fresh, which marks a synchronized advance, the opposite condition.
• On the last bar, an optional table lists each index with its all-time-high date, age in days and classification, plus summary counts and the raw span in days.
█ HOW TO USE
The script is designed for the 1D timeframe. The running all-time high is intended to operate on daily closes, and both windows are specified in calendar days, so daily resolution matches the granularity of the logic.
In plain terms, the blue columns answer one question: how many of the enabled indexes hit a record high this week? The red line answers another: how spread out in time are everyone's record highs? In a strong market, the indexes peak together, so the columns are tall and the line stays low. At major tops, the market tends to fall apart in slow motion: one index peaks, then months later another, and by the time the last index prints its final record, several others stopped making records long ago. Each new high is carried by fewer indexes, so the columns thin out while the line climbs. The shaded background marks the combination of both: the market is still printing record highs, but the set of indexes confirming them has been shrinking for months. That is the structure documented at the 2000 and 2007 tops. The same combination also appears during rotation phases that resolve higher, so treat it as a statement that conditions resemble past major tops, not as an instruction to act.
Read the two plotted series together. Low dispersion with high participation describes a synchronized advance in which the enabled indexes are registering highs together. Rising dispersion while some indexes continue to print fresh highs describes fragmentation: leadership is narrowing and earlier leaders have stopped confirming. The shaded background marks bars on which the dispersion value is at or above the dashed threshold line while at least one fresh high exists, the specific combination in which fragmentation is present at a live high rather than in an established downtrend.
The table gives the attribution behind the numbers: which indexes are Fresh, which remain inside the topping window, and which have gone Stale, along with each all-time-high date. Stale entries are non-confirmations older than the topping window and are deliberately excluded from the span so that a single long-dormant index does not saturate the statistic.
The condition is a warning context, not a timing trigger. It identifies an environment consistent with historical distributive tops. It does not predict the date or the existence of a decline.
█ SETTINGS
• Index universe, twelve slots, each with an enable checkbox and a symbol field. Defaults: DJI, DJT, DJU, DJA, SPX, NDX, IXIC, NYA, RUT, SOX, MID, SPXEW. All twelve are enabled by default. Any slot can be repointed to another symbol or disabled.
• Fresh high window, calendar days. Default 7. An index whose all-time high printed within this many days counts as Fresh.
• Topping window, calendar days. Default 378. An index whose all-time high printed within this many days participates in the dispersion span. Older highs are classified Stale.
• Dispersion warning threshold, percent of topping window. Default 25. The dashed reference line and the threshold for the fractured top condition.
• Minimum in-window index count for a valid span. Default 4. Below this count the dispersion plot returns na, which prevents a span computed from too few indexes.
• Show status table. Default on.
• Table position. Default Top right.
█ WHAT MAKES IT ORIGINAL
Breadth and non-confirmation tools on this platform generally measure the price domain: divergences between an index and an internal line, counts of components above a moving average, or new-high and new-low tallies within one exchange universe. This script instead measures the time domain across whole indexes. It reduces the peak-date scatter of a user-defined index universe to a single bounded statistic, the in-window span of all-time-high ages, and pairs it with a participation series so that fragmentation is only flagged while a high is live. The classification into Fresh, in-window and Stale, with the Stale exclusion and the minimum-count validity gate, is what allows the scatter of a historical topping process to be plotted as one continuous, comparable series across eras.
█ NOTES / LIMITATIONS
• The running all-time high is computed only over the bars loaded for each requested symbol. Symbols with short available history, and the early portion of any chart, understate the true age of the all-time high. Treat the plot as reliable only after all enabled symbols have substantial loaded history.
• The logic is designed for the 1D timeframe. On intraday charts the running maximum operates on intraday closes and the calendar-day windows lose their intended granularity. On weekly or monthly charts a fresh window shorter than one bar cannot register.
• All request.security() calls run on the chart timeframe with lookahead off. Values on the developing bar update until the bar closes and do not repaint afterward.
• The script issues twelve security calls. A symbol slot that fails to resolve or returns no data is excluded from every count and appears in the table as No data.
• Ages and spans are measured in calendar days, not trading days, so weekends and holidays are included in the counts.
• The warning threshold is expressed as a percent of the topping window. Changing the topping window changes the day-equivalent of the same percent threshold.
• The dispersion plot returns na whenever fewer than the minimum required indexes have an all-time high inside the topping window.
• The status table renders on the last bar only. Indikator

Margin Debt Expansion vs Contraction Indicator█ OVERVIEW
This indicator plots the year over year percentage change in a quarterly measure of U.S. margin debt in a separate pane, classifies that rate of change into an expansion regime and a contraction regime, and marks the quarters in which the rate of change turns while inside either regime. The thesis is that the second derivative of speculative leverage, rather than its absolute level, is what distinguishes one phase of a market cycle from another.
█ HISTORY / BACKGROUND
Aggregate customer margin debt has been reported for U.S. brokerage accounts for many decades. The NYSE compiled and published the series historically. FINRA later assumed responsibility for aggregating and distributing margin statistics from its member firms, on a monthly basis. The Federal Reserve publishes a closely related quarterly aggregate as part of the Z.1 Financial Accounts under the heading "Security Brokers and Dealers; Receivables Due from Customers (Margin Loans and Other Receivables); Asset, Level."
The observation that leverage growth accelerates into cycle peaks and contracts violently during forced deleveraging is long standing and not proprietary to any single author. The absolute level of margin debt trends upward with nominal market capitalisation and with the size of the brokerage system, which makes level comparisons across decades of limited use. Expressing the series as a year over year rate of change removes that trend and puts every cycle on a comparable scale. This script implements that transform and adds a regime classification and turn detection layer on top of it.
█ HOW IT WORKS
• The script issues two requests against FRED:BOGZ1FL663067003Q at the 3M resolution, both with gaps off and lookahead off. The first returns the current quarterly value. The second returns the same series offset by four quarters.
• The year over year rate of change is computed as (current minus prior year) divided by prior year, multiplied by 100. The calculation is skipped and the plot returns na when either request is na or when the prior year value is zero.
• Because the source is quarterly and the chart is not, the resulting series is a step function. It holds a constant value across every chart bar inside a quarter and changes only on the first chart bar after a new quarterly value becomes available.
• Two regimes are derived from the rate of change. The expansion regime is active when the reading is at or above the Red Zone Lower input. The contraction regime is active when the reading is at or below the Green Zone Upper input. The Red Zone Upper and Green Zone Lower inputs define the outer edge of the shaded bands and do not participate in regime classification, so a reading that jumps past the outer edge still registers.
• A threshold cross is flagged on the first bar on which a regime becomes active after not being active on the prior bar. A triangle marker prints at the value of the line.
• A rollover is flagged when the regime is active and the current reading is below the prior bar reading while the prior bar reading was at or above the reading before it. On a step function this resolves to the first chart bar of any quarter whose value moved against the direction of the regime. The contraction rollover is the mirror condition. A circle marker prints at the value of the line.
• The line is coloured red while the expansion regime is active, green while the contraction regime is active, and neutral otherwise.
█ HOW TO USE
Use this on a daily or weekly chart. The underlying data is quarterly, so a daily chart gives enough resolution to see each quarterly step clearly while still covering a multi decade span on one screen. Intraday timeframes add no information because the value cannot change intraday. Timeframes at or above 3M collapse the step structure and are not useful.
The chart symbol does not enter the calculation. The output is identical on every symbol. Load it beneath a broad U.S. equity index if you want visual correspondence between the leverage cycle and the price cycle, but understand that the indicator is not reading the chart.
Reading the output:
• The line is the year over year rate of change of margin debt in percent. Zero means leverage is flat against the same quarter one year earlier.
• The red band spans the expansion thresholds. A reading inside or above it means leverage is growing at a pace that has historically clustered in the later stages of an advance.
• The green band spans the contraction thresholds. A reading inside or below it means leverage is shrinking at a pace that has historically clustered around and after deep declines.
• Triangle markers mark the quarter in which a regime first became active.
• Circle markers mark a quarter in which the rate of change moved against the direction of the active regime. These can print more than once inside a single regime episode, since any adverse quarter qualifies. Treat a run of consecutive circles as more informative than a single one.
The measure is coincident to lagging with respect to price. It describes the state of leverage rather than anticipating price. Read it alongside independent inputs such as breadth, credit spreads and the yield curve.
█ SETTINGS
Zone Thresholds
• Red Zone Upper (%) , default 55. Outer edge of the expansion band. Shading only.
• Red Zone Lower (%) , default 40. Expansion threshold. Regime classification, marker logic and line colour key off this level.
• Green Zone Upper (%) , default -20. Contraction threshold. Regime classification, marker logic and line colour key off this level.
• Green Zone Lower (%) , default -40. Outer edge of the contraction band. Shading only.
Display
• Show Zone Markers , default on. Toggles the triangle and circle markers. The line, bands and alert conditions are unaffected by this input.
█ WHAT MAKES IT ORIGINAL
Plotting margin debt, or its rate of change, is not itself novel. What this script does differently is separate three things that are usually collapsed into one threshold test.
First, regime membership is defined by a single inner threshold per side rather than by band membership, so the classification does not fail when the series gaps past the outer edge of the shaded band. The band remains a visual reference for how far into the regime the reading sits.
Second, turn detection is evaluated only conditionally, inside an active regime. An adverse quarter in the middle of the range carries no signal and produces no marker. The same adverse quarter above the expansion threshold is the event the script is built to isolate.
Third, the turn test is written for a step function rather than a continuous series. It fires on the first chart bar carrying a new quarterly value that moved against the regime, which is the only bar on which new information actually arrived, rather than repeating across the plateau.
The combination of a one sided regime gate with a step aware turn test applied to a quarterly macro leverage series is what distinguishes this from a threshold crossing plot of the same data.
█ NOTES / LIMITATIONS
• Quarterly source. FRED:BOGZ1FL663067003Q is published quarterly. FINRA's monthly margin debt series is not available natively on this platform. Every regime change and every marker resolves to quarterly granularity. A turn that a monthly series would show in month one will not appear here until the quarter closes.
• Publication lag. The Z.1 Financial Accounts are released roughly ten weeks after the quarter they cover. The script positions each quarterly value at the close of the quarter it describes, which is earlier than the date on which that value became publicly known. Historical marker placement is therefore ahead of real world availability by approximately one quarter. This is inherent to charting a macro release against calendar time and cannot be corrected inside the script.
• Revisions. The Z.1 series is revised. Historical values, and therefore historical markers, can change when the source data is revised.
• No lookahead. Both requests use barmerge.lookahead_off, so a quarterly value is not shown on chart bars that precede the close of its own quarter. The most recent quarter updates as new data arrives, in the normal way for any real time series.
• History dependence. The rate of change requires five quarterly observations before it can be computed, and the plot returns na until they exist. On charts whose own history is shorter than the available FRED history, the line only covers the bars the chart has. Applying the script to a recently listed symbol will truncate the visible record accordingly.
• Symbol independence. The output does not depend on the chart symbol and will be identical on any instrument. It is a U.S. aggregate leverage measure and carries no meaning with respect to the price series it is displayed against.
• Timeframe sensitivity. Intraday resolutions cannot resolve the source data and produce a flat line across long stretches. Resolutions at or above 3M compress the step structure to the point of illegibility. Daily or weekly is the intended range.
• Threshold provenance. The default threshold values are round numbers chosen to sit near the extremes observed in the available history. The number of complete leverage cycles contained in the series is small, so the thresholds should be treated as adjustable reference levels rather than as fixed boundaries with statistical support.
• Repeated rollover markers. The rollover test flags any adverse quarter inside an active regime, not only the first or the extreme one. Multiple circles inside a single regime episode are expected behaviour, not a defect. Indikator
