Liquidity Radar Engine Pools Sweeps and Next DrawThis script answers one question continuously: which pool of resting liquidity was taken most recently, was it reclaimed, and where is price likely being delivered next. It is a context and narration tool, not a signal generator. It never tells you to enter.
**The three pool states — the core idea**
Most liquidity tools mark a level and then delete it the moment price touches it. That throws away the information that matters. Here a pool moves through three distinct states, drawn differently at each:
- **LIVE** — resting, untouched, still a magnet.
- **SWEPT** — taken, but price has not closed back through the origin. The sweep may still fail. Nothing is confirmed yet.
- **RECLAIMED** — taken and price closed back through the origin. This is the completed sweep-and-reclaim, and it is the only state the narration treats as a story worth acting on.
Separating SWEPT from RECLAIMED is the entire point of the script. A sweep without a reclaim is not a setup, and collapsing the two into one "hit" state hides the distinction that decides whether anything happened.
**What it draws**
Pool levels are built from prior-period highs and lows, session extremes, equal highs and lows, and swing pivots, each drawn according to its state. A liquidity glow fades with pool age so stale levels visibly recede rather than cluttering the chart indefinitely. A Next Draw ring marks the nearest unswept pool in the direction of the current higher-timeframe bias — the level price is being pulled toward. A Delivery Map shows where price has been delivered from and to. A narration bar states the current condition in plain words; when it reads that no sweep has happened yet, there is no story and nothing to do.
**The two engines that gate the narration**
Higher-timeframe bias reads structure on a higher timeframe from pivot sequence and reports bullish, bearish, or neutral/choppy. Bias decides which side of a sweep is worth watching. It is a filter, never a position, and it never extends how long anything is held.
Lower-timeframe change-of-character confirms that structure on the entry timeframe has actually shifted after a reclaim. This is the difference between a level being touched and a level being rejected.
Response presets (Fast, Balanced, Strict, Manual) set the pivot left and right bar counts independently, trading detection latency against confirmation lag. This is worth being precise about: the presets change how soon an event is detected. They do not lower what counts as an event. Strict reproduces the original timing exactly.
**Optional breadth**
Advance-decline and TICK feeds can be requested to flag exhaustion. These require the relevant index symbols on your data plan. Without them the breadth row reads unavailable and everything else continues to work normally.
**Using it with the sequence engine**
This script publishes five numbered plots as an export bridge, intended to be read as external sources by the companion script "Liquidity Sequence Suite — 4-Confirmation Engine". Wiring them lets that script consume this one's pool ledger, next-draw level and bias rather than recomputing them, so both agree on what happened and when. Wire each numbered source to the matching numbered field once. The exports are display-only and cost nothing if unused — this script is fully standalone and needs no companion.
**Limitations and shortcomings — please read**
- Pivot-based structure confirms with lag by definition. A pivot is only a pivot once the required bars to its right exist, so higher-timeframe bias and change-of-character both arrive after the turn, not at it. Faster presets shorten that lag. Nothing removes it.
- Higher-timeframe values update while the higher-timeframe bar is forming. Intrabar bias and change-of-character states are provisional and can change within the bar.
- Prior-period level requests use the standard previous-bar idiom and do not repaint. The pivot requests use no lookahead. Nothing in this script draws a level earlier on history than it could have appeared live.
- Pool detection is capped for performance. On very long histories or very low timeframes the oldest pools are dropped, so panel counts reflect what is tracked rather than everything that ever existed.
- Breadth is optional and depends on your data subscription.
- This is a context tool. It produces no entries, no stops, no targets and no performance claim. It is an indicator, not a strategy.
- Nothing here is financial advice.
**Originality**
Written clean-room from a written specification of publicly described concepts — resting liquidity above highs and below lows, sweeps, reclaims, equal highs and lows, session and prior-period levels. No third-party source was consulted or adapted. All code is original.
مؤشر

Candle-Pattern Detector ProCandle-Pattern Detector Pro (CPD-Pro++)
This indicator automatically identifies 48 classic candlestick patterns on the chart, marking each occurrence with a label showing the pattern's abbreviation (e.g., HA = Hammer, LE = Long Engulfing, 3WS = Three White Soldiers, etc.), placed directly above or below the corresponding candle.
How it works
The script analyzes the relationship between body, upper shadow, and lower shadow of each candle (and of previous candles, when a pattern requires multi-bar confirmation) to classify reversal, continuation, and indecision formations — such as Hammer, Engulfing, Morning/Evening Star, Three Methods, Kicking, and others.
How traders can use it
Fast visual identification: instead of memorizing dozens of patterns, the trader sees the abbreviation directly on the candle where the pattern occurred.
Confluence with other tools: the patterns detected here work best as confirmation context — for example, a Hammer (HA) or Bullish Engulfing (LE) near a support/liquidity zone carries far more weight than the same pattern in isolation.
Configurable alerts: each of the 48 patterns has its own individual alertcondition, allowing traders to set up alerts for a specific pattern (e.g., only Morning Star) without having to watch the chart manually.
Per-pattern customization: each pattern can be individually enabled/disabled and given a custom color, letting traders build a lean setup with only the patterns relevant to their strategy (e.g., only top/bottom reversal patterns).
Limitations and recommended use
Candlestick patterns are probabilistic, not deterministic — they should not be used as a standalone entry/exit signal.
It's recommended to combine this indicator's signals with market structure (support/resistance, trend, volume) to filter out false positives.
This script is a technical analysis aid and does not constitute investment advice. مؤشر

Trend Trigger | EMA Trend Filter + MTF Stochastic Entry with ATROverview
This strategy combines two proven, independent mechanisms rather than inventing a new indicator: a slow-moving EMA trend filter decides which direction is permitted, and a higher-timeframe-confirmed stochastic oscillator decides when to actually enter. Trend and timing are handled by separate logic layers so each does one job well, instead of stacking multiple overlapping conditions that rarely align.
How it works
Trend permission (EMA 38/62): Trades are only allowed in the direction the EMA fast/slow relationship currently supports — longs when fast > slow, shorts when fast < slow. This keeps the strategy from fighting the prevailing trend. This filter can be disabled for a pure counter-trend/mean-reversion test.
Entry timing (MTF Stochastic): The current-timeframe %K/%D stochastic must cross through the midline (50) with rising/falling momentum, and the same stochastic recalculated on the next higher timeframe (auto-stepped: 1m→5m, 1h→4h, 1D→1W, etc.) must agree in direction. This is the same core logic as classic MTF stochastic systems — entries are timed at momentum inflection points that are confirmed on a broader structural timeframe, not just the noisy current one.
Staged, ATR-based risk management: Every position opens with an ATR-scaled hard stop. Once the trade reaches a configurable R-multiple (default 1.0R), the stop moves to breakeven — locking in "no loss" without capping upside. Past a second, larger R-multiple (default 1.5R), the stop begins trailing using ATR (not fixed ticks), so the trailing distance scales with the instrument's actual volatility instead of an arbitrary number.
Secondary exits: A stochastic-fade exit (mirroring the entry logic in reverse) and an optional trend-flip exit close the trade early if the higher-timeframe signal reverses or the EMA trend turns against the position. A time-stop closes any trade that's gone nowhere after N bars.
Distinctive features
Trend and timing are decoupled — you can test pure momentum-timing (trend filter off) versus trend-confirmed pullback entries (trend filter on) with one toggle.
No fixed-tick trailing stop — every risk parameter (initial stop, breakeven trigger, trailing distance) is ATR-scaled, so the same settings behave sensibly across instruments with very different volatility (e.g., a $30 stock vs. a $60,000 crypto asset) without manual re-tuning.
Risk-based position sizing ties trade size directly to the ATR stop distance and a fixed % of equity risked per trade, rather than a flat share/contract count.
A compact confirmation meter (colored bar table) shows trend + stochastic alignment strength at a glance — no cluttered multi-line oscillator overlays on the chart.
Tips for use
Test with the trend filter both on and off separately — they represent genuinely different strategies (trend-following pullback entries vs. pure momentum reversal) and will perform differently depending on the instrument's regime.
Start testing on liquid instruments and a base timeframe of 1H or higher — the automatic higher-timeframe step needs enough bars underneath it to be meaningful; very low timeframes (1–5 min) compress the "higher timeframe" confirmation into something almost as noisy as the entry timeframe itself.
Check Average Win vs. Average Loss in the Strategy Tester, not just win rate — this strategy is built to keep those two numbers close together (via the breakeven/trailing stages), and that ratio is a better health check than win rate alone.
The breakEvenR and trailStartR inputs interact — a very tight breakeven trigger combined with a very close trail can choke off winners before they develop; a very loose one leaves more of the position exposed to giveback. Both are worth walking through several combinations on your specific instrument and timeframe rather than assuming one setting is universally correct.
This is a rules-based tool, not a guarantee — past backtest results don't ensure future performance, and all trading involves risk of loss.
استراتيجية

Uranium VolumeUranium Volume — PVT Momentum
Uranium Volume is an experimental momentum indicator based on price percentage changes combined with the logarithm of trading volume. Its purpose is to provide a visual representation of relative price-volume pressure, helping traders observe moments of acceleration or weakening momentum.
🔬 How It Works
The indicator calculates a simplified PVT (Price-Volume Trend) change:
PVT Change = ((Current Price − Previous Price) / Previous Price) × log(Volume)
The price source used in the calculation can be selected by the user:
Close — closing price
HLCC4 — average of High, Low, and two Close values
HL2 — average of High and Low
HLC3 — average of High, Low, and Close
The resulting value is then smoothed using an EMA (Exponential Moving Average). The default period is 9.
📊 Visual Interpretation
The columns display the smoothed indicator value, while the column color is determined by the price/volume change of the current bar:
🟢 Lime: positive price change relative to the previous bar.
🔴 Red: negative price change.
🔵 Blue background: confirmed bar with a positive or neutral change.
🟠 Orange background: confirmed bar with a negative change.
The indicator can be used as a complementary tool to observe momentum, expansion, or loss of strength, together with price action, volume, trend analysis, and other technical-analysis tools.
⚙️ Settings
Price Mode: determines which price reference is used in the calculation.
MME Reactor Core: controls the EMA period applied to the PVT Change. Lower values make the indicator more responsive, while higher values provide a smoother reading.
⚠️ Important
Uranium Volume is a technical-analysis tool, not an automated buy or sell system. The indicator's colors and values should not be interpreted in isolation as guaranteed entry or exit signals.
The indicator uses price and volume data available on the chart and should be analyzed within the context of the selected asset and timeframe. Different markets may have different volume characteristics, so results may vary depending on the instrument.
No financial results are guaranteed. Users are responsible for their own investment decisions and risk management.
🧪 Indicator Name
The name "Uranium Volume" is a visual reference to the concept of energy and momentum and does not imply that the indicator is related to the uranium market or uranium-mining assets. مؤشر

Jamallo Channels🔹Intro
For decades, technical traders have relied on conventional channel models, each burdened by fundamental mathematical limitations:
- Bollinger Bands rely on simple moving averages (SMA) and raw price standard deviation. When strong directional trends emerge, raw variance conflates trend slope with volatility, causing the bands to artificially flare open ("volatility bulge") and produce severe lag and frequent false mean-reversion signals.
- Keltner Channels utilize exponential moving averages (EMA) wrapped with Average True Range (ATR). While smoother, the EMA introduces continuous phase delay, and the bands drift constantly with price, failing to provide stable, horizontal support and resistance benchmarks during consolidation.
- Donchian Channels plot rolling highest highs and lowest lows over an N-bar window. However, they are exceptionally vulnerable to single-bar outlier wicks and sudden step jumps that distort the true statistical distribution without accounting for underlying volatility dynamics.
Jamallo Channels resolves these structural flaws through a novel mathematical synthesis:
1. It replaces lagging moving averages with a multi-resolution Maximal Overlap Discrete Wavelet Transform (MODWT) Haar filter bank coupled with an energy-calibrated deadband step-hold state machine. The baseline remains strictly stationary during consolidation and snaps instantaneously to new price levels upon statistically significant drift.
2. It decouples trend from volatility by computing standard deviation strictly on the detrended high-frequency wavelet residual, filtered through a rolling linear-interpolation median to eliminate spike distortion.
3. It locks the volatility corridor at the exact moment a new regime step triggers—producing pristine, step-synchronized horizontal channels and mathematically robust exhaustion zones.
🔹Break down
1. Multi-Resolution Haar Wavelet MODWT Engine:
- Undecimated Dyadic Decomposition: Deconstructs raw price action across up to 5 dyadic scale levels (Level 1 = 2-bar, Level 2 = 4-bar, Level 3 = 8-bar, Level 4 = 16-bar, Level 5 = 32-bar) into orthogonal approximation (trend) and detail (high-frequency noise) coefficients without phase distortion or downsampling loss.
- Scale-Adaptive Smoothing: Isolates the true low-frequency structural trend from intraday churn and microstructure noise at the selected dyadic decomposition level.
- Dynamic Detail Energy Tracking: Measures the real-time volatility intensity of the high-frequency detail spectrum by computing a rolling Simple Moving Average of absolute detail coefficients over a calibrated lookback window.
2. Energy-Calibrated Deadband Step-Hold Mechanism:
- Statistical Innovation Filtering: Establishes an adaptive deadband threshold scaled directly by the product of the detail energy and a deadband multiplier.
- Zero-Drift Piecewise Step-Holding: The smooth wavelet baseline is held strictly horizontal until price innovation definitively breaches the dynamic detail deadband threshold. Once breached, the baseline snaps instantaneously to the new equilibrium price level, eliminating baseline drifting during consolidation phases.
- Clean Regime Direction State: Evaluates the direction of every confirmed step, immediately classifying the market into Bullish (Teal) or Bearish (Maroon) regime states.
3. Detrended Residual Volatility & Frozen Sigma Bands:
- Trend-Decoupled Dispersion Measurement: Unlike standard deviation calculated around lagging moving averages—which artificially inflates during strong trends—Jamallo Channels isolates the high-frequency wavelet residual (Price minus Wavelet Mid) before computing variance, capturing genuine localized volatility.
- Median Filter Outlier Rejection: Applies a rolling linear-interpolation median filter (50th percentile over a 100-bar window) to the raw residual standard deviation, immunizing the channel against one-off spike anomalies and erratic expansion.
- Step-Locked Volatility Corridors: Volatility is sampled and frozen precisely at the moment a new Haar baseline step triggers. The frozen sigma remains constant throughout the entire regime life cycle, producing stable, non-wiggling horizontal channels.
4. Multi-Tier Volatility Corridors & Exhaustion Envelopes:
- Inner Expansion Zone (1.0σ): Defines the immediate high-probability operational boundary around the stepped trend baseline.
- Mid Dispersion Boundary (2.0σ): Represents standard 2-sigma statistical bounds where normal trending impulse legs oscillate.
- Outer Exhaustion & Mean-Reversion Zone (3.0σ): The extreme channel boundary (2.0σ to 3.0σ highlighted by shaded backgrounds) marks statistical overextension where price is prime for momentum exhaustion and mean-reverting retests back to the Haar stepped baseline.
🔹How to use: Trend Following & Risk Management
Jamallo Channels provides clear, objective mathematical parameters for both momentum trend riders and mean-reversion scalpers across all timeframes.
Regime Trend Trading:
- Setup & Execution: Enter in the direction of a newly confirmed Haar baseline step (when the baseline shifts color to Teal for Longs or Maroon for Shorts) or upon a sustained price breakout above/below the baseline following volatility compression.
- Stop Loss Placement: Anchor stop loss orders directly behind the most recent stepped Haar baseline level or just outside the opposite inner/mid channel boundary.
- Trailing & Letting Winners Run: Trail stop loss orders systematically step-by-step as new horizontal baseline rungs are confirmed, protecting capital while letting winners ride the macro expansion.
Mean-Reversion & Exhaustion Scalping:
- Exhaustion Rejection: When price enters the extreme 2.0σ–3.0σ outer band corridor (upper red fill or lower teal fill) and forms rejection wicks or structural exhaustion patterns, execute counter-trend mean-reversion setups.
- Take-Profit Targets: Target the inner channel (1.0σ) for partial profits and the primary Haar stepped baseline (0σ mean) for final profit harvesting.
- Invalidation / Stop Loss: Place tight stop losses just beyond the outer 3.0σ boundary line.
🔹Settings Parameters
Haar Wavelet Basis:
- Basis Level (1 - 5): Selects the dyadic wavelet decomposition scale (1 = 2-bar, 2 = 4-bar, 3 = 8-bar, 4 = 16-bar, 5 = 32-bar). Higher levels smooth out larger macro trends, while lower levels capture high-frequency swings.
- Deadband Multiplier (0.1 - 10.0): Scaling coefficient applied to the detail energy. Higher values widen the deadband, requiring larger directional thrusts to trigger a new step and producing wider, noise-immune steps.
- Detail Energy Lookback (5 - 200): The rolling lookback window used to calculate the average magnitude of wavelet detail coefficients.
Stdev Bands:
- Stdev Length (min 2): Lookback period for measuring the standard deviation of the detrended wavelet residual.
- Inner Multiplier (0.1 - 10.0): Standard deviation multiplier for the inner channel envelope (default: 1.0σ).
- Mid Multiplier (0.1 - 10.0): Standard deviation multiplier for the middle channel envelope (default: 2.0σ).
- Outer Multiplier (0.1 - 10.0): Standard deviation multiplier for the extreme exhaustion envelope (default: 3.0σ).
Display Settings:
- Basis Up Color: Custom color for the stepped baseline during bullish regime states (default: Teal).
- Basis Down Color: Custom color for the stepped baseline during bearish regime states (default: Maroon).
- Upper Color: Accent color for the upper channel bands and exhaustion fills (default: Red).
- Lower Color: Accent color for the lower channel bands and exhaustion fills (default: Teal).
- Show Fill: Toggles background shading for the inner and outer volatility corridors.
مؤشر

FCP | Market Sessions | High Low Box & Range StatsMarks the Sydney, Tokyo, London and New York sessions, tracks each
one's high and low, and carries those levels forward to the next
session open.
WHAT IT DRAWS
• A shaded box spanning each session's time window and price range.
• High and low lines that extend to the next session's open.
• Range extension lines projected from the session high and low at
configurable multiples of the session range (0.5x, 1x, 2x by
default), with optional multiplier labels.
• A stats table showing each active session's current range as a
percentage of its own average range over the last N sessions.
Rows for disabled sessions are hidden.
HOW IT WORKS
Session boundaries and session extremes are not read from the chart's
candles. They are computed from 5-minute data through a lower-timeframe
request, so the levels are identical whether you are on a 15-minute
chart or a 4-hour chart. The chart is only the canvas.
The session in progress updates on every tick rather than on bar close,
so the box and its high and low lines follow price in real time.
SETTINGS
Session timezone — sessions are defined in this timezone, so the
windows stay fixed regardless of the symbol's exchange timezone.
Accepts a UTC offset (GMT+0, GMT+3) or an IANA name (Europe/London).
Look-back — how many past sessions to keep drawn.
Each session has its own on/off switch, time window, colour and line
width, so you can define custom windows instead of the defaults.
Range extensions — three independent multipliers; set any of them to
0 to hide one. Line style, width and transparency are adjustable.
Range stats — the averaging window, panel corner and text size.
NOTES
Works on timeframes up to and including 1 day. On higher timeframes
nothing is drawn.
Session times are fixed to the selected timezone and do not shift with
daylight saving time. If your sessions are defined in a DST-observing
timezone, adjust the windows twice a year or enter an IANA timezone
name. مؤشر

Wave-Ocean Trend Wave-Ocean Trend
Description
Wave-Ocean Trend is a momentum indicator based on a combination of Exponential Moving Averages (EMA), mean deviation, and Simple Moving Average (SMA).
The indicator is designed to help visualize market direction and momentum changes through the relationship between two waves:
* X1 — Aqua: the fast wave, designed to respond to changes in momentum.
* X2 — Orange: the smoothed wave, used as a reference for identifying changes in market momentum.
## How to Use
🌊 Bullish Crossover
When X1 (Aqua) crosses above X2 (Orange), an Aqua ball appears.
This event represents a potential shift in momentum to the upside and can be used as a reference when analyzing possible bullish movements.
🔻 Bearish Crossover
When **X1 (Aqua)** crosses below **X2 (Orange)**, a **red-orange ball** appears.
This event represents a potential shift in momentum to the downside and can be used as a reference when analyzing possible bearish movements.
Reference Zones
The indicator includes two main reference zones:
* Above +60: elevated momentum zone.
* Below -60: negative momentum zone.
* Between +60 and -60: intermediate momentum zone.
These zones should not be interpreted independently as automatic buy or sell signals. They are intended to provide additional context when evaluating momentum.
## X1-X2 Area
The area between X1 and X2 helps visualize the difference between the two waves:
* Green: X1 is above X2.
* Red: X1 is below X2.
A wider separation between the waves indicates a larger momentary difference between fast momentum and its smoothed reference.
Settings
The indicator has two main parameters:
Fast Wave ⚡ — Default: 10
Controls the responsiveness of the fast wave.
Slow Wave 🐌 — Default: 21
Controls the smoothing of the reference wave.
Lower values may make the indicator more responsive to market changes, while higher values generally produce a smoother reading.
Suggested Use
Wave-Ocean Trend can be used together with:
* Market structure
* Support and resistance
* Higher-timeframe trend
* Volume
* Price action
* Risk management
One possible approach is to identify the broader trend on a higher timeframe and then use Wave-Ocean Trend crossovers on a lower timeframe to evaluate momentum within that context.
Important
Wave-Ocean Trend is a **technical analysis tool and does not guarantee financial results.
No crossover should be considered, by itself, a recommendation to buy or sell. Signals may occur during consolidation, choppy markets, or periods of high volatility and should be evaluated within the broader market context.
Use proper risk management and perform your own testing before using the indicator in live trading.
مؤشر

Market Regime: NQStatsMarket Regime — nqstats
A volatility-regime dashboard for NQ (and any symbol). It answers one question: is the market currently moving more, or less, than its own long-term normal — and is that changing? It does not predict direction. It describes the character and intensity of price movement, so you can size positions, place stops, and pick strategies that suit the current environment.
The methodology follows the market-regime framework described at nqstats.com/market_regimes. Big thanks to Chris for publishing this research and full credit to him for this concept. This indicator is simply an independent implementation of that concept, built for TradingView.
1. What it does
Markets cycle between calmer and more turbulent phases. A regime measure captures where you are in that cycle by comparing current volatility against a long-term baseline volatility:
- Ratio above 1.0 → Elevated regime. Moves are larger than normal.
- Ratio below 1.0 → Compressed regime. Moves are smaller than normal.
Knowing the regime matters because most strategies are implicitly tuned to a particular volatility environment. Running a breakout system in a compressed, range-bound regime — or a mean-reversion system in an elevated, trending one — is a common reason live results drift from a backtest. The indicator is a filter and a context tool, not a signal generator.
The output is a compact, monospace, monochrome table — there is no plotted line. That is deliberate: the regime is a daily-returns statistic, so the numbers are identical whether you view them on a 5-minute or a daily chart (see §2). A table reads cleanly on every timeframe; a plotted line would only be meaningful on the daily.
2. How it's calculated (and why)
Return series. It works from daily log returns: ln(close / previous close). Log returns are the standard choice for volatility work — they're additive across time and symmetric around zero. (A simple-returns toggle is provided if you prefer.)
Rolling volatility (the "now"). For each lookback window, it takes the standard deviation of those daily returns. A 10-day SD reflects the last ~2 weeks; a 50-day SD reflects the last ~2.5 months. Each is a snapshot of realized volatility at that horizon.
Baseline volatility (the "normal"). It takes the standard deviation of the same daily-return series over a long trailing window — several years — to represent the market's normal volatility across a full cycle. This is the denominator that defines "normal."
The regime ratio. rolling SD / baseline SD. Above 1 = louder than normal; below 1 = quieter than normal. This ratio is the heart of the framework.
Why standard deviation. Equity-index returns are skewed and fat-tailed, so it's fair to ask whether SD is the right scale. Two design choices handle this: the ratio is relative (rolling and baseline use the identical estimator, so most distributional distortion cancels in the division), and the extremeness read uses a percentile (see below), which is fully non-parametric and doesn't assume any distribution shape. SD is also what keeps this faithful to the reference methodology, and on the rolling side its sensitivity to large moves is a feature — a regime tool should react when a big move lands.
Why it's timeframe-independent. All calculations run on the daily series and are pulled onto your chart, so the table reads the same on any timeframe. This avoids a subtle trap: an intraday return SD is far smaller than a daily one, so comparing intraday volatility against a daily baseline would read "compressed" almost permanently. Keeping numerator and denominator in the same daily units is what makes the ratio meaningful.
Percentile (how extreme). For each lookback, the current rolling SD is ranked against its own history over the baseline window (0–100). A ratio tells you how far from normal; the percentile tells you how rare. A reading of 0.90 at the 5th percentile is a much bigger deal than 0.90 at the 40th. Because it's a rank, it's robust to skew and fat tails.
Compression trend. The change in the ratio over a short trend window tells you which way volatility is moving — whether compression is building (ratio falling) or easing (ratio rising).
A note on estimators: both the rolling and baseline standard deviations use the same population formula, so the two sides of the ratio are always measured identically.
3. Inputs and how to configure them
Regime
- Log returns — on by default. Turn off to use simple percentage returns.
- Lookback 1 / 2 / 3 (bars) — the three rolling windows, in daily bars. Defaults 10 / 20 / 50. These are your short, medium, and long horizons. Note "bars" here means trading days, since the calc runs on the daily series.
Baseline
- Baseline lookback (years) — how many years define "normal." Default 10. Longer = a more stable baseline that includes a fuller cycle (calm stretches and crises alike). Shorter = a baseline that reflects only recent conditions and updates faster. This single input has the largest effect on your readings: a baseline drawn only from a calm period will make current conditions look elevated, while one that includes major volatility events will make the same conditions look compressed. If you want to line up with an external reference, adjust the years until your BASE SD matches theirs.
Trend
- Trend window (days) — how far back the compression trend looks. Default 5. Smaller = more responsive; larger = smoother.
- Trend deadband (ratio) — how much the ratio must move before the trend is called BUILD or EASE rather than HOLD. Default 0.05. Widen it if the trend feels twitchy; tighten it if it sits on HOLD too often.
Table
- Text colour — applied to the whole table (monochrome by design).
- Location — nine on-chart positions.
- Text size — Tiny to Huge; scales the whole table.
4. What the table shows
Columns:
- LOOKBACK — the rolling window (e.g. 10d, 20d, 50d).
- STATE — Elevated (ratio > 1) or Compressed (ratio < 1). Binary at 1.0, matching the reference framework.
- RATIO — rolling SD ÷ baseline SD. The core number.
- %ILE — where current volatility ranks in its own multi-year history. Near 0 = calmer than almost any point in the window; near 100 = hotter than almost everything.
- COMPR — the compression trend: BUILD (compression increasing / volatility contracting), EASE (compression releasing / volatility expanding), or HOLD (inside the deadband).
- ROLLSD — the raw rolling standard deviation, for reference and for comparing against external sources.
Rows:
- One row per lookback.
- OVERALL — a headline read taken from the medium (20d) horizon: COMPRESSING, EXPANDING, or STABLE.
- BASE SD / BARS — the baseline standard deviation and the number of daily bars it was built from (≈ 252 × your years setting). Use BARS to confirm the baseline loaded the history you expect.
5. How to read it
Start with STATE and RATIO. Above 1 means the market is printing larger-than-normal moves (elevated); below 1 means smaller-than-normal (compressed). This says nothing about direction — only about how much the market is moving.
Read the lookbacks as a timeline, not three separate numbers. Because each window only "sees" its own recent slice, the shape across horizons tells a story. When the short window reads lower than the long one (e.g. 10d compressed while 50d still elevated), a volatility event from weeks ago is still inside the long window but has already rolled out of the short one — volatility is decreasing and compression is building. The reverse ordering means the front end is heating up. The shortest lookback always moves first, so watch it as your leading tell.
Use the percentile for extremeness. A compressed reading in the low single-digit percentiles means the market is near its quietest in years — historically these deep-compression phases tend to resolve, sometimes abruptly. A high percentile means an unusually loud environment.
Use COMPR and OVERALL for direction. BUILD means the coil is winding tighter; EASE means it's releasing. The first lookback to flip to EASE is your earliest heads-up that a compression is breaking.
Turning it into decisions (following the reference framework's guidance):
- Elevated regime — expect larger, more extended moves. Stops are better placed wider to accommodate the range, and position size reduced accordingly. Trend and continuation approaches tend to work better here.
- Compressed regime — the market tends to mean-revert and range. Breakout and trend strategies are less reliable. Realized volatility is low, so stops can often be tighter — but remember compression doesn't last, and it can release quickly.
- As a filter — before taking a trade, check that the strategy you're about to use suits the regime you're actually in. This is the single most valuable use of the tool.
Notes
- Built with NQ in mind but works on any symbol with sufficient daily history.
- Requires enough loaded history for the baseline; if BARS reads far below years × 252, extend your chart history or reduce the baseline years.
- This is an analysis tool, not financial advice, and does not generate buy/sell signals. Regimes describe volatility conditions; they do not predict direction.
- Concept credit: the market-regime framework at nqstats.com/market_regimes. This is an independent implementation. مؤشر

مؤشر

Renko Suiteall-in-one chart overlay engineered to clean up market noise, map structural order flow, and deliver actionable multi-market context directly on your standard time-based candle charts.
By combining synthetic Renko trend tracking with automated market structure levels and real-time index monitoring, this script allows you to spot structural shifts instantly without switching chart types.
Primary Use Cases
Noise Filtering & Trend Identification: Use synthetic Renko bar coloring to eliminate intraday choppy price movements, allowing you to hold positions during strong trends and spot real structural trend reversals early.
Initial Risk Mapping: The First-Candle Renko Box locks onto the high and low of the exact candle that triggered a new Renko color flip. Traders can use this initial range to set initial stop-losses or measure early breakout consolidation zones.
Target & Reversal Level Execution: Use the forward-looking Continuation / Flip Lines to identify exact price targets where the next Renko brick will print or where price must reverse to trigger a trend flip.
Dynamic Support/Resistance Tracking: Leverage the automated Pivot S/R lines to see where key swing highs and lows align with current Renko trends, identifying high-probability confluence zones for entries and exits.
Multi-Market Confluence: Monitor the live Index Dashboard (QQQ, SPY, DIA) in the corner of your screen to ensure individual stock trades align with the overall direction of the broader indices.
Key Features
Synthetic Renko Bar Coloring: Repaints live chart candles according to a custom-defined Renko box size without losing time-based bar visibility.
First-Candle Renko Trend Boxes: Generates a continuous visual box starting from the precise candle where a Renko color change occurs, locking its top/bottom boundaries to that trigger candle while extending forward until the next trend flip.
Forward-Looking Target & Projection Lines: Dynamically plots forward-extending line levels indicating the exact price target for the next bullish/bearish Renko brick, alongside a shaded Zero Zone marking the last closed Renko brick range.
Automated Pivot Support & Resistance: Identifies structural swing points via a multi-pass matrix algorithm and projects horizontal ray lines across your chart.
Live Index Dashboard: A non-intrusive bottom-right table providing real-time price readouts for QQQ, SPY, and DIA (including extended session data).
Inputs & Customization
Renko Settings: Adjust the primary box size, custom bullish/bearish colors, and toggle forward-looking target projection lines or the Zero Zone overlay.
Box Settings: Toggle trend boxes on/off and adjust transparency to suit dark or light chart themes.
Pivot Support / Resistance: Adjust pivot lookback periods (lb / rb), line styles (dashed, solid, dotted), widths, and distinct colors for support and resistance.
Index Display Settings: Selectively show or hide individual trackers for QQQ, SPY, or DIA. مؤشر

Sweep IFVG (M1D)Sweep IFVG
Marks one sequence and refuses to mark anything else.
Liquidity is taken, a fair value gap opens away from it, and that gap then fails and inverts.
Each stage has to happen in order and inside a window you set, or the zone is never drawn.
Most gap indicators draw every imbalance on the chart and let you sort out which ones matter. This one starts from the liquidity event and works forward, so a gap that opened without a raid in front of it is not a candidate and never appears. What survives to the chart is a small number of zones with a reason behind each one.
The sweep
A swing is the three-candle structure; one candle each side of the middle one, the middle holding the high or the low. That is the default, and it can be widened when you want only larger structure tracked. A sweep is that level being wicked through and rejected on the same candle: price trades beyond the swing extreme and the candle closes back inside it. A raided high is a buyside sweep, a raided low is a sellside sweep.
Each sweep is marked with a small arrow set clear of the bar — above a swept high, below a swept low — and the level that was taken is drawn as a solid line back to the candle that formed it, so the origin of the raid stays visible rather than being implied.
Sweeps are capped at a number you choose. Past it, the oldest arrow and its level line are removed together, so a sweep never half-disappears.
The candidate gap
A sweep stays live for a set number of bars afterwards. Only inside that window can a fair value gap be adopted as its displacement, which is what stops an unrelated gap forty bars later being attributed to a raid it had nothing to do with.
The displacement itself is read over three candles and has to clear a minimum size in ticks to count. It must also run the same way as the reaction the sweep implies: a raided low can only qualify a bullish leg, a raided high only a bearish one. Two things qualify — a fair value gap, and a suspension block — and the section below covers how they differ.
A qualifying gap is drawn as a dashed box named BISI or SIBI. That is a candidate — a gap on watch, nothing more.
Volume imbalance and suspension blocks
A fair value gap is measured wick to wick, and on a fast leg that understates the region. Where the candle bodies also gap but the wicks still bridge the space, there is a volume imbalance sitting on the seam, and it is part of the same imbalance rather than a separate object. The zone absorbs it: the edge extends from the wick out to the body it should have reached. Each gap has two seams, one either side of the displacement candle, and each is tested on its own.
A suspension block is what happens when both joins gap at once. Three candles run the same way and each one opens beyond the previous one's close, so the bodies never trade back through the leg at any point in it. The zone is then the whole suspended span, from the first candle's close to the last candle's open, and it is named SB+ or SB- rather than BISI or SIBI.
It qualifies on its own terms and does not need a fair value gap to be present. A leg can be stacked tightly enough that every wick overlaps the one before it — no wick gap anywhere — while the bodies still never trade back. That is the case a wick-measured gap cannot see at all. Where a wick gap is present as well, the block's span is drawn instead, and it always contains the gap it replaces: the first candle's close sits at or below that gap's high, and the last candle's open at or above its low.
A block goes on to fail and invert on exactly the same terms as any other candidate. The resolved edges — absorbed or suspended — are what the midpoint line, the overlap rule and the failure test are all measured against.
One exclusion is built in. A body gap across a session or weekend break is a calendar artefact rather than displacement, so a join spanning more than one bar's worth of time is rejected. Without it a daily session break would manufacture a block every day. The rule applies to blocks, which is where that would happen.
Absorption and block detection each have their own switch. With both off, every zone is the plain wick-to-wick gap.
The inversion
A candidate has a limited number of bars to fail. Failure means a candle body closing clean through the gap, not a wick into it: a wick is a probe, and probes are not delivery.
When that close happens the box turns solid, changes colour, and is renamed IFVG+ or IFVG-. The names describe how the gap was built and which way it now trades — a bullish gap that gets closed through becomes a bearish inversion. Both directions share one confirmed colour, because at that point the useful distinction is confirmed against candidate, and direction is already stated in the name.
A candidate that never fails inside its window is deleted rather than left on the chart. Nothing that did not complete the sequence stays drawn.
Consequent encroachment
Each zone can carry its midpoint — the consequent encroachment of that gap, which is a different object from the equilibrium of a range. It is off by default and has its own colour, width and line style.
Zone names sit beside the box, on its centre line, just past the right edge. The midpoint line stops at that edge and the text starts there, so neither ever crosses the other, and a name stays readable when the zone it belongs to is only a few pixels tall.
Keeping the chart readable
Four limits, all yours to set. Candidates are capped per side and confirmed inversions are capped per side, oldest dropped first. A new zone can optionally be refused when it overlaps one already on the chart, which is what stops a run of gaps stacking into a single unreadable block on a fast leg.
The fourth is distance. A zone left hanging far from the candles forces the price scale to keep reaching for it, so the candles end up squashed into part of the pane and the whole thing rescales every time you touch the chart. Confirmed zones past a set distance are dropped, measured from the nearer edge of the zone to the current close and expressed in chart-timeframe ATR so it carries across instruments and timeframes. A zone price is trading inside reads as near zero and can never be dropped from under the candles.
Candidates are never dropped this way — one has to stay in play to be able to invert at all — and they expire on their own grace window regardless.
Colours, border width, label text, label size and every name string are settings, including the words BISI, SIBI, SB+, SB-, IFVG+ and IFVG- themselves.
Alerts
Four. Buyside sweep, sellside sweep, bullish IFVG confirmed, bearish IFVG confirmed. The two sweep alerts fire on the raid itself; the two inversion alerts fire on the close that completes the failure.
Method & repainting
Everything is read from the chart timeframe. There are no higher-timeframe requests anywhere in the script, so there is no lookahead to get wrong and no future data to leak.
Every detection is gated to a confirmed bar close. A sweep, a gap and an inversion are all judged on closed candles, so nothing appears mid-bar and then withdraws.
One characteristic is worth stating plainly, because it is inherent to pivots rather than a fault: a swing is only confirmed once the bars to its right have printed. On the three-candle default that is one bar, and a sweep can only be measured against a swing that has been confirmed. Widening the swing setting widens that delay by the same amount. It is lag, not repainting — the marks do not move once drawn.
Zones and midpoint lines extend rightward to the current bar while they are live. That is the boxes tracking the present, not their history changing.
What it will not do
It places no entries, exits, stops or targets, and it does not size a position. It draws no trend, no bias and no target projection.
It does not read structure beyond the pivots it uses to find swings, and it does not label market phases. Whether a completed inversion is worth trading is a judgement about context this script does not have — session, higher-timeframe draw, and what the day has already done.
A sweep alone draws nothing but its arrow and its level. Displacement alone, with no raid in front of it, draws nothing at all. Only the finished sequence produces a zone, so an empty chart in a range is the tool working, not failing.
Settings
Swing lookback, sweep validity window, sweep markers and their size, the swept-level line and its width, and the cap on sweeps shown; minimum gap size, volume imbalance absorption, suspension block detection, inversion grace window, the per-side caps on candidates and confirmed inversions, the overlap rule and the distance gate with its ATR multiple; candidate and confirmed colours, sweep colour and zone border width; the midpoint line with its colour, width and style; and zone labels with their six name strings, size and text colour.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. It draws where a level failed, a candidate imbalance and leaves the decision to you. مؤشر

Regression Slope Oscillator [QuantAlgo]🟢 Overview
The Regression Slope Oscillator measures the rate of directional change in price using a robust regression estimator that resists outliers, then converts that slope into a scale free reading so a single threshold carries the same meaning across instruments and timeframes. Rather than fitting a least squares line, which a single spike or gap can pull off course, it takes the median of pairwise slopes inside a rolling window to produce a trend estimate that holds up through erratic data. A three state engine with separate entry and exit thresholds then translates the normalized slope into a bullish, bearish, or neutral regime, holding established states through pullbacks instead of flickering whenever the reading brushes the boundary.
🟢 How It Works
The indicator's core methodology lies in its combination of outlier resistant slope estimation and volatility relative normalization, where a trend regime is only established once the fitted rate of change clears a threshold expressed in units of the instrument's own volatility.
First, the source is optionally moved into log space so the fitted slope becomes a proportional rate of change rather than an absolute one, keeping readings comparable across instruments at very different price levels and across histories where price has moved by an order of magnitude:
srcMid = useLog ? math.log(srcSafe) : srcInput
Then the slope is fitted across the window using a robust estimator rather than ordinary least squares, which has an effective breakdown point of zero and lets a single gap or liquidation wick tilt the fit for the entire window. Theil-Sen takes the median of every pairwise slope inside the window, tolerating roughly 29 percent contaminated data while staying close to a least squares fit on clean data:
for i = 0 to length - 2 by 1
for j = i + 1 to length - 1 by 1
array.push(slopes, (source - source ) / (j - i))
array.median(slopes)
Repeated Median nests the same idea, taking a median of pairwise slopes anchored on each bar and then a median of those results, which lifts the breakdown point to 50 percent, the theoretical maximum, at several times the computational cost. Both estimators target the same underlying quantity, so switching between them changes robustness without shifting the scale.
The raw slope is then divided by a volatility unit to strip out the instrument's price scale and volatility regime, producing a reading that means the same thing on any chart:
normUnit = switch normMode
'ATR' => useLog ? atrUnit / srcSafe : atrUnit
'Stdev' => sdevUnit
=> useLog ? 0.01 : srcSafe / 100.0
slope = rawMid / normUnit
Each path is dimensionally self consistent with the log transform, so numerator and denominator always move together and the resulting reading stays dimensionless. In ATR mode a value of 0.10 means the trend is advancing at one tenth of an average true range per bar.
The normalized slope then drives a state engine where the level required to establish a regime and the level required to release it are deliberately different, creating a hysteresis band that suppresses boundary flicker:
if slope > entryTh
state := 1
else if slope < -entryTh
state := -1
else if useNeutral and state == 1 and slope < exitTh
state := 0
else if useNeutral and state == -1 and slope > -exitTh
state := 0
Finally, in Candles display mode the estimator runs two additional passes against the chart high and the chart low, building a synthetic OHLC series in slope space where the body spans the change in slope and the wicks reveal how far trend disperses across the bar range, with an optional Heikin-Ashi transform applied on top:
barHigh = math.max(slopeHigh, math.max(barOpen, barClose))
barLow = math.min(slopeLow, math.min(barOpen, barClose))
haClose = math.avg(barOpen, barHigh, barLow, barClose)
🟢 Signal Interpretation
▶ Bullish State (Oscillator Above the Upper Entry Band with Bullish Color)
The normalized slope has cleared the positive entry threshold, meaning price is advancing faster than the instrument's own recent volatility rather than simply drifting higher. Trend traders take the confirmation as a long entry and hold through pullbacks, since the state only releases once the slope retreats below the exit level rather than on every minor pause, and a reading that climbs deeper into the upper zones represents strengthening rather than a reason to exit. Mean reversion traders read the same plot for depth instead of direction. A reading sitting in the first zone is an ordinary trend and offers nothing to fade, but a push into the second or third upper zone means price is rising at two or three times the rate required for confirmation, which is statistically unusual and marks the region where an advance is most likely to decelerate and revert toward the band. The trigger for a fade is the turn back down out of the outer zone rather than arrival in it, because a steep slope can hold for a surprisingly long stretch in a genuine trend.
▶ Bearish State (Oscillator Below the Lower Entry Band with Bearish Color)
The normalized slope has cleared the negative entry threshold, confirming that price is declining at a rate meaningful relative to its own volatility. Trend traders use this for short entries or long exits and keep directional bias through corrective bounces that fail to reverse the underlying rate of change. Mean reversion traders again work from zone depth, treating a reading in the lower second or third zone as an accelerated decline that is stretched far enough for a bounce back toward the band to carry a favorable expected move. In either direction, a slope that decays back toward the entry band while price continues in the trend direction is an early rate of change divergence, giving mean reversion traders advance notice of exhaustion and trend traders a reason to tighten stops before the state formally releases.
▶ Neutral State (Oscillator Inside the Threshold Band with Neutral Color)
The oscillator has released into neutral, either because an established regime decayed back through its exit level or because the slope never cleared entry to begin with. This reading carries the same meaning for both styles, since price is neither trending quickly enough to follow nor stretched far enough to fade. Trend traders stand aside and watch for the compression that frequently precedes the next confirmed regime, while mean reversion traders treat the return into the band as a completed reversion and the natural place to close a fade, the move having exhausted itself by definition once the slope no longer clears the threshold.
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets tailored to different trading styles and timeframes, each configuring the slope window, normalization length, entry threshold, exit fraction, and normalization method together so the threshold always stays matched to the units it is measured in. "Default" balances noise filtering against responsiveness for swing trading on 4-hour and daily charts. "Fast Response" shortens the window and lowers the entry threshold to engage regimes early for intraday use on 5-minute to 1-hour charts, while a raised exit fraction releases them quickly. "Smooth Trend" lengthens the window and raises the entry threshold to produce few, high conviction regimes held through deep pullbacks, suited to position trading on daily and weekly charts.
▶ Built-in Alerts: Six alert conditions plus a dynamic alert message enable automated monitoring of regime transitions without constant chart observation. "Bullish State" and "Bearish State" trigger on first confirmation of a directional regime, "Neutral State" fires when a directional regime is released, and "Any State Change" provides a combined alert covering all transitions through a single setup. "Bullish Zero Cross" and "Bearish Zero Cross" track the moment the slope changes sign, offering an earlier and more sensitive trigger than threshold confirmation.
▶ Visual Customization: A Candles or Line display toggle switches between the full synthetic slope candle series and a single plotted value for a lighter, cleaner presentation. In Candles mode, an optional Heikin-Ashi transform makes sustained trend phases visually contiguous, and hollow up candles layer bar direction on top of the regime color so momentum inside a state can be read at a glance, for example a filled bar within a bullish phase indicating the slope eased on that bar. Graduated threshold zones fill at one, two, and three multiples of the entry threshold at progressively increasing transparency, giving an immediate sense of how far beyond confirmation the current reading sits.
Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart themes with coordinated bullish and bearish schemes applied consistently across every element.
مؤشر

TF: Market Cycle MA (MCMA)TradingFlow: Market Cycle MA (MCMA)
MCMA plots two moving averages of the same length on the price chart: an EMA and a Wilder RMA. These two averages smooth price at different rates, so their relative position tells you about the current trend direction and momentum at a chosen cycle length.
Switch the chart timeframe and you'll see the broader market regime at each level, from intraday cycles up to weekly and monthly trends. This helps you stay aligned with the dominant direction while filtering out short-term noise.
The cycle length comes from a standard market calendar: up to 5 minutes maps to a trading day, 6–15 minutes to a trading week, 16–65 minutes to a trading month, up to 24 hours to a quarter, and weekly and above to a year. You can also use shorter cycle fractions (75% or 50%) for faster response.
How It Works
EMA uses a smoothing factor of 2/(N+1), while Wilder RMA uses 1/N. With the same period N, the EMA responds roughly twice as fast as the RMA. This difference is the core signal:
• When price is trending upward, the faster EMA pulls above the slower RMA.
• When price is trending downward, the faster EMA drops below the slower RMA.
• When price is flat, both averages converge and the spread narrows.
In practice, this behaves like a fast/slow EMA crossover system where the "slow" side is approximately twice the "fast" side's period, packed into a single setting.
How to Read the Chart
• Green line (thicker): EMA, the faster average.
• Fainter line (thinner): Wilder RMA, the slower average, same color family as the EMA but more transparent.
• Fill between lines: colored by the current trend regime. Green for bullish, red for bearish, gray for neutral.
The fill color changes as the regime shifts, giving you a continuous read on trend state.
Trend Classification
MCMA classifies each bar into one of three regimes based on multiple conditions:
• Bullish: EMA is above RMA, price is above RMA, EMA is rising, and RMA is not falling.
• Bearish: EMA is below RMA, price is below RMA, EMA is falling, and RMA is not rising.
• Neutral: Any other combination, such as small spread, flat slopes, or mixed price position.
You can raise the minimum EMA–RMA spread (in ATR units) to filter out low-confidence signals during choppy markets. A slope filter is also available to require the EMA to be moving decisively in the trend direction.
Important
MCMA is a trend-direction indicator. It does not predict reversals, generate entry signals, or measure volatility. The trend classification is a filtered interpretation of the two averages' relationship, not a confirmation of price action. Because both averages use the same nominal period, the EMA–RMA spread primarily reflects recent momentum rather than the full cycle's worth of data. For the best results, use MCMA as context alongside other tools rather than as a standalone signal.
---
TradingFlow: Market Cycle MA (MCMA)
MCMA 在價格圖上同時繪製兩條相同週期長度的均線:EMA 和 Wilder RMA。兩種均線對價格的平滑速率不同,因此它們之間的相對位置可以揭示市場在選定週期下的趨勢方向與動量狀態。
切換圖表時間框架,就能看到不同層級的市場狀態,從日內週期到週線和月線趨勢,幫助你在各個時間框架下識別主要趨勢方向,過濾掉短期雜訊。
週期長度來源於標準市場日曆:5m 及以下對應一個交易日,6–15m 對應一個交易週,16–65m 對應一個交易月,24h 及以下對應一個季度,週線以上對應一年。指標也支持較短的週期比例(75% 或 50%),以獲得更快的響應。
工作原理
EMA 使用 2/(N+1) 的平滑係數,Wilder RMA 使用 1/N。在相同週期 N 下,EMA 的響應速度大約是 RMA 的兩倍。這種差異就是核心訊號來源:
• 價格上漲時,較快的 EMA 會領先於較慢的 RMA。
• 價格下跌時,較快的 EMA 會落後於較慢的 RMA。
• 價格橫盤時,兩條均線趨於收斂,價差縮小。
實際上,這等於一個快/慢雙均線交叉系統,「慢」側的週期約為「快」側的兩倍,只是用單一設定就能實現。
如何閱讀圖表
• 綠色線(較粗): EMA,較快的均線。
• 較淡的線(較細): Wilder RMA,較慢的均線,與 EMA 同色系但透明度更高。
• 兩條線之間的填充區域: 顏色由當前趨勢狀態決定。綠色表示看漲,紅色表示看跌,灰色表示中性。
填充區域的顏色會隨趨勢狀態的變化而切換,提供持續的視覺趨勢讀取。
趨勢分類
MCMA 根據多個條件將每根 K 線分為三種狀態之一:
• 看漲: EMA 位於 RMA 上方,價格位於 RMA 上方,EMA 正在上升,且 RMA 未在下降。
• 看跌: EMA 位於 RMA 下方,價格位於 RMA 下方,EMA 正在下降,且 RMA 未在上升。
• 中性: 其他任何組合,例如價差較小、斜率平坦或價格位置不一致。
可調高最小 EMA–RMA 價差(以 ATR 為單位)來過濾震盪市中的低置信度訊號。還可使用斜率過濾器,要求 EMA 在趨勢方向上明確運動。
重要說明
MCMA 是一個趨勢方向指標。它不預測反轉、不生成進場訊號、也不衡量波動率。趨勢分類是對兩條均線關係的過濾解釋,而非價格行為的確認。由於兩條均線使用相同的名義週期,EMA–RMA 價差主要反映近期動量,而非完整週期的數據。為獲得更好的效果,建議將 MCMA 作為輔助背景工具,與其他分析方法配合使用,而非作為獨立訊號。
---
TradingFlow: Market Cycle MA (MCMA)
MCMAは、価格チャートに同じ期間の2本の移動平均線をプロットします。1本はEMA、もう1本はウィルダーRMAです。2本の線は異なる速度で値動きを平滑化するため、互いの位置関係から選択したサイクルにおけるトレンドの方向とモメンタムを読み取ることができます。
チャートのタイムフレームを切り替えれば、日中の短いサイクルから週足・月足のトレンドまで、各レベルでの市場のレジームを把握できます。主たる方向感覚を保ちつつ、短期的なノイズを排除するのに役立ちます。
サイクルの長さは標準的な市場カレンダーから算出されます。5分足以下は1営業日、6〜15分足は1営業週、16〜65分足は1営業月、24時間以下は四半期、週足以上は1年に対応します。より短いサイクル割合(75% or 50%)を選択すると、応答が速くなります。
仕組み
EMAの平滑化係数は2/(N+1)、ウィルダーRMAは1/Nです。同じ期間Nでも、EMAはRMAのおよそ2倍の速さで反応します。この差がシグナルの核となります。
• 価格が上昇トレンドにあるとき、速いEMAは遅いRMAの上に位置します。
• 価格が下降トレンドにあるとき、速いEMAは遅いRMAの下に位置します。
• 価格がレンジで推移するとき、2本の線は収束し、スプレッドは狭まります。
実質的にこれは、速いEMAと遅いEMAのクロスオーバーシステムと同じ動作をします。「遅い」側の期間が「速い」側の約2倍に相当し、1つの設定で実現しています。
チャートの見方
• 緑の線(太い方): EMA。速い方の移動平均です。
• 薄い色の線(細い方): ウィルダーRMA。遅い方の移動平均で、EMAと同じ色系統ですが透過率が高くなっています。
• 2本の線の間の塗りつぶし: 現在のトレンドレジームに応じて色が変わります。強気なら緑、弱気なら赤、中立ならグレーです。
レジームが切り替わると塗りつぶしの色も変わり、トレンドの状態を視覚的に把握できます。
トレンド分類
MCMAは複数の条件に基づき、各足を3つのレジームのいずれかに分類します。
• 強気: EMAがRMAの上、終値がRMAの上、EMAが上昇中、RMAが下降していない。
• 弱気: EMAがRMAの下、終値がRMAの下、EMAが下降中、RMAが上昇していない。
• 中立: 上記以外のすべての組み合わせ。スプレッドが小さい、傾きがフラット、価格の位置が混在する場合など。
EMA−RMAスプレッド(ATR単位)の最小値を上げれば、もみ合い相場での偽シグナルをフィルタリングできます。傾きフィルタを使えば、EMAがトレンド方向に明確に動いていることを条件として設定できます。
注意事項
MCMAはトレンド方向を示す指標です。反転の予測、エントリーシグナルの生成、ボラティリティの測定を行いません。トレンド分類は2本の移動平均の関係をフィルタリングして解釈したものであり、価格行動の確認ではありません。両方の平均が同じ名目の期間を使用しているため、EMA−RMAスプレッドはサイクル全体のデータよりも直近のモメンタムを反映します。より効果的に使うには、MCMA単体ではなく他のツールと併用して背景情報として活用してください。
مؤشر

Ghost Pattern Finder Ghost Pattern Finder searches an instrument’s historical price action for candle patterns that closely resemble a user-selected section of the current chart.
The idea is simple:
If price behaved like this before, what happened next?
Unlike a traditional pattern indicator, the script does not look for predefined formations such as triangles, flags, or head-and-shoulders patterns. Instead, you manually select the price sequence you want to analyze. The indicator then searches the instrument’s own history for similar market behavior and overlays the historical pattern directly on the selected area.
Candle-based Ghost Overlay
The historical match is displayed as a transparent candle overlay rather than only as a line.
This makes it possible to visually compare:
candle bodies
wicks
bullish and bearish sequences
local swings
volatility
acceleration and consolidation phases
the overall shape of the move
The overlay is intentionally semi-transparent so the original chart remains clearly visible underneath it.
Historical Candle Forecast
Once a qualified historical match is found, the candles that actually followed that historical pattern are projected forward.
The projected candles are therefore not generated by AI, regression, or mathematical extrapolation.
They are the real OHLC candles that occurred after the historical match, adjusted to the current price level and time scale.
The forecast should therefore be understood as a historical ghost, not as a guaranteed prediction.
Multi-Timeframe Search
The indicator can search neighboring timeframes automatically.
For example, when used on a 1-hour chart, it can compare patterns from approximately:
15 minutes
30 minutes
1 hour
2 hours
4 hours
A match from another timeframe is not required to have exactly the same number of candles.
Variable Pattern Duration
Historical market structures often develop faster or slower than the current pattern.
For this reason, the indicator also searches different pattern lengths within every timeframe.
By default, historical candidates can range from approximately:
0.5× to 2.0× the duration of the selected pattern.
All candidates are normalized before comparison.
This allows the indicator to recognize similar market behavior even when the historical event unfolded at a different speed.
Strict Ghost Qualification
The script does not simply display the best available candidate.
A historical pattern must pass several independent filters before it is accepted as a Qualified Ghost.
The qualification process evaluates:
overall price-shape correlation
correlation of the most recent part of the pattern
candle-body and wick similarity
swing/directional structure
normalized shape distance
robustness when the comparison window is slightly shortened or shifted
If no candidate meets the selected requirements, the indicator displays:
NO QUALIFIED GHOST
This is intentional. A weak historical similarity should not automatically produce a forecast.
Ghost Stability
Similar matches belonging to the same historical event are grouped into a Ghost Family.
This prevents slightly shifted versions of the same historical pattern from being treated as completely new signals.
The AUTO mode also favors the currently active ghost unless another qualified historical event becomes clearly superior.
The goal is to reduce unnecessary forecast switching when only a few new candles appear.
Multiple Ghosts
The indicator can retain several independent qualified historical matches.
The user can choose:
AUTO
Ghost #1
Ghost #2
Ghost #3
Ghost #4
Ghost #5
This allows manual inspection of alternative historical analogs instead of relying entirely on the algorithm’s highest-ranked candidate.
Adjustable Search Parameters
The settings allow control over:
timeframes included in the search
historical search depth
minimum and maximum pattern-duration scaling
search precision
correlation requirements
tail correlation
candle similarity
swing similarity
robustness
shape distance
ranking weights
ghost-family clustering
ghost switching sensitivity
Preset modes are available for easier use:
Strict, Balanced, Loose and Manual.
Appearance
Overlay and forecast visuals can be customized independently.
Users can adjust:
overlay bullish candle color
overlay bearish candle color
overlay wick color
overlay transparency
forecast bullish candle color
forecast bearish candle color
forecast wick color
forecast transparency
selected-pattern area
invalidation level
This allows the historical ghost to remain visible without hiding the original chart.
How to Use
Select a meaningful section of price action using the Pattern START and Pattern END inputs.
The indicator then:
Builds the selected candle pattern.
Searches historical data across the enabled timeframes.
Tests multiple historical pattern durations.
Scores and filters the candidates.
Groups similar candidates into historical Ghost Families.
Overlays the selected ghost as transparent candles.
Projects the actual historical candles that followed it.
For a conservative workflow, start with Ghost Strictness = Strict.
Important
Ghost Pattern Finder is a historical analog analysis tool.
Markets do not have to repeat previous behavior. A high-quality historical match only means that a similar sequence existed in the past; it does not mean the same outcome will occur again.
The projected candles show what happened after a historical analog, not what must happen next.
The indicator does not place trades and should be used as additional market context rather than as a standalone trading signal. مؤشر

Moving Average IndexMoving Average Index is an overlay indicator that manages up to ten moving averages at once and highlights their relationship to each other, rather than just displaying them side by side. It's built for anyone who wants to track several moving averages at the same time without the chart turning into a tangle of lines — for example to compare short- and long-term trends, or to keep multiple timeframes in view at once, and see at a glance how these averages relate to one another.
Each moving average can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
**Moving Average** (present ten times, MA 1–MA 10, each instance identically structured)
- Length: number of bars the average is calculated over.
- Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
- Source: the price or value the calculation is based on (e.g. close).
- Timeframe: a separate timeframe for this average; left empty, it uses the chart's timeframe. On a higher timeframe, the value updates within that timeframe's still-forming bar and can shift slightly until that bar closes.
- Line style: Line, Stepline, or Circles.
- Line width: thickness of the plotted line.
- Color: color of the line.
**Fill** (present three times, Fill 1–Fill 3, each instance identically structured)
- Connect: the two moving averages the area is drawn between.
- Bull / Bear: two colors: one for when the first selected average is above the second, the other for the opposite case.
Each enabled moving average is plotted as its own line, in the chosen style, width, and color. Up to three areas can also be shown between any two of these averages: their color switches automatically whenever the order of the two connected averages changes — one color while the first one is above, the other once it drops below. Once such an area is active, the indicator hides the two lines it connects; only the colored area remains visible, making trend changes stand out more clearly than with two crossing lines.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance. مؤشر

OBV Acceleration / DecelerationDescription:
Introduction
Classic On-Balance Volume (OBV) is a powerful tool for tracking smart money and volume flow. However, standard OBV relies on raw closing prices to determine whether volume was "bullish" or "bearish" for the day. This makes it highly susceptible to market noise, wicks, and fake-outs.
This open-source script, OBV Acceleration / Deceleration, rebuilds the OBV formula from the ground up. It filters price noise using a Fibonacci-weighted Master Average and introduces a Volume Kinetics engine to detect exactly when volume is accelerating (spiking) or decelerating (drying up)
How It Works: Core Logic & Features
This indicator is built on three core mechanical features. Here is the exact logic behind how they work:
1. The Fibonacci Master Average (Noise Filtering)
Instead of looking at the raw close price to decide if volume should be added or subtracted, this script calculates six separate Simple Moving Averages (SMAs) based on the first six numbers of the Fibonacci sequence (1, 1, 2, 3, 5, 8).
*The Logic: The script averages these six SMAs together to create a "Master Average."
*The Result: If the Master Average is pointing up, the volume is added to the OBV. If it points down, it is subtracted. This ensures that a single erratic price wick does not falsely flip the volume flow.
2. Volume Kinetics (Acceleration & Deceleration)
Standard OBV only tells you direction, not intensity. This script measures the "velocity" of the volume by tracking the absolute change in the OBV step bar-by-bar, and compares it to a 40-period historical average.
*Acceleration (Volume Spikes): If the current volume is greater than our customizable Expansion Factor (default 2.0x the average), it flags an Acceleration state. This indicates high momentum, institutional participation, or a heavy breakout.
*Deceleration (Volume Dry-Up): If the current volume drops below our Compression Factor (default 0.5x the average), it flags a Deceleration state. This mathematically highlights market exhaustion, tight consolidation, or a lack of interest.
3. OBV Moving Average & Cloud Fill
To help determine the broader momentum context, a 20-period SMA is applied directly to the custom OBV line.
*The Logic: A dynamic cloud fills the space between the OBV line and its SMA.
*The Result: When OBV is above its SMA, the cloud is Teal (Bullish momentum). When OBV is below its SMA, the cloud is Maroon (Bearish momentum).
Visual Guide (Reading the Dots)
The indicator plots color-coded dots directly on the OBV line to give you instant visual feedback on volume kinetics:
🟢 Bright Green Dot: Bullish Acceleration (High-volume buying spike).
🔴 Bright Red Dot: Bearish Acceleration (High-volume selling spike).
🟡 Yellow Dot: Deceleration / Exhaustion (Volume has severely dried up).
🔵 Teal Dot: Standard bullish volume flow.
🟤 Maroon Dot: Standard bearish volume flow.
Practical Trading Applications
Confirming Breakouts: If price breaks through a key resistance level and the indicator prints a Bright Green Dot, it confirms the breakout is supported by anomalous volume and is more likely to succeed.
Spotting Reversals (Exhaustion): When price approaches a major support or resistance level and prints a cluster of Yellow Dots, it means the volume pushing the trend has dried up. This often precedes a reversal or a deep pullback.
Trend Riding: Stay in trades as long as the OBV line remains on the correct side of its SMA (represented by the Teal or Maroon cloud fill), ignoring minor price pullbacks.
مؤشر

مؤشر

TTP IMB - Unfilled ImbalancesWhat it draws
Unfilled imbalances — three-bar fair value gaps — from four timeframes at once (4H, 1D, 1W, 1M by default, all configurable), rendered on whatever chart timeframe you are on. Switching the chart resolution does not change the levels: a weekly gap keeps the same two prices whether you are looking at 4H or 1D.
A gap is defined by wicks across a three-bar window:
bullish — the high of the first bar is below the low of the third
bearish — the low of the first bar is above the high of the third
The box spans exactly those two extremes.
When a gap stops being drawn
Once price has overlapped 66.6% of the box's ORIGINAL height, measured from the side price enters by. A bullish gap dies when price falls that far into it from the top; a bearish gap when price rises that far from the bottom. A wick is enough by default — there is a setting to require a close instead, which leaves noticeably more zones alive.
The threshold is adjustable. 100 means only a complete traverse closes a zone, 50 is the classic midpoint rule.
Partially overlapped zones keep their full original geometry — the box does not shrink, so you can always see the imbalance as it was formed.
Fading
A zone price has already eaten at least 50% into, but which has not reached the closing threshold, is drawn faded and labelled with its fill percentage. This separates an untouched imbalance from one that has already been worked, without hiding either.
Multiplicative search band
Zones lying entirely outside a band around current price are discarded before anything else. That band is a RATIO — price/N up to price*N, N=2 by default — not a percentage.
This matters more than it sounds. A symmetric percentage band is badly lopsided, because price moves in multiples: −80% is 0.2x, a five-fold drop, practically zero, while +80% is only 1.8x, a couple of levels. Equal ratios up and down is what a log chart actually shows.
Timeframe gating
Only timeframes at or above the chart's own are computed, and only up to a ceiling of N rungs above it (2 by default). On a 4H chart that gives 4H/1D/1W and drops the monthly; on a daily chart, 1D/1W/1M. Timeframes below the chart are never drawn — they would be hairlines — and are not calculated at all.
Set the ceiling to 3 to see everything at or above the chart, or to 0 for the chart's own timeframe only.
How much is shown
Per timeframe: the N nearest unfilled zones above price and N below (3 each by default), plus every zone that currently CONTAINS price — those are the operative ones and are never rationed away.
Border thickness increases with timeframe, so the hierarchy reads at a glance.
Settings worth knowing
Filled at (%) — closing threshold, default 66.6
A wick is enough to fill — off requires a bar close beyond the threshold
Zones per side, per TF — default 3
Search range (xN) — multiplicative band, default 2
Dim a zone once filled (%) — fading threshold, default 50
Rungs above chart TF — the gating ceiling, default 2
Ignore zones thinner than (%) — optional micro-gap filter, off by default
Notes and limitations
The still-forming higher-timeframe bar cannot CREATE a zone — that would repaint intrabar — but it does count toward FILLING one, so a zone can die live as price moves into it. Everything else is closed-bar only.
Buffers fill only as far back as the chart's own loaded history reaches. On a 4H chart covering roughly two years, the monthly buffer holds about two dozen months rather than the full setting. This does not affect zones near price, which is all the script draws.
The gap scan is linear in the number of bars. The "has this gap been filled" test is answered with suffix extremes rather than a nested scan over later bars, which is what keeps four timeframes inside the execution budget instead of timing out.
This is a visualisation tool. It marks structural levels and does not generate entry or exit signals. مؤشر

Daily High & Low Time Map (HOD / LOD)Daily High & Low Time Map
What it does
This indicator counts, across the completed trading days that your chart has loaded, which time window of the day produced the daily high and which produced the daily low. The result is a two-row heat strip in its own pane, lined up in time under the running day, plus a dashboard that answers the one question that actually matters intraday: at this hour, in how many of the past days was the final high still ahead? Every number carries its sample size, so you can see when a bright cell stands on three days instead of three hundred.
How it works
The script walks the chart bar by bar, never leaves the timeframe you are on and never requests data from a higher timeframe. A day is a span between two anchor points that you choose; inside that span each confirmed bar can move the running high and low. The time bucket of an extreme is taken from the opening time of the bar that produced it, so a later part of the day can never move an earlier reading.
A day is closed on the first bar of the next day and written once into a ring buffer; the running day is never part of the statistics.
The bucket index comes from the bar opening time in the anchor timezone, which follows daylight saving. The repeated hour of the autumn change stays inside the same day, which is capped at 100 % coverage instead of counting as an error.
Days below the coverage threshold - half days, data gaps, the clipped first day of a replay - are dropped and reported as skipped instead of silently diluting the counts.
Filters for weekday, day type and sample window are applied while counting; stored days are never modified. Shares carry a Wilson score interval, which stays inside 0 to 100 % even when a bucket holds no hits or every hit.
How to use it
Add the script. It opens in its own pane below the chart.
Pick the day definition that matches the instrument: midnight New York for index and FX charts, the 18:00 anchor for CME futures, the 09:30 anchor when only the cash session interests you, midnight UTC for symbols that trade around the clock.
Read the upper row of the strip as "how often the daily high was made here" and the lower row as the same for the daily low. Brighter means more often.
Read the dashboard line "High still ahead" as a conditional share over completed days, never as a statement about today.
If the cells look pale and the note says the sample is small, widen the slot or load more history before you read anything into them.
What makes it original
Time-of-day statistics for highs and lows exist, and so do session boxes; what this script does differently is refuse to hand out a number without the evidence behind it. Every share is printed with the sample it came from and with a Wilson confidence interval, so a bucket built from eleven days does not read like one built from two hundred. Days are admitted only when they carry enough bars to be comparable, and the dropped ones are counted in plain sight. The map is a strip of buckets rather than a table, because the question is a shape. The conditional row extends the same idea forward: given the time of day, how much of the day's high-making is still ahead - again with the sample attached.
Inputs
Behaviour:
Day definition - where a trading day starts: Midnight New York, Futures 18:00 NY, RTH 09:30 NY or Midnight UTC. Session windows use the same timezone, and an evening session is labelled by the calendar day it ends on.
Slot width - 15, 30 or 60 minutes. A bucket narrower than one chart bar is raised automatically and the dashboard says so.
Min day coverage % - a day counts only with at least this share of the bars of the fullest day on the chart. Range 10-100, default 60.
Last N days - size of the ring buffer. Range 5-1000, default 250.
Tie rule - which occurrence wins when the same price is reached twice in a day.
Use start date and Start date - restrict the sample to days after a fixed date. Off by default.
Mon , Tue , Wed , Thu , Fri - on by default. Sat and Sun - off by default. Auto-include weekends for 24/7 symbols - on by default; crypto includes both anyway.
Day type - all days, or only those that closed above or below their open.
Asia , London KZ , NY AM KZ , Lunch , NY PM KZ - session windows, one dashboard row each; a bucket counts when any part of it falls inside. NY AM KZ drives the session-start alert.
Show Silver Bullet rows - three fixed one-hour rows. Off by default.
Count current slot as still open - whether a day whose extreme fell into the current bucket counts as ahead. On by default.
Ahead alert threshold % - level at which the ahead alert fires. Range 1-99, default 25.
Ramp scaling - relative to the busiest bucket, or a fixed scale so two symbols can be compared.
Strip mode - both rows, high only, low only, or one combined row counting either extreme.
Presentation: whether the strip, dashboard, live row, Wilson bounds, sparkline, session rows and the H and L markers are drawn, the dashboard corner and text size, the marker size and background, the two colour ramps and the theme.
Signals and alerts
Entering high-frequency high slot - fires on bar close when price enters the bucket that held the daily high most often in the current sample.
Entering high-frequency low slot - the same for the daily low.
Ahead alert - fires on bar close the first time the share of days with a later high falls below the threshold.
Session start - fires on the first bar inside the NY AM window.
New running day extreme - fires on bar close when the running high or low of the day has moved.
The first three depend on the aggregation, which is evaluated on the most recent bar. They are meant for live use; on historical bars they stay silent.
Repainting
Every state change happens on a confirmed bar. The running day is written into the sample only on the first bar of the next day, so the current day never influences a count. The bucket of an extreme is taken from the opening time of the bar that made it and is stored once; nothing rewrites it later. There is no request for a higher timeframe and no lookahead, so a reload and a bar replay produce the same numbers.
Limitations
The map is suppressed above a certain timeframe and whenever the chart bar does not divide the bucket width - on a daily chart every day is one bar, and on a 45-minute chart with 60-minute buckets some buckets get twice as many bars. The strip stays empty and the note line says why. Use a minute timeframe that divides the bucket width.
The sample is the loaded chart history, nothing more: at 20 000 bars roughly 14 days on 1-minute futures, 51 on a 1-minute regular-hours stock chart, 72 on 5-minute futures, 256 on 5-minute regular hours, 217 on 15-minute futures, 430 on 30-minute and 870 on hourly. The dashboard prints the number it has.
Small samples move. Below 30 days the cells are dimmed on purpose, and a share out of ten days is a number, not a finding.
Buckets the chart has no bars for - the night hours of a regular-hours stock chart - stay dark. That is missing data, not a measurement.
On a 1-minute chart the strip cannot be drawn more than 500 bars into the future; the dashboard reports how many buckets were left out.
It describes the past of one symbol on one chart and says nothing about where today's high will be.
This script is a charting tool for educational purposes. It does not provide financial advice and does not predict future price movement. Trading carries risk; decisions and their outcome remain yours. مؤشر

Regime Gated Confluence Score [Pineify]Regime Gated Confluence Score
Overview
This pane indicator combines trend, momentum, and volume after a four-state gate selects meaning and weight. The main score and dashboard reconcile signed contributions.
Problem Definition
Fixed-weight confluence hides a regime error. Positive RSI may confirm a trend but mark extension in a range. EMA separation can persist after efficient travel ends. Relative volume shows participation, not acceptance. A permanent sum can stay strong when path efficiency is low, factors disagree, or ATR leaves its baseline, so users cannot tell whether magnitude reflects agreement or one dominant input.
Design Rationale
ATR-normalized EMA separation and slope measure trend across price scales. Centered RSI supplies momentum; RANGE reverses it to express a fade. Volume pressure combines capped relative volume with close location without claiming aggressor flow. EMA spread and path efficiency classify structure; ATR versus baseline identifies displacement. Lower hold thresholds add hysteresis. A trained model would add hidden data assumptions, while fixed weights preserve the failure. Explicit rules accept sensitivity and lag for auditability.
Key Features
Four regimes with hysteresis.
Standardized trend, RSI, and participation factors.
Regime weights, range inversion, missing-volume renormalization, conflict attenuation, exact contribution totals, and confirmed alerts.
How It Works
EMA spread and fast-EMA change are normalized by ATR, blended 65/35, and clipped to -1 through +1. RSI is centered at 50, divided by 25, and clipped. Volume multiplies close location inside the bar by relative volume capped at 2.5 times baseline, then smooths it. If fewer than 80% of volume-window bars are usable, volume is omitted.
Trend strength is absolute normalized EMA spread. Path efficiency divides net movement by total one-bar movement. ATR relative to baseline measures displacement. VOLATILE has priority until its lower hold level clears. Otherwise, strong separation and efficiency enter TREND, weak evidence enters RANGE, and unresolved evidence is TRANSITION.
Trend/momentum/volume weights are 55/30/15 in TREND, 15/60/25 in RANGE, 40/35/25 in VOLATILE, and 35/40/25 in TRANSITION. RANGE reverses only RSI. Missing volume removes its weight and renormalizes the others. Agreement divides absolute net contribution by total absolute contribution and sets a 0.55-to-1 gate; VOLATILE adds an ATR penalty. Gated components sum to the score. Warm-up or invalid threshold and EMA ordering blocks output with a diagnostic.
How Multiple Indicators Work Together
Trend estimates structure, momentum locates bounded pressure, and volume tests participation plus bar acceptance. The regime interprets them before combination. Without range inversion, extension becomes a continuation vote; without trend, brief momentum can dominate; without volume, weights must be renormalized. Agreement converts remaining conflict into lower magnitude rather than hiding it.
Trading Ideas and Insights
Use the score as context, not an order. A confirmed threshold cross during TREND identifies aligned conditions. In RANGE, check whether trend or volume opposes inverted momentum before considering a fade. In VOLATILE, a compressed gate shows ATR displacement discounting the raw sum. A strong component beside a modest total indicates conflict.
Unique Aspects
The contribution is the sequence of classification, interpretation change, weighting, and attenuation. RANGE reverses momentum while other factors can veto it; hysteresis separates trend entry from persistence; missing volume is removed; and agreement scales every component so the ledger equals the score. The halo shows magnitude, the background shows regime, and the table exposes construction.
How to Use
Start with defaults and compare the regime label with visible path behavior. Wait for warm-up. Keep the ledger visible to see whether structure, oscillator pressure, or participation drives direction. Use confirmed alerts when closing-state transitions matter. Contribution lines are diagnostic; the halo and background form the primary view. Omitted volume means a disclosed two-factor score.
Customization
EMA lengths and slope lookback control structural response; RSI length controls momentum sensitivity. Volume baseline and smoothing trade speed for stability. Regime length changes path efficiency and the ATR baseline. Entry thresholds must exceed hold thresholds. Raising the score threshold reduces alert frequency but does not establish better forecasting. Visual switches change display only.
Assumptions and Limitations
The script uses chart OHLC and reported volume. Exchange, tick, and absent volume differ; close-location volume is only a proxy. EMA, ATR, RSI, and rolling baselines lag. RANGE can fade a breakout, hysteresis can delay exits, and attenuation can suppress an early shock.
Realtime factors, regime, colors, and score can change before close; alerts require confirmation. No request calls, future data, pivots, or negative offsets are used. The script does not model liquidity, news, sizing, entries, stops, or exits. Thresholds do not establish expected return. Sparse bars and unreliable volume can distort evidence.
Conclusion
This replaces a fixed sum with an inspectable state process. The score and ledger show weights, conflict attenuation, and missing-data effects. Keep separate risk and execution rules.
.
مؤشر

مؤشر

5-Day Rolling SMA 1m + Trend Alignment Band5-Day Rolling SMA 1m + Trend Alignment Band
This indicator displays a rolling multi-day Simple Moving Average calculated from 1-minute closing prices, together with a three-state Trend Alignment Band.
It is designed to provide a continuous view of short-term market direction across intraday chart timeframes.
Concept
A conventional 5-day SMA calculated on a daily chart averages only five daily closing prices.
This indicator uses a different approach. It calculates the average from all 1-minute closing prices contained in approximately five regular trading sessions.
For a U.S. stock or ETF with a 390-minute regular trading session:
390 minutes x 5 trading days = 1,950 one-minute bars
The default 5-day calculation is therefore approximately equivalent to:
SMA = Sum of the last 1,950 one-minute closes / 1,950
However, the script does not assume that every market has exactly 390 one-minute bars per trading day.
Instead, it measures the actual number of 1-minute bars in recent completed trading sessions. It then uses the median session length to estimate the typical number of bars per day.
The rolling window is calculated as:
Rolling Window = Typical 1-minute bars per session x Rolling Days
Using the median helps reduce the influence of shortened or unusual trading sessions.
Why use 1-minute data?
Using 1-minute data allows the multi-day average to move continuously instead of behaving like a daily moving average projected onto an intraday chart.
On a 1-minute chart, the rolling SMA can update every minute as:
one new 1-minute close enters the calculation;
the oldest observation leaves the rolling window.
On higher chart timeframes, the same internally calculated 1-minute rolling SMA is sampled onto the selected chart timeframe.
The purpose is not to reproduce a conventional 5-period daily SMA. It is to represent the average location of intraday prices over approximately the most recent five trading sessions.
Trend Alignment Band
The area between price and the rolling SMA is colored according to the relationship between price and the direction of the SMA.
Green - Bullish Alignment
Green appears when:
Price is above the rolling SMA.
The rolling SMA is rising.
Condition:
Price > SMA AND SMA(t) > SMA(t-1)
This indicates that price location and short-term trend direction are aligned upward.
Red - Bearish Alignment
Red appears when:
Price is below the rolling SMA.
The rolling SMA is falling.
Condition:
Price < SMA AND SMA(t) < SMA(t-1)
This indicates that price location and short-term trend direction are aligned downward.
Yellow - Transition / Conflict
Yellow appears when the two conditions are not aligned.
Examples include:
Price moves above the SMA while the SMA is still falling.
Price moves below the SMA while the SMA is still rising.
The SMA is flat.
Yellow should therefore not automatically be interpreted as a ranging market. It represents disagreement between current price location and the direction of the rolling average, which can occur during transitions, pullbacks, reversals, or consolidation.
Intended Use
The indicator is intended primarily as a short-term market-regime and directional context tool rather than as a standalone entry signal.
Possible uses include:
Identifying short-term directional bias.
Distinguishing aligned trends from transition phases.
Providing context for pullbacks and rallies.
Comparing current price with the average intraday price location of recent trading sessions.
Maintaining a consistent short-term reference when moving between intraday chart timeframes.
The three band states can be interpreted as:
Green = bullish alignment
Red = bearish alignment
Yellow = transition or directional conflict
These states are descriptive, not predictive, and should not be treated as automatic buy or sell signals.
Original Features
The script differs from a standard daily SMA or a fixed-length intraday SMA in several ways:
The moving average is calculated internally from 1-minute closing prices.
The script automatically measures the typical number of 1-minute bars in recent completed sessions.
The median session length is used to reduce sensitivity to shortened or irregular trading days.
The rolling period is automatically constructed from the detected session length and selected number of trading days.
The Trend Alignment Band combines both price position and SMA direction instead of using a simple price/SMA crossover alone.
This allows the indicator to adapt its multi-day rolling window to different symbols and trading-session structures without relying on a permanently fixed 1,950-bar setting.
Settings
Show 5-Day Rolling SMA
Shows or hides the rolling SMA line.
Show Trend Alignment Band
Shows or hides the colored area between price and the rolling SMA. Enabled by default.
SMA Line Width
Adjusts the thickness of the SMA.
SMA Color
Default: orange.
Band Transparency
Controls the transparency of the colored trend band.
Bullish Band / Bearish Band / Transition Band
Allows customization of the green, red, and yellow states.
Rolling Days
Default: 5 trading days.
Session Detection Days
Controls how many completed sessions are used when estimating the typical number of 1-minute bars per trading day.
Session
Regular: Uses the symbol's regular trading session.
All: Uses the available session data for the symbol.
For U.S. stocks and ETFs, Regular is the intended default.
Limitations
This is not the same calculation as a conventional 5-period SMA on a daily chart.
The indicator averages 1-minute closing-price observations, so it is better interpreted as a rolling intraday time-sampled price average over approximately the selected number of trading days.
Results can vary depending on:
the symbol's trading-session structure;
Regular versus All session selection;
holidays and shortened trading sessions;
the amount of 1-minute historical data available from the data provider;
the chart timeframe on which the internally calculated series is sampled.
A sufficient amount of historical intraday data is required before the script can determine the normal session length and calculate the full rolling window.
This indicator does not predict future prices and does not generate guaranteed trading signals. It should be used together with price structure, support/resistance, volume analysis, risk management, or other independent forms of analysis.
日本語説明
このインジケーターは、**直近の複数営業日相当の1分足終値から計算するローリングSMA(単純移動平均線)**と、価格とSMAの状態を3色で表すTrend Alignment Bandを表示します。
一般的な日足5SMAとは計算方法が異なります。
通常の日足5SMAは、
直近5本の日足終値の平均
ですが、本インジケーターは直近約5営業日に含まれる1分足終値を連続的に平均します。
米国株・ETFの通常取引時間が1日390分の場合、
390分 × 5営業日 = 1,950本
となるため、デフォルト設定では概ね1分足1950期間SMAに相当します。
1日のバー数を自動判定
このインジケーターでは、1日のバー数を390本と固定していません。
過去の完了した取引日について実際の1分足本数を計測し、その中央値から通常の1営業日あたりのバー数を推定します。
計算期間は、
ローリング本数 = 1営業日の代表的な1分足本数 × ローリング日数
として自動的に決定されます。
中央値を使用することで、短縮取引日などの特殊なセッションの影響を受けにくくしています。
1分足を使用する理由
日足5SMAをそのままイントラデイチャートへ表示すると、日ごとに値が切り替わるため階段状になります。
本インジケーターでは内部計算を1分足で行うため、1分足チャートでは新しい1分足が形成されるごとにローリング平均が更新されます。
したがって、通常の日足5SMAよりも連続的に、直近数営業日における価格の平均的な位置を表現できます。
上位時間足では、この1分足で計算されたRolling SMAを各チャート時間足へサンプリングして表示します。
Trend Alignment Band
価格とRolling SMAとの間を、価格の位置とSMAの方向に応じて3色に分類します。
緑 - Bullish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより上
SMAが上向き
Price > SMA かつ SMA(t) > SMA(t-1)
価格と短期トレンドの方向が上方向に一致している状態を示します。
赤 - Bearish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより下
SMAが下向き
Price < SMA かつ SMA(t) < SMA(t-1)
価格と短期トレンドの方向が下方向に一致している状態を示します。
黄 - Transition / Conflict
価格とSMAの方向が一致していない状態です。
代表例:
価格はSMAを上回ったが、SMAはまだ下降している
価格はSMAを下回ったが、SMAはまだ上昇している
SMAが横ばい
したがって黄色は単純な「レンジ」を意味するものではありません。
価格の位置と短期平均の方向に不一致が生じている状態であり、転換、押し・戻し、反転、持ち合いなどで発生します。
基本的な使い方
本インジケーターは直接的な売買シグナルではなく、短期的な相場環境と方向性を把握するためのツールとして設計しています。
基本的には、
緑 = 上昇方向への整合
赤 = 下降方向への整合
黄 = 移行状態または方向の不一致
として使用します。
価格が単にSMAの上か下かだけではなく、SMA自体の方向も同時に判定することが特徴です。
本インジケーター独自の特徴
一般的な日足SMAや固定期間のイントラデイSMAと比較して、以下の特徴があります。
1分足終値を内部計算に使用
1営業日の実際の1分足本数を自動計測
過去セッションの中央値によって通常のセッション長を推定
セッション長 × 日数からローリング期間を自動設定
価格のSMAに対する位置とSMAの方向を組み合わせて3色の状態を表示
これにより、1950本などの固定値をすべての銘柄に適用するのではなく、銘柄ごとの取引セッションに応じた複数日Rolling SMAを構成します。
設定
Show 5-Day Rolling SMA
Rolling SMAの表示・非表示。
Show Trend Alignment Band
Trend Bandの表示・非表示。デフォルトはON。
SMA Line Width
SMAの太さ。
SMA Color
デフォルトはオレンジ。
Band Transparency
帯の透明度。
Bullish / Bearish / Transition Band
緑・赤・黄色を個別に変更できます。
Rolling Days
デフォルト5営業日。
Session Detection Days
通常の1営業日の1分足本数を判定するために使用する過去セッション数。
Session
Regular:通常取引時間のみ
All:取得可能なセッションデータを使用
米国株・ETFではRegularを基本設定として想定しています。
通常の日足5SMAとの違い
通常の日足5SMAは、5本の日足終値を平均します。
本インジケーターは、直近約5営業日に含まれる大量の1分足終値を平均します。
したがって、両者は「5日」という時間範囲を扱っていても同じ指標ではありません。
本インジケーターは、直近数営業日において価格が平均的にどの水準に滞在していたかを連続的に表現することを目的としています。
制約・注意事項
計算結果は以下の要因によって変化する場合があります。
銘柄ごとの取引時間
Regular / All の選択
祝日や短縮取引
TradingView側で利用可能な1分足履歴
表示しているチャート時間足
十分な1分足履歴が存在しない場合、通常のセッション長および完全なローリング期間を計算できるまでSMAが表示されない場合があります。
また、本インジケーターは将来の価格を予測するものではなく、売買結果を保証するものでもありません。価格構造、支持抵抗、出来高、リスク管理など、他の分析と組み合わせて使用してください。 مؤشر

Volume Surge Radar - 2x/4x/8x/16x# Volume Surge Radar — 2x / 4x / 8x / 16x
The goal is simple: don't just find unusual volume—find when unusual volume keeps coming back.
## Overview
**Volume Surge Radar** is designed to identify unusual and **repeated volume activity**, not just isolated volume spikes.
The indicator compares each bar's volume against the **average volume of the previous trading week** and classifies unusual activity into four customizable tiers:
**2x → 4x → 8x → 16x**
It then tracks how often these volume surges occur within a configurable rolling window and combines that information with price behavior to provide a **RISING, FALLING, MIXED, or QUIET bias**.
The idea is simple:
**One volume spike may be noise. Repeated volume surges can tell a much more interesting story.**
---
## Key Features
### 🔹 Relative Volume Multiples
Every bar's volume is compared with its 1-week average volume.
For example:
* **2x** = Volume is at least 2 times the weekly average
* **4x** = Volume is at least 4 times the weekly average
* **8x** = Volume is at least 8 times the weekly average
* **16x** = Volume is at least 16 times the weekly average
The tiers are cumulative. For example, a **9x volume bar qualifies as a 2x, 4x and 8x event**.
---
### 🔹 Dynamic 1-Week Baseline
The indicator can automatically calculate the appropriate number of bars representing approximately one trading week based on the chart timeframe.
For example, the baseline can adapt differently when viewing:
* Daily charts
* Hourly charts
* 15-minute charts
* 5-minute charts
Session minutes and trading days per week are configurable, making the indicator adaptable to different markets.
You can also disable automatic calculation and manually specify the baseline.
---
## 🔹 Repeat Volume Detection
This is one of the main features of Volume Surge Radar.
Instead of only asking:
**"Is volume unusually high right now?"**
the indicator also asks:
**"How many times has unusually high volume appeared recently?"**
For each tier, the dashboard counts how many bars inside the configured rolling window reached:
**2x / 4x / 8x / 16x volume**
This can help distinguish an isolated spike from repeated participation.
For example:
**2x volume once**
may simply represent a single event.
But:
**2x+ volume 4 times within 20 bars**
may deserve significantly more attention.
---
# Understanding the Dashboard
The dashboard provides a compact view of current and recent volume activity.
### NOW
Shows whether the current bar has reached each volume tier.
### Hit Count
Shows how many times each volume threshold has been reached within the configured rolling window.
### Ratio
Displays the exact current volume multiple.
For example:
**3.7x**
means the current bar's volume is approximately **3.7 times the calculated 1-week average volume**.
### Price Change
Displays the percentage price change over the same rolling window used for volume analysis.
### Up / Down Surge Count
Shows how many qualifying high-volume bars closed higher versus lower.
For example:
**5↑ 2↓**
means five qualifying surge bars were positive candles and two were negative candles.
---
# Volume Bias
Volume Surge Radar combines two pieces of information:
1. **Price change over the rolling window**
2. **Whether qualifying volume surges occurred more frequently on up or down bars**
The indicator then produces one of several possible readings.
### 🟢 RISING
Price direction and volume-surge direction both support a bullish interpretation.
Repeated high-volume activity is occurring alongside positive price behavior.
### 🟢 RISING?
Only one of the two measurements supports the bullish interpretation.
Consider this an early or weaker signal rather than confirmation.
### 🔴 FALLING
Price direction and volume-surge direction both support a bearish interpretation.
Repeated high-volume activity is occurring alongside negative price behavior.
### 🔴 FALLING?
Only one measurement supports the bearish interpretation.
Additional confirmation may be useful.
### ⚪ MIXED
Price movement and volume-surge direction disagree.
This may indicate conflicting participation, consolidation, absorption, or a transition period.
### ⚪ QUIET
Not enough qualifying volume events have occurred to establish a meaningful bias.
---
# How I Use It
The indicator is particularly useful as a **confirmation and discovery tool** rather than as a standalone buy/sell signal.
### Example 1 — Breakout Confirmation
A stock breaks above an important resistance level.
Instead of looking only at whether the breakout candle has high volume, Volume Surge Radar can show whether **multiple elevated-volume events have appeared around the breakout**.
Repeated 2x or 4x volume combined with a **RISING** bias can provide additional evidence of participation behind the move.
### Example 2 — Finding Unusual Accumulation
Price may initially move only modestly while several unusually high-volume bars appear within a relatively short period.
For example:
**4 separate 2x+ volume events within 20 bars**
can be more interesting than one isolated 4x spike.
The indicator helps make these repeated events easier to identify.
### Example 3 — Distribution / Weakness
Suppose a stock remains near its highs, but repeated high-volume bars increasingly close down.
The dashboard may begin showing more:
**↓ volume surges**
while the bias moves toward **FALLING?** or **FALLING**.
That divergence between price location and volume behavior may deserve additional investigation.
### Example 4 — Extreme Volume Events
An **8x or 16x** volume bar represents an unusually large departure from the recent baseline.
These events can occur around:
* Earnings
* News
* Breakouts
* Gap moves
* Institutional activity
* Capitulation
* Major reversals
The indicator highlights these extreme-volume bars so they can be investigated quickly.
---
# Alerts
Volume Surge Radar includes several built-in alert conditions.
### Single Volume Surge Alerts
Alerts are available when volume reaches:
**2x / 4x / 8x / 16x**
These are useful when monitoring individual extreme-volume events.
### Repeated Volume Alerts
You can also receive alerts when a particular volume tier occurs repeatedly within the rolling window.
For example:
**2x volume reached 4 times within the last 20 bars**
This allows you to detect persistent unusual-volume activity without constantly watching the chart.
### Bias Alerts
Alerts are also available when the volume/price bias changes to:
**RISING**
or
**FALLING**
### Custom Repeat Alert
A configurable alert allows you to choose:
**Volume Tier + Required Hits + Direction**
For example:
**4x Volume + 3 Hits + Rising Bias**
This makes it possible to create alerts around the specific type of volume behavior you want to monitor.
---
# Suggested Workflow
I generally recommend using Volume Surge Radar alongside market structure rather than interpreting volume in isolation.
Look for repeated volume activity around:
* Support and resistance
* Breakouts and breakdowns
* Consolidation ranges
* Moving averages
* Previous highs/lows
* Gap areas
* Earnings or news events
The indicator answers:
**"Is unusual volume appearing repeatedly, and what is price doing while that volume appears?"**
The trader still determines **why that activity matters within the broader chart structure.**
---
# Important Interpretation
High volume is **not automatically bullish**.
A 4x, 8x or even 16x volume event simply tells us that market participation is unusually high compared with the recent baseline.
That activity could represent:
**Accumulation, distribution, breakout participation, profit-taking, capitulation, news-driven trading, or other market activity.**
For this reason, volume should always be interpreted together with **price action and market structure**.
---
# Limitations
Volume Surge Radar is an analytical tool and should not be treated as an automatic trading system.
The RISING/FALLING bias is based on price movement and the direction of qualifying volume bars. It does **not** directly identify institutional buying or selling.
Extremely high volume can also occur because of earnings, news, index rebalancing or other one-time events.
Different assets have different volume characteristics, so the default thresholds and rolling-window settings may need adjustment depending on the instrument and timeframe.
---
## Final Thought
Traditional volume indicators tell you:
**"Volume is high."**
Volume Surge Radar goes one step further:
**"How high is it, how often has it happened recently, and what has price been doing while those volume surges occurred?"**
That is the core idea behind **Volume Surge Radar**.
The goal is simple: don't just find unusual volume—find when unusual volume keeps coming back.
مؤشر
