Virgin CPR Zones (Open Source) D / W / M / YVirgin CPR Zones — D / W / M / Y
OVERVIEW
This indicator plots the Central Pivot Range (CPR) for four timeframes — Daily, Weekly,
Monthly and Yearly — and automatically marks the "virgin" ones as extending zones on the
chart.
A CPR is called virgin when price never traded inside it during the period it belonged to.
Because that range was never tested while it was active, many traders treat it as an
untouched area of interest that price may react to when it eventually returns.
WHAT IT DRAWS
1. CPR lines for each enabled timeframe:
- TC (Top Central) = 2 × Pivot − BC
- Pivot = (High + Low + Close) / 3
- BC (Bottom Central) = (High + Low) / 2
The CPR is latched at the first bar of each new period using the previous period's
completed HLC, so the levels never repaint or shift mid-period.
2. Virgin CPR zones: when a period closes without price having traded into its own CPR,
a box is drawn between TC and BC and extended forward bar by bar. The zone stops
extending the moment price trades into it, leaving a permanent record of where and
when it was consumed.
HOW IT WORKS
Each timeframe runs through its own self-contained state machine, so the Daily, Weekly,
Monthly and Yearly logic never share arrays, latches or touch flags with one another.
Higher-timeframe data is requested with lookahead disabled and gaps off, so nothing is
known before it would have been known in real time.
The touch test is reset at the start of each new period before the current bar is
evaluated, which means the very first candle of a period can register as a touch. A CPR
is only promoted to a virgin zone after its own period has closed untouched, so zones
appear at the period boundary rather than intrabar.
Each timeframe only draws if the chart timeframe is equal to or lower than the CPR
timeframe. For example, Weekly zones will not appear on a Monthly chart.
INPUTS
- General: toggle the D / W / M / Y text tags on each zone.
- Per timeframe (Daily, Weekly, Monthly, Yearly):
- Show CPR lines on/off
- Show virgin CPR zones on/off
- Maximum number of zones to keep (oldest is deleted first)
- Colour
Defaults: Daily and Weekly lines are on, Monthly and Yearly lines are off to keep the
chart clean, while zones are enabled for all four.
HOW TO USE IT
Untested zones from a higher timeframe tend to carry more weight than lower ones, so a
virgin Monthly or Yearly CPR is generally treated as more significant than a virgin
Daily. Common uses are watching for a reaction on the first tag of a zone, or using the
zone edges (TC and BC) as reference levels for entries, targets and invalidation.
This is a levels and context tool. It does not generate buy or sell signals and should be
combined with your own structure, trend and risk management rules.
NOTES
- Zones are capped per timeframe to stay within drawing object limits. Increase the
"Max zones" input if you want more history, reduce it if the chart feels crowded.
- Because CPR is built from the previous period's completed data, the levels for the
current period are fixed from its first bar onward.
Author: Vishwajeeth J K Penunjuk

Range PositionRange Position answers one question at every bar: where is price inside the range it has just travelled? For each of seven lookback windows (the last 1, 3, 5, 15, 60 and 240 closed one-minute bars, plus the session since 18:00 ET) the indicator draws the window high and low on the price chart and computes the position of the current close as a percentage of that range, 0 at the low and 100 at the high. Because a long taken near the low and a short taken near the high are the same situation from the trader's side, the reading is also expressed side-relative as "ext": a BUY's ext is the distance up from the low, a SELL's ext is the distance down from the high, so a low ext on either side means you are entering at the favourable extreme rather than chasing. Each window shades that favourable zone as a band, green from the low for buys and red from the high for sells, with its own adjustable width, so "4h ext ≤ 35" is simply price sitting inside the green band of the 4h window. All windows are built from the one-minute series via request.security, so the levels are identical whether the chart is on 1m, 5m or 1h. A top-right table shows the live BUY and SELL ext for every window and highlights the ones inside their band, one window is selectable as the alert window with triangle markers and two alert conditions on band entry, and an optional JSON alert() payload carries the window, side, range position, ext, and window high and low for webhook use. Only closed bars are ever included, so the bar you are in never moves its own reference range.
Penunjuk

MTF Trend Dashboard [PineLogic]Multi-timeframe trend, momentum and bias in one compact table.
WHAT IT DOES
Reads five timeframes at once (default 15m / 1h / 4h / 1D / 1W, all configurable) and shows, for each one:
- Trend: "Up" when close is above the slow EMA and the fast EMA is above the slow EMA, "Down" for the mirror condition, "Flat" otherwise.
- RSI: the raw value, tinted when it reaches 70 or 30.
- MACD: the sign of the histogram (12/26/9).
A final Bias row sums the five trend readings into a score from -5 to +5. It reads BULLISH at +3 or more, BEARISH at -3 or less, and MIXED in between.
HOW TO USE IT
The point is to stop flipping through timeframes to check whether a setup agrees with the higher ones. Trade your working timeframe and use the Bias row as a filter, for example taking longs only while Bias reads BULLISH.
SETTINGS
Five timeframe slots, Fast EMA (default 21), Slow EMA (default 50), RSI length (default 14), plus table position and text size.
HONEST NOTE ON HIGHER-TIMEFRAME VALUES
Rows for timeframes above your chart update live while that bar is still forming, and settle only when it closes. This is normal behaviour for any dashboard of this kind, but it does mean the 1W row can change during the week. Read closed bars, not forming ones.
This is a context tool, not a signal generator. It produces no entries or exits and makes no claim about profitability. Penunjuk

OHLC4 Structure Ribbon [RMA] OHLC4 Structure Ribbon is a multi-horizon market-structure indicator built from a fixed stack of Wilder Running Moving Averages applied to OHLC4. Rather than treating the ribbon as a collection of independent moving averages, the indicator analyzes the shape, ordering, compression, expansion, and directional geometry of the entire stack as one structural system.
The primary ribbon uses six RMA horizons: 5, 8, 13, 20, 34, and 50. A separate 75 / 110 pair provides a slower structural reference without influencing the primary ribbon's regime engine.
The objective is not simply to show whether a fast average is above or below a slow average. The ribbon is designed to answer a broader question: how organized is price structure across multiple horizons, how strong is that structure relative to current volatility, and is that structure being maintained, disrupted, or transferred to the opposite side?
Why OHLC4 and RMA?
Each average is calculated from OHLC4, giving equal representation to the open, high, low, and close of each candle rather than using the closing price alone. The smoothing method is Wilder's RMA, which reacts differently from a conventional EMA. RMA places more persistence into the series, allowing the ribbon to develop a slower, more structural character while still preserving enough responsiveness for shorter-timeframe use.
Because the six averages span several horizons, the resulting ribbon provides a continuous view from the fast edge of the market through the deeper intermediate structure.
➖REG BODY➖
At the center of the indicator is a measurement called REG BODY. Instead of measuring only the distance between two selected averages, REG BODY examines all six RMA levels together. Each RMA is assigned its theoretical Wilder lag, and a linear regression is calculated across those lag coordinates. That regression estimates the directional slope of the entire stack. The slope is then projected across the complete lag range to produce one signed structural spread.
A positive REG BODY means the faster horizons are structurally positioned above the slower horizons. A negative REG BODY means the opposite. The larger the absolute value, the more strongly the full ribbon is separating in that direction. This is important because two ribbons can have the same fast-to-slow distance while having very different internal structure. One may be cleanly ordered from front to back, while another may be folded, crossed, or compressed internally. REG BODY is intended to evaluate the complete structure rather than relying on a single moving-average spread.
➖Volatility normalization➖
Raw ribbon separation naturally varies by instrument, price level, and timeframe. To make the structural measurement more comparable, REG BODY is normalized by ATR14. This expresses ribbon expansion in volatility-relative terms rather than raw points. For example, a ten-point separation means something very different on an instrument whose ATR is 3 than on one whose ATR is 100. ATR normalization gives the engine a common structural language across those environments.
➖Peak-Persistence ATR-Drag Guard➖
Strong trends can occasionally create an unusual problem: volatility expands so rapidly that ATR rises faster than the ribbon itself. When that happens, a simple REG BODY / ATR calculation can make a structurally healthy trend appear to weaken even while the ribbon remains strongly ordered and continues expanding. The indicator addresses this with a Soft Peak-Persistence ATR-Drag Guard. The guard evaluates ribbon ordering, REG BODY persistence, directional continuity, and ATR expansion together. When the underlying structure remains intact, it can temporarily preserve part of the previously established normalized strength rather than allowing an abrupt ATR expansion to collapse the reading prematurely. The effect is intentionally limited. It decays automatically and releases when structure deteriorates, the ribbon body cools, directional ownership changes, or the qualifying conditions are no longer present. Its purpose is not to manufacture momentum. It is simply to reduce false structural decay caused by volatility expanding faster than an otherwise intact ribbon.
➖Wide Semantic and the CORE scale➖
After volatility normalization and the persistence guard, structural strength is translated through a non-linear mapping called Wide Semantic. Wide Semantic converts the normalized ribbon measurement into a bounded -100 to +100 CORE scale. The center of the scale provides greater resolution for ordinary market structure, while increasingly large structural expansions require progressively greater ATR-normalized separation to approach the extremes.
The principal absolute-value anchors are:
0.70 ATR → 34
1.25 ATR → 55
2.50 ATR → 65
4.00 ATR → 75
7.00 ATR → 89
12.0 ATR → 95
20.0 ATR → 100
Positive CORE values represent bullish structural direction, while negative values represent bearish direction. A CORE reading is not a probability, price target, or percentage. It is a volatility-normalized measurement of multi-horizon structural strength. This distinction becomes especially useful near the outer portions of the scale. A move from 89 to 95 represents a much larger increase in underlying structural expansion than a move from 34 to 55.
➖Global Regime architecture➖
The ribbon uses CORE together with the physical ordering of the RMA stack to maintain a persistent Global Regime. A fully ordered bullish stack can establish Bull Rise, while a fully reversed stack can establish Bear Fall. When an established bullish structure begins to lose internal ordering, the system can transition into Bull Resistance rather than immediately declaring the market bearish. Likewise, disrupted bearish structure can remain in Bear Support while the prior bearish lineage is still structurally relevant. This distinction allows the indicator to separate trend continuation, compression, transition, and actual directional transfer. Directional ownership uses fixed structural rails. Same-side full-stack re-entry occurs around ±34, while initial or opposite-side directional transfer requires approximately ±55. Larger structural expansions can progress into Extreme and Exceptional regimes around ±89 and ±95, with separate release thresholds to reduce unnecessary state flipping. The result is deliberately different from coloring a ribbon solely according to whether one moving average crossed another.
➖Contiguous ribbon transitions➖
The visible ribbon contains five adjacent bands:
5/8 → 8/13 → 13/20 → 20/34 → 34/50
Transition ownership begins at the fast 5/8 edge and progresses outward. A deeper portion of the ribbon is not allowed to visually transfer direction until the faster pairs in front of it have aligned first. This creates a contiguous transition rather than allowing isolated sections of the ribbon to change color independently. During a bullish rollover, for example, the fast edge can begin transferring into resistance while slower portions of the ribbon still retain bullish ownership. The reverse occurs during recovery from bearish structure. This makes the ribbon itself a visual representation of how far a structural transition has propagated through the stack.
➖Ribbon ORDER➖
The context table also displays Ribbon ORDER %. ORDER measures how efficiently the six averages form one monotonic path from OHLC5 through OHLC50. A perfectly ordered ribbon approaches 100%, while internal folding and crossover geometry progressively reduce the reading. The accompanying Bull/Bear x/5 value shows how many adjacent pairs have aligned contiguously from the fast edge. For example, Bull 3/5 means the first three adjacent relationships have transferred bullishly while the deeper structure has not yet completed the transition. ORDER describes the ribbon's current geometry. It does not override Global Regime ownership.
➖Developing higher-timeframe CORE➖
The table includes both the current chart-timeframe CORE and a Developing HTF CORE calculated on the automatically selected next higher timeframe. The higher-timeframe value is not created by resampling the chart-timeframe result. The complete six-RMA structural engine is calculated natively in the higher-timeframe context using the same REG BODY, ATR normalization, persistence guard, and Wide Semantic mapping. Because this is a developing higher-timeframe reading, it updates while the higher-timeframe candle is still forming. It can therefore change until that candle closes. This provides a direct comparison between current-timeframe structure and the developing structural condition immediately above it.
➖75 / 110 long structure➖
OHLC75 and OHLC110 form a separate slower structural pair. They do not participate in REG BODY, CORE, or Global Regime calculations. Their purpose is to provide a longer structural reference alongside the primary six-average ribbon. When 75 > 110, the long structure is displayed in orange. When 110 > 75, it is displayed in gray. The table also reports the current relationship directly—for example, 75 > 110—along with the number of bars since the most recent 75/110 crossover.
➖Price-relative OHLC labels➖
Each RMA level can be displayed in a right-side label containing the current level and its distance from price. The labels also maintain a persistent price-relative marker:
$⤴ means price most recently moved above that OHLC level.
$⤵ means price most recently moved below that OHLC level.
The marker persists until the opposite side takes ownership. This makes it possible to scan the right-side stack and quickly see where current price is positioned relative to multiple structural horizons. The short-horizon labels visually inherit the active ribbon gradient, while the 75/110 labels use their separate long-structure color owner.
➖Crossover events➖
Five crossover families are available. The 5/8 event represents the fast ribbon edge. 8/20 provides an optional early-intermediate structural crossover, while 13/34 represents a deeper middle-structure transition. 20/50 tracks slower primary-ribbon equilibrium, and 75/110 represents the separate long structural pair. Bullish crossover labels appear below the candle and bearish labels appear above it. Historical events preserve the exact Global Regime color that was active when the crossover occurred, allowing older events to retain their original structural context rather than being recolored by the current regime.
➖PlotCandles➖
Optional PlotCandles can color price directly from the active Global Regime while maintaining independent body, wick, and border transparency.
➖How I use the ribbon➖
The indicator is most useful when the components are read together rather than treating any one color or crossover as a standalone signal.
A clean, high-ORDER ribbon with expanding CORE reflects a very different structural environment from a similarly colored ribbon whose ORDER is deteriorating and whose fast-edge transition has already begun. When CORE is higher than its HTF value, tha'ts also a bullish sign (and vice versa). Likewise, disagreement between chart CORE and Developing HTF CORE can provide useful context. Strong local structure may be developing inside a weaker higher-timeframe environment, or a lower-timeframe transition may be occurring while the next timeframe remains firmly established.
The 75/110 pair provides another layer of context without contaminating the primary regime calculation. For that reason, I view the indicator primarily as a market-structure and context tool, rather than a mechanical entry/exit system.
➖Final note➖
Moving averages are inherently derived from historical price, and no ribbon can predict future market direction. CORE, ORDER, Global Regime states, crossover events, and Developing HTF readings should be interpreted as descriptions of current and developing structure—not guarantees of continuation or reversal.
The value of the indicator is in combining multi-horizon OHLC4 structure, volatility-normalized strength, persistent regime ownership, and visually progressive ribbon transitions into one coherent framework.
➖A few chart examples➖
Penunjuk

Market Effort Response ProfileMarket Effort Response Profile is a behavioral price-profile indicator designed to examine how market effort and realized price response have interacted across different occupied price regions.
Rather than treating every price level equally, the indicator organizes recent market behavior into adaptive price regions and evaluates the relative activity and effort-response balance observed within each region.
The purpose is not to predict where price will move next. The profile provides a spatial view of how price has behaved across the analyzed sample.
How It Works
The indicator evaluates market behavior through two related components:
Effort represents the relative intensity of market movement and activity observed during the analysis window.
Response measures how effectively that effort translated into realized price movement.
These components are normalized so that their relationship can be compared across changing volatility conditions.
The resulting information is then mapped into an adaptive price profile.
Adaptive Occupied-Price Profile
Instead of dividing the entire chart range into fixed price intervals, the indicator builds its profile from price regions that were actually occupied during the analysis window.
Observed prices are organized into adaptive quantile-based regions.
For each region, the indicator aggregates behavioral activity and the relationship between effort and response.
The horizontal width of each profile strip represents the region's relative behavioral activity within the current sample.
Wider regions therefore represent greater observed activity relative to other regions in the same profile.
Profile Colors
The profile uses restrained behavioral coloring:
Teal regions indicate comparatively response-led behavior.
Muted red regions indicate comparatively effort-led behavior.
Neutral regions indicate a more balanced relationship between the two components.
These classifications are relative descriptions of historical behavior within the current analysis window. They are not bullish or bearish trade signals.
Profile Peak
The Profile Peak identifies the adaptive price region containing the highest smoothed behavioral activity in the current profile sample.
It provides a reference for where the strongest concentration of measured activity occurred.
The Profile Peak is descriptive only. It is not a price target, reversal probability, expected return, or guarantee that price will react there again.
Structural References
The indicator also tracks confirmed structural references derived from price behavior.
To keep the chart readable, only the nearest relevant support and resistance references around current price are displayed.
Each reference label contains the structural price and a normalized relative activity reading associated with the nearest profile region.
These references provide additional context for interpreting the effort-response profile; they should not be treated as guaranteed support or resistance.
Dashboard
The compact Effort Profile dashboard summarizes the current behavioral state:
EFFORT — normalized market effort.
RESPONSE — normalized realized price response.
EFFICIENCY — the relationship between response and observed effort.
BALANCE — identifies whether the current measurement is comparatively effort-led, response-led, or balanced.
PROFILE PEAK — price associated with the highest-activity profile region.
These measurements describe current and historical market behavior. They do not represent probabilities or trading recommendations.
Originality and Intended Use
Market Effort Response Profile is built around the relationship between behavioral effort, realized response, and spatial price occupancy.
Its profile is not constructed from traditional volume-at-price data or reversal-frequency probabilities.
The adaptive occupied-price geometry allows the profile to adjust to the actual distribution of observed prices instead of forcing the sample into a fixed full-range grid.
The indicator is intended for traders studying market behavior, structural interaction, movement efficiency, and the distribution of activity across price.
It can be used as analytical context alongside an independent trading methodology.
Calculation Timing
The profile is recalculated from the available analysis sample as new market data becomes available.
Confirmed structural references are used for the displayed support and resistance context.
Because the active analysis window changes over time, profile geometry, Profile Peak, behavioral classifications, and displayed structural references can also change as new observations enter the sample.
Limitations
The indicator analyzes historical and current price behavior. It does not know future market direction.
High historical activity at a price region does not imply that price will revisit or react from that region.
Effort-response relationships can change when volatility, liquidity, market structure, or broader market conditions change.
The Profile Peak is not equivalent to a conventional volume point of control.
Support and resistance references can fail.
Normalized readings are comparative analytical measurements and should not be interpreted as probabilities, expected returns, or historical win rates.
The indicator does not generate Buy or Sell signals and should not be used as a standalone trading system. Penunjuk

Impulse Retention Map [MQLSoftware]OVERVIEW
Impulse Retention Map shows how much of a sharp price move remains after it forms. It automatically fixes the move's origin, halfway level and closing endpoint, then follows subsequent closes to distinguish a partial retracement, a full unwind and a recovery after a deep retracement.
The question is simple: has price kept the move, given half of it back, or returned all the way to its origin? No manual anchors, external signal source or volume feed are required.
DETECTION AND ORIGINAL CONTRIBUTION
The script measures a short close-to-close displacement. With the default settings, a qualifying impulse must satisfy all of these conditions:
1. The absolute change from the close three bars earlier to the current close is at least 2.0 times ATR, with a minimum size of two price ticks. The 20-bar ATR reading is taken at the origin bar, before the three subsequent price changes being measured. The move therefore does not increase its own volatility benchmark.
2. Path efficiency is at least 0.75: the absolute net change divided by the sum of the three absolute close-to-close changes. A reading of 1 means no closing-price retracement inside the window.
3. The final close is in the directional outer 30% of the impulse window's high-low range: near the high for an upward move or near the low for a downward move.
ATR scaling, path efficiency and halfway retracements are established concepts. The contribution here is their use in one automatic, frozen displacement episode: detection uses a pre-window volatility reference, the resulting map has fixed price boundaries, and the subsequent close-based events follow an explicit lifecycle. It measures a short move's retention rather than constructing pivot-based trend waves, projecting reversal targets or evaluating signals supplied by another indicator.
A map is admitted on the first qualifying bar of a fresh directional burst, subject to spacing of at least one impulse window since the previous admission. Consecutive qualifying bars in the same direction do not create repeated maps. A burst blocked by the spacing rule is not queued for later admission. A newly admitted map replaces any still-active previous map; replacement is not treated as a successful outcome.
READING THE MAP
The three fixed references are:
100% — the close at which the impulse was detected.
50% — halfway between that close and the origin.
0% — the closing price at the beginning of the measured move.
Move retained (%) = 100 x (evaluated close - origin) / (impulse close - origin).
The same formula works for upward and downward impulses. For an upward move from 100 to 110, a later close at 107 retains 70%; a close at 112 retains 120%. Values above 100% describe extension beyond the original move. Values below 0% mean price closed beyond the origin in the opposite direction. These percentages are price-distance measurements, not success rates or probabilities.
Teal identifies upward impulses and rose identifies downward impulses. The half between the impulse close and midpoint uses the direction colour; the half between midpoint and origin uses a quieter amber tint. These are measurement areas, not prescribed entry, stop or target zones.
The UP/DOWN label reports the initial move in units of its pre-impulse ATR. The status panel shows retained movement, the lowest retained reading observed on a confirmed close since detection, the original price distance, the initial ATR multiple and the number of bars tracked. When an episode finishes, the panel shows a final snapshot until a new map is admitted.
EVENTS AND LIFECYCLE
Subsequent evaluation starts on the bar after detection. The impulse's own formation bars cannot supply a later outcome.
HALF BACK — the first subsequent close retains 50% or less, but remains above 0%.
UNWOUND — a close retains 0% or less. Tracking ends. A direct jump through the origin is recorded as UNWOUND without inventing an earlier HALF BACK event.
RECOVERED — after a HALF BACK event, a later close reaches or exceeds 100% retention. Tracking ends. This does not mean the entire intervening path held above the halfway line.
EXPIRED — the tracking limit is reached without an earlier terminal outcome; 60 bars by default. An unwind or recovery on the final allowed bar takes precedence over expiry.
REPLACED — a fresh qualifying impulse is admitted while the earlier map is still active. The earlier map stops at that bar. Its final status is available in the original impulse label's tooltip and as an event in the Data Window. Expiry also has a Data Window event; neither creates a separate outcome label on the chart.
Between events, the panel can show NEW IMPULSE, HOLDING, EXTENDED, DEEP RETRACE or REBUILDING. REBUILDING means a map that previously returned at least half has moved back above 50% but has not yet recovered the full original move.
The old episode is evaluated before a new one is admitted. Consequently, an outcome for the old map and a new impulse can occur on the same closed bar.
CONFIRMED BARS AND DISPLAY CHANGES
Detection, retained readings, outcome flags and alerts update only on confirmed chart bars. The script uses no higher-timeframe requests, future-bar data, pivots or backward-shifted event markers. A map starts at the detection bar, although its origin price comes from the earlier close. It is not drawn across the formation window as if it had been known then.
The display does evolve: an active map extends to each newly confirmed bar; finishing a map dims its existing drawings and updates its tooltip; older maps and their outcome labels are removed as the retention limits are reached. The latest reference labels move with the chart's right edge. These presentation changes do not move the recorded event bars or change a map's fixed price boundaries. They also mean the final historical appearance is not a literal recording of how bright each zone looked at every earlier moment.
Changing inputs, symbol, timeframe, feed or available history recalculates the script. Provider corrections and price adjustments can change past input data. Closed-bar processing does not prevent those external changes.
SETTINGS AND ALERTS
Detection controls the impulse window, minimum ATR-scaled move, minimum path efficiency, ATR baseline length and tracking duration. Defaults are 3 bars, 2.0 ATR, 0.75 efficiency, 20-bar ATR and a 60-bar tracking limit. The directional closing-location filter stays fixed at 70%.
Display controls how many maps remain visible (six by default), outcome labels, the status panel and its position, latest-map reference labels, and colours. Display settings do not alter detection or outcomes. The panel distinguishes initial warmup, unavailable price data, a flat price range and waiting for a qualifying move when no map has yet been created.
Five alert conditions are available: new up impulse, new down impulse, half of impulse returned, impulse fully unwound, and impulse recovered. Create the desired TradingView alert and select Once Per Bar Close. Alerts must be configured by the user; adding the indicator does not create them automatically.
USE AND LIMITATIONS
Add the indicator to a standard candlestick chart and read the latest fixed references alongside the panel. Higher movement or efficiency thresholds generally select fewer impulses. The parameters are heuristic filters, not optimized probabilities. The tool can use price data across crypto, forex, indices and stocks; it does not require traded or tick volume.
Only closes resolve the tracked outcomes. A wick through halfway or origin that closes back beyond it does not establish the corresponding close-based event. Session gaps are included in close-to-close displacement and can qualify as impulses. The script does not reconstruct intrabar order, identify participants, estimate order flow or distinguish a session gap from continuously traded movement.
Only one episode is active at a time. New impulses can replace unresolved ones, so the displayed map history is not a complete sample of every possible retracement. No aggregate win rate, trading expectancy, order fills, fees, slippage or profitability backtest is calculated. Synthetic chart types produce measurements of synthetic prices and should not be interpreted as execution-price evidence.
This is a descriptive chart-analysis tool, not a prediction of recovery or a recommendation to enter or exit a position. Penunjuk

Penunjuk

Structure-Anchored VWAP [WillyAlgoTrader]📐 Structure-Anchored VWAP is an overlay indicator that anchors a true volume-weighted average price to market structure and re-anchors it automatically at every confirmed swing pivot, structure break, fast extreme, or one manual date — combining a pivot-based structure engine, an O(1) prefix-sum VWAP core, volume-weighted sigma bands, a retest entry model with ATR risk management, and a sectioned dashboard with session statistics.
The core insight: a VWAP anchored to the start of the current structural leg tells you the average price at which volume actually changed hands since this move began. That is the level participants in this leg are collectively break-even at. Session VWAP resets at midnight and ignores structure. Manual anchored VWAP requires you to drag it and re-drag it. This indicator keeps the anchor synchronised with the structure itself, and measures how stretched price is from that anchor in the leg's own volume-weighted standard deviations rather than in generic ATR units.
It works on any market and any timeframe. On instruments with no volume feed it falls back to time weighting automatically and says so in the dashboard.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A VWAP alone has no memory of structure — it does not know whether the market is making higher highs or lower lows, so it cannot know when its own anchor has gone stale. A structure detector alone tells you HH / HL / LH / LL but gives you no price level to trade against. Deviation bands built on ATR describe candle size, not participation, so they say nothing about where volume was actually transacted. And an entry signal without a fixed stop and target is not a trade, it is an opinion.
This indicator connects all four into one chain:
Pivot structure engine → anchor selection → prefix-sum anchored VWAP → volume-weighted sigma bands → retest detection → ATR risk model → session statistics
The structure engine finds confirmed swing highs and lows, filters them by ATR amplitude and enforces strict high/low alternation, so every anchor is a real structural turn rather than a passing wick. Anchor selection decides which of those turns starts a new leg, with four different policies for four trading styles. The prefix-sum core then computes the anchored VWAP for that leg — and because it also accumulates the sum of squared prices, the same pass produces the leg's own volume-weighted standard deviation, so the bands are derived from the same data as the line instead of being bolted on. The retest engine watches the distance between price and that line, requires price to leave and come back, and only then produces an entry. The risk model turns the entry into a fixed stop and three targets, and the statistics layer records what happened to each of them.
Remove any link and the chain stops working. Without structure anchoring, the VWAP measures a leg that ended days ago. Without the ATR amplitude filter, every minor wick creates a new anchor and the line resets constantly. Without the sigma bands, "far from VWAP" has no unit. Without the retest rule, every touch of the line is a signal, including the fifty touches that happen while price is glued to it. Without the risk layer, you know where to enter but not where you are wrong.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Prefix-sum VWAP core — any anchor evaluated in O(1), including a decayed one.
Three running totals are maintained on every bar, where p is the price source and w is the bar weight:
— S_w(t) = lam × S_w(t−1) + w(t)
— S_pw(t) = lam × S_pw(t−1) + p(t) × w(t)
— S_p2(t) = lam × S_p2(t−1) + p(t)² × w(t)
The sum over any leg is then recovered without looping:
— sum = S(t) − lam^(t−a+1) × S(a−1)
With lam = 1 this is an exact cumulative anchored VWAP — every bar of the leg keeps its full weight, the same quantity the built-in Anchored VWAP tool computes. With lam < 1 the same identity still holds, which is what makes the optional Half-life mode possible without a second engine.
Why this matters: re-anchoring becomes cheap. Moving the anchor does not require replaying the whole leg bar by bar, so the indicator can afford four anchor modes and legs up to 4000 bars long without a performance penalty.
2️⃣ Volume-weighted sigma bands — dispersion of the leg, not size of the candle.
Because the squared-price sum is already accumulated, the leg's variance comes out of the same pass:
— VWAP = sum_pw / sum_w
— sigma = sqrt( max( sum_p2 / sum_w − VWAP², 0 ) )
Bands are drawn at VWAP ± multiplier × sigma. Band 1 defaults to 0.5 sigma (the value-area edge of this leg), Band 2 to 2.0 sigma and is off by default.
Why this matters: an ATR band tells you how big recent candles were. A volume-weighted sigma band tells you how widely the volume of this specific leg was distributed around its own average price. Two markets with identical ATR but different participation profiles get different bands, and the "Premium / Fair value / Discount" classification in the dashboard becomes comparable across instruments.
3️⃣ Four anchor modes — one engine, four trading styles.
— Swing (default): a new leg starts at every confirmed pivot. The anchor is the opposite extreme, so a bullish leg is anchored at the swing low that preceded it.
— Structure break : a new leg starts only when price closes beyond the previous swing. The anchor is then the extreme that preceded the break, found by scanning back from that swing. Fewer legs, each tied to an actual break of structure.
— Fast : no confirmation delay. The bar printing the highest high or lowest low of the last N bars (default 30) is treated as a new extreme, and the leg flips the moment an extreme opposite to the previous one appears. When a bar prints both a new high and a new low, the candle direction decides which one is taken.
— Manual : a single leg from a chosen date and time, which reproduces the behaviour of the built-in Anchored VWAP tool inside the same framework — useful for comparing against a manual anchor or pinning a level.
4️⃣ Structure engine with ATR amplitude filter and strict alternation.
Pivots come from equal left/right lookback (default 55/55). A new pivot of the opposite type is only accepted when it clears an ATR-scaled amplitude:
— accept a new high when: pivotHigh − lastSwingLow ≥ minSwing × ATR(atrLen)
— accept a new low when: lastSwingHigh − pivotLow ≥ minSwing × ATR(atrLen)
Default minSwing 1.5, ATR length 13. A pivot of the same type as the last one does not create a new structural point — it only supersedes the previous extreme if it is more extreme. This enforces a clean alternating high-low-high-low sequence instead of clusters of adjacent highs.
Classification against the previous extreme of the same type, with an equality tolerance (default 0.1 × ATR):
— |current − previous| ≤ eqTol × ATR → EQH or EQL
— current > previous → HH or HL
— current < previous → LH or LL
5️⃣ Retest entry model — price must leave before it can come back.
Every bar the engine measures the relationship between the bar range and the anchored VWAP:
— tol = sigma × touchTolerance (default 0.25), or ATR × 0.1 while sigma is still zero
— touch = low ≤ VWAP + tol and high ≥ VWAP − tol
— outside = bullish leg ? low > VWAP + tol : high < VWAP − tol
An "away" counter increments on every outside bar and resets to zero on every touch. A retest fires only when a touch happens while the committed away counter has already reached the threshold (default 5 bars).
Why this matters: a raw "price touched VWAP" condition fires continuously in the chop that surrounds every mean. Requiring a genuine departure first converts an omnipresent condition into a discrete, countable event.
6️⃣ Volume balance — who controlled this leg.
While the leg accumulates, every bar's weight is assigned to one of two buckets by where it closed relative to the VWAP at that moment:
— close ≥ VWAP → volUp += w
— close < VWAP → volDn += w
— balance = volUp / (volUp + volDn) × 100
The dashboard shows this as a percentage with a bar gauge, and relabels it "Bars above VWAP" automatically when the instrument has no volume data. Above 50 % means most of the leg's participation happened above its own average price.
7️⃣ Signal strength — a transparent 0-100 context score.
Four independent components, published in full so the number is auditable rather than a black box:
— 40 pts × (volume balance aligned with leg direction, 0..1). For a bearish leg the balance is inverted before scoring.
— 25 pts if price sits on the leg's own side of the VWAP.
— 20 pts if price is not stretched beyond Band 2, i.e. |distance in sigma| ≤ band 2 multiplier.
— 15 pts if the leg has already produced at least one retest.
The score is clamped to 100 and shown with a gauge. This is a context filter, not a proven edge — it says how coherent the current leg is, nothing more.
8️⃣ VWAP memory levels — dead legs leave a level behind.
When a leg ends on a genuine direction flip, its final VWAP value is written to the chart as a dashed horizontal line. That line extends forward until price trades through it, then it is either removed or faded to dotted, depending on a setting. Up to four such levels are kept (configurable), and the newest push out the oldest.
When a level is created, the bars between the anchor and the current bar are scanned first, so a level that was already traded through is never shown as untouched.
9️⃣ Single-position trade model with break-even and outcome tracking.
A retest signal opens a trade only while flat — signals never stack. On entry, the levels are fixed once and never recalculated:
— slDistance = ATR(riskAtrLen) × slMultiplier
— long: SL = entry − slDistance, TP(n) = entry + slDistance × tpMult(n)
— short: SL = entry + slDistance, TP(n) = entry − slDistance × tpMult(n)
Presets set all four multipliers at once — Conservative 2.5 / 1R / 2R / 4R, Balanced 1.5 / 1R / 2R / 3R, Aggressive 1.0 / 1.5R / 2.5R / 4R, Scalping 0.8 / 0.8R / 1.5R / 2R, or Custom.
Break-even is optional and on by default: the first touch of TP1 moves the stop to the entry price, the entry label changes to show it now acts as the stop, and the stop line dims. TP1 still counts as a win. Hit checks begin only on the bar after entry and only on confirmed bars, so the entry bar's own range cannot close the trade it just opened.
🔟 Persistent trade forensics — the chart keeps the last result.
SL and TP lines are not deleted when the trade closes. They stay until the next entry, so the last trade remains readable on the chart: any target that was reached is redrawn as a solid teal line and its label gets a check mark, while untouched targets keep their original dashed style. Labels can show the distance from entry in percent, for example "SL 78120.5 (-0.36%)".
1️⃣1️⃣ Realtime correctness — ring buffers and a commit/undo pattern.
Functions that only run on some bars cannot use the history operator safely, because the history they see is sparse and does not correspond to chart bars. All per-bar values this indicator needs later are therefore written to explicit ring buffers on every single bar, and read back by index.
On top of that, the live leg uses a commit/undo pattern: statistics are always recomputed from the last confirmed state, and the provisional point for the forming bar is popped before a new one is pushed. A bar being formed can therefore never be counted twice, no matter how many ticks arrive.
1️⃣2️⃣ Continuous curve across anchor changes.
When a new anchor appears, the previous leg is not erased — it is cut exactly at the new anchor bar and frozen. The curve therefore has no gaps at handover points, including the case where a stronger extreme of the same type supersedes the previous one.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Structure: On each confirmed bar the engine evaluates pivot highs and lows with equal left/right lookback, applies the ATR amplitude filter, enforces high/low alternation and classifies the result as HH, HL, LH, LL, EQH or EQL.
Step 2 — Weighting: The bar weight is volume, or 1.0 when the instrument has no volume. If spike clamping is on, the weight is capped at N × the 50-bar median volume so a single print cannot dominate the average.
Step 3 — Accumulation: The three running totals of weight, price × weight and price² × weight are advanced, decayed by lam if Half-life weighting is selected.
Step 4 — Buffering: The totals plus high, low, close and ATR are appended to ring buffers, one entry per bar, with the current bar's provisional entry overwritten rather than duplicated on repeat ticks.
Step 5 — Anchor decision: The active anchor mode decides whether this bar starts a new leg and where that leg's anchor sits.
Step 6 — Leg build: On a new anchor the previous leg is trimmed to the anchor bar, frozen and archived, a memory level is created if the direction actually flipped, and the new leg is replayed once from the anchor to the current bar. On every other bar the live leg simply advances by one point.
Step 7 — Readouts: VWAP, sigma, distance in sigma and percent, zone, volume balance, leg age and the strength score are computed for the current bar.
Step 8 — Signal: The retest rule is evaluated. A qualifying retest, on a confirmed and warmed-up bar, while flat, becomes an entry.
Step 9 — Risk: On entry the stop and three targets are fixed. On later confirmed bars they are tested for hits, break-even is applied after TP1, and the trade is closed by stop or final target.
Step 10 — Reporting: Lines, labels, markers, the dashboard and alerts are updated. Closed trades update the win/loss counters and the form strip.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator. Defaults are tuned for 15m to 4H swing structure.
2. Watch the coloured curve — it is the anchored VWAP of the leg the market is currently in.
3. Wait for a Long ▲ or Short ▼ marker. That is a retest of the VWAP in the direction of the leg.
4. Read the Trade section of the dashboard for the stop, the three targets and the R:R.
5. If signals are too frequent, raise "Bars away before a retest counts". If legs are too frequent, raise pivot strength or the minimum swing size.
👁️ Reading the chart:
— 🟢 Green curve = bullish leg, anchored at the swing low that started it.
— 🔴 Red curve = bearish leg, anchored at the swing high that started it.
— Shaded band around the curve = ± sigma of this leg. Price inside it is at fair value for the leg.
— 🟢 Long ▲ / 🔴 Short ▼ marker = a retest entry was taken on that bar.
— Dotted blue line = entry. Solid red line = stop. Dashed green lines = TP1, TP2, TP3.
— A target that turns solid teal with a ✓ in its label was reached.
— An orange entry label reading "→ SL (BE)" means the stop has been moved to break-even.
— Dashed horizontal level far from the curve = a memory level, the final VWAP of a finished leg.
— HH / HL / LH / LL / EQH / EQL tags mark every confirmed pivot.
📊 Dashboard fields:
— Trend : direction of the current leg.
— Signal : LONG, SHORT or Wait. A new trade can only open while flat.
— Strength : the 0-100 context score with a gauge.
— Last event : the most recent new leg or retest.
— Timeframe : the chart resolution.
— Mode : active anchor mode and weighting, plus a note when the symbol has no volume.
— Anchor : structure tag and price of the bar the leg is anchored to.
— Leg age : bars since the anchor and the price move from it.
— VWAP : the anchored VWAP on the current bar.
— Price vs VWAP : distance in sigma and in percent.
— Zone : Premium above Band 2, Discount below it, Fair value in between.
— Vol above VWAP : share of the leg's weight transacted above the VWAP, with a gauge.
— SL / TP1 / TP2 / TP3 : the fixed levels of the open trade. A ✓ marks a reached target, "BE @" marks a stop moved to entry.
— R:R (TP1) and SL Dist % : reward-to-risk at the first target and the stop distance as a percentage of entry.
— Trades / W / L / Win rate / Form : closed trades in the loaded history, the win-loss split, the win rate with a gauge and the last ten outcomes as ▰ and ▱.
🔧 Tuning guide:
— Too many legs, the line resets constantly: raise pivot strength (55/55 → 80/80) or the minimum swing size (1.5 → 3.0).
— Legs appear too late: lower pivot strength, or switch the anchor mode to Fast for immediate flips.
— Too many entries: raise "Bars away before a retest counts" and lower the touch tolerance.
— The line drifts too far from price on long legs: switch Weighting to Half-life. This is no longer a textbook VWAP, and the dashboard says so.
— Comparing against the built-in Anchored VWAP tool: set the mode to Manual with the same anchor time, price source to hl2, weighting to Cumulative, and turn volume clamping off.
— Stops feel too tight or too wide: change the Risk Preset before touching individual multipliers.
⚙️ KEY SETTINGS
⚙️ Main Settings:
— Pivot strength left / right (default 55 / 55): bars required on each side of a swing. Right is the confirmation delay.
— Minimum swing size (default 1.5 × ATR): amplitude filter for new pivots. 0 disables it.
— ATR Length (default 13): ATR used by the swing filter and the equality tolerance.
— Re-anchor on (default Swing): Swing, Structure break, Fast or Manual.
— Fast mode: extreme lookback (default 30): lookback for the Fast mode only.
— Equal high/low tolerance (default 0.1 × ATR): threshold for EQH and EQL tags.
— Manual anchor : date and time for the Manual mode, shown in the chart's timezone.
📐 Anchored VWAP:
— Price source (default hl2): hl2 matches the built-in tool, hlc3 weights closes more, close is the most reactive.
— Weighting (default Cumulative): Cumulative is a true VWAP, Half-life fades older bars.
— Half-life (default 21 bars): only used by Half-life weighting.
— Clamp volume spikes (default on, 4 × median): caps outlier volume bars.
— Max leg length (default 4000 bars): keeps very old anchors bounded.
📏 Deviation Bands:
— Band 1 (default on, 0.5 sigma): inner band.
— Band 2 (default off, 2.0 sigma): outer band, also defines the Premium and Discount zones.
— Fill transparency (default 90).
🎯 Signals & Levels:
— Bars away before a retest counts (default 5).
— Touch tolerance (default 0.25 sigma).
— VWAP memory levels (default on, max 4, crossed levels removed).
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative, Balanced, Aggressive, Scalping or Custom.
— ATR Length (SL) (default 13).
— SL ×ATR / TP1 / TP2 / TP3 ×Risk (defaults 1.5 / 1.0 / 2.0 / 3.0): used by the Custom preset.
— Break-Even After TP1 (default on).
— Show SL/TP Lines, Labels, % Distance (all on by default).
— Entry / SL / TP Line Style (defaults Dotted / Solid / Dashed).
🎨 Visual:
— Theme (default Auto): Auto detects the chart background, Dark and Light force it.
— Show Buy/Sell Signals, HH/HL/LH/LL, Leg Background, Watermark .
— SL/TP Label Font Size (default Small).
— Finished legs kept on chart (default 30).
📊 Dashboard:
— Position (default Top Right) and four independent section switches: Market, VWAP, Trade, Stats.
🔔 ALERTS
— 🟢 LONG — VWAP retest entry, with price, VWAP, SL, TP1, TP2, TP3 and R:R
— 🔴 SHORT — same payload, short side
— 🛑 SL HIT — entry and stop price. Reported as 🛡️ BE STOP-OUT when the stop had already been moved to break-even
— 🛡️ BREAK-EVEN — stop moved to entry after TP1 (optional)
— 🎯 TP1 HIT, 🎯🎯 TP2 HIT, 🏆 TP3 HIT — first touch of each target (optional)
— 🟢 New bullish leg / 🔴 New bearish leg — a new anchor was set (optional)
— 🔵 Close above VWAP / 🔵 Close below VWAP — the close crossed the anchored VWAP (optional)
Entry alerts support both plain text and a JSON webhook payload. All alerts fire on bar close.
⚠️ IMPORTANT NOTES
— 🚫 No repainting of confirmed values. Every structure event, entry, stop, target and alert is evaluated only when barstate.isconfirmed is true. Pivots use equal left and right lookback, so the swing point is in the past by the "right" value at the moment it becomes known — that is delayed confirmation, not a look into the future. Stop and target hits are tested only from the bar after entry. Alerts fire once per bar close.
— 📐 What does update intrabar. The VWAP value of the leg currently in progress moves while the bar is forming, because that is what an anchored average does. Values on closed bars never change. A commit/undo pattern makes sure a forming bar is never counted twice in the statistics.
— 📐 The unfinished leg can be shortened. When a stronger extreme of the same type is confirmed, the current leg is cut at that point and a new leg starts there. Legs that have already been archived are never modified.
— 📊 The statistics are not a backtest. Trades, win rate and the form strip are counted over the history currently loaded on the chart and reset when the chart reloads or a setting changes. They describe how this rule set behaved on the visible data. Past performance does not guarantee future results.
— 🧮 The strength score is a context filter. Its four components and weights are published above precisely so it can be judged on its merits. It measures the internal coherence of the current leg, not the probability of any outcome.
— ⚖️ Half-life weighting is not a VWAP. When that mode is selected the line is an exponentially weighted average, useful on instruments without volume, but it is no longer the textbook volume-weighted average price. The dashboard states the active mode at all times.
— 🌐 Universal compatibility. Works on stocks, futures, forex, crypto and indices, on every timeframe. Where no volume data exists the weighting falls back to time and the dashboard relabels the volume-balance row accordingly.
— 🛠️ Decision support, not automation. This is an anchored VWAP and structure analysis tool with a risk framework attached. It marks anchors, measures distance in the leg's own units, detects retests and lays out stops and targets — trade decisions remain yours. Penunjuk

Session Breakout ContextMulti-Market Session Breakout Context
Description
Multi-Market Session Breakout Context is a rule-based intraday indicator designed to help traders organize session structure across gold, forex pairs, and selected index instruments. It was originally developed for XAUUSD and can also be applied to other markets whose session behavior, liquidity, and data quality are suitable for this type of analysis.
The indicator tracks the Asia, London, and New York session ranges using the America/Chicago timezone. It displays session highs, lows, and midpoint reference levels, then classifies selected price movements as directional breakouts or sweep/fade conditions. The chart markers and dashboard are intended to support discretionary analysis and trade planning. They do not place orders, manage positions, or guarantee a market outcome.
The main session conditions are:
•London breakout: price moves beyond the completed Asia session range.
•London fade: price sweeps an Asia range boundary and satisfies the rule-based reversal filters.
•New York breakout: price moves beyond the completed London session range.
•New York fade: price sweeps a London range boundary and satisfies the rule-based reversal filters.
•Asia breakout: price moves beyond the completed New York session range.
The indicator also provides additional market context through pivot-based directional readings, RSI divergence conditions, volatility measurements, volume-derived pressure and spread classifications, prior-day levels, previous-week levels, daily range references, weekly open, four-hour swing references, and a fixed time blackout window. These components are contextual filters. They are not independent guarantees of direction, probability, or profitability.
The optional dashboard summarizes the current session state, rule-based directional alignment, reference levels, entry and stop planning zones, target reference levels, and hypothetical point movement. Any displayed score is a rule-based alignment score, not a statistically validated probability or accuracy rate. Any displayed point movement is hypothetical and does not represent broker P&L, account performance, or a Strategy Tester result.
How to use the indicator
1.Apply the indicator to a standard candlestick chart.
2.Begin with XAUUSD and a lower intraday timeframe such as 5 minutes or 15 minutes.
3.Confirm that the chart symbol, exchange or broker feed, timezone, and session schedule are appropriate for your market.
4.Allow the relevant session range to form before interpreting its breakout or fade conditions.
5.Use the plotted levels as analytical references rather than guaranteed entry or exit prices.
6.Independently evaluate market structure, spread, volatility, scheduled events, liquidity, and position risk before making any trading decision.
7.Test the indicator on historical data and in a simulated environment before considering live use.
The displayed session schedule is based on fixed Chicago-time windows. The indicator should therefore be checked after daylight-saving changes and on every symbol or data feed where it is used. Session behavior can differ between spot metals, forex pairs, CFDs, futures, and other instruments.
Signal interpretation
A green or red breakout marker identifies a rule-based directional breakout classification. A blue or orange fade marker identifies a rule-based sweep/fade classification. These classifications describe what the indicator detected; they are not instructions to buy or sell and do not predict how far price will move.
Signals may depend on the active chart bar and on confirmed pivot information. A condition can change before the realtime bar closes. Users should evaluate signals on confirmed bars when they require stable, repeatable readings and should not assume that every historical marker was available at the beginning of the bar where it appears.
The indicator is intended for standard time-based candles. Signal interpretation may be misleading on non-standard chart types such as Heikin Ashi, Renko, Kagi, Point & Figure, Line Break, or Range charts.
Example screenshots
The following screenshots show selected visual examples on XAUUSD. They demonstrate how the indicator labels different session conditions. They are illustrative examples only and are not a complete record of all signals.
1. Full XAUUSD overview
Full overview of the indicator on XAUUSD showing session ranges, reference levels, breakout and fade markers, and the rule-based dashboard.
2. London fade long
London fade-long example after price sweeps the lower boundary of the completed Asia range. The marker represents a rule-based condition, not a guaranteed reversal.
3. London fade short
London fade-short example after price sweeps the upper boundary of the completed Asia range. Traders should independently evaluate confirmation, stop placement, and market conditions.
4. London sell
London bearish breakout example showing a downside break of the Asia session range. The displayed level is an analytical reference and does not represent an executed order.
5. New York sell
New York bearish breakout example showing a downside break of the completed London session range. Results may vary according to symbol, data feed, spread, liquidity, and execution conditions.
6. New York fade long
New York fade-long example after price sweeps the lower boundary of the completed London range. This is a rule-based signal classification for discretionary analysis.
7. New York fade short
New York fade-short example after price sweeps the upper boundary of the completed London range. The indicator does not guarantee continuation or reversal.
The screenshots are visual examples of the indicator’s signal classifications and are not a performance record. They do not show every signal, guarantee future results, or account for spread, slippage, commissions, liquidity, or execution delay. Signal behavior may vary across instruments, brokers, data feeds, and timeframes.
Limitations
This indicator is a decision-support and chart-organization tool. It is not investment advice, an automated trading system, a broker connection, or a guarantee of profit. It does not determine position size, account risk, contract quantity, execution quality, or whether a trade is appropriate for a particular user.
The indicator does not use a broker-level order book or guarantee access to true exchange-level volume. Volume-derived calculations may behave differently on symbols with limited, synthetic, tick, or unavailable volume. Reference levels and classifications can also vary according to the selected symbol, historical data, chart timeframe, session template, and data provider.
Historical examples should not be interpreted as evidence of future performance. Any decision to trade remains the user’s responsibility. Always consider the possibility of loss and use risk controls appropriate to your own circumstances.
Release notes
Initial public release of the Multi-Market Session Breakout Context indicator. This version provides Asia, London, and New York session levels, rule-based breakout and fade classifications, contextual reference levels, and an optional dashboard for discretionary chart analysis.
Penunjuk

Market Transition Pressure EngineMarket Transition Pressure Engine is a behavioral-state framework designed to evaluate whether current market behavior remains relatively stable or is developing internal pressure consistent with a potential state transition.
Rather than attempting to predict the direction of the next move, the framework measures changes occurring inside the current market environment and organizes that evidence into a confirmed lifecycle.
How It Works
The engine evaluates five normalized behavioral dimensions:
• Directional Efficiency Shift — measures how current directional efficiency differs from its behavioral baseline.
• Volatility Shift — evaluates changes in ATR-normalized volatility conditions.
• Structural Persistence Deterioration — measures whether recent directional persistence is weakening relative to its baseline.
• Directional Conflict — identifies disagreement between shorter-term directional behavior and the broader directional baseline.
• Range Shift — evaluates changes in local price-range behavior relative to its longer baseline.
These components are combined into a normalized Transition Pressure measure.
The pressure value represents the degree of behavioral instability detected by the framework. It is not a probability of reversal or continuation.
Pressure Lifecycle
The framework organizes transition pressure into five states:
STABLE — transition evidence remains comparatively limited.
BUILDING — internal behavioral changes are beginning to accumulate.
ELEVATED — multiple components are producing stronger transition-pressure evidence.
CRITICAL — transition pressure has reached a comparatively high state under the framework.
RELEASED — previously elevated pressure has subsequently contracted sufficiently to register a confirmed pressure release.
RELEASED is a temporary lifecycle state rather than a directional conclusion.
Confirmation and State Persistence
Lifecycle changes are evaluated using confirmed bars.
Both upgrades and downgrades require persistence before a replacement state is confirmed. This helps reduce one-bar state switching and distinguishes a developing candidate state from an established lifecycle state.
The information panel therefore separates:
STATE — current confirmed pressure state.
PRESSURE — confirmed normalized pressure measurement.
LIFECYCLE — whether the state is confirmed or a replacement is developing.
CANDIDATE — the developing replacement state when applicable.
TIMING — identifies the confirmed-bar basis of the displayed lifecycle information.
Adaptive Pressure Bands
The chart visualization uses an adaptive behavioral field around price.
Its width responds to ATR-normalized volatility and the engine's measured transition pressure. Lower-pressure environments generally produce a more subdued field, while increasing pressure changes the structure and visual emphasis of the bands.
Boundary proximity can also receive additional visual emphasis.
The bands are analytical context. They are not price targets, support/resistance guarantees, or projected future ranges.
Originality and Intended Use
Market Transition Pressure Engine is built around the interaction between behavioral baselines, normalized feature shifts, composite transition pressure, symmetric state confirmation, pressure-release detection and lifecycle persistence.
Its analytical focus is not conventional trend direction or entry generation.
The primary question is:
Is the current behavioral environment remaining stable, or is measurable internal pressure for a state change developing?
This distinction allows transition pressure to be studied separately from market direction.
Calculation Timing
Lifecycle decisions use confirmed-bar information.
The dashboard reports confirmed measurements so the displayed pressure value and confirmed lifecycle state are based on the same information set.
The adaptive visual field may continue developing during the current bar, while lifecycle confirmation intentionally waits for confirmed information.
This confirmation delay is part of the methodology.
Limitations
Transition-pressure states describe measured behavioral conditions; they do not represent reversal probabilities, continuation probabilities, expected returns, or guaranteed future outcomes.
A CRITICAL state does not necessarily mean that price will reverse.
A STABLE state does not imply that a significant move cannot occur.
Results depend on the selected market, timeframe, available history and settings. ATR normalization improves comparability across volatility environments but does not make different instruments behaviorally identical.
Historical state transitions do not imply that future transitions will develop in the same manner.
The indicator is intended as an analytical and research framework and should be interpreted alongside broader market context. Penunjuk

Balanced Price Range (M1D)Balanced Price Range
Marks one thing and refuses to mark anything else: the band of untraded price left where two opposing fair value gaps overlap, when price displaced straight back through the first gap without ever testing it. If the gap was tested first, no zone is drawn — that is an inversion, and it is a different event.
Most tools that draw a balanced price range take any bullish gap and any bearish gap, intersect them, and paint the overlap. That also fires on inversions, because an inverted gap and a fresh opposing gap produce the same geometry. This one starts from what happened at the first gap and works forward, so the two are never confused.
What separates a BPR from an inversion
A fair value gap is read over three candles and has to clear a minimum size in ticks to be watched at all. Once it is being watched, the first candle to reach its consequent encroachment decides everything, and there are only three outcomes.
The candle reaches the midpoint and closes on the respecting side of it, or closes inside the gap: the gap has been tested. It held, or price accepted inside it, and either way something happened there. It is dropped from this tool for good and can never produce a zone.
The candle reaches the midpoint and, on that same candle, closes its body clean past the far edge: no test. Nothing ever held inside it. The gap was transited in one move, and it stays in play.
The candle trades into the gap but never reaches the midpoint, then closes back outside: a probe. Nothing was proven at the midpoint, so the gap stays in play — but the wick counts, and the section on the drawn zone explains what it does.
That first distinction is the whole indicator. A tested gap that later fails is an inversion; an untested gap that is displaced straight through is what this draws.
The pivot is the window
Two opposing gaps that merely overlap are not a balanced price range. The formation is a tight swing — an inverted V or U for a bearish zone, a V or U for a bullish one — and the displacement back begins as the swing completes.
So a pivot has to sit between the gap forming and the gap being broken, and the break has to follow that pivot closely. Both are settings: the pivot length, where three candles give the sharp V and five the rounded U, and the number of bars the close-through may lag the pivot. A gap that drifts sideways for a dozen bars before finally reversing has a pivot in it somewhere too, and it is not this formation.
There is no separate shape filter, and that is deliberate rather than an omission. A fair value gap is by definition a leg that moved faster than two-sided trade could occur, so two opposing gaps with a pivot between them and no test in between already describe the V. Adding a shape test on top of that would reject valid formations without catching anything the existing conditions miss.
The same fact explains the tool's behaviour: these are uncommon on high timeframes and get more frequent as you drop down, because the speed requirement is harder to satisfy the more time a candle covers.
The zone is the untraded air, not the intersection
The overlap of the two gaps is only the candidate band. What gets drawn is the part of it with no wick lying in it.
If a wick from the bars between the two gaps reaches into the candidate band, that part has been traded and is removed, and the wick's own extreme becomes the edge of the zone. A wick taking a third of the band leaves two thirds drawn. A wick clean through it leaves nothing, and no zone appears.
Only the bars strictly between the first gap completing and the candle that broke it can trim. The breaking candle transits the whole band by definition and the second gap's own candles are the displacement, so counting either would erase every zone.
The box still starts at the candle that formed the first gap, so it stays attached to its origin rather than floating in mid-chart at the wick that trimmed it, and it runs to the live candle the way a breaker or an inversion does. A minimum size in ticks applies after the trim, so a band cut down to almost nothing does not paint.
Polarity follows the newer gap. The most recent displacement is the one describing how the market is currently delivering, so a bullish gap broken downward produces a bearish zone, and the reverse for a bullish one.
Midpoint and labels
Each zone can carry its consequent encroachment — the midpoint of the drawn band, taken after the trim rather than from the raw overlap. A range has an equilibrium; a price delivery array has a consequent encroachment, and they are not the same object.
Names sit beside the box on its centre line, just past the right edge, so a name stays readable when its zone is only a few pixels tall and never crosses the midpoint line.
The two parent gaps can be shown faintly behind the zone. It is off by default: the trimmed band is the point of the tool, and drawing both parents puts back the clutter it exists to remove.
Invalidation
A zone is spent when a candle body closes clean beyond its far edge against its direction. On the default setting it is removed, the same rule this stack applies to any spent inventory. It can instead be faded and kept, which holds the record of where delivery already happened.
Live zones are capped per side, oldest removed first, so a long session cannot fill the chart.
The console
A small table, verdict first: whether there is support, resistance, both or nothing live. Under it, the count on each side, and a respected count.
Respected means price returned into the zone and has not closed through it. It is counted only across what is currently drawn, so the number always describes the boxes in front of you rather than a hidden history, and an invalidated zone leaves the count together with its box. A watching row shows how many untested gaps are still able to become a zone.
Every row carries its rule in the cell tooltip.
Alerts
Four. Bullish zone formed, bearish zone formed, and first touch on each side. The formation alerts fire on the close that completes the second gap; the touch alerts fire the first time price returns into a drawn zone.
Method and repainting
Everything is read from the chart timeframe. There are no higher-timeframe requests anywhere in the script, so there is no lookahead to configure wrongly and no future data to leak.
Every detection is gated to a confirmed bar close. The test call, the break, the second gap and the invalidation are all judged on closed candles, so nothing appears mid-bar and then withdraws.
One characteristic is inherent to pivots and worth stating plainly rather than leaving to be discovered: a swing is only confirmed once the bars to its right have printed. On the three-candle setting that is one bar, on five it is two. A zone therefore confirms a bar or two after the move that created it. That is lag, not repainting — nothing moves once drawn.
Zones and midpoint lines extend rightward to the current bar while they are live. That is the box tracking the present, not its history changing.
What it will not do
It places no entries, exits, stops or targets, and it does not size a position. It draws no bias, no trend and no projection.
It does not read structure beyond the pivots it uses, and it does not label market phases. Whether a drawn zone is worth trading is a judgement about context this script does not have — the session, the higher-timeframe draw, and what the day has already done.
A gap that gets tested draws nothing. Two opposing gaps overlapping without a pivot between them draw nothing. A candidate band that a wick has already run through draws nothing. Only the finished sequence produces a zone, so an empty chart through a slow session is the tool working rather than failing.
Settings
Pivot length; minimum parent gap in ticks; minimum zone size after the wick trim; maximum bars from the pivot to the close-through; maximum bars from the break to the opposing gap; the per-side cap on live zones; behaviour on invalidation, remove or fade and keep; the consequent encroachment midline; the parent gaps behind the zone; how far right the drawings extend past the live candle; the console; and label text size.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. Penunjuk

Stock Breakout Momentum StrategyDescription
A breakout entry alone isn't a system, it's the first third of one. What happens after the breakout fires is what usually decides whether the equity curve goes up or down: does every close beyond a lookback high get traded, or only the ones with real trend and participation behind them? Does a winning trade get room to develop, or does it get cut off by an exit window built for a losing trade? This strategy answers both questions directly: breakout entries are screened by a trend filter and a volume filter before they're taken, and once in a trade, a fixed ATR profit target works alongside a trailing stop and a materially longer time-based exit — instead of the time exit doing double duty as the only thing standing between a trade and an open-ended hold.
The Breakout Trigger, Now Screened by Trend and Volume
The core signal is unchanged from a classic breakout: a long triggers when a bar closes above the highest high of a lookback window (20 bars by default); a short triggers on a close below the lowest low. The signal only evaluates on barstate.isconfirmed, so it reacts to a bar's final, settled value rather than an intrabar tick, a non-repainting design where the order is submitted on the confirmed signal bar and fills at the next bar's open. What's new is what has to be true alongside that close: an optional trend filter requires price to be above a 50-period SMA for longs (below it for shorts), and an optional volume filter requires the breakout bar's volume to exceed 1.2× its 20-period average. Both are on by default and both can be switched off independently: turning them off reproduces the original unfiltered breakout-only version, which is a useful baseline to compare against.
Why Two Confirmation Filters Instead of One
A breakout on a stock trading below its own trend line, or on below-average volume, is a weaker signal than a breakout with the reverse conditions, a common cause of a low win rate is a system taking every technically-valid breakout regardless of context. The trend filter keeps the strategy from fighting its own directional bias; the volume filter is a basic conviction check against thin, low-participation moves that are more likely to be noise than the start of a real trend.
A Trailing Stop That Only Moves in Your Favor
Once in a position, the stop is recalculated every bar as entry ATR × a multiplier (2.0 by default) behind price, but it only ever ratchets in the trade's favor, a long's stop can rise as price rises but can't be pulled back down on a pullback, and a short's stop mirrors that in reverse.
An Explicit Profit Target, Not Just a Trailing Stop
Earlier versions of this approach relied on the trailing stop as the only way to close a trade in profit, which meant a short exit window could cut a winning trade off before the stop had room to ratchet up. This version adds a fixed ATR profit target (3.0× ATR by default, set once at entry and left in place; it doesn't trail the way the stop does) placed alongside the stop as a bracket order. Paired with the default 2.0× ATR stop, that's a built-in 1.5:1 reward-to-risk skew: the strategy doesn't need a high win rate to be net positive, it needs winners to average meaningfully more than losers, which is what the target is there to enforce. This can be turned off entirely if you'd rather rely on the trailing stop alone.
A Longer Time-Based Exit
Trades that haven't been stopped out or hit target within a set number of bars are closed as a housekeeping measure, a fixed exit window is there to purge trades that have stopped developing rather than to signal a directional call. That window is now 20 bars by default rather than a handful, giving the trailing stop and profit target actual room to do their jobs before the clock forces a decision. Whichever of the three exit conditions: stop, target, or time is met first is what closes the trade.
Position Sizing Tied to Equity, Not a Fixed Share Count
Instead of trading a static number of shares, the strategy calculates how many shares fit within a configurable percentage of current account equity (100% by default) divided by the current share price, floored to a whole share count with a floor of one. Sizing compounds with account equity rather than staying fixed at the starting balance. A dedicated "Allow Short Entries" toggle exists because not every account can short every stock; turn it off to backtest and trade long-only.
A Note on Shorting and Margin
Short positions on equities require margin, and margin requirements for shorting are not the same as the cash-equivalent share count this script computes for sizing; real brokers generally require posting more buying power to hold a short than to hold an equivalent long. Sizing at 100% of equity while shorting is enabled can produce trades a real margin account would reject or forcibly liquidate before the strategy's own exit logic gets to close them on its own terms. If you intend to trade this live with shorting on, size conservatively (well under 100%) and confirm your broker's actual margin requirements rather than relying on this script's sizing as a margin calculation.
Backtest Realism Settings
The strategy ships with commission modeled at 0.05% and 2 ticks of slippage baked into every fill, pyramiding disabled, and no same-bar order fills: defaults chosen so Strategy Tester numbers reflect something closer to live execution rather than an idealized fill.
Timeframes and Instruments
Built for equities, and tested across multiple timeframes and symbols with meaningfully different results depending on the instrument's underlying trend regime during the test window — a stock that trended cleanly produced a very different outcome than one that chopped sideways over the same period, even with identical settings. Because the exit logic is bar-count based, results will also vary by timeframe: retest breakoutLength, trendLength, atrMultiplier, profitTargetATRMult, and barsInTrade together whenever you change timeframe rather than assuming the defaults transfer.
What to Examine in Backtesting
Because of the built-in 1.5:1 reward-to-risk skew, a win rate meaningfully below 50% can still be net profitable: check the Strategy Tester's average win versus average loss alongside the raw win rate rather than judging on hit rate alone.
Watch trade count relative to your test window: a strategy that only fires a handful of times over several months (which the trend and volume filters will produce, by design) needs a longer test period or a broader set of symbols before a positive or negative result says much about a real edge versus a lucky or unlucky stretch. Also check the Margin Usage tab specifically if shorting is enabled, and compare max drawdown against total return, a strategy that gives back most of an open gain before ending marginally positive is a different risk profile than one that climbs more steadily, even if the final number looks the same.
Shared for educational purposes. This is not investment advice. Backtest results, including any shown in this listing's chart or comments, reflect a specific historical period and instrument and are not a representation of future performance. Trading involves substantial risk of loss and is not suitable for all investors. Strategi

Market Structure Flow Map [BOSWaves]Market Structure Flow Map - Strength-Scored Curved Ribbon Visualization of Break of Structure and Change of Character Events
Overview
Market Structure Flow Map is a market structure event visualization system that renders each Break of Structure and Change of Character as a curved three-layer ribbon connecting the broken swing pivot to the bar where the break occurred, where ribbon thickness, glow intensity, and arc curvature are driven by a composite strength score derived from the displacement beyond the broken level and the relative volume at the break bar rather than applying uniform visual treatment regardless of the conviction behind each structural event.
Instead of marking BOS and CHoCH events with simple horizontal lines or static labels, this system renders each structural break as a curved polyline ribbon that physically connects the origin swing point to the breakout bar, with the ribbon's visual weight scaling continuously from the configured minimum to maximum width based on how far price moved beyond the broken level and how significantly above average volume was at the moment of the break. Wider, brighter ribbons represent high-conviction structural breaks with strong displacement and volume evidence. Thinner, more subtle ribbons represent marginal breaks that barely cleared the structural level with below-average participation.
This creates a market structure visualization where the visual record of structural history is encoded with conviction information rather than presenting all breaks as visually equivalent events. The curved arc geometry provides an immediate spatial reading of the distance between the origin swing and the break bar, with longer arcs indicating structural breaks that developed over more bars. The three-layer glow, body, and core rendering gives each ribbon depth and visual prominence scaled to its structural significance. And the circular node markers at each broken swing pivot anchor the ribbon origins to the precise structural prices that were violated.
Price structure is therefore presented not just as a sequence of labeled events but as a visually weighted conviction map where the strongest structural breaks are immediately identifiable by their visual dominance over weaker ones.
Conceptual Framework
Market Structure Flow Map is founded on the principle that not all structural breaks carry equal significance, and that a visualization system which presents every BOS and CHoCH with identical visual weight fails to communicate the most important information available at the moment of each break: how convincingly price moved through the structural level and whether that move was supported by meaningful participation.
Traditional market structure tools mark every qualifying break with the same line, label, or zone regardless of whether the break was a decisive high-volume displacement or a marginal low-volume close that barely cleared the level. This framework replaces uniform visual treatment with strength-scaled ribbon geometry where every visual property of the ribbon reflects the composite conviction of the underlying structural event, creating a chart where the structural history reads as a visual conviction hierarchy rather than a flat sequence of identical events.
Three core principles guide the design:
Each structural break should be rendered as a physical curved connection between its origin swing and its break bar, preserving the spatial and temporal relationship between the structural level that was violated and the moment of violation rather than abstracting the event to a horizontal line.
Ribbon visual weight should scale continuously with a composite strength score that combines displacement magnitude and volume significance, ensuring that the chart's visual hierarchy reflects the structural conviction hierarchy rather than being independent of it.
BOS and CHoCH events should be visually distinguished not only through color but through the arc geometry, with the ribbon curvature and length encoding the temporal distance between the swing origin and the break completion.
This shifts market structure visualization from event marking into conviction-weighted structural flow mapping where the cumulative visual record encodes the relative significance of every structural event in the chart history.
Theoretical Foundation
The indicator combines pivot high and low detection for swing origin identification, configurable close or wick break confirmation for structural break detection, displacement-based and volume-ratio-based strength scoring with configurable weighting, structural state tracking for BOS versus CHoCH classification, three-layer curved polyline ribbon construction with strength-scaled width and distance-adaptive arc height, and circular node markers at broken swing pivot prices.
Displacement strength is calculated as the distance from the broken level to the break bar's source price, normalized against an ATR multiple and capped at the configured maximum. Volume strength is calculated as the excess of the break bar's volume above average relative to the configured maximum ratio, with below-average volume bars receiving zero volume strength. These two components are combined using the configured dispWeight and volWeight parameters, normalized by their sum so the total always produces a 0-1 strength score regardless of the weight distribution chosen. The arc height scales with both ATR and the temporal distance between the swing origin and break bar, so ribbons connecting distant origin-break pairs curve more dramatically than ribbons connecting adjacent ones.
Four internal systems operate in tandem:
Swing Detection and State Engine : Identifies confirmed pivot highs and lows using the configurable lookback, tracks the most recent unbroken high and low with their bar indices and prices, classifies each qualifying break as BOS or CHoCH based on the current structural state, and updates the structural state on each confirmed break.
Strength Scoring System : Calculates displacement from the broken level normalized against ATR, calculates volume ratio normalized against the configured maximum, combines both components with configurable weights, and maps the result to a 0-1 composite strength score that drives all ribbon visual properties.
Curved Ribbon Rendering Engine : Constructs three-point curved polyline paths from origin to arc midpoint to break bar for each of the three ribbon layers, applying strength-derived width to the body layer, additive width to the glow layer, and subtractive width to the core layer, with arc height scaling by both ATR and temporal distance.
Label and Node System : Places circular node markers at each broken pivot price to anchor ribbon origins visually, places directional event labels at each break bar offset by a small ATR fraction, and enforces maximum event count limits across all object arrays independently.
This design ensures every structural event produces a visually complete conviction-weighted representation while the object management system maintains a clean configurable historical event window.
How It Works
Market Structure Flow Map evaluates price through a sequence of structure-aware and strength-scored processes:
Pivot Detection : Confirmed swing highs and lows are identified using the configured left-right bar symmetry requirement, updating the tracked last high and last low prices and bar indices on each new confirmation.
Break Source Selection : Depending on the break mode setting, either the close price or the bar's high and low extremes are used as the source for testing structural breaks, allowing either confirmed closing breaks or intrabar wick-based breaks to qualify.
Break Detection : On each bar, the bullish break source is tested against the last unbroken high and the bearish break source is tested against the last unbroken low. A qualifying break requires the current bar to have crossed the level while the previous bar had not, and the level must not have been broken previously since its last registration.
Structural State Classification : Bullish breaks during a bearish structural state classify as bullish CHoCH. Bullish breaks during a neutral or bullish state classify as bullish BOS. The same logic applies in reverse for bearish breaks, with structural state updating to the new direction on each confirmed event.
Displacement Strength Calculation : The absolute distance between the break source price and the broken level price is divided by the product of ATR and the configured maximum displacement multiplier, clamped to a 0-1 range.
Volume Strength Calculation : The excess volume above average is normalized by the configured maximum ratio minus one, clamped to a 0-1 range. Bars with below-average volume receive a volume strength of zero.
Composite Strength Derivation : Displacement and volume strengths are combined using the configured weights normalized by their sum, producing a 0-1 composite score that drives all ribbon visual properties.
Ribbon Geometry Construction : Three chart points are derived at the origin swing bar, the temporal midpoint between origin and break, and the break bar. The midpoint arc height is calculated from ATR, the arc ATR multiplier, a distance factor derived from the bar span, and the composite strength. For bullish breaks the arc curves above both endpoints; for bearish breaks below.
Three-Layer Ribbon Drawing : The glow layer renders at the body width plus five with high transparency. The body layer renders at the strength-scaled width with low transparency. The core layer renders at the body width minus two with a near-white color at low transparency, providing depth and brightness.
Node and Label Placement : A circular node is placed at the origin swing price and bar. A directional event label is placed at the break bar offset by a small ATR fraction above for bullish breaks and below for bearish breaks.
Object Count Management : All five object arrays are independently trimmed to the maximum event count by removing the oldest entries, maintaining a clean rolling window of the most recent structural history.
Together, these elements form a continuously updating market structure visualization where every structural event is rendered as a spatially accurate, conviction-weighted curved ribbon that communicates both the structural significance and participation quality of each break.
Interpretation
Market Structure Flow Map should be interpreted as a conviction-weighted structural event history where ribbon visual weight communicates break significance:
Bullish BOS Ribbon (Cyan) : Curved ribbon arcing upward from a broken swing high to the break bar, indicating a continuation structural break in the direction of the prevailing bullish structural state. Ribbon width reflects break strength.
Bearish BOS Ribbon (Red) : Curved ribbon arcing downward from a broken swing low to the break bar, indicating a continuation structural break in the direction of the prevailing bearish structural state. Ribbon width reflects break strength.
Bullish CHoCH Ribbon (Green) : Curved ribbon arcing upward from a broken swing high during a bearish structural state, indicating a potential trend reversal where price has broken bullish structure against the prior downtrend.
Bearish CHoCH Ribbon (Amber) : Curved ribbon arcing downward from a broken swing low during a bullish structural state, indicating a potential trend reversal where price has broken bearish structure against the prior uptrend.
Ribbon Thickness : The primary strength indicator. Thick ribbons represent high composite strength with strong displacement and above-average volume. Thin ribbons represent weak breaks that barely cleared the structural level with low participation.
Ribbon Arc Height : Reflects both ATR-relative volatility and the temporal distance between the swing origin and break bar. Tall arcs indicate breaks that developed over many bars or occurred during high-volatility conditions. Flat arcs indicate quick breaks between adjacent swings.
Glow Layer : The wide transparent outer layer provides visual prominence that scales with ribbon width, making the strongest ribbons immediately identifiable across the full chart view.
Core Layer : The bright near-white inner layer provides a luminous center line that reinforces the direction and curvature of each ribbon while adding visual depth to the three-layer geometry.
Structure Nodes (Circles) : Circular markers at each ribbon origin anchor the structural event to its precise swing price, making it clear which pivot level was broken to produce each ribbon.
Event Labels : BOS and CHoCH text labels at each break bar identify the event type with color coding matching the ribbon, providing a text-based reference that complements the visual ribbon hierarchy.
Colored Candles : Optional bar coloring reflects the current structural state, coloring cyan during bullish structure and red during bearish structure regardless of individual bar direction.
Ribbon width hierarchy, arc geometry, color coding, and node placement collectively communicate more structural conviction information than text labels alone.
Signal Logic & Visual Cues
Market Structure Flow Map presents four distinct event types across two structural break categories:
Bullish BOS : Cyan ribbon connecting a broken swing high to the break bar during an established bullish structural state, confirming continuation of the prevailing upward structural sequence.
Bearish BOS : Red ribbon connecting a broken swing low to the break bar during an established bearish structural state, confirming continuation of the prevailing downward structural sequence.
Bullish CHoCH : Green ribbon connecting a broken swing high to the break bar during a bearish structural state, signaling a potential reversal of the prevailing downward structural sequence.
Bearish CHoCH : Amber ribbon connecting a broken swing low to the break bar during a bullish structural state, signaling a potential reversal of the prevailing upward structural sequence.
Both BOS and CHoCH events can be independently toggled, allowing the chart to focus exclusively on continuation signals, exclusively on reversal signals, or both simultaneously.
Alert generation covers bullish and bearish structural breaks for systematic structural monitoring workflows.
Strategy Integration
Market Structure Flow Map fits within momentum-validated market structure and conviction-weighted structural analysis approaches:
Ribbon Width Prioritization : Assign greater analytical weight to thick, wide ribbons representing high-strength breaks. Thin ribbons from marginal low-volume breaks carry reduced structural significance and warrant more caution before acting on the direction signal.
CHoCH Reversal Framework : Use green and amber CHoCH ribbons as primary reversal identification signals, treating their appearance as the first confirmation that structural direction may be shifting. Subsequent BOS ribbons in the new direction following a CHoCH provide continuation confirmation.
BOS Continuation Framework : Use cyan and red BOS ribbons as trend continuation evidence within established structural regimes, with wider BOS ribbons providing stronger confirmation of sustained directional momentum.
Arc Length Context : Monitor ribbon arc lengths as a temporal context indicator. Short low arcs between adjacent swings indicate rapid structural progression. Tall arcs spanning many bars indicate structural breaks that required extended time to develop, which may reflect different momentum characteristics than immediate breaks.
Ribbon Density Assessment : The density and direction consistency of recent ribbons provides a visual structural momentum reading. A sequence of uniformly wide same-direction ribbons indicates sustained structural conviction. A mix of widths and directions indicates contested structure without clear dominance.
Multi-Timeframe Structure Hierarchy : Apply higher-timeframe structural state as directional bias context, using lower-timeframe BOS ribbons to time continuation entries within the structural direction established on the higher timeframe.
Technical Implementation Details
Structure Detection : Pivot high and low confirmation with configurable lookback and close or wick break mode selection
Strength Scoring : ATR-normalized displacement combined with SMA-normalized volume excess using configurable weights summing to a 0-1 composite score
Ribbon Geometry : Three-point curved polyline construction with distance-adaptive arc height scaling and strength-proportional line width across three layers
Classification Logic : Structural state tracking for BOS versus CHoCH identification with independent visibility toggles per event type
Object Management : Five independent arrays with configurable maximum event count enforced by oldest-first removal
Candle Coloring : Structural state-driven bar color applied to body, wick, and border independently
Performance Profile : Real-time execution on each confirmed bar with polyline and label objects created at event time and managed through independent array trimming
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday structural flow mapping for scalping with shorter swing length for faster structural event detection on smaller swings
15 - 60 min : Session-level structural analysis with balanced swing length and moderate displacement and volume thresholds for meaningful event density across typical session structure
4H - Daily : Swing-level market structure visualization with longer swing detection for broader structural events that reflect significant trend-level breaks
Suggested Baseline Configuration:
Swing Length : 8
Break Confirmation : Close
Volume Average : 20
Displacement Weight : 0.6
Volume Weight : 0.4
Ribbon Arc (ATR×) : 0.7
Maximum Events : 35
Show BOS : Enabled
Show CHoCH : Enabled
Show Structure Nodes : Enabled
Color Candles : Disabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's swing frequency, typical displacement characteristics, and preferred structural event density, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Too many structural events firing : Increase Swing Length to demand more structurally significant pivot confirmation, reducing the frequency of detected breaks, or switch Break Confirmation to Close to filter out wick-based marginal breaks.
Structural events too infrequent : Decrease Swing Length toward 2 for more sensitive pivot detection, or switch to Wick mode to capture structural breaks that close below the level but print a wick through it.
All ribbons appearing similar width : Adjust Max Displacement ATR and Max Volume Ratio to calibrate the scoring thresholds to the instrument's typical break characteristics. If most breaks exceed the maximum thresholds the scoring range collapses and all ribbons appear near maximum width.
Volume scoring not contributing : Decrease Max Volume Ratio to make above-average volume easier to achieve on the scoring scale, or increase Volume Weight to give volume a larger proportion of the composite score.
Ribbons too flat or too curved : Adjust Ribbon Arc ATR to scale the arc height. Lower values produce flatter, more linear ribbons. Higher values produce more pronounced curves, particularly on breaks that span many bars.
Too many ribbons cluttering the chart : Reduce Maximum Events to limit the historical ribbon count, or reduce Swing Length to produce more frequent events that each span shorter temporal distances, resulting in smaller arcs and less visual overlap.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional structural sequences where BOS ribbons accumulate in the trend direction and CHoCH ribbons mark definitive reversal points with distinct visual separation from the preceding BOS sequence
Instruments with consistent volume participation where the volume scoring component produces meaningful differentiation between high-conviction and low-conviction breaks rather than uniform low scores
Market structure-based trading approaches where the visual conviction hierarchy of ribbon widths provides immediate differentiation between structural breaks worth acting on and marginal breaks warranting caution
Multi-timeframe structural analysis where the ribbon history provides a visual structural narrative that communicates trend progression, reversal identification, and conviction levels simultaneously
Reduced Effectiveness:
Choppy, range-bound markets where frequent alternating BOS and CHoCH events in both directions produce a dense mixed-color ribbon cluster without a clear structural narrative
Low-liquidity instruments where volume is consistently below average, suppressing volume strength scores and causing most ribbons to render at or near minimum width regardless of structural significance
Markets with very large or small typical ATR ranges where the arc height calculations produce ribbons that are either too flat to read or that arc so dramatically they dominate the visible chart area
Extremely fast-moving markets where structural breaks occur on single large bars that span large price distances, producing short temporal ribbons that offer limited visual differentiation from one another
Consolidation environments where price oscillates between two nearby swing levels without establishing clear directional structural progression, generating frequent opposing CHoCH events without the sustained BOS sequences that define clear structural trends
Integration Guidelines
Confluence : Combine with BOSWaves volume flow tools, order flow analysis, or momentum indicators to validate high-strength CHoCH and BOS ribbons with broader analytical context before committing to structural direction trades
Width Hierarchy Respect : Build a ribbon width filter into your analysis workflow. Thin ribbons from marginal breaks should be treated as weak structural evidence requiring additional confirmation. Thick ribbons from high-displacement high-volume breaks warrant greater directional confidence.
CHoCH Sequencing : A single CHoCH ribbon is not sufficient confirmation of a structural reversal in isolation. Wait for a subsequent BOS ribbon in the new direction to confirm that structural momentum has genuinely shifted before treating the CHoCH as a completed reversal.
Arc Geometry Reading : Use ribbon arc height as a secondary strength indicator. Tall arcs on strong ribbons indicate breaks that developed over many bars with sustained momentum. Short arcs on strong ribbons indicate rapid decisive breaks that required minimal time to complete.
State Discipline : Maintain structural bias aligned with the current state established by the most recent CHoCH until a new CHoCH in the opposing direction confirms a structural shift. Individual BOS ribbons within an established trend do not alter the structural regime and should be interpreted as continuation rather than reversal evidence.
Disclaimer
Market Structure Flow Map is a professional-grade market structure visualization and conviction-weighted structural event analysis tool. It uses pivot-based break detection with composite displacement and volume strength scoring but does not predict future price movements. Results depend on market conditions, instrument structural characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, volume analysis, and comprehensive risk management. Penunjuk

Range Budget - Anchored Extension and Daily Range Exhaustion============================================================
DESCRIPTION
============================================================
Range Budget measures how much of a typical daily range has
already been delivered, and how far the current directional
leg has travelled, so that a level can be assessed on distance
as well as location.
The problem it addresses is a common one in level-based
trading. A level is identified in advance, price arrives, and
the setup is taken without accounting for how far price
travelled to get there. A level reached after a move that has
already covered a full day's range is a materially different
proposition from the same level reached after a quiet drift,
even though the level itself is identical. This script
quantifies that difference.
WHAT IT CALCULATES
Anchor and extension
The anchor is a chosen session open: the CME open at 18:00,
midnight, 08:30, or the regular session open at 09:30, all in
the selected timezone. The anchor is detected by tracking
minutes elapsed since the anchor time with wraparound across
midnight; a decrease in that value marks a new anchor period.
An optional gap check re-anchors at the Sunday reopen rather
than carrying the prior Friday value through the weekend.
Extension is the signed distance in points from the anchor
open to the current close. Session high and session low are
tracked from the anchor forward.
Leg travel
Up leg is the distance from the session low to the current
close. Down leg is the distance from the session high to the
current close. These are reported separately from extension
because extension understates a move that opened, reversed,
and then ran. A session that opens, falls forty points and
rallies eighty shows an extension of plus forty while the leg
being entered is eighty points old. The two readings answer
different questions: extension describes location relative to
the open, leg travel describes how much of the current move
has already occurred.
Daily range statistic
The denominator is a trailing statistic of daily high minus
low, taken from completed daily bars only. A one-bar offset is
applied inside the higher timeframe request so the forming day
is excluded from its own benchmark. The statistic is constant
intraday by construction.
Three methods are available. The default is the median rather
than the mean. Daily range distributions are right skewed and
a single outlier session, or a holiday half-day, shifts a mean
for the entire length of the window while barely moving a
median. Mean and exponential options are provided for users
who prefer them.
Range basis can be set to the full exchange day or to the
regular session only, which changes both the statistic and the
current day measurement consistently.
Budget and projections
Budget is today's realised daily range expressed as a
percentage of the denominator, displayed as a ten segment
gauge. Projections are drawn at the day low plus the
denominator and the day high minus the denominator. Room
reports the distance in points from current price to each
projection. This formulation is used in preference to
projecting symmetrically from the open because it accounts for
what the session has already delivered rather than assuming
the open sits at the centre of the eventual range.
Regime ratio
A rolling median range over a short window is divided by the
same statistic over the long window. Volatility expands far
faster than a fixed lookback adapts, so on the first day of a
changed environment the long window is still describing the
previous one. The ratio detects that condition immediately
rather than after the window has turned over. Values above the
expansion threshold indicate the short window is the more
representative reading.
State
The state row combines budget and regime. Budget beyond one
hundred percent is ambiguous in isolation: it can mean the day
is finished, or it can mean the denominator is stale. When
budget exceeds the exhaustion threshold and the regime ratio
is simultaneously elevated, the state reports expansion rather
than exhaustion, because the appropriate reading in that case
is a trending environment rather than a completed one.
Pullback levels
Optional retracement levels are drawn at configurable
percentages of the leg delivered since the anchor, measured
back from the extreme in the direction of travel.
WHAT IT DRAWS
A vertical line marking the anchor boundary, with a
configurable number of prior boundaries retained as session
separators.
A horizontal line at the anchor open, plus dotted session high
and low lines, each labelled with price and points from the
open. These are drawn for the current anchor period only and
are rebuilt at each new anchor, so historical periods do not
accumulate on the chart.
Three compact daily candles to the right of the last bar
showing the forming day and the two prior days. They are drawn
at true price levels, so they also serve as visual references
for the previous day high, low and close. The forming day
carries a dashed border and updates live.
Optional projection and retracement lines, both off by
default.
A panel reporting anchor open, extension, session range, up
and down leg with their share of the denominator, the budget
gauge, room to each projection, the denominator with its
method and window stated, the regime ratio, and the state.
Leg cells are colour graded against the exhaustion thresholds.
SETTINGS NOTES
Three separate lookback windows are used and they drive
different things. The slow window drives the denominator, the
gauge, the projections and room. The fast window drives only
the regime ratio. The context window drives only the minimum,
maximum and quartile rows, where responsiveness does not
matter.
A manual denominator override is provided. It exists for the
first session after a clear regime break, when the operator
knows the environment has changed and the window has not yet
caught up.
READING IT
The leg readings graded against the denominator are the
primary output. A leg at or beyond one hundred percent means a
full typical day's range has been delivered in one direction.
Room reports whether a target has space remaining even if the
directional read is correct.
The denominator is a range statistic, not a displacement
statistic. It describes the height of the envelope a session
typically builds, not how far price travels within it, and net
close to close movement is normally much smaller. A setup
requiring a large fraction of the typical envelope in a single
directional leg is an expansion day proposition rather than a
normal day proposition.
LIMITATIONS
This is a context readout. It produces no entries, no
directional bias and no filtering output, and it is not
intended to confirm or reject a setup on its own.
Leg readings measure distance, not recency or velocity. A leg
reset occurs whenever a new session extreme is made, so a leg
built slowly overnight and a leg built rapidly in the last
half hour produce identical readings.
No time of day weighting is applied. A given percentage of
range consumed early in a session and the same percentage late
in a session are not equivalent situations, and the script
does not currently distinguish them.
The denominator lags a genuine volatility regime change by at
least one session. The regime ratio shortens that lag but does
not eliminate it.
Compact daily candles are drawn at true price levels, so on a
strongly zoomed intraday chart the prior days may fall outside
the visible price scale. Penunjuk

Trend Dashboard - Direction and StrengthTrend Dashboard - Direction and Strength.
A single compact table that reads eleven trend, momentum, volatility, structure and volume-flow indicators on up to four timeframes at once. The directional readings are condensed into a score and a categorical verdict for each timeframe, while trend strength is reported separately by the ADX row and never enters the sum, so direction and strength stay two distinct answers. Built for top-down traders who want the confluence check they normally perform by switching charts to happen in one place, on the chart they are already trading.
How it works:
Every indicator for a given timeframe is computed inside one function and delivered by a single request.security call per timeframe, with lookahead disabled, so the table never reads data that was not available at the time of the bar. The four timeframe slots are user-assigned and default to daily, 4 hours, 1 hour and 5 minutes. Column headers are derived from the assigned timeframe itself, so reassigning a slot relabels the column. Market structure is delivered by a second request per timeframe: it tracks confirmed swing highs and lows over a configurable pivot window, registers the direction of the last break, and counts how many continuation breaks have followed the last change of character.
The table is rebuilt on the last bar only and cells are wiped before each refill, so toggling a timeframe off cannot leave stale values in a column that has shifted. Rows are ordered by the weight of the information they carry: structural context first, then macro regime, then medium-term structure, momentum, strength and the local price position, followed by the three context rows and the score and verdict at the bottom. A marker column carries a coloured dot for rows that must not be read as ordinary trend votes: orange for mandatory context that stays outside the score, white for indicators running on simplified parameters or on an approximation, blue for market structure. The script also detects whether the symbol reports volume. On symbols with no volume feed, cumulative volume delta and OBV divergence print a dash instead of a neutral reading, and the volume delta vote is dropped from the score, which lowers the maximum from eight to seven while the verdict thresholds stay absolute.
What it calculates:
- Market structure — direction of the last swing break, with a phase suffix (C, C+1, C+2 and higher) counting continuation breaks since the last change of character.
- EMA mid/slow — macro regime, the golden and death cross relation.
- EMA fast/mid — medium-term trend structure.
- SuperTrend — ATR trailing direction, computed from a configurable ATR length and factor.
- Ichimoku Kumo — price against the cloud built from the 9, 26 and 52 bar ranges.
- MACD — bullish only when the MACD line leads the signal line and the histogram agrees.
- RSI — directional reading around the midline, with the raw value shown in the cell.
- CVD — cumulative volume delta approximated from the position of the close inside the bar range, read as the agreement between flow slope and price slope.
- Price vs fast EMA — the local position of price, the most sensitive of the trend votes.
- ADX and DMI — trend strength with the raw ADX value shown in the cell, and direction from the DMI pair once the threshold is met.
- OBV divergence — price extreme of the window not confirmed by cumulative volume.
- RSI divergence — price extreme of the window not confirmed by momentum.
- Score — the sum of the eight directional votes per timeframe, shown against the maximum available on the symbol.
- Verdict — STRONG BULL, BULL, MIXED, BEAR or STRONG BEAR, derived from absolute score thresholds.
Key features:
- Four independently assignable timeframe slots, each with its own visibility toggle. Hidden columns shift the remaining ones left and are excluded from the alignment alerts.
- Column headers derived from the assigned timeframe, formatted as 1D, 4H, 1H, 5M rather than fixed labels.
- Separation of directional votes from context. Market structure, ADX and the two divergence rows are displayed but never summed into the score, so trend strength and reversal warnings are not confused with direction.
- Automatic handling of symbols without volume: the affected rows print a dash and the score maximum drops to seven, with verdict thresholds left absolute.
- Per-row tooltips that state what the indicator measures, how to read the three states, its role inside the system and its known failure modes.
- Configurable parameters for every indicator: EMA lengths, RSI length and thresholds, MACD triplet, ADX length and threshold, SuperTrend ATR and factor, CVD lookback, OBV and RSI divergence windows, and the market structure pivot window with a choice between candle close and wick confirmation.
- Ten alert conditions: a bullish and a bearish verdict transition for each of the four timeframes, plus full bullish and bearish alignment across all visible timeframes.
- Table position and text size selectable, with all signal and table colours exposed as colour inputs.
Who it's for:
Trend followers, swing traders and intraday traders who work top-down and want the higher timeframe bias, the execution frame and the entry frame visible at the same time. It suits price-action and SMC or ICT workflows that treat break of structure and change of character as the primary context, and momentum-based approaches that need a strength filter before acting on a directional signal. The outcome is one table that answers whether a trend exists, which way it points on each timeframe, and where the timeframes disagree, without stacking a dozen overlays on the chart. Penunjuk

Consolidation Ranges [ITA]🟠 OVERVIEW
Consolidation Ranges finds the places where price stopped trending and went sideways, draws the range while it forms, marks the bar that closes outside it, and then keeps watching to see whether that breakout actually held.
Finding a sideways range is the easy half. Every tool in this category draws the box and marks the breakout, and then stops, which is where the trader's real problem starts. The most common complaint about trading ranges is that the breakout fails and price comes straight back in, and almost nothing measures how often that happens.
So this one waits. After a breakout it gives price a set number of bars to stay outside. Close back inside within that window and the breakout is marked Failed. Stay out and it is marked Held. The running count of both sits in the corner.
🟠 CONCEPTS
* Consolidation - A stretch of bars whose full high to low span stays inside a chosen multiple of ATR. Measuring the range in ATR rather than in points means the same setting behaves the same way on a quiet symbol and a volatile one.
* Range Widening - While price stays inside, the box grows to contain each new bar, but only while the result is still narrow enough to count as a range. Without that limit a slow drift never breaks out, it just drags the box along with it.
* Breakout - The first close outside the box. The close matters rather than the wick, because a wick outside a range is the thing that most often reverses.
* Confirmation Window - The number of bars a breakout is given to prove itself.
* Held and Failed - What actually happened. Held means price stayed outside for the whole window. Failed means it closed back inside the range it had just left.
🟠 FEATURES
🔹 Range width measured in ATR, so one setting works across symbols and timeframes rather than needing to be retuned for each
🔹 The box builds live as the range develops and locks on the bar that breaks it
🔹 Breakouts marked in both directions at the price where the close happened
🔹 Every breakout followed to an outcome and labelled Held or Failed
🔹 A running count of held against failed breakouts, with the rate, for the symbol and timeframe on screen
🔹 Separate alerts for a break up, a break down, a failed breakout and a held breakout
🔹 If the settings are strict enough that nothing is found, the chart says so and names the two inputs to change, rather than leaving you looking at an empty chart unable to tell a quiet symbol from a bad setting
🟠 HOW TO USE
Set Range Length first. It decides how significant a consolidation has to be before it is drawn at all. Twenty bars is a reasonable starting point on any timeframe. Raise it for fewer and larger ranges.
Max Width is the second control. If nothing is being found on a volatile symbol, raise it. If the whole chart is boxes, lower it.
Then read the count in the corner before anything else. It is telling you whether breakouts on this symbol and timeframe have been worth taking. A symbol where most breakouts failed is not a symbol to trade breakouts on, and that is worth knowing before the next one rather than after it.
Bars To Confirm decides how patient the measurement is. A short window counts quick reversals as failures. A longer one only counts a breakout as failed if price genuinely came back.
🟠 CONCLUSION
Drawing the range is the part every tool does. The part that decides whether the range was worth trading is what happened after the break, and that is what this one records. Penunjuk

Global Net Liquidity - (Giovanni Fork)Hello traders. This plots the combined balance sheets of the Fed, ECB, BoJ, PBoC and Bank of England, converted to dollars, with the US Treasury General Account and the Fed's reverse repo facility subtracted.
There are already a lot of global liquidity scripts on here, so I want to be clear about what this one does differently rather than just adding another overlay to the pile. Three things.
First, this is a net measure.
Gross central bank assets tell you how much money has been created. They do not tell you how much of it is actually available, because some of it gets created and then taken straight back out of circulation. Money sitting in the Treasury's account at the Fed is not in the system. Nor is cash parked overnight in the reverse repo facility. Subtracting those gives you what is genuinely out there, and that is what net means here. At the time of writing it is 0.97tn in the TGA coming off a gross of 22.37tn.
It is also worth saying that this is built from central bank balance sheets rather than M2. Those are related but they are not the same measure, so if you are comparing this against something else, check which one you are looking at.
Units are worth paying attention to when you combine feeds like this. The underlying sources do not agree with each other: FRED publishes the Fed balance sheet in millions and the reverse repo facility in billions, and the China balance sheet is reported in hundred millions of yuan. TradingView appears to normalise all of them to absolute units before serving them, which is why every scale factor in this script is 1.
I would still rather you checked than took my word for it. Every series has its own visible scale factor and the table prints each component in USD trillions, so you can compare the numbers against what you know the Fed and the ECB are actually running. If a row looks wrong by orders of magnitude, that series' scale input is wrong and you can correct it in the settings without touching the code.
Second, China is measured properly.
The PBoC balance sheet is a poor gauge of Chinese liquidity and most aggregates include it anyway. Its growth up to 2014 was foreign exchange accumulation rather than stimulus, so the series has meant different things in different decades. More importantly, the PBoC's main easing tool is the reserve requirement ratio, and that is balance sheet neutral. Cutting the RRR reclassifies required reserves as excess reserves, releasing roughly 1 trillion yuan per 50bp, while total assets do not move at all. The biggest thing the PBoC does is invisible to a balance sheet aggregate.
The default here subtracts required reserves, estimated as the reserve ratio applied to M2 as a deposit proxy, so an RRR cut registers as the easing it actually is. You can switch back to the plain balance sheet or to the commercial bank balance sheet in the settings. It is an approximation because China's RRR is tiered across large, small and rural banks and the headline rate only covers the large ones, but it responds to the right events.
Third, and this is the part I think adds most, the currency effect is separated out.
Every aggregate that converts foreign balance sheets at spot has dollar moves baked into it. A stronger dollar shrinks the line even when no central bank has done anything, and that gets reported as tightening.
The purple line is the same aggregate chain linked at constant currency. Each period's balance sheet change is converted at that period's own opening rate and accumulated, so it shows what the balance sheets did without the currency. The shaded gap between the two lines is the currency effect, and the table gives it as a number. Since January 2016 it is 1.56tn, meaning that much of the apparent decline in global liquidity was dollar strength rather than central bank action.
The BoJ is the clearest example. Its assets have grown in yen over recent years while its reported dollar contribution has fallen sharply. A gross liquidity chart reads that as the BoJ tightening. It didn't tighten, the yen moved.
A few things to be aware of before you use it.
The chain start date is January 2016 by default and it matters. The constant currency line is accumulated rather than measured, so it seeds at that date and the two lines are identical there by construction. The currency figure is always cumulative since the start date, so 1.56tn means since January 2016, not in absolute terms. Set the date later if you find a component with no data at the start.
The TGA and RRP are US specific drains applied to a global gross, which is slightly inconsistent. Everybody does it, few say so, so I am saying so.
The underlying data updates weekly at best and the PBoC monthly, so use this on daily or higher. Intraday just repeats the last print.
I built this because I wanted to know how much of the last three years of liquidity contraction was real and how much was the dollar. If it is useful to you, say so, and if you think I have got something wrong let me know. Penunjuk

Delta Trend Delta Trend is a momentum and directional-trend indicator designed to measure the relative movement of price between the open and close of each candle. It converts the percentage change within each candle into a smoothed Delta Line, allowing traders to identify whether short-term price momentum is strengthening or weakening.
The indicator uses the relationship between the candle's Open and Close to calculate its raw directional movement. This value is then smoothed using a Weighted Moving Average (WMA) and multiplied by an adjustable Delta Adjust factor. The resulting Delta value provides a normalized representation of short-term price momentum.
How the Delta is calculated
The raw calculation is:
(Close − Open) / (Close + Open)
This measures the directional movement of the current candle relative to its overall price level.
The raw value is then smoothed using the selected Delta Smooth period and multiplied by the Delta Adjust setting:
Delta = WMA(Raw, Smooth) × 100 × Adjust
A higher Delta indicates stronger positive price momentum, while a negative Delta indicates bearish price momentum.
Delta Trend
The indicator compares the current Delta value with the previous Delta value.
Rising Delta → momentum is increasing or strengthening.
Falling Delta → momentum is decreasing or weakening.
The Delta Line is displayed in:
White when Delta is rising.
Red when Delta is falling.
This allows the trader to see changes in momentum visually without relying solely on whether price itself is moving up or down.
Zero Line and Thresholds
The indicator includes several reference levels:
0 — the primary bullish/bearish dividing line.
0.3 — an early positive-momentum threshold.
3 — a stronger positive-momentum threshold.
The area behind the indicator is shaded blue whenever Delta is zero or above, providing a quick visual indication that momentum is on the positive side of the zero line.
Delta Table
A table in the upper-right corner displays the current Delta value.
The table changes its background according to the strength of Delta:
Delta ≥ 5 → strong positive momentum.
Delta > 0 → positive momentum.
Delta ≤ 0 → negative momentum.
This gives the trader an immediate numerical reading of current momentum.
Alerts
The indicator contains alerts for both the direction and strength of Delta.
Trend alerts
Buy — Delta Line Rise
Triggered when Delta is rising compared with the previous candle.
Sell — Delta Line Fall
Triggered when Delta is falling compared with the previous candle.
Delta-level alerts
The indicator also provides bullish/bearish conditions around:
10
5
3
0.3
0
These thresholds allow traders to monitor different levels of momentum strength.
For example, a Delta above 5 represents considerably stronger positive momentum than simply being above zero.
Overall Interpretation
The Delta Trend indicator can be viewed as a short-term momentum and momentum-direction tool.
Its readings can be interpreted broadly as:
Positive Delta + Rising Delta
→ Positive momentum is strengthening.
Positive Delta + Falling Delta
→ Momentum remains positive but is weakening.
Negative Delta + Falling Delta
→ Negative momentum is strengthening.
Negative Delta + Rising Delta
→ Bearish momentum is weakening and a potential momentum transition may be developing.
The combination of the Delta level and the direction of the Delta Line is therefore more informative than either one by itself.
Example
If the indicator shows:
Delta = +6.2x
Delta Line = Rising
this suggests that the current smoothed price momentum is strongly positive and is increasing.
If it subsequently changes to:
Delta = +4.1x
Delta Line = Falling
the momentum is still positive, but its strength is declining.
If Delta eventually moves below 0, the indicator has transitioned into negative momentum.
Important Limitation
Delta Trend should not be interpreted as true order-flow or buy/sell volume delta.
Unlike an exchange-provided bid/ask delta, this indicator does not measure actual buyer-initiated versus seller-initiated trades. It derives its value entirely from the relationship between open and close prices.
Therefore, it is more accurately described as a smoothed price-momentum/directional-pressure indicator, rather than a true volume-delta indicator.
In simple terms
Delta Trend answers two questions:
1. Is price momentum positive or negative?
and
2. Is that momentum getting stronger or weaker?
The Delta value tells you the approximate strength of the momentum, while the rising/falling state of the Delta Line tells you whether that momentum is increasing or decreasing.
Penunjuk

Penunjuk

DAO GAM Reversal StructureBX Reversal Structure - Adaptive Top and Bottom is a market-structure indicator designed to identify potential horizontal reversal structures formed by two significant swing areas, referred to as A and B.
The indicator analyzes both top structures and bottom structures.
For a top structure, the script looks for an upward price phase followed by a meaningful rejection. It uses the high and close of the final bullish anchor candle to define a price zone around the swing high.
For a bottom structure, the logic is reversed. The script looks for a downward price phase followed by a meaningful recovery and uses the low and close of the final bearish anchor candle to define the swing-low zone.
When two valid zones, A and B, share an overlapping price area, the script attempts to determine a horizontal reference level called X.
The X level is selected so that it remains within the common price area of A and B while avoiding the interior of candle bodies located between the two structures. Wick interaction with X is permitted.
This approach is intended to distinguish meaningful horizontal market structures from simple price equality between two isolated swing points.
Main concepts
The indicator evaluates several structural conditions, including:
Minimum price movement into and away from each swing.
A minimum number of candles forming the directional phase before and after the swing.
Overlap between the price zones of A and B.
Candle-body interaction between A and B.
Separation between the two swing areas.
Distance and spacing between A and B.
Additional interactions with the X level after the structure is formed.
The indicator can detect:
Top structures: potential resistance or reversal structures.
Bottom structures: potential support or reversal structures.
Adaptive mode
The indicator includes an adaptive mode based on ATR (Average True Range).
Instead of relying exclusively on fixed price distances, ATR-based thresholds can automatically scale according to the volatility of the current symbol and timeframe.
This allows the indicator to be tested on different markets and timeframes, including forex, metals, cryptocurrencies, indices and other instruments available on TradingView.
A manual mode is also available for users who prefer fixed parameter values.
A, B and X
A represents the first qualified swing structure.
B represents a later qualified swing structure that shares a valid price area with A.
X is the horizontal reference level calculated from the overlapping zones of A and B.
Additional qualified interactions with the same level may be displayed as C, D, E or subsequent touches.
For top structures, X acts as a horizontal resistance reference.
For bottom structures, X acts as a horizontal support reference.
Line behavior
After a valid A-B structure is detected, the X line is extended to the right.
The visual line stops when a future candle body reaches the X level. Candle wicks alone do not necessarily stop the line.
The script may also generate a CHECK condition when price moves a specified distance beyond X within the configured monitoring period.
These signals indicate that the predefined structural condition has occurred; they are not automatic trading orders.
How to use
Users can apply the indicator directly to a chart and choose between:
AUTO (ATR): parameters adapt to current market volatility.
MANUAL: price-distance parameters are entered manually.
Because volatility and market structure differ significantly between instruments and timeframes, users should evaluate the parameters on the specific market they intend to analyze.
The indicator is intended primarily as a market-structure visualization and research tool. It can be combined with independent analysis of trend, volatility, liquidity, risk management and broader market context.
Original concept
The central idea of this indicator is that a horizontal resistance or support structure should not necessarily be defined by two identical highs or lows.
Instead, each swing is represented as a price zone between the close and the extreme of its anchor candle.
The indicator searches for the common price area between two qualifying zones and then determines a horizontal level that respects candle-body structure between them.
This zone-overlap and candle-body approach is the main structural concept used by the script.
Limitations
This indicator does not predict future market direction and does not guarantee that a detected support or resistance structure will produce a reversal.
Pivot-based structures require subsequent candles for confirmation, so signals are identified only after sufficient market data becomes available.
ATR adaptation improves portability between instruments and timeframes, but no single parameter configuration can provide identical behavior across all markets.
Low-liquidity instruments, gaps, unusually volatile market conditions and different data feeds may produce different results.
Historical structures should not be interpreted as evidence of future profitability.
Users should independently evaluate the indicator and apply appropriate risk management before making trading decisions. Penunjuk

Penunjuk

Prime Structure BiasKaushik Prime — Prime Structure Bias 👑 is a professional 1H market structure dashboard designed to identify the current market bias and structure using confirmed price action.
The indicator analyzes Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL), along with BOS and CHOCH confirmations to determine whether the market is Bullish, Bearish, or Neutral.
It displays the analysis in a clean, table-only dashboard with no chart labels, arrows, or structure drawings. The dashboard shows Market Bias, Structure, Direction, Last Structure Event, Trend Strength, Market Condition, Trading Bias, and Analysis Timeframe.
The indicator is designed to provide a clear 1H higher-timeframe market direction for traders analyzing lower timeframes such as 5M and 15M.
Features:
• 1H Higher-Timeframe Market Bias
• HH / HL / LH / LL Structure Detection
• BOS & CHOCH Detection
• Bullish / Bearish / Neutral Classification
• Trend Strength Assessment
• Trending / Ranging Market Detection
• BUY / SELL / NO TRADE Bias
• Clean Table-Only Dashboard
• No unnecessary chart markings
Note: This indicator is intended as a market-structure analysis tool and does not guarantee future price movement. Penunjuk

MAD Adaptive Trend Score [BackQuant]MAD Adaptive Trend Score
Overview
MAD Adaptive Trend Score is a trend oscillator built from a Median Absolute Deviation-based price filter and a multi-lookback relative-position score.
The indicator first calculates a rolling median and MAD from the selected source. Price deviation from the median is then clipped to a configurable MAD envelope, producing the MAD Adaptive Filter.
The current value of that filtered series is then compared with a range of its previous values. Each comparison contributes either +1 or -1 to a Trend Score.
The result is a bounded directional score that can be used with separate bullish and bearish thresholds to create a persistent trend state.
The script includes:
Exact rolling median and MAD calculations.
MAD-based clipping of source movement.
Configurable multi-lookback Trend Score.
Separate long and short regime thresholds.
Optional filter overlay on the main chart.
Trend candle colouring and signals.
Reference levels and alerts.
MAD Adaptive Filter
The first stage calculates the rolling median of the selected Source over the MAD Length.
It then calculates Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
Raw MAD is multiplied by 1.4826:
Scaled MAD = Raw MAD × 1.4826
with a minimum value based on the instrument's minimum tick.
The 1.4826 factor is commonly used to scale MAD to approximately the same scale as standard deviation when the underlying distribution is normal.
The indicator then measures:
Deviation = Source - Rolling Median
and defines the maximum permitted deviation as:
Maximum Deviation = Scaled MAD × MAD Multiplier
The source deviation is clipped to this range before being added back to the median.
Conceptually:
If Source remains inside the MAD envelope, the filter follows Source.
If Source moves above the envelope, the filter is limited to the upper MAD boundary.
If Source moves below the envelope, the filter is limited to the lower MAD boundary.
The MAD Adaptive Filter is therefore not a conventional moving average. It is a source series whose distance from its rolling median is limited by the current MAD-derived envelope.
MAD Multiplier
MAD Multiplier controls the permitted distance between the filtered value and the rolling median.
Lower values:
Create a tighter envelope.
Clip more of the source movement.
Keep the filter closer to the median.
Higher values:
Create a wider envelope.
Allow more source movement through unchanged.
Make the filter follow price more closely.
Trend Score
The second stage scores the current MAD Filter against several previous values of the same filtered series.
For every lookback between Score Lookback Start and End:
+1 if the current MAD Filter is above the historical MAD Filter.
-1 otherwise.
The final Trend Score is the sum of all comparisons.
If N historical values are being compared, the theoretical score range is:
-N to +N
For the default 1-to-45 range, 45 comparisons are made, so the score can range from -45 to +45.
What the score represents
A high positive score means the current MAD-filtered value is above most of the historical filtered values being compared.
A strongly negative score means it is above very few of them.
For example, with 45 comparisons:
A score near +45 means the current filtered value is above nearly the entire comparison range.
A score near 0 means the comparisons are more evenly divided.
A score near -45 means the current filtered value is below, or equal to, nearly all of them.
The score is therefore best understood as a relative position / trend score of the filtered series.
It is not a return forecast or probability of future direction.
Why use several lookbacks?
Comparing the current filter with only one previous value would effectively reduce the calculation to short-term slope.
Using many previous values instead measures where the current filtered level sits relative to a broader section of its history.
A steadily rising filtered series will generally move toward higher positive scores because the current value becomes greater than an increasing number of historical values.
During sustained weakness, the opposite occurs.
Score Lookback Start and End
These settings define which historical MAD Filter values participate in the score.
For example:
Start = 1
End = 45
compares the current filter against each filtered value from 1 through 45 bars ago.
A shorter range:
Responds more quickly to recent changes.
Creates a smaller score range.
A longer range:
Includes more historical comparisons.
Produces a broader measure of relative trend position.
Usually changes more gradually.
Because the score range depends on the number of comparisons, threshold settings should be chosen with the selected score range in mind.
Trend State
The script converts the Trend Score into a persistent bullish or bearish signal state.
The bullish and bearish rules are deliberately separate.
Bullish condition
The signal becomes bullish when:
Trend Score > Long Threshold
Once bullish, the state remains bullish until a valid bearish condition occurs.
Bearish condition
The signal becomes bearish when the score crosses downward through the Short Threshold:
Previous Score >= Short Threshold
Current Score < Short Threshold
The bearish condition therefore requires an actual downward threshold crossing rather than simply remaining below the level.
Why use separate thresholds?
Using different bullish and bearish levels introduces persistence into the regime.
The signal does not need to reverse whenever the score crosses zero.
For example, with:
Long Threshold = 40
Short Threshold = -6
the score must reach a strongly positive state before the model turns bullish, but the bullish state can persist through a substantial amount of score deterioration before a bearish transition occurs.
This creates a form of threshold hysteresis and reduces rapid switching around a single center level.
The thresholds are fully configurable and do not need to be symmetrical.
Initial state
The signal begins neutral.
A bullish state can be established once the Long Threshold condition is satisfied.
A bearish state requires a valid downward crossing of the Short Threshold.
Signal markers are shown only when an established bullish state changes to bearish or an established bearish state changes to bullish.
The initial transition from neutral does not produce a long/short marker.
Reference Lines
The optional dashed reference lines display the Long and Short Thresholds directly in the oscillator pane.
These levels correspond to the actual regime settings and can be useful when visually tracking how the Trend Score approaches a possible state change.
MAD Filter Overlay
The MAD Adaptive Filter can optionally be plotted directly on the main price chart.
This makes it possible to compare:
Raw price.
The rolling-median/MAD envelope response.
The active trend colour.
The overlay uses the same bullish or bearish state colour as the oscillator.
Trend Candles
Optional chart candles are coloured from the stored trend state:
Bullish state = Long Color.
Bearish state = Short Color.
The colour represents the indicator's trend regime rather than the direction of each individual candle.
Background Colour
An optional transparent background can also display the current trend regime on the main chart.
This is purely visual and does not alter the calculation.
How to interpret it
Strong positive score
The current MAD Filter is above most values in the selected historical comparison range.
This typically accompanies a relatively strong upward position in the filtered trend.
Falling score while still bullish
The filtered trend is losing relative strength, but the Short Threshold has not yet been crossed.
The persistent state therefore remains bullish.
Short Threshold crossing
The score has deteriorated far enough to cross below the selected bearish boundary, changing the stored state to bearish.
Rising score while bearish
The score can recover substantially while the trend remains bearish.
A new bullish state is not established until the score exceeds the Long Threshold.
How to use the indicator
The indicator can be used as:
A directional trend filter.
A persistent bullish/bearish regime indicator.
A way to measure the relative position of a MAD-filtered price series.
A confirmation tool alongside other price or market-structure analysis.
The score itself can also provide additional context beyond the binary trend colour.
For example, a bullish regime with a score near its maximum is different from a bullish regime whose score has already fallen substantially toward the bearish threshold.
Input Guide
MAD Length
Controls the rolling sample used to calculate the median and Median Absolute Deviation.
Shorter values adapt more quickly.
Longer values produce a broader statistical reference window.
MAD Multiplier
Controls how far the filtered source may move away from its rolling median.
Lower values produce stronger clipping.
Higher values allow the filter to follow Source more closely.
Score Lookback Start / End
Defines the historical MAD Filter values used in the Trend Score comparisons.
Long Threshold
Score level that must be exceeded to establish a bullish state.
Short Threshold
Level that must be crossed downward to establish a bearish state.
Data Window
The script exposes:
Rolling Median.
Raw MAD.
Scaled MAD.
These values can help show how the underlying MAD filter is being constructed.
Limitations
The indicator is reactive rather than predictive.
The score measures the current filtered value relative to historical filtered values; it does not estimate future returns.
Threshold selection can materially change signal frequency and persistence.
A very tight MAD Multiplier can suppress meaningful movement along with noise.
A very wide MAD Multiplier makes the filter increasingly similar to the original Source.
Long score ranges can improve persistence but also delay changes in regime.
Strong trends can keep the score near an extreme for extended periods.
Alerts
The script includes:
MAD Trend Score Long: stored signal changes from bearish to bullish.
MAD Trend Score Short: stored signal changes from bullish to bearish.
Summary
MAD Adaptive Trend Score combines two simple ideas.
First, the selected Source is constrained around a rolling median using Median Absolute Deviation. Source movement inside the MAD envelope passes through normally, while movement beyond the envelope is clipped to the current boundary.
Second, the current filtered value is compared with a configurable range of its own historical values.
Those comparisons are summed into a Trend Score, with positive values indicating that the current filtered level is above more of the historical comparison range and negative values indicating the opposite.
Separate Long and Short Thresholds then convert the score into a persistent bullish or bearish regime.
The result is a MAD-based filtered series and relative-position trend score for experimenting with trend persistence and threshold behaviour. Penunjuk
