EZ$ AMDBrief update description
EZ$ AMD Extreme Distribution v2.2 refines the indicator around higher-timeframe AMD narrative and precise lower-timeframe execution. Its primary purpose is to identify one high-quality AMD BUY near the lowest qualified manipulation area or one AMD SELL near the highest qualified manipulation area.
AMD signals require a completed accumulation period, manipulation beyond the accumulation range, a meaningful external-liquidity sweep, a confirmed reclaim, microstructure shift, displacement, and majority multi-timeframe bias agreement. The default model uses 4-hour AMD with 1-minute or 5-minute execution, making it suitable for Asia, London, and New York trading.
The live higher-timeframe candle synchronizes with the selected AMD model and changes color in real time:
Yellow: accumulation or waiting
Aqua: low-side manipulation
Purple: high-side manipulation
Green: bullish distribution
Red: bearish distribution
Standard BUY/SELL signals are optional and disabled by default. Support/resistance and higher-timeframe supply/demand origin zones remain available as visual context without independently creating AMD entries.
Settings guide
1. Recommended: AMD extreme signals only
This is the cleanest setup and the one I recommend.
Simple Signal Engine
Setting Value
Standard BUY / SELL Display Off
Confirm Signals on Candle Close On
Signal Gap 8
Microstructure Length 2
Displacement Range × ATR 0.80
Displacement Body ÷ Range 0.60
This removes ordinary reaction signals and leaves AMD as the main entry engine.
Optimal Higher-Timeframe Signals
Setting Value
Show Confirmed HTF BUY / SELL Off
This prevents additional HTF labels from appearing.
Bias Dashboard
Setting Value
Show Bias-Only Dashboard On
Use Confirmed HTF Candles On
Count 5m, 15m, 1H, 2H, 4H, Daily All On
Minimum Matching Biases 4
An AMD BUY requires at least four bullish timeframes, while an AMD SELL requires at least four bearish timeframes. The aligned side must also outnumber the opposing side.
AMD settings
Setting Value
Show 4-Hour AMD On
All other AMD timeframes Off
Show AMD Extreme-Level Signals On
Hide Standard Signals When AMD Signals Are On On
AMD Signals Only on 1m / 5m Charts On
AMD Signal Timeframe 4H
Require External Level Liquidity Sweep On
Require Close Back Through Swept Level On
Require Microstructure Shift + Displacement On
One AMD Signal Per Candle On
Use Accumulation High / Low On
Use Selected AMD Candle Open Off
AMD Zone Trigger Mode Deepest Zone Reaction
Use HTF Origin Zones for AMD Location On
Use HTF Zone Edges + Midpoint On
Require Level Cluster Inside HTF Zone On
Minimum Levels in Cluster 2
Show Manipulation Extreme Diamond Off
This is the strict A+ configuration.
2. Structural-zone visuals
For your 4-hour AMD and 1-minute execution workflow:
Setting Value
Zone Model Adaptive
Chart Timeframe Zone Off
5-Minute Zone Off
15-Minute Zone Off
1-Hour Zone Off
2-Hour Zone Off
4-Hour Zone On
Daily Zone Off
Show Interaction Volume Off
Show Timeframe + Zone Type On
Use Visible Zones for Standard Signals Off
Require FVG / Imbalance for S/D On
Maximum S/D Retests 1
The 4-hour supply/demand origin zone remains visible and can improve AMD location, but it does not create an entry by itself.
3. Key levels
Keep these on:
Camarilla H4/L4
Previous day high/low
Previous week high/low
Previous 4-hour high/low
Asia high/low
London high/low
New York high/low
Overnight high/low
Keep these off for less noise:
Central Pivot
H3/L3
Daily, weekly, and monthly opens
Previous mids
Monday levels
Quarter levels
Yearly levels
Timed opens
The highs become possible SELL-side liquidity, and the lows become possible BUY-side liquidity.
4. Live AMD candle
Setting Value
Show Live HTF Candle On
Sync Live Candle to AMD Signal Timeframe On
Color Live Candle by Real-Time AMD Phase On
Show Timeframe Label On
Show Candle Timer On
The candle color is developing visual context. An actual AMD signal still requires a confirmed execution candle.
To show regular BUY/SELL signals too
Use:
Setting Value
Standard BUY / SELL Display Bias-Aligned Only
Hide Standard Signals When AMD Signals Are On Off
Show AMD Extreme-Level Signals On
This displays both:
Ordinary bias-aligned BUY/SELL
Strict AMD BUY/AMD SELL
For even stricter ordinary signals, turn Use AMD to Filter Standard Signals on. Ordinary BUY/SELL signals will then require matching AMD distribution.
I would leave this off initially because your primary focus is the AMD extreme signal.
To show only regular signals
Setting Value
Standard BUY / SELL Display Bias-Aligned Only
Show AMD Extreme-Level Signals Off
Show Confirmed HTF BUY / SELL Off
This returns the indicator to ordinary level reactions filtered by majority bias.
To show no signals at all
Use this visual-only mode:
Setting Value
Standard BUY / SELL Display Off
Show AMD Extreme-Level Signals Off
Show Confirmed HTF BUY / SELL Off
Show Manipulation Extreme Diamond Off
You may still keep these visible:
4-hour AMD boxes
Live AMD candle
Bias dashboard
Key levels
4-hour supply/demand zone
This provides AMD market context without any entry symbols.
When no AMD signal appears
That does not necessarily mean the indicator is malfunctioning. Under the recommended settings, all of these must qualify:
You are using a 1-minute or 5-minute chart.
The 4-hour accumulation period completed.
Price manipulated beyond the correct accumulation boundary.
An external high or low was swept.
Price closed back through the swept level.
Price reclaimed into the accumulation range.
Microstructure shifted.
Displacement confirmed.
At least four of six biases agreed.
The required level cluster or HTF origin-zone condition qualified.
No earlier AMD signal was already issued for that 4-hour model.
Indicator

Accumulation Distribution DivergenceOverview
Accumulation Distribution Divergence turns Chaikin's Accumulation/Distribution line into a bounded pane oscillator and runs a price/oscillator divergence engine on it, with a built-in forward-calibration harness that measures whether those divergences have actually preceded a move on your instrument. It is an analytical study of accumulation versus distribution — not a strategy, not a signal, not a recommendation.
What it measures — and why it is not another CVD/MFI tool
The A/D line measures a different physical quantity from the volume oscillators most traders already run. Cumulative Volume Delta signs an entire bar's volume by tick direction; the Money Flow Index weights volume by typical price. The A/D line instead weights each bar's volume by its Close-Location-Value — how close the bar finishes to its high versus its low — so a bar that opens weak but closes on its high still accumulates. Because the input quantity is different, an A/D-line divergence is an independent read of who is in control, not a restatement of a signed-tick or typical-price oscillator. That independence is the entire point of running it alongside your existing volume tools.
How the three components work together (why they are combined)
This is a deliberate three-part construction, not a random stack. Each part answers a question the previous one leaves open:
The oscillator answers "is volume accumulating or distributing right now?" — the raw A/D line drifts endlessly and can't be read on a fixed scale, so it is detrended (subtract its EMA), z-scored over a window to put it on a portable σ axis, and tanh-squashed to a soft ±100 pane where 0 is balance and the ±50 bands mark an accumulation/distribution edge.
The divergence engine answers "is that flow diverging from price?" — it compares confirmed price pivots to the oscillator at those pivots. Regular divergence (price makes a new extreme, flow does not) flags thinning conviction; hidden divergence flags trend continuation. Divergence alone, though, is famously prone to firing early and often.
The calibration harness answers the question every divergence tool leaves unanswered: "has this class of divergence actually paid on this symbol?" Every regular divergence is queued and resolved a fixed horizon later against the unconditional same-horizon base rate, and the dashboard reports Hit % / Edge / sample size with a Wilson-score-gated star. A divergence that never beats the base rate is adding no information — and now you can see that instead of assuming it.
Together: a distinct volume lens, a divergence read on it, and an honesty layer that tells you whether the read is worth anything on the instrument in front of you.
How to use it
Read the oscillator's side and slope — above 0 is net accumulation, below 0 is net distribution.
Treat a divergence mark as context (conviction thinning or trend confirming), never as a standalone entry. It marks a condition, not a trade.
Read the dashboard before you weight a divergence: if the Bull/Bear Edge is not clearly positive with an adequate sample and a star, that class is not carrying an edge on this instrument right now.
Combine with your own level/trend framework and risk rules. This tool describes behaviour; it does not decide anything for you.
Settings
Five grouped sections: Data source (High/Low series for the pivots — configurable so the engine runs on any market), A/D engine (detrend EMA and normalization window), Divergence (pivot strength, max bars between pivots, hidden on/off, connecting lines), Calibration (forward horizon, minimum sample for stars), and Dashboard & theme (position, auto/dark/light palette that reads the chart background so the table stays legible, and the bull/bear colours).
Universality & data note
High/Low are inputs, so the divergence engine works on any symbol or timeframe. The A/D line, however, needs real volume — on a no-volume symbol (like a cash index) the dashboard reads "no volume" and no signals fire. Use the futures contract. Defaults target liquid index-futures intraday; change the sources and lengths for any other asset.
Non-repainting
Pivots confirm a fixed number of bars after the fact and do not move once printed. The calibration harness logs and resolves only on confirmed bars, so its statistics never repaint. The live oscillator value updates each bar, like any oscillator.
Originality
The Accumulation/Distribution line and Close-Location-Value are Marc Chaikin's public concepts; the Wilson score interval is Edwin B. Wilson's; price/oscillator divergence is a standard public technique. What is original here is the specific construction: the detrend → z-score → tanh-squash oscillator that makes the A/D line readable on a fixed bounded scale, the combined regular+hidden divergence engine keyed to that oscillator, and — most importantly — the forward-calibration harness that scores each divergence class against its unconditional base rate with a Wilson-gated confidence read. This is a clean-room implementation; no third-party script code is reused.
Concept credits
Accumulation/Distribution line & Close-Location-Value — Marc Chaikin
Wilson score confidence interval — Edwin B. Wilson
Price/oscillator divergence — standard public technical-analysis technique
Disclaimer
Educational / informational only. Not financial advice, not a signal, not a recommendation. The oscillator describes past volume-and-location behaviour; the edge figures are in-sample, forward-measured at a fixed horizon over overlapping windows, with no costs, slippage or stops — read them as context, not a verified backtest. Past behaviour does not assure future behaviour. Markets carry risk. Do your own research and paper-trade before risking capital; you alone are responsible for your decisions. Indicator

HTF Candle PO3 AMD SessionsHTF Session Dashboard (Higher Timeframe Candles)
Core idea: This indicator allows you to view the price action of a Higher Timeframe (HTF) drawn as full candles directly on your current lower timeframe chart. It's designed to keep you aware of the macro market structure without needing to constantly switch timeframes.
How It Works
Instead of just showing standard HTF levels, this indicator dynamically builds and projects the current day's higher timeframe candles (e.g., 4-Hour candles) off to the right side of your active chart (e.g., a 1-minute or 5-minute chart).
The candles are constructed in real-time. As price moves on your lower timeframe, the active "current" HTF candle will grow its wicks and adjust its body live.
Key Features
Live HTF Candle Projection: Displays the sequence of HTF candles that make up the current trading day, spaced neatly to the right of the current price action.
Session Extremes: Automatically draws dotted reference lines stretching across your chart to highlight the absolute High, Low, Body High, and Body Low of the entire current session.
Live Countdown Timer: Shows a dynamic timer above and below the candle cluster indicating exactly how much time is left until the active HTF candle closes.
Hour Labels: Every HTF candle has a small label indicating its open hour (with an adjustable timezone offset setting) to help you quickly identify Kill Zones within the macro candles.
Visual Customization: Fully adjustable body width, transparency, spacing, offset distance, and bull/bear color schemes.
Clean Daily Reset: The indicator automatically clears the prior day's candles at midnight (exchange time) and begins building the new sequence, keeping your chart uncluttered.
Why Use This?
When trading intraday (like on a 1m chart), it's easy to get lost in the noise and trade right into a major 4-Hour support or resistance level. By projecting the 4-Hour candles directly onto your 1-minute chart, you always know exactly where you are relative to the higher timeframe narrative and structure.
Recommended Settings
HTF Setting: 240 (4 Hours) or 60 (1 Hour) when trading on a 1m–15m chart.
Hour Label Offset: Adjust this (e.g., +1 or -1) if you want the candle hour labels to match a specific local time zone (like EST) rather than exchange time.
Indicator

BEDROCK Gated Macro Spot Cycle ModelBEDROCK condenses several independent long-term Bitcoin valuation models into a single transparent 0–100 score, then maps that score onto a seven-tier ladder running from deep value to cycle-top risk — with capitulation and euphoria gates that hold back the two most common false signals at each extreme. It is built for spot investors making multi-month and multi-year allocation decisions, not for short-term trading.
The reference card below shows how to read the model and how each tier behaves:
█ WHAT IT DOES
BEDROCK answers one question: where does price sit inside its macro cycle right now? Rather than a single oscillator, it scores a basket of slow-moving valuation measures, normalizes each to a common 0–100 "cheap → expensive" scale, blends them into a weighted composite, and classifies the result into an actionable tier with a suggested accumulation or distribution size. A higher composite means greater long-term value and lower risk; a lower composite means the market is stretched and risk is rising.
█ HOW IT WORKS
The composite is built from four independent blocs, any of which can be reweighted or disabled:
Trailing cost-basis bloc — price relative to the 200-week SMA, the 2-year SMA, and the 200-day SMA (Mayer Multiple). These three are deliberately collapsed into a single averaged, bounded factor so the moving-average family is represented once and cannot dominate the score through collinearity.
Drawdown from all-time high — how far price has fallen from its peak. The heaviest-weighted leg by default.
Weekly RSI — long-term momentum, as secondary confirmation.
MVRV Z-Score (optional) — an on-chain valuation leg you can enable and feed from an external source.
Each metric is mapped to 0–100 through its own linear calibration between a deep-value anchor and an expensive anchor, so every leg speaks the same language before being combined. Weights are auto-renormalized over whatever blocs are actually available — so the model stays coherent on early history where the 200-week isn't yet populated, or when MVRV is turned off. It simply reweights the parts it has.
█ THE TWO GATES — THE CORE IDEA
A raw valuation score has two classic failure modes: it screams "generational buy" on the first leg down of a bear market, and it screams "top" every time price gets mildly extended. BEDROCK addresses both with directional gates that only ever cap the tier toward the middle — they never fabricate a signal, and they never block the core accumulate or trim reads.
Capitulation gate (bottom) — the two deepest tiers stay locked until the market shows genuine capitulation. Generational requires a large drawdown from the all-time high (or a deeply negative MVRV-Z); Deep Accumulation requires price at or below its 200-week basis. Until then the score is capped at Accumulation, so you keep buying value without prematurely committing everything.
Euphoria gate (top) — the two riskiest tiers stay locked until multiple independent overheating signs agree across the 200-week multiple, weekly RSI, the Mayer Multiple, and MVRV-Z. Euphoria requires at least one confirmation; Cycle Top requires at least two. This is what stops the model from calling a top on every rally.
Because both gates only cap toward neutral, accumulation signals are never suppressed and trim signals are never suppressed. The gates restrain only the extreme calls, and only until the evidence is actually there.
█ READING THE INDICATOR
Composite line — the 0–100 score, colored by its current tier.
Background — shaded by tier for at-a-glance cycle context.
Threshold lines — the tier boundaries.
Markers — gated triangles mark transitions into accumulation tiers (up) and distribution tiers (down).
Data table — live composite, current tier, suggested action, both gate states, and every underlying metric (200W and 2Y multiples, Mayer, drawdown, weekly RSI, MVRV).
█ THE SEVEN TIERS
Generational Value — extremely rare deep value; aggressive accumulation.
Deep Accumulation — excellent value; size up.
Accumulation — good value; keep building.
Neutral / Hold — fairly valued; hold.
Expensive / Trim — above fair value; begin scaling out.
Euphoria / Distribute — high risk; distribute and protect profit.
Cycle Top / Exit — extreme; high-probability macro top.
Each tier also outputs a suggested DCA-in or trim-out multiplier, so the signal is sized rather than binary.
█ HOW TO USE IT
Use it on Bitcoin spot or index charts such as BITSTAMP:BTCUSD or $BINANCE:BTCUSDT.
Weekly is the primary timeframe; daily works as a secondary view.
Accumulate through tiers 1–3, hold in tier 4, scale down in tiers 5–6, and treat tier 7 as exit territory.
Built-in alerts fire on entry into each accumulation and distribution tier (gated).
█ WHAT MAKES IT ORIGINAL
BEDROCK is not a single valuation ratio dressed up as an oscillator. The combination is the point: a transparent additive composite over independent metrics, a deliberate collinearity fix that collapses the moving-average family into one bounded bloc, a dual directional-gate system that suppresses the two most common false signals at both extremes without ever blocking the core reads, and sized accumulate/trim output instead of a bare number. Every metric, weight, calibration anchor, and gate threshold is exposed as an input, so the entire model is auditable and tunable — nothing is hidden.
█ NOTES & LIMITATIONS
BEDROCK is a long-horizon valuation tool, not a precise top/bottom timer and not a short-term trading system. It is designed to keep you positioned in the statistically favorable portion of the cycle, not to nail exact turns. Several display themes are included. This script is for educational purposes only and is not financial advice — size your own risk and do your own research. Indicator

Indicator

Indicator

Buy/Sell Pressure# **Buy/Sell Pressure**
Buy/Sell Pressure is designed to provide insight into **who is actually controlling the market beneath the surface**. Rather than focusing exclusively on whether price is moving higher or lower, the indicator attempts to determine whether those price movements are being supported by genuine buying interest or genuine selling pressure.
Markets do not always move because one side is aggressively taking control. Sometimes prices drift higher simply because sellers temporarily step aside. Other times, prices fall because buyers become reluctant rather than because sellers are overwhelming the market. Looking at price alone can make these distinctions difficult to recognize.
Buy/Sell Pressure was developed to address that problem.
The indicator combines several different aspects of market behavior into a single, easy-to-read oscillator. By evaluating how price behaves within each bar, how volume participates in those movements, and whether underlying money flow supports the move, it attempts to provide a clearer picture of the balance of power between buyers and sellers.
The goal is not to predict the future. Instead, the goal is to answer a simpler but often more useful question:
> **Who appears to be winning the battle right now: buyers or sellers?**
---
# **What the Indicator Is Measuring**
Buy/Sell Pressure evaluates multiple dimensions of market behavior simultaneously.
It examines where price closes within the range of each bar. A market that consistently closes near the upper portion of its range often reflects persistent buying interest. Conversely, a market that repeatedly closes near the lower portion of its range may indicate sustained selling pressure.
The indicator also evaluates the relationship between opening and closing prices. Large bullish bodies suggest buyers were able to maintain control throughout the period, while large bearish bodies suggest sellers dominated the session. Smaller candle bodies generally indicate indecision or equilibrium between the two sides.
Wick behavior is another important component. Long lower shadows often suggest that sellers attempted to push prices lower but buyers stepped in aggressively enough to reject those lower levels. Long upper shadows may indicate that buyers attempted to push prices higher but encountered significant selling resistance. These subtle forms of rejection can reveal underlying pressure that may not be obvious from price alone.
Volume is then incorporated into the calculation. Price movement occurring during periods of elevated participation tends to carry greater significance than identical price movement occurring during quiet conditions. By weighting certain behaviors according to volume, the indicator attempts to emphasize moves that are supported by broader market involvement.
The indicator also considers money flow and cumulative volume behavior. This helps determine whether capital has generally been flowing into the market or out of it over recent periods. These additional layers of analysis help distinguish meaningful shifts in pressure from ordinary short-term fluctuations.
The result is a composite measure designed to identify whether **buying pressure is strengthening, selling pressure is strengthening, or neither side currently has a meaningful advantage.**
---
# **Understanding the Histogram**
The primary visual component of the indicator is the histogram.
The histogram oscillates around a central zero line. The further the histogram extends away from that centerline, the stronger the underlying pressure is considered to be.
The direction and color of the histogram provide insight into the current balance between buyers and sellers.
---
## **Green Histogram Bars**
Green histogram bars indicate that underlying buying pressure is present.
When the histogram begins printing green bars, it suggests that buyers are exerting increasing influence over market behavior. Price action is becoming increasingly supported by demand rather than simply drifting higher due to a lack of sellers.
As green bars expand in size, the strength of buying pressure is increasing. This often occurs during healthy uptrends, breakout phases, or periods of sustained accumulation.
---
## **Red Histogram Bars**
Red histogram bars indicate that underlying selling pressure is dominant.
These readings suggest that sellers are becoming increasingly aggressive and that downward price movement is being supported by genuine supply entering the market.
As red bars grow larger, selling pressure is intensifying. These conditions frequently accompany strong downtrends, breakdowns, or periods of distribution.
---
## **Gray Histogram Bars**
Gray histogram bars represent neutral conditions.
During these periods, neither buyers nor sellers possess a sufficiently strong advantage to justify a directional reading.
Neutral conditions often occur during:
* Consolidation phases.
* Sideways markets.
* Transitional periods between trends.
* Areas of temporary equilibrium.
Gray bars can serve as a reminder that not every market environment is favorable for directional decision-making.
---
## **Extreme Pressure Conditions**
The indicator also identifies periods when buying or selling pressure becomes unusually strong relative to recent history.
These conditions are represented by brighter shades of green or red.
Extreme readings indicate that conviction is significantly elevated. Buyers or sellers are demonstrating an unusual degree of control compared to what has been considered normal over the selected historical period.
It is important to understand that extreme readings should not automatically be interpreted as reversal signals.
Strong markets can remain strong for extended periods. Likewise, weak markets can continue to weaken. Extreme readings are best viewed as evidence of exceptional pressure rather than immediate exhaustion.
---
# **The Signal Line**
The orange signal line provides a smoother representation of the underlying pressure reading.
Because it is less reactive than the histogram itself, it can help traders focus on broader shifts in pressure rather than becoming distracted by every short-term fluctuation.
A rising signal line generally reflects improving conditions for buyers.
A falling signal line generally reflects strengthening conditions for sellers.
Many users find the signal line useful when assessing whether pressure is accelerating, stabilizing, or beginning to deteriorate.
---
# **Pressure Dots**
The indicator includes optional pressure dots designed to highlight important transitions in market control.
Users can choose between two different methods for generating these signals.
---
## **Zero Cross Mode**
In Zero Cross mode, a green dot appears when pressure crosses above the zero line, while a red dot appears when pressure crosses below zero.
These signals occur relatively early because they identify the point at which the balance of pressure shifts from negative to positive or vice versa.
The advantage of this approach is speed.
The disadvantage is that early signals can occasionally occur during temporary fluctuations that fail to develop into meaningful trends.
---
## **First Colored Bar Mode**
In First Colored Bar mode, dots appear only when pressure moves decisively beyond the neutral zone and the first meaningful buying or selling histogram bar is printed.
Green dots identify the first significant buying bar.
Red dots identify the first significant selling bar.
Because these signals require stronger confirmation, they tend to occur later than zero-cross signals.
However, they are often cleaner and easier to interpret.
This mode is the default setting because it focuses on identifying **meaningful pressure shifts rather than merely technical transitions around the zero line.**
---
# **Understanding the Inputs**
---
## **Confirmed Bars Only (Non-Repainting)**
When enabled, all calculations are based exclusively on completed bars.
This prevents signals from changing after a bar closes and ensures that historical signals accurately reflect what would have been visible in real time.
The tradeoff is that signals appear one bar later.
This setting is enabled by default because reliability is often more valuable than immediacy.
---
## **Show Confirmed Mode Label**
This optional label provides a visual reminder that non-repainting mode is active.
It has no impact on calculations and exists purely for convenience.
The label is disabled by default to preserve a cleaner appearance.
---
## **Pressure Lookback**
This setting controls how persistent underlying pressure must be before the indicator fully reflects it.
Lower values produce a more responsive oscillator that reacts quickly to changing conditions.
Higher values produce a smoother oscillator that emphasizes sustained pressure rather than short-term fluctuations.
The default value of **50** attempts to strike a balance between responsiveness and stability.
---
## **Score Smoothing**
Score Smoothing determines how aggressively the raw pressure calculations are filtered before reaching the final oscillator.
Increasing this value reduces noise but delays transitions.
Decreasing it improves responsiveness but increases sensitivity.
The default value of **5** provides moderate smoothing without excessively sacrificing timeliness.
---
## **Volume Baseline**
Volume Baseline establishes the historical reference used to determine whether current participation levels are unusually high or unusually low.
Higher settings create a more stable volume benchmark.
Lower settings allow the indicator to adapt more quickly to changing market environments.
---
## **Normalization Lookback**
Normalization Lookback determines how much historical information is used when establishing what constitutes "normal" pressure conditions.
Shorter values adapt rapidly but may cause thresholds to shift more frequently.
Longer values create a more stable frame of reference.
The default value of **100** was chosen to emphasize consistency and reduce sensitivity to temporary anomalies.
---
## **Signal Line Length**
This setting controls the responsiveness of the signal line.
Shorter lengths allow the signal line to track pressure more closely.
Longer lengths smooth the signal line and emphasize broader trends.
---
## **Money Flow Length**
Money Flow Length determines how much historical information is used when evaluating whether capital has generally been entering or exiting the market.
Smaller values respond quickly to recent changes.
Larger values emphasize longer-term participation trends.
---
## **OBV Pressure Length**
This setting controls how much cumulative volume history contributes to the assessment of broader buying and selling participation.
Lower values prioritize recent developments.
Higher values place greater emphasis on sustained pressure trends.
---
## **Neutral Zone**
The Neutral Zone defines the boundary separating insignificant pressure from meaningful pressure.
Histogram readings that remain inside this area are considered inconclusive and are displayed using neutral colors.
Reducing the size of the neutral zone increases sensitivity.
Expanding it requires stronger evidence before directional readings are generated.
The default setting of **35** attempts to filter out routine market noise while remaining responsive to meaningful shifts.
---
## **Extreme Level**
The Extreme Level determines when pressure becomes exceptionally strong relative to recent market conditions.
Readings beyond this threshold are highlighted using brighter colors.
These conditions often reflect unusually strong conviction but should not automatically be interpreted as reversal opportunities.
The default value of **75** identifies situations where pressure has become significantly elevated.
---
# **Practical Applications**
Buy/Sell Pressure can be used in a variety of ways.
Many traders use it as a confirmation tool during breakouts. When price breaks through an important level while buying pressure simultaneously strengthens, the move may possess greater credibility.
Others use it to evaluate pullbacks. Temporary declines occurring during periods of weak selling pressure may suggest healthy retracements within larger uptrends. Similarly, weak buying pressure during countertrend rallies may indicate that bearish conditions remain intact.
The indicator can also help identify potential exhaustion. If price continues advancing while buying pressure steadily deteriorates, the underlying trend may be losing support. Likewise, continued price declines accompanied by weakening selling pressure may suggest that bearish momentum is beginning to fade.
Finally, Buy/Sell Pressure can serve as a valuable trade filter. Traders who already possess an established strategy may use the indicator to align themselves with the prevailing side of the market.
---
# **Final Thoughts**
Buy/Sell Pressure was designed to help traders look beyond price itself and focus on the forces driving that price movement.
Rather than asking whether the market moved higher or lower, it asks whether buyers or sellers genuinely supported that move.
By combining price behavior, volume participation, money flow characteristics, and cumulative pressure analysis into a single adaptive framework, the indicator seeks to provide a clearer understanding of market conviction.
Its purpose is not to predict exactly what the market will do next.
Its purpose is to help answer a more immediate and practical question:
> **If a battle is taking place between buyers and sellers, which side currently appears to have the advantage?** Indicator

Indicator

Indicator

Torsion Range [JOAT]Torsion Range
Introduction
Torsion Range is an open-source compression, expansion, and wave-energy panel designed to track whether the market is coiling, releasing, trending, or exhausting. The script combines wave direction, weighted energy accumulation, compression scoring, and exhaustion logic into one regime-aware panel.
The problem Torsion Range solves is fragmentation between wave tools and volatility tools. Traditional wave studies often ignore whether the market is compressing or expanding, while compression indicators often ignore directional wave state. Torsion Range merges both worlds so the user can monitor directional energy and structural volatility state together.
Core Concepts
1. Wave Direction Engine
The script supports multiple methods for determining directional wave state, including impulse, pressure, and hybrid behavior. This allows the model to adapt to different styles of price movement.
2. Weighted Energy Accumulation
Wave state is not just directional. It is weighted by body, range, ATR context, and optional relative volume to produce a more informative torsion core.
3. Compression Index
A 0-100 compression framework is built from fast and slow comparisons of range, body, and energy behavior. This allows the indicator to identify tight conditions before release.
4. Release and Exhaustion Logic
Confirmed-bar release events occur when compression gives way to directional expansion. Exhaustion logic looks for overstretched waves with weakening internal behavior.
5. Dashboard and Regime Visualization
The panel includes adaptive colors, background overlays, event flashes, and a top-right dashboard that summarizes wave state, bias, compression, and most recent event.
Features
Multi-method wave direction: Impulse, pressure, or hybrid state engine
Weighted energy accumulation: Uses price and optional relative volume
Compression scoring: Tracks coiling conditions on a normalized scale
Confirmed release logic: Detects transition from compression to directional expansion
Exhaustion detection: Flags overextended wave conditions
Adaptive gradient styling: Institutional panel presentation for dark charts
Regime overlays and event flashes: Highlights important state transitions cleanly
Top-right dashboard: Summarizes live wave and compression state
Confirmed event mode: Optional bar-close only event gating
Alertconditions: Wave flips, release events, and exhaustion states
How to Use This Indicator
Step 1: Read the Wave State
Determine whether directional energy currently favors bullish, bearish, or neutral behavior.
Step 2: Check Compression
High compression means stored energy but not yet confirmed release. Low compression with directional energy implies active movement rather than coiling.
Step 3: Watch Release Events
Release events matter most when they occur after genuine compression and align with the active wave bias.
Step 4: Respect Exhaustion
Exhaustion conditions can warn that a strong wave is becoming less efficient, even if trend has not yet fully reversed.
Indicator Limitations
Compression and exhaustion are relative, not absolute, conditions
Wave direction depends on the selected method and will respond differently across market types
This panel does not identify exact reversal bars and should not be treated as one
Release events are strongest when combined with separate structural context
Originality Statement
Torsion Range is original in its fusion of wave-state persistence, weighted energy accumulation, compression analysis, and exhaustion logic within one panel. It is not a basic Weis-style clone and not a plain volatility gauge. Its value comes from combining directional energy and volatility state into a single workflow.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Compression, release, and exhaustion states are analytical conditions derived from historical chart behavior and do not guarantee future outcomes.
- Made with passion by jackofalltrades
Indicator

Market PressureMarket Pressure — Description & Usage
Market Pressure is a normalized oscillator designed to characterize whether buying or selling pressure is dominating the market, and how persistent that pressure is over time. It does not attempt to predict price or generate signals. Instead, it measures the consistency of directional behavior by combining where price closes within each bar, the strength of the candle body, the level of volume participation, and alignment with trend. These components are smoothed and scaled into a range between -100 and +100, allowing the user to quickly assess who is in control and how strong that control is relative to recent conditions.
Values above zero indicate net buying pressure, while values below zero indicate net selling pressure. The most important region is the neutral zone around zero, defined by the user, which represents a balanced market where neither side has clear control. When the histogram remains within this neutral range, price action is typically rotational and prone to false moves. When the indicator moves and sustains itself outside of that range, it reflects a shift toward directional control. Strong readings toward the extremes suggest persistent and coordinated pressure, often associated with trend continuation rather than random movement.
This indicator is best used as a contextual filter rather than an entry tool. When Market Pressure is positive and holding above the neutral boundary, it suggests focusing only on long opportunities and avoiding shorts. When it is negative and holding below the neutral boundary, the opposite applies. When it is inside the neutral zone, the most effective action is often to stand aside, as the market lacks a dominant participant. The behavior of the histogram also provides insight into the quality of a move. Expanding values indicate strengthening pressure, while contracting values suggest that the dominant side may be losing control.
Because the indicator is normalized using a rolling lookback window, all readings are relative to recent history rather than fixed absolute levels. This allows it to adapt across different markets and timeframes, but also means that extremes represent the strongest pressure observed within that window, not an absolute threshold. The result is a flexible tool that highlights when the market is trending with conviction, when it is losing momentum, and when conditions are best avoided altogether. Indicator

Wyckoff Accumulation Phase Map [AGPro Series]Wyckoff Accumulation Phase Map
🟢 OVERVIEW
Wyckoff Accumulation Phase Map is the bullish counterpart of the Wyckoff Distribution Phase Map and completes the AGPro Wyckoff structural cycle. It is a retrospective structural mapping tool that locates and labels the seven core accumulation events — Preliminary Support (PS), Selling Climax (SC), Automatic Rally (AR), Secondary Test (ST), Spring, Last Point of Support (LPS) and Sign of Strength (SOS) — only after a bullish Change of Character (CHoCH) confirms that the prior downtrend has structurally broken. The indicator frames the active trading range as a shaded zone, plots SC and AR horizontal references, tracks the current phase (A, B, C, D, E) in a dedicated info panel, and introduces three accumulation-specific layers absent from the distribution companion: a Spring Quality Score, a Cause-to-Effect markup projection and a rolling volume footprint classifier.
🟢 COMPANION TO THE DISTRIBUTION PHASE MAP
This indicator is intentionally designed as the symmetric counterpart of Wyckoff Distribution Phase Map . The two scripts share a unified AGPro visual language and a CHoCH-gated reveal philosophy, but they operate on opposite market regimes and different event sets:
- Distribution map works on uptrends and draws PSY, BC, AR, UT, SOW and LPSY after a bearish CHoCH.
- Accumulation map works on downtrends and draws PS, SC, AR, ST, Spring, LPS and SOS after a bullish CHoCH.
- Distribution projects a potential markdown line from LPSY.
- Accumulation projects a Cause-to-Effect markup target from SOS.
- Accumulation additionally provides a 0-100 Spring Quality Score, which has no structural equivalent in the distribution schematic.
Both tools are standalone. Users running the full AGPro Wyckoff workflow can apply them together for complete cycle coverage, but neither depends on the other.
🟢 WHAT MAKES IT DIFFERENT
Most Wyckoff scripts on PulseWire react to every elevated swing low during a downtrend and label PS / SC / Spring on every modest dip. The result is a noisy chart, often with contradictory events stacked on top of each other. This indicator takes the opposite approach. During a qualified downtrend, the chart remains completely clean. Rolling trackers silently maintain candidate values for SC, PS and AR in memory, while a live Watching row in the panel shows what the engine is currently monitoring. Events are only drawn on the chart after a bullish CHoCH locks the schematic, at which point PS, SC and AR appear together as a confirmed retrospective bundle. ST, Spring, LPS and SOS then populate as post-CHoCH structure unfolds. A multi-tier expiry system closes both incomplete and fully-played-out accumulations, ensuring the active schematic on screen always reflects current market structure and not stale history.
🟢 METHODOLOGY
The engine runs in three coordinated layers.
Layer one qualifies a prior downtrend. A valid Wyckoff accumulation precondition requires four concurrent factors: structural lower highs and lower lows, a minimum ATR-multiple depth from the lookback-window high, a duration sustained across the full lookback window, and price currently located in the lower portion of that window. All four conditions must hold before any candidate can form.
Layer two rolls candidate values during that qualified downtrend. SC candidate is the running lowest pivot low with elevated or climactic volume. PS candidate is the prior elevated swing low that predates the SC. AR candidate is the highest post-SC swing high that remains within a structurally reasonable distance from SC. Candidates are automatically invalidated if price drifts far above the SC without a structural break or if the candidate ages beyond a configurable maximum.
Layer three watches for a bullish Change of Character, defined as the first bar that closes above the qualified AR candidate. On CHoCH confirmation, PS, SC and AR are snapshotted as labeled events, the trading range is drawn, and the state machine advances to forward detection. ST, Spring, LPS and SOS are then detected in sequence using a combination of price-to-SC, price-to-AR and volume-to-average filters. Volume context is computed against a configurable moving-average baseline with separate climactic, elevated and weak thresholds.
The Spring Quality Score blends four components into a 0-100 rating: penetration depth below SC, volume dry-up on the sweep bar, recovery strength measured by close position within the candle range, and close location relative to SC. The Cause-to-Effect projection draws a symmetrical markup target from the SOS bar using the trading range height.
🟢 SIGNALS AND ALERTS
The indicator fires three categories of alerts, all reserved for confirmed structural events:
- CHoCH Confirmation alert triggers when the structural break locks in, including the resolved SC and AR levels.
- Spring alert fires when the Spring is detected, including the Spring Quality score.
- Sign of Strength alert fires when SOS confirms with climactic volume above AR.
No alerts are emitted during the forming phase. This keeps notification volume low and focused on decisive structural moments.
🟢 KEY INPUTS
Core Engine inputs control swing lookback sensitivity, candidate maximum age, post-CHoCH timeout, prior downtrend lookback, minimum downtrend depth in ATR multiples, and the near-lows threshold used in downtrend qualification. Volume Analysis exposes the moving-average length and three separate multipliers for climactic, elevated and weak volume classification. Visual inputs toggle the trading range zone, SC and AR horizontal levels, the CHoCH dashed break line, the Cause-to-Effect projection, the floating summary label and the keep-historical-events mode, with full control over font size and zone transparency. The info panel can be repositioned to six anchor points and switched between dark and light themes.
🟢 HOW TO USE
Apply the indicator to any liquid instrument and any timeframe. During downtrends, observe the Watching row in the panel to monitor the forming SC candidate. When CHoCH prints, the full PS, SC and AR bundle appears and the trading range is shaded. From that point, use the Next Expected row to track what the engine is waiting for. The Confidence score progresses from 70 at CHoCH to 97 at SOS. The Spring Quality Score becomes populated when a Spring is detected and quantifies the character of the sweep. The Volume Footprint row rolls through Range forming, Supply exhausting, Weak hands shaken, Supply absorbed and Demand in control as the schematic matures. The floating summary label on the right edge of the chart provides an at-a-glance status even when the primary event labels are scrolled off to the left. The indicator works standalone but is designed to complement any market structure, order flow or supply-and-demand workflow.
🟢 LIMITATIONS AND TRANSPARENCY
This tool is a pattern-recognition and labeling engine, not a strategy or a trading signal generator. All events are detected retrospectively after their confirming bar has closed plus the swing lookback period. This is by design to eliminate redrawing. The Wyckoff schematic is a framework, not a deterministic forecast. Not every accumulation completes the full seven-event sequence, and markets frequently fail schematics entirely and resume the prior downtrend. The volume analysis assumes reliable reported volume, so thin or fragmented markets may produce weaker classification. The Spring Quality Score and Confidence score are internal heuristics tied to event progression and are not statistical probabilities. The Cause-to-Effect projection is a classical Wyckoff reference line derived from range height, not a mechanical target guaranteed to be reached. Past schematic completions do not predict future market behavior.
🟢 RISK DISCLOSURE
This indicator is published for educational and analytical purposes only. It does not constitute financial advice, a trading recommendation or an investment solicitation. Trading any financial instrument involves substantial risk, including the potential loss of principal. Past performance does not guarantee future results. Users are solely responsible for their own trading decisions, risk management and independent research. Always backtest thoroughly and trade within a risk framework you understand. Indicator

Institutional Session Profiler [JOAT]Institutional Session Profiler
Introduction
The Institutional Session Profiler builds a real-time volume-by-price distribution for each of the three major trading sessions — Asia (Tokyo, 01–09 UTC), London (07–16 UTC), and New York (13–22 UTC). For each session, it calculates the Point of Control (POC — the price level with the highest traded volume), the Value Area High (VAH) and Value Area Low (VAL) encompassing 70% of session volume, and a net buy/sell delta that reveals directional institutional participation within the session. Profile shapes are rendered as smooth polyline waves via Catmull-Rom cubic spline interpolation, giving the profiles a clean, readable curve rather than a jagged bar histogram.
The core problem this solves: standard volume profile tools display a single aggregated profile for an arbitrary lookback. Institutional traders operate within defined session windows — Asia sets the range, London typically engineers liquidity, New York resolves direction. Mapping volume distribution per session reveals where institutions are genuinely active versus where price is simply passing through thin volume.
Core Concepts
1. Lower-Timeframe Volume Accumulation
To build accurate price-level histograms on any chart timeframe, 1-minute (or user-specified lower timeframe) bars are requested via Pine Script's security_lower_tf function. Each sub-bar's volume is classified as buy-side or sell-side, then placed into the session's price bins:
array ltf_c = request.security_lower_tf("", i_ltf, close)
array ltf_v = request.security_lower_tf("", i_ltf, volume)
for i = 0 to ltf_c.size() - 1
float p = ltf_c.get(i)
float v = ltf_v.get(i)
int idx = int(math.floor((p - s_asia.lo) / bin_size))
s_asia.bins.set(idx, s_asia.bins.get(idx) + v)
This means the profile represents actual sub-bar traded volume distributed across price, not a simple tick count or approximation from chart-timeframe candles.
2. Point of Control and Value Area
The POC is the bin index with the highest accumulated volume. The Value Area is computed by iteratively expanding from the POC outward, adding the higher-volume neighbor bin at each step until 70% of total session volume is captured:
float target = total_vol * VA_PCT // VA_PCT = 0.70
float accum = bins.get(poc_idx)
int lo_i = poc_idx
int hi_i = poc_idx
while accum < target
// expand toward whichever neighbor bin has more volume
The resulting VAH and VAL define the zone where the majority of institutional volume transacted. Price inside the value area is "accepted" — price outside it is either in premium or discount relative to session fair value.
3. Catmull-Rom Spline Profile Rendering
Rather than rendering a stepped histogram, the volume bins are smoothed with a double-pass averaging and then connected via Catmull-Rom cubic splines into a polyline. This produces the signature smooth profile wave that is readable at a glance without the visual noise of raw histogram bars:
// Control point generation for cubic interpolation
float cx0 = x0, cy0 = y0
float cx1 = x1 + (x2 - x0) / 6, cy1 = y1 + (y2 - y0) / 6
// ... polyline rendered via array
4. Session Delta
Each session accumulates a running buy/sell delta (buy volume minus sell volume across all sub-bars). The dashboard displays the session delta as a signed value with color coding — positive delta in the Asia session followed by a bullish London opening is a meaningful institutional convergence signal.
Features
Three Simultaneous Session Profiles: Asia, London, and New York built in parallel, each with its own color
Point of Control Line: Horizontal line at the highest-volume price level per session, extended across the full session range
Value Area Box: Shaded box from VAL to VAH representing the 70% volume concentration zone
Volume Wave: Smooth Catmull-Rom spline profile rendered as a polyline — showing the full shape of volume distribution
Buy/Sell Delta: Net directional volume per session displayed in the dashboard
Session Range Box: Outer boundary box showing the full session high-to-low range
9-Row Dashboard: Displays session status (open/closed), POC price, VAH, VAL, session range, delta, and total session volume for each active session
Alerts: Asia session open, London session open, NY session open, price enters value area, price exits value area
Input Parameters
Sessions:
Asia (01–09 UTC): Toggle Asia session profiling (default: on)
London (07–16 UTC): Toggle London session profiling (default: on)
New York (13–22 UTC): Toggle NY session profiling (default: on)
Volume Profile:
LTF for Volume: Lower timeframe to use for sub-bar volume accumulation (default: 1m). Must be smaller than chart timeframe.
Profile Bins: Number of price levels in each session distribution (default: 35, range: 10–100). More bins = finer resolution.
Show Value Area (70%): Toggle VAH/VAL box rendering (default: on)
Visualization:
Asia / London / NY Colors: Independent session color selection
Box Transparency: Base transparency of session range and value area boxes (default: 85)
Show Volume Wave: Toggle Catmull-Rom spline profile rendering (default: on)
Dashboard:
Position: Top Right, Top Left, Bottom Right, Bottom Left (default: Top Right)
How to Use This Indicator
Step 1: Locate the POC and Value Area
The POC is the single most important price level in each session — it represents the highest institutional agreement. Value Area (VAH to VAL) is where the majority of volume transacted. Price above VAH is premium; price below VAL is discount.
Step 2: Identify Session Transitions
The London open (07 UTC) frequently engineers liquidity above or below the Asia range. If London takes out the Asia high and then reverses, the Asia POC becomes a magnetic target. The NY open at 13 UTC is the resolution event — watch for which side of the London value area price is trading on at that open.
Step 3: Read the Session Delta
A session with strong positive delta (more buy volume than sell volume) combined with price closing near the VAH suggests institutional accumulation. Negative delta closing near VAL suggests distribution. Divergence between price direction and delta direction is a key reversal signal.
Step 4: Use VAH/VAL as Dynamic S/R
After a session closes, its VAH and VAL remain on chart as reference levels. These levels frequently act as support or resistance in the following session because institutional participants remember where the majority of volume transacted.
Originality Statement
This indicator is original in its combination of per-session volume profile construction using lower-timeframe data with Catmull-Rom spline visual rendering and real-time delta tracking across three simultaneous sessions. Its publication is justified because:
Volume profiles are typically computed for arbitrary user-defined time windows or fixed periods. Per-session profiling maps institutional behavior to the actual time windows in which institutions operate — Asia, London, and New York — creating contextually meaningful distributions rather than arbitrary aggregations
Catmull-Rom spline interpolation of the bin array produces a smooth, continuous profile shape that preserves the true distribution topology while being readable without histogram visual noise
Real-time lower-timeframe volume decomposition into price bins on any chart timeframe gives accurate sub-bar volume placement that chart-timeframe-only calculations cannot produce
Simultaneous three-session display with independent POC, VAH, VAL, and delta tracking per session enables cross-session analysis that no single-profile tool can provide
Limitations
LTF data requests consume additional computation. On very high timeframe charts (4H+), 1-minute LTF data pulls are large. Consider using 5m LTF on higher timeframes to reduce computation.
The buy/sell volume classification (close >= open = buy) is an approximation at the 1-minute level. True tick-direction is not available in Pine Script.
Session times are fixed UTC offsets. Daylight saving time transitions may shift the actual institutional open by one hour depending on the exchange.
Value Area calculation uses 70% of session volume by default. This follows the standard Market Profile convention but the threshold is not universally agreed upon.
On assets with very low volume (illiquid instruments), the profile bins will be sparse and the spline shape may not be representative of meaningful distribution.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any instrument. All trading involves risk of loss. Session volume patterns do not guarantee future price behavior. Always use proper risk management.
-Made with passion by jackofalltrades
Indicator

Volumetric Structure Engine [JOAT]Volumetric Structure Engine
Introduction
The Volumetric Structure Engine is an institutional market structure tracker that fuses swing-point classification with real-time buy/sell volume delta analysis. Every confirmed swing high and swing low is measured not only by price, but by the net volume composition of the leg that produced it — revealing whether a structural move was driven by genuine institutional buying or selling, or whether it was a low-conviction, thin-volume probe. The indicator classifies market structure as HH/HL (bullish) or LH/LL (bearish), detects Break of Structure (BOS) and Change of Character (ChoCH) events on bar close, and renders each swing zone with a color gradient that reflects the underlying volume delta of that leg.
The core problem this solves: most market structure tools draw lines or arrows at swing points but say nothing about the quality of that swing. A break of structure on rising volume is categorically different from one on declining volume — the first signals institutional participation, the second suggests a liquidity grab. VSE quantifies that difference on every bar.
Core Concepts
1. Non-Repainting Swing Detection
Swings are confirmed using a lookback comparison pattern that resolves only on bar close:
float H = ta.highest(high, i_len)
float L = ta.lowest(low, i_len)
bool new_sh = high == H and high < H
bool new_sl = low == L and low > L
A swing high at bar N-1 is confirmed when bar N closes lower, meaning the prior bar's high was the highest in the lookback window. This approach never repaints because it always references the closed bar to the left.
2. Volume Delta Accumulation Per Leg
Between each confirmed swing, running buy and sell volume totals accumulate. On each bar, if close >= open the bar's volume is classified as buy-side; otherwise it is sell-side. When a new swing is detected, the accumulated totals are saved to that swing node, and the counters reset for the next leg:
if new_sh or new_sl
run_buy := 0.0
run_sell := 0.0
if close >= open
run_buy += volume
else
run_sell += volume
The delta percentage (buy minus sell divided by total volume) determines the color and transparency of each swing zone box. A leg with 80% buy delta renders as a vivid bull green; a leg with 20% buy delta renders as a vivid bear red. Neutral legs render in the neutral color.
3. BOS and ChoCH Detection
Break of Structure fires when confirmed price closes through the most recent confirmed swing extreme in the opposite direction. Change of Character fires when the first break occurs against the established trend — the earliest signal that the dominant structure may be shifting. Both signals are barstate.isconfirmed, preventing any lookahead.
4. Structure Cloud
A fill between the last confirmed swing high and swing low creates a visual structure range that updates dynamically. The cloud color matches the current trend direction and serves as an at-a-glance bias indicator for the session.
Features
Swing Zone Boxes: ATR-scaled zone boxes at every confirmed swing, colored by the net buy/sell delta of the producing leg
Volume Delta Gradient: Zone colors range from deep bull green (high buy delta) to deep bear red (high sell delta), with transparency encoding conviction
BOS Lines: Dashed horizontal lines drawn at the level where a Break of Structure closes, with text label
ChoCH Highlight: Change of Character events highlighted with a distinct yellow-amber color to distinguish them from continuation BOS signals
Structure Connection Lines: Lines connecting consecutive swing nodes, colored by the delta of each leg
Structure Cloud: Gradient fill between the last swing high and low showing current structural range
Candle Coloring: Optional candle tinting by current trend direction
9-Row Dashboard: Displays trend bias, last swing high/low price levels, structure range percentage, BOS bull/bear counts, ChoCH count, last leg delta percentage, and total swing node count
Alerts: BOS bullish, BOS bearish, ChoCH bullish, ChoCH bearish
Input Parameters
Structure Detection:
Swing Length: Lookback bars for swing high/low detection (default: 20, range: 5-200). Higher values identify fewer, stronger structural swings. Lower values are more reactive.
Show BOS Lines: Toggle BOS line rendering (default: on)
Show ChoCH: Toggle Change of Character highlighting (default: on)
Structure Cloud: Toggle the fill between swing high and low (default: on)
Visualization:
Bullish / Bearish / Neutral / ChoCH colors: Fully customizable
Zone Transparency: Control the base transparency of swing zone boxes (default: 78)
Color Candles: Optional candle tinting by structural trend (default: off)
Dashboard:
Position: Top Right, Top Left, Bottom Right, Bottom Left (default: Top Right)
How to Use This Indicator
Step 1: Read the Current Structure
The dashboard shows the current trend bias (BULLISH / BEARISH / NEUTRAL), the last confirmed swing high and low prices, and the structural range as a percentage. This gives you the directional context at a glance.
Step 2: Interpret Zone Colors
Zones colored in vivid green (high buy delta) represent legs driven by institutional buying. Zones colored in vivid red (high sell delta) represent institutional selling pressure. Faded or gray zones represent low-conviction legs — useful for identifying weak structure that is more likely to be swept.
Step 3: Trade BOS and ChoCH Events
A BOS in the direction of the existing trend is a continuation signal. A ChoCH (against the trend) is a structural shift signal and often marks the beginning of a reversal. Volume delta on the breaking leg adds conviction: a BOS on a high-buy-delta leg is more reliable than one on a low-delta leg.
Step 4: Use Swing Zones as S/R
Each swing zone box represents a price area where a structural pivot occurred. Institutional order flow often returns to these levels. High-delta zones in particular tend to act as meaningful support or resistance.
Originality Statement
This indicator is original in its combination of confirmed non-repainting swing structure with per-leg volume delta measurement. While market structure tools and volume analysis tools each exist independently, this indicator is justified because:
Volume delta is computed per structural leg — not per candle and not as a global indicator — creating a direct mapping between market structure quality and institutional participation
The swing confirmation method using the lookback comparison pattern eliminates repainting while maintaining responsiveness to genuine structural changes
Zone color encoding with delta-driven gradient creates an immediate visual hierarchy — strong zones versus weak zones — without requiring separate panels or indicators
BOS and ChoCH detection with volume delta context provides a more complete signal than either alone
Limitations
The buy/sell volume classification (close >= open = buy) is an approximation. True tick-level direction is not available in Pine Script. On very short timeframes where volume is sparse, classification may be imprecise
Swing length selection significantly affects structure quality. Too short produces noise; too long misses intermediate structure. Users should calibrate to their timeframe and instrument
BOS and ChoCH are confirmed on bar close, so they are identified one bar after the actual breakout candle closes. This is a deliberate trade-off for accuracy over speed
The indicator does not predict direction — it classifies the current structural state. A bullish structure can break down without warning
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any instrument. All trading involves risk of loss. Past structural patterns do not guarantee future results. Always use proper risk management.
-Made with passion by jackofalltrades
Indicator

AG Pro Chaikin Money Flow Pressure [AGPro Series]AG Pro Chaikin Money Flow Pressure
Overview / What it does
AG Pro Chaikin Money Flow Pressure is a chart-overlay indicator built to translate Chaikin Money Flow behavior into a more structured view of buying and selling pressure on the price chart itself. Instead of presenting CMF only as a standalone oscillator around a zero line, this script converts money-flow behavior into visible pressure zones, a backbone line, selective event labels, and a compact decision panel. The goal is to make pressure conditions easier to read in context with price rather than in a separate pane.
The script is designed to help users judge whether positive or negative money-flow pressure is merely appearing, becoming more persistent, expanding with price support, or losing quality. In practical terms, it focuses on how pressure behaves through time, not only on whether CMF is above or below zero on a single bar. This distinction is important because many CMF readings are technically positive or negative while still being structurally weak, transitional, or unstable.
This publication is an indicator, not a strategy. It does not place orders, does not simulate broker execution, and does not claim to predict future price direction. Its purpose is to organize CMF-derived pressure information into a chart-readable framework that can be used for analysis, filtering, or confluence with a user’s existing process.
Unique Edge
The distinctive design choice in this script is that it treats Chaikin Money Flow as a pressure-structure input rather than as a simple zero-cross oscillator. The script evaluates pressure using a combination of directional bias, persistence, slope behavior, and exhaustion characteristics, then maps those conditions into an overlay format.
That makes it materially different from tools that focus primarily on:
- classic CMF zero-line interpretation,
- MFI-style overbought/oversold framing,
- OBV-style cumulative flow interpretation,
- divergence-first logic,
- or trend/momentum tools that derive most of their signal from price structure rather than money-flow persistence.
Within the broader AG Pro catalog, some scripts are centered on momentum, reaction quality, divergence behavior, or trend-state interpretation. This one is specifically built around CMF-derived pressure persistence. In other words, it is less about identifying a single trigger event and more about showing whether accumulation or distribution pressure is building, holding, fading, or reverting toward balance.
Methodology
The script begins with the standard Chaikin Money Flow foundation: money flow is derived from the close’s location within the bar range and weighted by volume across the selected CMF lookback. That raw series can then be smoothed to reduce short-term noise.
From there, the script classifies pressure through several layers:
1) Bias
Positive and negative CMF conditions establish the directional pressure side. This is the base layer, but it is not used alone.
2) Persistence
The script tracks how long positive or negative pressure has been maintained. Short-lived readings are treated differently from more persistent runs.
3) Expansion
The slope of the smoothed CMF series helps distinguish strengthening pressure from flatter or compressing conditions.
4) Exhaustion risk
When pressure remains extended but begins to weaken internally, the script can shift into a fading or exhaustion-sensitive interpretation instead of treating every positive or negative reading as equally strong.
These components are then summarized into:
- a state,
- a phase,
- a pressure score,
- a backbone-based pressure map,
- and selective event labels.
The overlay uses an EMA backbone and ATR-scaled zones to visualize where pressure is concentrated around price. Outer and core zones help separate broad pressure environment from tighter pressure concentration. A lightweight bridge effect is used to connect confirmed pressure conditions to price in a restrained way so the visual hierarchy remains readable.
Signals & Alerts
The script uses a state/condition framework rather than a direct buy/sell promise.
Core states include:
- Accumulation
- Distribution
- Balanced
- Exhaustion Risk
Phase interpretation includes:
- Building
- Holding
- Fading
- Neutral
Selective chart labels are intentionally limited to higher-quality transitions such as:
- ACCUM
- DIST
- FADE
- FLIP
Available alert conditions are designed around pressure behavior, not outcome guarantees:
- Pressure Building
- Pressure Holding
- Pressure Weakening
- Pressure Flip Risk
- Accumulation Regime Confirmed
- Distribution Regime Confirmed
These alerts are best understood as structural notifications about pressure behavior. They are not instructions to enter or exit positions by themselves.
Key Inputs
Important settings include:
- CMF Length: controls the main money-flow lookback.
- CMF Smoothing: reduces noise in the base CMF series.
- Neutral Band: defines when pressure is treated as balanced rather than directional.
- Strong Pressure Band: helps scale the pressure score and zone intensity.
- Exhaustion Band: helps identify stretched but weakening pressure conditions.
- Persistence Confirmation Bars: sets how long pressure should persist before confirmation.
- Backbone EMA Length: controls the central overlay structure.
- ATR settings: control the width of the pressure zones.
- Label filters and cooldowns: reduce repeated labels and keep the chart cleaner.
These inputs allow users to make the script more responsive or more selective depending on timeframe, asset behavior, and chart density.
Limitations & Transparency
This script does not measure real order-book flow, exchange-specific footprint data, or trade-by-trade delta. It is a CMF-based analytical model built from OHLCV data available on PulseWire. As with any derived indicator, its output depends on the quality and characteristics of the underlying market data.
The pressure score is not a prediction score and should not be interpreted as a probability of success. It is a normalized summary of current pressure quality based on the script’s internal framework. A higher score means the current pressure structure is stronger by the script’s rules; it does not mean the next move is guaranteed.
Like other pressure or flow-based tools, this script can become less reliable in choppy, thin, or event-driven conditions where pressure quickly alternates and persistence breaks down. It should also be expected that different assets and timeframes will respond differently to the same parameter set. Users should evaluate settings in the market context where they intend to use the indicator.
This publication is meant to explain what the script measures and how it organizes that information. It is not presented as a black-box promise, and it is not intended to replace independent chart reading, risk control, or broader market context.
Risk Disclosure
This script is provided for educational and analytical use. It does not constitute financial advice, investment advice, or a solicitation to buy or sell any financial instrument. No indicator can remove uncertainty from markets, and no visual state, score, zone, or alert should be treated as a guarantee of future results.
Users should make their own decisions, test their own process, and apply appropriate risk management. This tool is best used as a structured market-reading aid and as part of a broader analytical framework rather than as a standalone decision engine. Indicator

Market Cycle Projection EngineMarket Cycle Projection Engine
WHAT IT DOES
Market Cycle Projection Engine (MCPE) is a fully original indicator
built in Pine Script v6 that automatically identifies the current
market cycle phase, draws key structural levels, and projects the
next expected price movement all on a single overlay chart.
Unlike traditional indicators that react to price, MCPE analyzes
the internal structure of market behavior using a four-phase cycle
model inspired by Wyckoff methodology, combined with a linear
regression slope engine and volatility expansion/contraction logic.
WHAT MAKES IT ORIGINAL
Most cycle indicators either repaint, rely on subjective drawing,
or require manual input. MCPE does none of these.
The core innovation is a three-factor phase classification engine:
1. Linear Regression Slope measures the true directional
momentum of price over the cycle lookback period, normalized
by ATR to make it comparable across all assets and timeframes.
2. ATR Ratio (Volatility State) compares current ATR to its
own slow average to detect whether volatility is expanding
(trending phase) or contracting (consolidation phase).
3. Price Position in Cycle Range determines whether price
is in the lower 40% (potential accumulation) or upper 60%
(potential distribution) of the cycle's high/low range.
These three factors combine to produce a four-phase classification
that updates automatically on every bar without any repainting.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE FOUR CYCLE PHASES
🔵 ACCUMULATION
Slope is flat. Volatility is contracting. Price is in the
lower portion of the cycle range. This is where institutions
quietly build long positions before the markup phase.
Candles colored cyan.
🟢 MARKUP
Slope is rising. Volatility is expanding. This is the
trending upward phase the reward for accumulation patience.
Candles colored green.
🟠 DISTRIBUTION
Slope is flat again. Volatility is contracting. Price is now
in the upper portion of the cycle range. Smart money is
offloading positions to retail buyers.
Candles colored orange.
🔴 MARKDOWN
Slope is falling. Volatility is expanding downward. The
cycle completes its rotation back toward accumulation.
Candles colored red.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
Step 1 Read the Phase
Look at the current candle color and the Dashboard panel
(top-right). The Cycle Phase row tells you exactly where the
market is in its current rotation.
Step 2 Check Cycle Position %
The Cycle Position metric shows where price sits within the
current cycle range (0% = bottom, 100% = top).
Below 30% = potential accumulation opportunity.
Above 70% = potential distribution / caution zone.
Step 3 Use the Projection Arrow
When a phase transition occurs, MCPE draws a directional
projection line showing the expected next move. The arrow
length is calculated from the average of the previous two
cycle swing ranges and expressed as a percentage of current
price. This is NOT a price prediction it is a probabilistic
projection based on historical cycle amplitude.
Step 4 Respect the Key Levels
Three horizontal levels are always visible:
Cycle High upper boundary of the current cycle range.
Cycle Low lower boundary of the current cycle range.
Mid the equilibrium level between the two.
Price returning to Mid after an extreme move is a common
mean-reversion setup.
Step 5 Confirm with Volatility and Volume
The Dashboard shows Volatility Status and Volume reading.
Strong signals occur when phase transitions align with
expanding volatility and elevated volume simultaneously.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CALCULATION LOGIC
Phase Classification:
lr_slope = linreg(close, cycle_len, 0) - linreg(close, cycle_len, 1)
lr_slope_norm = lr_slope / ATR(14)
atr_ratio = ATR(14) / ATR(cycle_len)
price_pos = (close - cycle_low) / cycle_range
Markup : lr_slope_norm > 0.1 AND atr_ratio > 1.1
Markdown : lr_slope_norm < -0.1 AND atr_ratio > 1.1
Accumulation: slope flat AND price_pos < 0.4
Distribution: slope flat AND price_pos >= 0.4
Projection Amplitude (Last Cycle method):
avg_range = (|meso_high - meso_low| + |prev_high - prev_low|) / 2
target = last_pivot + avg_range (bull) or - avg_range (bear)
Volatility Status:
High when ATR(14) > SMA(ATR(14), 20) * 1.3
Cycle Strength (0-100):
Measures how far price deviates from the cycle midpoint,
expressed as a percentage of the total cycle range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
Cycle lookback (bars)
Controls how many bars define one full cycle. Increase for
macro analysis, decrease for shorter-term cycles.
Recommended: 50 for daily, 30 for 4H, 20 for 1H.
S/R pivot lookback
Controls how far back the indicator looks for key support
and resistance pivot points.
Projection bars
How many bars into the future the projection line extends.
Projection basis
Three methods available:
Cycle Average uses average of last two swing ranges.
Last Cycle uses 75% of the most recent cycle range.
ATR Multiple uses ATR × 30 as a fixed projection size.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPATIBILITY
Works on all assets Crypto, Forex, Stocks, Indices, Futures.
Works on all timeframes.
Best results on Daily and 4H charts for swing trading.
For intraday use, reduce cycle_len to 20-30.
No repainting. All signals calculated on bar close.
No lookahead bias. No request.security() with lookahead.
No Heikin Ashi or non-standard chart dependency.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS INCLUDED
Phase: Accumulation detected
Phase: Markup detected
Phase: Distribution detected
Phase: Markdown detected
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
This indicator is provided for educational and informational
purposes only. It does not constitute financial advice or a
recommendation to buy or sell any asset. Past cycle patterns
do not guarantee future results. Markets are inherently
unpredictable. Always apply your own analysis and use proper
risk management before placing any trade. The author is not
responsible for any trading losses incurred from use of this
indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Indicator

OBV Linear Regression Multi-Slope [HYPR-run]DESCRIPTION:
Three linear regression slopes fitted to On-Balance Volume. Measures whether accumulation or distribution is accelerating, decelerating, or reversing across short, medium, and long lookbacks simultaneously. Raw OBV tells you the cumulative direction of volume flow. Fitting a linear regression to it gives you the rate of change: the slope. Three slopes at different lookbacks show the structure of volume commitment. When all three agree, volume flow is structurally committed in one direction. When they disagree, the timeframes are in conflict.
DISCOVERING EDGE
Dual and triple slope alignment has proven to be a staple confirmation signal in our most reliable automated strategies for both entries and exits. When two or three independent lookbacks agree on the direction of volume flow, the commitment is structural, not noise. When alignment breaks, the first slope to flip tells you exactly where conviction cracked. We built this indicator to surface that alignment as a first-class signal rather than something you eyeball across separate panes.
THREE LR SLOPES vs RAW OBV LINE
Three slopes at different lookbacks show whether all timeframes of volume flow agree or conflict. Dual alignment (short + long) is the entry signal; triple (all three) confirms later for pyramids. When triple breaks, that's the exit. Values above 0.3 mean the slope is steeper than one standard deviation per bar (very strong trend). Sigma/bar above 0.1 means the slope is statistically strong; below 0.05 is weak.
FEATURES
- Three linear regression slope lines on OBV (short 9, medium 26, long 50)
- Optional adaptive short lookback (ATR-scaled for low timeframes)
- Slope alignment detection: dual (short+long) and triple (all three)
- Universal angle normalization (slope/sigma x 45 degrees)
- Sigma/Bar ratio: slope strength relative to OBV noise
- Auto-adjusts all lookbacks by timeframe (weekly/monthly compress)
- Webhook alerts on slope flip or triple alignment
- Full bar filter rejects doji/wick-heavy bars
- Dashboard with lookback, angle, and sigma/bar for all three lines
HOW IT WORKS
Linear regression calculates the best-fit line through OBV values over a lookback window. The slope of that line is the rate of volume flow. Positive slope = accumulation accelerating. Negative slope = distribution accelerating. The universal angle normalizes raw slope by OBV standard deviation so the dashboard reads consistently across any asset (BTC's OBV in millions, a low-cap's in thousands, same angle scale).
UNIVERSAL ANGLE
Slope divided by OBV standard deviation per bar, multiplied by 45. A value of 45 degrees means the slope equals one standard deviation per bar. Makes angle comparable across any asset and timeframe: 30 degrees on BTC means the same relative strength as 30 degrees on SOL.
ALERT MODES
Slope Flip: fires when selected lookback crosses zero. Negative to positive = accumulation starting (LONG). Positive to negative = distribution starting (SHORT). Triple Alignment: fires when all three slopes agree on direction. Fewer signals, higher conviction. Alert payload is built into the script as JSON; works with any webhook receiver.
CREDITS
On-Balance Volume: Joseph Granville, Granville's New Key to Stock Market Profits (1963) Indicator

ROC Regime Filter [HYPR-run]DESCRIPTION:
A reliable universal regime filter across all assets, all timeframes. Rate of change filter that classifies price action into regime states. A suite of smoothed EMAs feeds a layered ROC engine that detects when fast momentum aligns with, or diverges from, slow structure. The filter measures; it doesn't predict. When all ROC layers stack in the same direction (parallel alignment), the trend is confirmed by arithmetic. When fast ROC diverges from slow, the regime shifts. The lag is the cost of certainty. Sweet spot is 1hr to 1D; lower timeframes get noisy.
DISCOVERING EDGE
In order to gain a persistent, mechanical edge in which trades are permitted and which are filtered out, we explored a more meaningful expression of regime classification using layered multiple ROC periods to detect when fast momentum aligns with or diverges from slow structure. This resilient regime filter has been the backbone for our automated strategies since 2021.
LAYERED ROC vs SINGLE-INDICATOR REGIME
A single RSI or ADX reading flattens the market into binary (trending/not trending). Layered ROC alignment separates six distinct states, each with different permissible trade types, so the filter matches the complexity of what the market is actually doing. Six regime states gate every decision; the combination of regime color + ROC slope is the trade filter, not either one alone. Phase transitions (green to yellow, orange to green) are the actionable signals; static states just confirm what's already happening. Webhook alerts fire on macro pivots (accumulation/distribution inflections) at the regime transition, not after the move has run.
FEATURES
- Six regime states from layered ROC alignment (see color legend below)
- Early trend detection when all layers accelerate in parallel
- ROC 200 line with regime-colored gradient fill
- Macro pivot detection: strong trend exhausting into sideways, scored by where ROC 200 sits relative to its all-time range
- Accumulation/distribution context in dashboard
- ROC 200 pivot high/low divergence markers on main chart
- Consolidation markers with conviction scoring (normal vs extreme)
- Gradient candle overlay (ROC Sticks; toggle on/off)
- Two-row dashboard: row 1 = macro context (accumulation/distribution), row 2 = current regime state with directional qualifier and slope
- Dashboard dark/light theme toggle for any chart background
- Full ROC stack in data window for manual analysis
- Webhook alerts on macro pivots (accumulation/distribution)
HOW IT WORKS
ROC alignment is the core signal. When all layers stack in the same direction, that's strong trend territory (green). When fast ROC diverges from the slower layers while slow structure still holds, the engine reclassifies from strong trend to sideways (yellow), flagging a pullback rather than trend failure. Deeper corrections where intermediate layers fall below the structural anchor fire orange, indicating a correction within the primary trend. Macro pivots fire at the inflection: strong trend exhausting into sideways for the first time. The consolidation score layers this with where ROC 200 sits in its all-time range. Consolidation at extreme ROC readings (bright green/red dots) is the highest-conviction signal for reversal.
HOW TO USE
Read the regime color, not the price. Green = strong trend long, red = strong trend short, orange = deeper correction, yellow = short pullback, white = directionless. Use regimes as a directional gate: longs during green, shorts during red. Yellow flags a pullback within trend; wait for resolution back to green/red before re-entering. Orange is a deeper correction; patience or fade with confirmation from other tools. The highest-edge signals come from regime transitions, not static states. Watch for: green breaking into yellow (macro pivot, potential reversal), extended yellow resolving back to green (continuation re-entry), and the ROC slope within a regime (slope rising in orange = trend about to resume). The data window shows the full ROC stack across all layers. When fast ROC diverges from slow, that signals continuation or reversion.
MACRO CONTEXT (Dashboard Row 1)
REGIME COLOR LEGEND (Dashboard Row 2)
ALERTS
Macro pivot long fires when accumulation is detected (bull inflection). Macro pivot short fires when distribution is detected (bear inflection). Create alert: condition = this indicator, "Any alert() function call". Paste your webhook URL, set Open-ended, create. Alert payload is built into the script; works with any webhook receiver.
CREDITS
Advance/Decline gradient function: LucF Indicator

Velocity Acceleration Momentum [VAM]Velocity Acceleration Momentum
Overview
VAM is a multi-layered momentum indicator that measures how fast price is moving (Velocity), whether that speed is increasing or decreasing (Acceleration), and how strong the underlying trend is (ADX). Rather than just telling you the direction of price, VAM tells you the quality and phase of the move you're in.
How It's Calculated
Velocity measures the percentage rate of change of price over a lookback period (default: 14 bars), then smooths it with a 3-period EMA. It answers: "How fast is price moving relative to where it was?"
Acceleration is the change in Velocity over a secondary smoothing window (default: 5 bars), also EMA-smoothed. It answers: "Is momentum speeding up or slowing down?"
Signal Line is an EMA of Velocity (default: 9 bars) — similar in concept to the MACD signal line. When Velocity crosses above/below the Signal Line, it can indicate momentum shifts.
ADX Histogram uses Pine's built-in DMI/ADX calculation. When DI+ > DI−, bars plot positively (green); when DI− > DI+, bars plot negatively (red). The color opacity is gradient-mapped to ADX strength — vivid bars mean a strong trend, faded bars mean a weak/ranging market.
Reading the Velocity Line Colors (Regime Detection)
The Velocity line changes color based on the combination of Velocity and Acceleration:
ColorConditionMeaning🟢 LimeVelocity > 0, Acceleration > 0Rocket — momentum is up and accelerating🟡 YellowVelocity > 0, Acceleration < 0Topping — still positive but losing steam🔴 RedVelocity < 0, Acceleration < 0Freefall — momentum is down and worsening🟠 OrangeVelocity < 0, Acceleration > 0Bottoming — still negative but recovering
How to Trade With It
High level Buy when Velocity Line Green 🟢sell when Velocity drops hard and is Red 🔴
+
ADX BARS TELL YOU THE TREND AND THE TREND STRENTH (COMBINE THIS AND THE VELOCITY LINE)
+
ACCELERATION PUROPLE AND YELLOW WAVE TELLS YOU SHARP DROPS OR ADVANCES IN ACCELERATION
Trend Entries: Look for the Velocity line turning Lime (🟢) with the ADX histogram printing vivid green bars above the +25 line. This is the highest-confidence long setup — price is accelerating upward with confirmed trend strength.
Caution / Exit Signals: When Velocity turns Yellow (🟡) and sharply drops, momentum is fading even if price is still rising. Consider tightening stops or taking partial profits.
Short / Bearish Bias🔴 : Red Velocity + vivid red ADX bars below −25 signal a strong downtrend in Freefall. Avoid longs; look for short setups.
Potential Reversals: Orange Velocity (Bottoming) combined with ADX bars beginning to fade and shift green can be an early signal that a bottom is forming — useful for scaling into longs cautiously.
Signal Line Crosses: When the Velocity line crosses above the white Signal Line, momentum is picking up. Crosses below suggest weakening. Best used as a confirmation filter, not a standalone trigger.
The ±25 Reference Lines mark the ADX threshold commonly used to separate trending (above) from ranging (below) markets. ADX histogram bars inside the ±25 zone suggest low trend conviction — reduce position sizing or wait for confirmation.
Inputs
Source — Price input (default: Close)
Velocity Length — Lookback period for rate-of-change calculation (default: 14)
Acceleration Smooth — Smoothing window for acceleration (default: 5)
Signal Line Length — EMA period for the signal line (default: 9)
ADX Length — Period for DMI/ADX calculation (default: 14)
Show Signal Line — Toggle the white signal line on/off
Show Zone Backgrounds — Toggle ADX-strength background shading
Show ADX Histogram — Toggle the ADX directional histogram Indicator

Range Finder & Profile [UAlgo]Range Finder & Profile is a structured market range detection tool that combines pivot based range discovery with an embedded volume profile. Its purpose is to identify areas where price begins to rotate inside a defined boundary, track whether that balance remains intact, and then summarize how volume was distributed inside the completed range once price finally exits it.
The script starts by using pivot highs and pivot lows to define potential horizontal boundaries. When a valid upper and lower reference exist, and price is trading inside those bounds without already breaking them, the script opens a candidate range. From that point onward, it keeps monitoring the structure bar by bar, checking whether the range survives long enough to become confirmed and whether price remains accepted inside it.
What makes this indicator especially useful is that it does not stop at simply drawing a box around consolidation. Once a range becomes confirmed, it also builds a row based internal profile of all activity inside that zone. When the range eventually breaks, the script calculates Point of Control, Value Area High, and Value Area Low, then draws a compact profile directly inside the range. This transforms a simple horizontal box into a more informative market acceptance map.
The result is a tool that can help traders study balance, distribution, and eventual expansion. It is useful for identifying clean consolidation structures, understanding where the heaviest participation occurred inside a range, and interpreting whether the breakout happened after meaningful internal acceptance or after a less developed structure.
🔹 Features
🔸 Pivot Based Range Discovery
The script uses pivot highs and pivot lows to establish potential range boundaries. This creates a structure that reacts to meaningful swing points rather than arbitrary rolling highs and lows. As a result, the detected ranges tend to reflect actual market rotation more naturally.
🔸 Clean Range Validation
A new range is only created when price is already trading inside the proposed top and bottom boundaries and when no bar in the candidate history has already closed outside those levels. This helps prevent invalid or already broken ranges from being accepted.
🔸 Overlap Protection
The script tracks where the last completed range ended and avoids creating a new one that starts inside an already closed structure. This reduces repeated overlap and keeps the chart cleaner.
🔸 Minimum Range Confirmation
Not every detected range is immediately treated as valid. The structure must survive for a minimum number of bars before it becomes confirmed. This helps filter out weak or short lived consolidations.
🔸 Embedded Volume Profile
Each confirmed range contains its own internal volume profile. The vertical height of the range is divided into configurable rows, and every bar contributes volume into the relevant price segments. This creates a compact distribution map inside the actual range boundaries.
🔸 Proportional Volume Allocation
The script does not simply drop full bar volume into a single row unless the bar has no height. Instead, when a candle spans multiple rows, its volume is distributed proportionally across the overlapped sections. This produces a more realistic representation of participation across the range.
🔸 Point of Control Detection
After the range is complete, the script finds the profile row with the highest accumulated volume. This row becomes the Point of Control, giving the user a quick view of the price area with the strongest concentration of activity.
🔸 Value Area Calculation
The script expands outward from the Point of Control and accumulates neighboring rows until the selected percentage of total range volume is reached. This produces Value Area High and Value Area Low, which highlight the area where most participation occurred.
🔸 Gradient Range Background
The active and completed range is drawn with a multi slice background gradient between the upper and lower colors. This improves readability and gives the zone a more polished visual structure.
🔸 Histogram Inside the Range
When a range is confirmed and completed, the script draws horizontal histogram bars inside the zone. Rows inside the value area use a dedicated color, while rows outside the value area use a separate profile color. This makes internal acceptance easy to read visually.
🔸 Live Active Range Updates
While the range is still active and not yet broken, the background extends forward in time with every new bar. Once the range becomes confirmed, profile and value area calculations are refreshed continuously until the breakout occurs.
🔸 Practical Market Structure Use
This makes the indicator useful for consolidation analysis, acceptance and rejection studies, and breakout context. A trader can see not only where price paused, but also how volume built inside that pause before expansion occurred.
🔹 Calculations
1) Pivot Detection for Range Anchors
float ph = ta.pivothigh(high, lengthInput, lengthInput)
float pl = ta.pivotlow(low, lengthInput, lengthInput)
if not na(ph)
recentPH := ph
recentPHIndex := bar_index
if not na(pl)
recentPL := pl
recentPLIndex := bar_index
This is the starting point of the whole script.
The code asks PulseWire to detect a pivot high and a pivot low using the selected swing length. A pivot high appears only after enough bars have formed on both sides of the swing, and the same logic applies to a pivot low. Because of that, pivots are confirmed reference points rather than instant highs or lows.
When a valid pivot high is found, the script stores two things.
The pivot price itself in recentPH
The bar index where that pivot actually occurred in recentPHIndex
The same is done for pivot lows through recentPL and recentPLIndex .
This means the script always keeps track of the latest confirmed upper swing and the latest confirmed lower swing. Those two swing references become the raw ingredients for a possible trading range.
2) Candidate Range Creation Logic
bool canCreateRange = na(activeRange) and not na(recentPH) and not na(recentPL)
if canCreateRange
float top = math.max(recentPH, recentPL)
float bot = math.min(recentPH, recentPL)
if top > bot and close <= top and close >= bot
int sIndex = math.min(recentPHIndex, recentPLIndex)
int barsBack = bar_index - sIndex
This block decides whether the script is even allowed to start a new range.
First, canCreateRange requires three conditions:
there must be no currently active range,
there must be a recent pivot high,
and there must be a recent pivot low.
If those conditions are met, the script builds a provisional upper bound and lower bound using the greater and smaller of the two pivot prices. Then it checks whether current price is actually inside that proposed range. This is important because it prevents the script from creating a range that price has already escaped.
The code also finds sIndex , which is the earlier of the two pivot bar indices. That earlier point becomes the true starting location of the range. Then barsBack measures how many bars ago the range began.
So at this stage, the script has a full candidate structure:
an upper price,
a lower price,
and a starting point in time.
3) Overlap Prevention and Broken History Check
bool isOverlapping = false
if sIndex <= lastClosedRangeEndIndex
isOverlapping := true
if not isOverlapping
bool broken = false
if barsBack > 0
for i = 0 to barsBack
if close > top or close < bot
broken := true
break
This section filters out bad candidates before a range is created.
First, the script checks whether the proposed start index falls inside or before the end of the last completed range. If it does, the new candidate is marked as overlapping and rejected. This keeps the indicator from repeatedly generating new boxes on top of old structures.
Next, even if there is no overlap, the script scans every bar from the proposed start point up to the present. It checks whether any close moved above the top boundary or below the bottom boundary. If that happened, the candidate is marked as broken.
This is a very important quality filter. It means the script does not simply connect two pivots and call that a range. It also verifies that price actually stayed accepted inside those boundaries over the full candidate history.
4) Initializing the Range Object
activeRange := RangeData.new(
startIndex = sIndex,
startTime = time ,
endIndex = bar_index,
endTime = time,
topPrice = top,
bottomPrice = bot,
isActive = true,
isConfirmed = false,
totalVolume = 0.0,
pocPrice = na, pocVolume = 0.0, pocIndex = -1, vah = na, val = na,
bgBoxes = na, histBoxes = na, pocLine = na, vahLine = na, valLine = na, pocLabel = na, vahLabel = na, valLabel = na
)
activeRange.initProfile(profileRows)
Once the script is satisfied that the candidate is valid, it creates a new RangeData object.
This object stores all important information about the range:
where it starts,
where it currently ends,
its top price,
its bottom price,
whether it is still active,
whether it is confirmed,
and all profile related values such as total volume, Point of Control, Value Area High, and Value Area Low.
Immediately after creating the object, the script calls initProfile(profileRows) . That method prepares the internal volume profile rows that will later hold the distribution data.
So this is the moment where the script moves from pure detection into active tracking.
5) Building the Internal Profile Rows
method initProfile(RangeData this, int rowsCount) =>
float step = (this.topPrice - this.bottomPrice) / rowsCount
this.profile := array.new()
for i = 0 to rowsCount - 1
float pBottom = this.bottomPrice + (i * step)
float pTop = pBottom + step
this.profile.push(ProfileRow.new(pTop, pBottom, 0.0))
This method divides the height of the range into a fixed number of rows.
First, it calculates step , which is the height of one profile row. That is simply the total range height divided by the selected number of profile rows.
Then it creates an empty profile array and fills it row by row. Each row stores:
its upper price,
its lower price,
and the total volume accumulated in that row.
At this moment, every row starts with zero volume. The profile is just an empty framework waiting to receive bar by bar contributions.
This design is important because the script is not using a prebuilt PulseWire volume profile function. It is constructing the profile manually, row by row, inside the exact range boundaries.
6) Adding Volume Into the Profile
method addVolume(RangeData this, float bHigh, float bLow, float bVol) =>
float overlapHigh = math.min(bHigh, this.topPrice)
float overlapLow = math.max(bLow, this.bottomPrice)
if bHigh == bLow and bHigh <= this.topPrice and bHigh >= this.bottomPrice
for i = 0 to this.profile.size() - 1
ProfileRow row = this.profile.get(i)
if bHigh >= row.priceBottom and bHigh <= row.priceTop
row.volumeTotal += bVol
this.totalVolume += bVol
break
else if overlapHigh > overlapLow
float overlapHeight = overlapHigh - overlapLow
float totalHeight = bHigh - bLow
float effectiveVol = totalHeight > 0 ? bVol * (overlapHeight / totalHeight) : bVol
for i = 0 to this.profile.size() - 1
ProfileRow row = this.profile.get(i)
float rowOverlapHigh = math.min(overlapHigh, row.priceTop)
float rowOverlapLow = math.max(overlapLow, row.priceBottom)
if rowOverlapHigh > rowOverlapLow
float rowOverlapHeight = rowOverlapHigh - rowOverlapLow
float rowRatio = rowOverlapHeight / overlapHeight
float addedVol = effectiveVol * rowRatio
row.volumeTotal += addedVol
this.totalVolume += addedVol
This is one of the most important calculations in the whole script.
The goal here is to take a candle and distribute its volume into the profile rows that the candle actually overlaps.
First, the script limits the candle to the range boundaries using overlapHigh and overlapLow . This ensures that only the part of the candle inside the range contributes to the profile.
Then two cases are handled.
If the candle has no height, meaning bHigh == bLow , the full volume is assigned to the single row that contains that exact price.
If the candle does have height, the script calculates how much of the candle actually overlaps the range. That overlapping height becomes the valid section for profile allocation. Then, for each profile row, the script measures how much of that valid section overlaps the row. Volume is distributed proportionally according to that overlap share.
This is much more accurate than placing the full candle volume into a single row. It means tall candles contribute volume across the price levels they truly passed through, which creates a more realistic internal distribution.
7) Filling the New Range With Historical Volume
if barsBack >= 0
for i = 0 to barsBack
float bVol = na(volume ) ? 1.0 : volume
activeRange.addVolume(high , low , bVol)
Right after a new range is created, the script goes back through all bars that belong to that range from its start until the current bar.
For each of those bars, it reads the volume and sends the bar high, bar low, and volume into addVolume .
This step is essential because it backfills the profile immediately. Without it, the range would start with an empty volume profile and would only accumulate data from future bars. Instead, the script reconstructs the whole internal history of the range as soon as the range is created.
Also notice the fallback 1.0 when volume data is missing. That ensures the script can still function on symbols where actual volume may not be available.
8) Range Confirmation and Break Detection
bool isBroken = close > activeRange.topPrice or close < activeRange.bottomPrice
if (bar_index - activeRange.startIndex) >= minRangeLen
activeRange.isConfirmed := true
Once a range is active, the script keeps evaluating two key questions on every bar.
The first question is whether the range is broken.
If the current close moves above the top or below the bottom, the range is considered finished.
The second question is whether the range has lasted long enough to be trusted.
If the number of bars since the range started is at least the user selected minimum, isConfirmed becomes true.
This creates a useful distinction between a candidate range and a confirmed range. A short structure can exist visually for a while, but it only becomes analytically meaningful after it survives long enough.
9) Live Updating While the Range Is Active
if not justCreated
float barVol = na(volume) ? 1.0 : volume
activeRange.addVolume(high, low, barVol)
if activeRange.isConfirmed
activeRange.calcValueArea(valAreaPct)
activeRange.drawProfile(colorBgTop, colorBgBot, colorProfile, colorProfileVA, colorPOC, colorVA)
else
activeRange.updateBgRight(time, colorBgTop, colorBgBot, colorBorder)
This block explains how the range evolves in real time.
If the current bar is not the same bar where the range was created, the script adds the latest candle volume into the profile. That keeps the internal distribution up to date bar by bar.
Then the script behaves differently depending on confirmation state.
If the range is already confirmed, it recalculates the value area and redraws the full profile. This means Point of Control, Value Area High, Value Area Low, and the histogram are all updated continuously as long as price remains inside the range.
If the range is not yet confirmed, the script only extends the background box to the current time. In other words, the market structure is still being monitored, but the full profile is not drawn until the range has proven itself.
10) Point of Control Discovery
float maxVol = -1.0
int pIndex = -1
for i = 0 to this.profile.size() - 1
ProfileRow row = this.profile.get(i)
if row.volumeTotal > maxVol
maxVol := row.volumeTotal
pIndex := i
this.pocIndex := pIndex
this.pocVolume := maxVol
ProfileRow pocRow = this.profile.get(pIndex)
this.pocPrice := (pocRow.priceTop + pocRow.priceBottom) / 2.0
This is the first phase inside the value area calculation.
The script scans every profile row and looks for the one with the largest accumulated volume. That row becomes the Point of Control row.
Once that row is found, the script stores:
the row index in pocIndex ,
the largest row volume in pocVolume ,
and the row midpoint price in pocPrice .
So the Point of Control is not guessed from the center of the range or from price action alone. It is derived directly from the heaviest profile row.
11) Expanding to Build the Value Area
float targetVol = this.totalVolume * (pct / 100.0)
float currentVol = maxVol
int upIndex = pIndex + 1
int downIndex = pIndex - 1
while currentVol < targetVol and (upIndex < this.profile.size() or downIndex >= 0)
float upVol = upIndex < this.profile.size() ? this.profile.get(upIndex).volumeTotal : -1.0
float downVol = downIndex >= 0 ? this.profile.get(downIndex).volumeTotal : -1.0
if upVol == -1.0 and downVol == -1.0
break
Here the script begins with the Point of Control row and tries to accumulate enough neighboring volume to reach the selected percentage of total range volume.
First, it calculates targetVol , which is the amount of total volume required for the value area. For example, if the input is 70 percent, the target is 70 percent of the full profile volume.
The process then starts from the Point of Control row. currentVol begins at the Point of Control volume itself. From there, the script looks one row up and one row down and keeps expanding until the target is reached or no more rows remain.
This is the classic logic of building a value area around the highest participation zone.
12) Choosing Whether to Expand Up or Down
bool addUp = false
if upVol > downVol
addUp := true
else if downVol > upVol
addUp := false
else
int distUp = upIndex - pIndex
int distDown = pIndex - downIndex
if distUp < distDown
addUp := true
else if distDown < distUp
addUp := false
else
addUp := true
This section decides which side should be added next to the value area.
If the row above the current zone has more volume than the row below, the script expands upward.
If the row below has more volume, it expands downward.
If both sides have the same volume, the script breaks the tie by comparing distance from the Point of Control. If distance is also equal, it defaults upward.
This matters because value area construction should not be arbitrary. It should expand toward the heaviest nearby participation first. That keeps the final value area centered around the most meaningful volume concentration.
13) Final VAH and VAL Calculation
int finalUp = math.min(upIndex - 1, this.profile.size() - 1)
int finalDown = math.max(downIndex + 1, 0)
this.vah := this.profile.get(finalUp).priceTop
this.val := this.profile.get(finalDown).priceBottom
After expansion is complete, the script converts the final upper and lower included rows into actual price boundaries.
vah becomes the top of the highest included row.
val becomes the bottom of the lowest included row.
These two values form the value area envelope, showing the price zone that contains the selected percentage of all volume traded inside the range.
So the final value area is not a fixed distance from Point of Control. It adapts to the actual row by row distribution.
14) Drawing the Gradient Range Background
method drawBg(RangeData this, color cBgTop, color cBgBot, color cBorder, int rTime) =>
if not na(this.bgBoxes)
for b in this.bgBoxes
b.delete()
this.bgBoxes := array.new()
int bgSlices = 10
float sliceStep = (this.topPrice - this.bottomPrice) / bgSlices
for i = 0 to bgSlices - 1
float bBot = this.bottomPrice + (i * sliceStep)
float bTop = bBot + sliceStep
this.bgBoxes.push(box.new(this.startTime, bTop, rTime, bBot, border_color=na, bgcolor=sliceCol, xloc=xloc.bar_time))
This method handles the visual background of the range.
Before drawing anything new, the script deletes previously drawn background boxes. Then it splits the range vertically into ten slices. Each slice receives an interpolated color between the selected bottom background color and top background color.
Finally, each slice is drawn as a time based box from the range start to the chosen right edge time.
The result is a smooth vertical color transition across the range body, which makes the zone easier to read and visually separates upper and lower sections.
15) Drawing the Histogram, POC, VAH, and VAL
if this.isConfirmed
float maxVol = this.pocVolume
if maxVol > 0
int rangeTimeWidth = math.max(rightTime - this.startTime, 1000)
int maxTimeWidth = math.round(rangeTimeWidth * 0.35)
for i = 0 to this.profile.size() - 1
ProfileRow row = this.profile.get(i)
if row.volumeTotal > 0
float widthRatio = row.volumeTotal / maxVol
int boxTimeWidth = math.round(maxTimeWidth * widthRatio)
int boxLeftTime = rightTime - boxTimeWidth
bool inVA = (row.priceTop <= this.vah and row.priceBottom >= this.val)
color finalHistCol = inVA ? histVaCol : histCol
this.histBoxes.push(box.new(boxLeftTime, t, rightTime, b, border_color=na, bgcolor=finalHistCol, xloc=xloc.bar_time))
this.pocLine := line.new(this.startTime, this.pocPrice, rightTime, this.pocPrice, color=pocCol, style=line.style_solid, width=2, xloc=xloc.bar_time)
this.vahLine := line.new(this.startTime, this.vah, rightTime, this.vah, color=vaCol, style=line.style_dashed, width=1, xloc=xloc.bar_time)
this.valLine := line.new(this.startTime, this.val, rightTime, this.val, color=vaCol, style=line.style_dashed, width=1, xloc=xloc.bar_time)
This is the drawing engine for the completed profile.
For each row with volume, the script calculates a width ratio relative to the Point of Control volume. Rows with more volume receive wider histogram boxes. Rows with less volume receive narrower boxes.
That width is converted into time space, so the histogram grows leftward from the right edge of the range. This creates a compact in range horizontal profile.
The script also checks whether each row lies inside the value area. If it does, the row uses the value area histogram color. If it does not, it uses the normal profile color. This makes the high participation area visually distinct.
Finally, the script draws three key lines across the full width of the range:
Point of Control,
Value Area High,
and Value Area Low.
These lines convert the internal profile data into easy to read structure references on the chart.
16) What Happens When the Range Breaks
if isBroken
activeRange.isActive := false
activeRange.endIndex := bar_index
activeRange.endTime := time
if not activeRange.isConfirmed
if not na(activeRange.bgBoxes)
for b in activeRange.bgBoxes
b.delete()
else
activeRange.calcValueArea(valAreaPct)
activeRange.drawProfile(colorBgTop, colorBgBot, colorProfile, colorProfileVA, colorPOC, colorVA)
lastClosedRangeEndIndex := bar_index
activeRange := na
This block defines the final lifecycle of a range.
When price closes outside the range boundaries, the active structure is terminated. The script records the ending bar and ending time, then checks whether the range had ever become confirmed.
If the range was never confirmed, its background is deleted and the structure is discarded. This prevents weak or short lived ranges from leaving unnecessary clutter.
If the range was confirmed, the script performs a final value area calculation and profile draw on the completed structure. It also stores the ending index so future ranges do not overlap with this one.
Then the active range is cleared from memory, which allows the script to start searching for the next valid structure. Indicator

Hidden Markov Reversal Finder [UAlgo]Hidden Markov Reversal Finder is a regime aware reversal detection indicator that uses a compact 3 state Hidden Markov style filter with online adaptation to classify market conditions and highlight potential top and bottom rotations. The script models price behavior as transitions between three regimes:
- Bull Expansion
- Balance
- Bear Stress
Instead of running a heavy Baum Welch retraining loop, this version is designed as a lightweight real time filter. It updates regime probabilities using a transition matrix plus a two dimensional Gaussian emission model built from two normalized observations:
Return observation as a smoothed log return z score
Volatility observation as a realized volatility z score
The indicator runs in its own pane ( overlay=false ) but can optionally paint chart bars and place reversal labels on price using force overlay. It also includes a clean dashboard panel showing the current state, confidence, observation values, score, posterior probabilities, stretch, and the current setup classification.
The reversal engine is built around a top rotation and bottom rotation concept. It looks for a probability peak in a regime, then a fade from that peak, combined with momentum flip conditions and a stretch filter measured in ATR units relative to a baseline EMA. Signals are gated by a confidence threshold and a cooldown period to reduce repetitive prints.
This makes the indicator useful as a regime driven reversal framework that integrates:
State probabilities and confidence
Regime score and momentum flip
ATR based stretch extremes
Peak fade rotation logic
Clean visual markers and dashboard transparency
🔹 Features
🔸 1) Three Regime Model
The script uses three explicit regimes with distinct roles:
Bull Expansion, intended to represent positive drift conditions
Balance, intended to represent neutral or mixed drift
Bear Stress, intended to represent negative drift and higher stress conditions
Each regime has its own mean and variance assumptions for return and volatility, which are then adapted online.
🔸 2) Two Dimensional Observation System (Return and Volatility)
The model does not rely on only returns. It uses both:
A normalized return feature
A normalized volatility feature
This helps distinguish clean bullish trends from choppy balance periods, and balance periods from bearish stress regimes.
🔸 3) Transition Matrix with Persistence Controls
Users can control how sticky each regime is through persistence settings:
Bull persistence
Balance persistence
Bear persistence
The transition matrix is constructed so that most probability remains in the same regime, while the remainder flows into other regimes using asymmetric weights that reflect realistic behavior.
🔸 4) Real Time Bayesian Filter Update
Each bar, the model performs:
Prediction step using the transition matrix
Update step using Gaussian emissions
Posterior normalization
Active state selection by arg max
This produces a smooth probability based regime tracker suitable for live use.
🔸 5) Adaptation
After filtering, the model adapts its internal means and variances using a learning rate scaled by posterior responsibility. This allows the state distributions to slowly adjust to changing market conditions without full retraining.
This keeps the indicator responsive while still stable.
🔸 6) Regime Score Output
The main score line is:
Bull posterior minus Bear posterior
This produces a continuous signal that ranges between negative and positive values and functions as a regime tilt meter. A confidence ribbon is also plotted as an area band derived from the dominant posterior.
🔸 7) Confidence Gating and Visual Strength
Confidence is defined as the largest posterior probability among the three regimes. The script uses confidence to:
Gate reversal signals
Determine bar tint transparency when bar coloring is enabled
Decide whether state shift tags should be printed
This reduces noise during low clarity periods.
🔸 8) Rotation Style Reversal Engine
The reversal finder is built on rotation logic:
A top rotation occurs after a Bull probability peak fades while Bear probability begins to rise
A bottom rotation occurs after a Bear probability peak fades while Bull probability begins to rise
This is a probabilistic rotation concept rather than a simple oscillator crossover.
🔸 9) Momentum Flip Confirmation
Signals require momentum confirmation through:
Regime score change direction
Return observation crossing a flip threshold
This is designed to reduce premature top and bottom calls when the regime probabilities shift but price momentum has not actually flipped.
🔸 10) ATR Based Stretch Filter
The script computes stretch as distance from an EMA baseline measured in ATR units. Signals require:
Top signals only when stretch is above a positive threshold
Bottom signals only when stretch is below a negative threshold
This ensures reversal signals occur when price is extended, not when it is near equilibrium.
🔸 11) Cooldown Control
A cooldown setting prevents consecutive buy or sell reversal signals from printing too frequently. This is especially useful when the market chops around an extreme and repeatedly triggers partial rotation conditions.
🔸 12) Dashboard Panel
A table dashboard displays key information on the last bar:
Active state name
Confidence
Return z score and volatility z score
Regime score
Posterior probabilities
Stretch in ATR units
Current setup text such as BUY REVERSAL, SELL REVERSAL, TOP WATCH, BOTTOM WATCH, WAIT
This makes the indicator transparent and easy to interpret.
🔸 13) State Tags and Reversal Labels on Chart
When enabled, the script prints:
State tags such as BULL, BASE, BEAR with arrows
Reversal markers with a vertical guide line and bold letter B or S
Tooltips include confidence, peak probability, stretch, and current posterior probabilities.
🔸 14) Optional Probability Curves and Bar Coloring
Users can toggle:
State probability plots
Signal markers and dots
Dashboard visibility
State tag visibility
Bar coloring by regime with confidence adjusted transparency
This makes the indicator adaptable for minimalist or fully informational workflows.
🔹 Calculations
1) Return Observation Construction
The script uses log returns:
float logReturn = math.log(close / nz(close , close))
It smooths return with an EMA:
float smoothedReturn = ta.ema(logReturn, returnSmoothLength)
Then normalizes by the return standard deviation:
float returnStdev = math.max(nz(ta.stdev(logReturn, returnZLength), EPS), EPS)
float returnObs = clampFloat(smoothedReturn / returnStdev, -obsClamp, obsClamp)
Interpretation:
Return observation is a clamped z score like feature, where positive values represent bullish return pressure and negative values represent bearish return pressure.
2) Volatility Observation Construction
Realized volatility is measured as the standard deviation of log returns:
float realizedVol = nz(ta.stdev(logReturn, volLength), EPS)
Then it is normalized relative to a baseline EMA and baseline standard deviation:
float volMean = nz(ta.ema(realizedVol, volBaselineLength), realizedVol)
float volStdev = math.max(nz(ta.stdev(realizedVol, volBaselineLength), EPS), EPS)
float volObs = clampFloat((realizedVol - volMean) / volStdev, -obsClamp, obsClamp)
Interpretation:
Volatility observation is a clamped z score like feature, where higher values indicate volatility expansion relative to baseline.
3) Warmup Logic
The model waits for enough history to compute stable normalized observations:
int warmupBars = math.max(returnZLength, volBaselineLength) + volLength
bool ready = bar_index > warmupBars and not na(returnObs) and not na(volObs)
Before ready, the script avoids producing live signals and uses the initial posterior distribution.
4) Transition Matrix Configuration
The transition matrix uses persistence values and asymmetric drift splits:
From Bull, most drift flows to Balance and a smaller portion to Bear
From Bear, most drift flows to Balance and a smaller portion to Bull
From Balance, drift splits evenly between Bull and Bear
Core setup:
this.setTransition(STATE_BULL, STATE_BALANCE, bullDrift * 0.78)
this.setTransition(STATE_BULL, STATE_BEAR, bullDrift * 0.22)
...
this.setTransition(STATE_BEAR, STATE_BALANCE, bearDrift * 0.78)
this.setTransition(STATE_BEAR, STATE_BULL, bearDrift * 0.22)
This design makes Balance act like a bridge regime and reduces unrealistic direct flip frequency.
5) Emission Model: 2D Gaussian Density
Each state computes an emission probability from return and volatility observations using a 2D Gaussian likelihood:
float exponent = -0.5 * ((retDeviation * retDeviation) / retVariance + (volDeviation * volDeviation) / volVariance)
float normalizer = 1.0 / (2.0 * math.pi * math.sqrt(retVariance * volVariance))
math.max(normalizer * math.exp(math.max(exponent, -24.0)), EPS)
Variances are floored at 0.12 to prevent collapse.
6) Prediction Step
The model predicts next probabilities using the transition matrix:
predictedProbability += posterior * transition(fromState, toState)
Then normalizes the predicted vector so it sums to 1.
7) Filter Update Step
The posterior is updated by multiplying predicted probabilities by emission likelihoods:
nextPosterior = predicted * emission(state, retObs, volObs)
Then normalized. The active state is the arg max of the posterior.
8) Online Adaptation
The model updates state means and variances using posterior responsibility times learning rate:
float responsibility = posterior * learningRate
Means update by moving toward the current observation:
nextMuRet = oldMuRet + responsibility * retError
nextMuVol = oldMuVol + responsibility * volError
Variances update toward squared error:
nextVarRet = oldVarRet + responsibility * (retError * retError - oldVarRet)
nextVarVol = oldVarVol + responsibility * (volError * volError - oldVarVol)
All parameters are clamped to stability ranges so the model does not explode.
9) Regime Score and Confidence
Score is defined as:
posterior - posterior
Confidence is the maximum posterior:
posterior
These values drive visuals and signal gating.
10) Stretch Calculation in ATR Units
Stretch uses an EMA basis of price and measures distance in ATR units:
float basis = ta.ema(close, stretchLength)
float atrValue = math.max(ta.atr(14), syminfo.mintick)
float stretch = (close - basis) / atrValue
Top stretch requires:
stretch >= stretchThreshold
Bottom stretch requires:
stretch <= -stretchThreshold
This ensures reversals occur when price is statistically extended relative to recent volatility.
11) Probability Peak and Fade Logic
The script measures recent peaks for bull and bear probabilities:
float bullPeak = ta.highest(bullProb , peakLookback)
float bearPeak = ta.highest(bearProb , peakLookback)
Fade is peak minus current:
bullFade = bullPeak - bullProb
bearFade = bearPeak - bearProb
Top rotation condition requires:
Bull peak above threshold
Bull fade above minimum
Bear probability rising
Bottom rotation requires the mirrored conditions.
This captures the idea of regime dominance peaking, then fading as the opposite side begins to regain influence.
12) Momentum Flip Confirmation
Momentum down requires:
Regime score decreasing
Return observation strongly negative below a flip threshold
Momentum up requires:
Regime score increasing
Return observation strongly positive above the flip threshold
This prevents signals when probabilities fade but momentum remains neutral.
13) Signal Gating and Cooldown
Signals require confidence above the threshold and a cooldown to avoid repeated triggers:
confidenceValue >= confidenceThreshold
bar_index - lastSignalBar > cooldownBars
14) Buy and Sell Reversal Signals
Buy reversal:
Bottom rotation
Momentum up
Bottom stretch
Confidence filter
Cooldown filter
Sell reversal:
Top rotation
Momentum down
Top stretch
Confidence filter
Cooldown filter
A Balance signal is also triggered when the state changes to Balance with sufficient confidence.
15) Visual Outputs
The indicator plots:
Regime score line with area fill around zero
Confidence ribbon as an area band
Optional posterior curves for Bull, Balance, Bear
Normalized stretch line scaled by the stretch threshold
Optional dots on the chart for reversal events
Optional bar coloring on the main chart
It also prints:
Reversal labels B and S with stretch, confidence, and peak probability tooltips
State tags on regime shifts
A dashboard panel summarizing live state and setup context Indicator

Institutional Liquidity Flow Engine [JOAT]Institutional Liquidity Flow Engine
Introduction
The Institutional Liquidity Flow Engine is an advanced open-source volume analysis indicator that combines relative volume monitoring, buyer/seller strength analysis, multi-timeframe alignment detection, and comprehensive flow metrics into a unified institutional-grade tool. This indicator helps traders identify when institutional money is entering or exiting positions by analyzing volume patterns, pressure dynamics, and liquidity conditions across multiple timeframes.
Unlike basic volume indicators that simply show volume bars, this engine dissects volume into actionable intelligence: relative volume (RVOL) to identify unusual activity, buyer/seller strength ratios to determine who controls the market, accumulation/distribution trends to track smart money positioning, and multi-timeframe alignment to confirm directional conviction. The indicator is designed for traders who understand that volume precedes price and that institutional footprints can be detected through systematic volume analysis.
Why This Indicator Exists
This indicator addresses a critical gap in retail trading: the ability to detect institutional activity in real-time. Institutional traders move large positions that create detectable volume signatures. By combining multiple volume analysis methodologies, this indicator reveals:
Relative Volume Analysis: Identifies when volume is significantly above or below average, signaling potential institutional activity
Buyer/Seller Strength: Quantifies the balance of power between buyers and sellers using volume-weighted calculations
Multi-Timeframe Alignment: Confirms whether volume patterns align across 1m, 5m, 15m, 30m, 1h, 2h, 4h, Daily, and Weekly timeframes
Flow Metrics: Tracks Money Flow Index (MFI), On-Balance Volume (OBV), Accumulation/Distribution (A/D), and VWAP deviation
Liquidity Classification: Categorizes market conditions as Strong Buying, Strong Selling, Balanced, or Thin liquidity
Each component provides a different lens on volume behavior. RVOL shows intensity, buyer/seller strength shows direction, MTF alignment shows conviction, flow metrics show institutional positioning, and liquidity classification shows market conditions. Together, they create a comprehensive view of institutional activity.
Core Components Explained
1. Relative Volume (RVOL) Analysis
RVOL is calculated as current volume divided by the average volume over a specified period (default 20 bars):
avgVolume = ta.sma(volume, volumeLength)
relativeVolume = avgVolume > 0 ? volume / avgVolume : 1.0
The indicator classifies RVOL into five categories:
Extreme (RVOL >= 3.0): Institutional-level activity, potential climax moves
High (RVOL >= 1.5): Above-average activity, significant interest
Normal (RVOL >= 1.0): Average activity, typical market conditions
Low (RVOL >= 0.5): Below-average activity, reduced interest
Very Low (RVOL < 0.5): Minimal activity, thin liquidity
RVOL thresholds are customizable. Higher RVOL often precedes significant price moves as institutions accumulate or distribute positions.
2. Buyer/Seller Strength Analysis
The indicator calculates buyer and seller strength using volume-weighted analysis:
buyerVolume = close > open ? volume : 0
sellerVolume = close < open ? volume : 0
buyerStrength = ta.sma(buyerVolume, volumeLength)
sellerStrength = ta.sma(sellerVolume, volumeLength)
Strength ratios are calculated as percentages:
Buyer Ratio: (buyerStrength / totalStrength) * 100
Seller Ratio: (sellerStrength / totalStrength) * 100
When buyer ratio exceeds 70%, bullish pressure dominates. When seller ratio exceeds 70%, bearish pressure dominates. The indicator also integrates ATR-based strength calculations to filter for significant moves and RSI-based strength classification (Strong/Moderate/Weak) for additional context.
3. Multi-Timeframe Alignment
The indicator requests RVOL data from three customizable timeframes (default: 5m, 15m, 60m) and calculates alignment:
mtf1_bullish = rvol_mtf1 > 1.0 and vol_mtf1 > ta.sma(vol_mtf1, 20)
mtfAlignment = (mtf1_bullish ? 1 : 0) + (mtf2_bullish ? 1 : 0) + (mtf3_bullish ? 1 : 0)
Alignment status:
Strong Aligned (3/3): All timeframes show elevated volume - high conviction
Aligned (2/3): Majority timeframes show elevated volume - moderate conviction
Weak (1/3): Only one timeframe shows elevated volume - low conviction
No Alignment (0/3): No timeframes show elevated volume - no conviction
Strong alignment across multiple timeframes indicates institutional participation at scale, as large orders are often split across timeframes to minimize market impact.
4. Flow Metrics Suite
Money Flow Index (MFI):
Volume-weighted RSI that measures buying and selling pressure:
mfi = ta.mfi(close, volumeLength)
MFI > 80 indicates overbought conditions with high volume, MFI < 20 indicates oversold conditions with high volume.
On-Balance Volume (OBV):
Cumulative volume indicator that adds volume on up days and subtracts on down days:
obv = ta.cum(math.sign(ta.change(close)) * volume)
obvTrend = obv > obvMA ? "Bullish" : obv < obvMA ? "Bearish" : "Neutral"
OBV divergences from price often signal reversals.
Accumulation/Distribution (A/D):
Measures the cumulative flow of money into and out of a security:
ad = ta.cum(close == high and close == low or high == low ? 0 : ((2 * close - low - high) / (high - low)) * volume)
Rising A/D with rising price confirms uptrend, falling A/D with rising price signals distribution.
VWAP Deviation:
Measures how far price is from volume-weighted average price:
vwap = ta.vwap(close)
vwapDeviationPercent = vwap != 0 ? ((close - vwap) / vwap) * 100 : 0
Large deviations often mean-revert as institutions take advantage of inefficient pricing.
5. Volume Speed & Acceleration
The indicator calculates volume momentum and acceleration:
Volume ROC: Rate of change in volume over 5 periods
Volume Acceleration: Change in volume ROC (second derivative)
Volume Momentum: Current volume minus 10-period SMA
Volume Trend: Increasing or Decreasing based on EMA crossover
Accelerating volume often precedes breakouts or breakdowns as institutional orders hit the market.
6. Liquidity Classification System
The indicator classifies current liquidity conditions:
Strong Buying: High RVOL + positive net pressure (buyer strength > seller strength)
Strong Selling: High RVOL + negative net pressure (seller strength > buyer strength)
Balanced: Normal RVOL with relatively equal buyer/seller strength
Thin: Low RVOL indicating reduced liquidity and potential for slippage
Pressure intensity is calculated as:
pressureLevel = math.abs(netPressure) / avgVolume
pressureIntensity = pressureLevel >= 2.0 ? "Extreme" : pressureLevel >= 1.0 ? "High" : pressureLevel >= 0.5 ? "Moderate" : "Low"
Visual Elements
RVOL Histogram: Main plot showing relative volume with color-coded intensity (extreme = magenta, high = yellow, normal = green, low = gray)
Reference Lines: Horizontal lines at 1.0 (average), 1.5 (high threshold), and 3.0 (extreme threshold)
Buyer Pressure Fill: Background fill showing buyer pressure ratio (0-100%)
Volume Oscillator: Histogram overlay showing short-term vs long-term volume momentum
MFI Line: Thick line overlay showing Money Flow Index with gradient colors
Information Table: Comprehensive dashboard displaying all metrics in real-time
The table displays 15 metrics:
1. RVOL (current relative volume)
2. Status (Extreme/High/Normal/Low/Very Low)
3. Volume Trend (Increasing/Decreasing)
4. Pressure (Bullish/Bearish/Neutral)
5. Buyer Strength (percentage)
6. Seller Strength (percentage)
7. RSI (current value)
8. Liquidity (Strong Buying/Strong Selling/Balanced/Thin)
9. MTF Alignment (Strong Aligned/Aligned/Weak/No Alignment)
10. A/D Trend (Accumulation/Distribution/Neutral)
11. OBV Trend (Bullish/Bearish/Neutral)
12. MFI (current value)
13. VWAP Deviation (percentage)
14. Volume Momentum (percentage)
Input Parameters
Volume Analysis:
Volume MA Length: Period for volume moving average (default: 20)
High RVOL Threshold: Multiplier for high volume detection (default: 1.5)
Extreme RVOL Threshold: Multiplier for extreme volume detection (default: 3.0)
Multi-Timeframe Settings:
Show Multi-Timeframe Analysis: Toggle MTF calculations (default: enabled)
Timeframe 1/2/3: Customizable timeframes for alignment analysis (default: 5m, 15m, 60m)
Buyer/Seller Strength:
ATR Length: Period for ATR calculation (default: 14)
RSI Length: Period for RSI calculation (default: 14)
RSI Overbought/Oversold: Thresholds for RSI classification (default: 70/30)
Display Options:
Show Info Table: Toggle information dashboard (default: enabled)
Show Volume Histogram: Toggle RVOL histogram (default: enabled)
Show VWAP Deviation: Toggle VWAP calculations (default: enabled)
Table Position: Choose dashboard location (Top Right/Top Left/Bottom Right/Bottom Left)
Colors:
All colors are customizable including bullish, bearish, neutral, extreme volume, and high volume colors.
How to Use This Indicator
Step 1: Monitor RVOL for Unusual Activity
Watch for RVOL spikes above 1.5 (high) or 3.0 (extreme). These indicate institutional activity. Extreme RVOL often marks climax moves or major reversals.
Step 2: Check Buyer/Seller Strength
Identify who controls the market. Buyer ratio > 70% suggests bullish control, seller ratio > 70% suggests bearish control. Look for divergences where price moves one direction but strength moves another.
Step 3: Confirm with MTF Alignment
Strong alignment across multiple timeframes confirms institutional conviction. Weak or no alignment suggests retail-driven moves that may lack follow-through.
Step 4: Analyze Flow Metrics
Check MFI, OBV, and A/D for confirmation. Rising OBV with rising price confirms uptrend. Falling A/D with rising price warns of distribution.
Step 5: Assess Liquidity Conditions
Strong Buying or Strong Selling conditions with high RVOL often precede significant moves. Thin liquidity conditions increase risk of slippage and false moves.
Step 6: Look for Volume Acceleration
Accelerating volume momentum often precedes breakouts. Decelerating volume momentum often precedes consolidation or reversal.
Best Practices
Use on liquid instruments (major forex pairs, large-cap stocks, major crypto) for most reliable signals
Combine with price action analysis - volume shows intent, price shows result
Pay attention to RVOL spikes at key support/resistance levels
Look for volume divergences: price making new highs/lows without volume confirmation often fails
MTF alignment is most reliable on trending markets, less reliable in choppy conditions
Extreme RVOL can signal exhaustion - be cautious of chasing moves with RVOL > 5.0
Use VWAP deviation for mean reversion opportunities when price extends far from VWAP
Monitor A/D and OBV for early warning signs of trend changes
Indicator Limitations
Volume analysis works best on liquid instruments with consistent volume patterns
Low-volume instruments or off-market hours can produce unreliable RVOL readings
MTF alignment requires sufficient data on all timeframes - may not work on newly listed instruments
Volume precedes price but doesn't guarantee direction - high volume can occur on both breakouts and fakeouts
Buyer/seller strength calculations assume close > open = buying and close < open = selling, which is a simplification
RVOL thresholds may need adjustment for different instruments and market conditions
The indicator shows what is happening, not why - fundamental catalysts can override technical volume patterns
Extreme RVOL can persist longer than expected during major news events or market dislocations
Technical Implementation
Built with Pine Script v6 using:
Custom RVOL calculations with dynamic thresholds
Volume-weighted buyer/seller strength analysis
Multi-timeframe security requests with proper lookahead settings
Comprehensive flow metrics (MFI, OBV, A/D, VWAP)
Volume momentum and acceleration calculations
Real-time liquidity classification system
Dynamic table with 15 metrics and color-coded cells
Thick histogram and line plots for enhanced visibility
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its comprehensive integration approach. While individual components (RVOL, MFI, OBV, A/D, buyer/seller strength) are established concepts, this indicator is justified because:
It synthesizes six distinct volume analysis methodologies into a unified system
The multi-timeframe alignment detection provides institutional conviction measurement not available in standard volume indicators
Buyer/seller strength calculations combine volume, ATR, and RSI for multi-dimensional pressure analysis
The liquidity classification system categorizes market conditions in real-time
Volume speed and acceleration metrics provide early warning of momentum shifts
The comprehensive dashboard presents 15 metrics simultaneously for holistic volume analysis
Integration of flow metrics (MFI, OBV, A/D, VWAP) with RVOL and strength analysis creates layered confirmation
Each component contributes unique information: RVOL shows intensity, buyer/seller strength shows direction, MTF alignment shows conviction, flow metrics show positioning, liquidity classification shows conditions, and volume acceleration shows momentum. The indicator's value lies in presenting these complementary perspectives simultaneously with a unified classification system.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Volume analysis is a tool for understanding market dynamics, not a crystal ball for predicting future price movement. High volume does not guarantee profitable trades. Past volume patterns do not guarantee future volume patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. High RVOL, strong buyer/seller ratios, and MTF alignment do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Accumulation Zone Profiles [UAlgo]Accumulation Zone Profiles is an overlay indicator that detects low volatility accumulation phases and automatically builds a fixed range volume profile for each confirmed zone. The script uses a statistical volatility model based on log returns, identifies periods where volatility compresses into an unusually quiet regime, then verifies that price action remains sufficiently sideways before confirming the zone.
When a zone is confirmed, the indicator draws two complementary views:
A highlighted accumulation range on the chart
A fixed range volume profile drawn to the right of the zone, including Point of Control and Value Area levels
The intent is to turn consolidation into a structured map. Instead of treating ranges as vague rectangles, the script assigns a volume distribution to the range so you can see where the market accepted price, where it rejected price, and which levels are most likely to matter during expansion.
🔹 Features
1) Statistical Accumulation Detection Using Log Volatility
The detection engine starts from log returns r = ln(C / C ) and builds an EWMA based volatility estimate. Volatility is converted into log space and evaluated with a rolling distribution model. A z score determines whether the current volatility is unusually low relative to its own history.
Zones begin when the z score falls below a configurable entry threshold and they end after volatility recovers above an exit threshold for a configurable number of confirmation bars.
2) Sideways Quality Filter With Trend Score
Not every low volatility period is true accumulation. The script measures drift using a trend score defined as:
absolute sum of returns divided by sum of absolute returns
Lower values indicate more rotation and less directional drift. A maximum trend score filter ensures zones remain meaningfully sideways before a profile is created.
3) Non Repainting Option Using Confirmed Bars
When enabled, the system only updates on confirmed bars. This reduces repainting behavior and makes zone start and zone end decisions more stable for live trading workflows.
4) Fixed Range Volume Profile Per Zone
For each confirmed accumulation zone, the script builds a histogram of volume across a user selected number of price rows. Each bar’s volume is distributed into bins according to how much of that candle range overlaps each bin. This produces a true fixed range profile for the zone.
The profile is drawn to the right of the zone so it does not cover price action.
5) Point of Control and Value Area Levels
The highest volume row is treated as the Point of Control. Value Area High and Value Area Low are computed by expanding outward from POC until a target percent of total volume is captured. This creates a practical acceptance framework inside the zone.
Optional plotting allows:
Highlighting the POC row
Drawing VAH and VAL lines
Drawing zone boundary guides
Showing an information label that summarizes zone statistics
6) Tick Alignment For Clean Levels
If enabled, the zone range, bin step size, and derived levels are aligned to the instrument tick size. This produces cleaner price levels and reduces floating point noise in labels and lines.
7) Object Budget Management
Volume profiles use many boxes. The script computes an effective rows value based on the number of profiles you choose to keep, then limits total box usage so you are less likely to hit platform object limits. Older profiles are deleted automatically when new ones are created.
8) Alerts
Two alerts are available:
Accumulation Zone Started
Accumulation Zone Confirmed and Profile Created
This supports automation such as watchlist monitoring and breakout preparation.
🔹 Calculations
1) Log Return and EWMA Variance
The script defines log return as ln(C / C ) and uses an EWMA of squared returns as a variance proxy.
Alpha for EWMA:
f_alpha(int len) =>
2.0 / (len + 1.0)
Log return:
lr = math.log(close / close )
lr := na(close ) or close == 0.0 ? 0.0 : lr
EWMA variance and volatility:
alphaFast = f_alpha(fastLen)
var float ewmaVarR = na
ewmaVarR := na(ewmaVarR ) ? lr * lr : alphaFast * (lr * lr) + (1.0 - alphaFast) * ewmaVarR
vol = math.sqrt(math.max(ewmaVarR, 0.0))
2) Log Volatility Distribution and z Score
Volatility is transformed into log space to stabilize distribution behavior. The script maintains EWMA estimates of mean and second moment, then computes standard deviation and z score.
eps = 1e-10
logVol = math.log(vol + eps)
alphaDist = f_alpha(distLen)
var float m1 = na
var float m2 = na
m1 := na(m1 ) ? logVol : alphaDist * logVol + (1.0 - alphaDist) * m1
m2 := na(m2 ) ? logVol * logVol : alphaDist * (logVol * logVol) + (1.0 - alphaDist) * m2
sigma = math.sqrt(math.max(m2 - m1 * m1, eps))
z = (logVol - m1) / sigma
Interpretation:
Negative z means volatility is below its typical level
More negative z means stronger compression
3) Zone Start and Zone End Conditions
Entry and exit logic uses the z score relative to thresholds:
Start when z is less than or equal to minus Enter Threshold
End when z is greater than or equal to minus Exit Threshold for Exit Confirm Bars
lowNow = not na(z) and z <= -enterZ
highNow = not na(z) and z >= -exitZ
Exit confirmation counter:
zb.exitCount := highNow ? zb.exitCount + 1 : 0
bool exitByConfirm = zb.exitCount >= exitBars
A maximum zone duration also forces closure:
bool exitByMax = zb.barCount() >= maxZoneBars
If exit is triggered via confirmation bars, the script removes those last bars from the zone before profiling to avoid contaminating the accumulation range with the volatility recovery phase.
4) Sideways Drift Score Filter
During zone building, returns are accumulated:
sumR is the signed drift
sumAbsR is total movement magnitude
Trend score:
method driftScore(ZoneBuilder this) =>
math.abs(this.sumR) / math.max(this.sumAbsR, 1e-10)
A zone is accepted only if:
Bar count is at least Min Zone Bars
Drift score is less than or equal to Max Trend Score
5) Profile Range and Row Step
Once accepted, the profile range is built from the min low and max high of the zone. The range is optionally aligned to tick.
Step size equals range divided by rows, with optional tick alignment:
float stepRaw = (hi - lo) / rows
float step = stepRaw
if alignTick
step := math.max(syminfo.mintick, f_roundToTick(stepRaw))
6) Volume Histogram Construction
For each bar in the zone, volume is assigned into bins.
If the candle range is very small, volume goes to a single nearest bin.
Otherwise, volume is distributed proportionally by overlap between candle range and each bin range.
Core proportional distribution logic:
float overlap = math.max(0.0, math.min(bh, binHi) - math.max(bl, binLo))
if overlap > 0
float frac = overlap / br
array.set(binVol, b, array.get(binVol, b) + bv * frac)
This produces binVol, a per row volume distribution.
7) POC Calculation
POC is the index of the maximum bin volume. POC price is the center of that row.
if v > maxV
maxV := v
pocIdx := b
float poc = lo + (pocIdx + 0.5) * step
8) Value Area Computation
Value Area is derived by expanding outward from POC until the cumulative volume reaches Value Area percent of total volume.
Target volume:
float target = totV * (valueAreaPct / 100.0)
Expand left and right by choosing the side with higher next volume until the target is met. This creates a contiguous value area band.
VAL and VAH mapping to prices:
float valP = lo + left * step
float vahP = lo + (right + 1) * step
9) Rendering Logic
Zone highlight is drawn directly over the accumulation period using a box with configurable fill and border transparency.
The volume profile is drawn as a stack of boxes to the right of the zone. Each row width is proportional to row volume relative to max row volume. Transparency is mapped so high volume rows appear more prominent.
POC row can be highlighted using a dedicated color and transparency configuration.
VAH and VAL can be drawn as horizontal lines across the profile region, and optional boundary lines can mark the start and end of the detected zone.
10) Profile Retention and Cleanup
Profiles are stored in an array. When the number of stored profiles exceeds Keep Last Profiles, the oldest profile is deleted and all of its objects are removed. This keeps the chart responsive and prevents reaching the platform maximum object counts. Indicator
