BT Trend QualityBT Trend Quality
Four market measurements in one compact panel: EMA/DEMA separation, relative volume, directional movement spread, and distance above the previous lookback high.
This free indicator keeps each measurement visible separately. It does not generate buy/sell signals, price targets, position sizes, or a combined probability score.
What It Measures
EMA/DEMA separation: Percentage distance between EMA9 and DEMA200. Default threshold: ≥0.30%.
Relative volume: Current bar volume divided by its 20-bar simple average, including the current bar. Default threshold: >1.10×.
DI spread: DI+ minus DI−, using a 14-period directional movement calculation. Default threshold: ≥10.
Prior-high distance: Closing price relative to the highest high of the preceding 10 bars. The current bar is excluded from the reference high. Default threshold: >0.10%.
ADX is displayed separately for context. All lengths and thresholds are adjustable. The defaults are reference settings, not universally optimal parameters.
Display and Alerts
Four historical rows show whether each measurement meets its threshold. The table displays the latest confirmed values. Missing data and insufficient history are marked N/A, rather than treated as a failed condition.
Calculations use the chart’s timeframe. Ten bars represent ten days only on a daily chart. With default settings, the indicator requires 400 preceding bars before displaying its measurements.
Each measurement offers a separate alert for threshold-state changes in either direction, evaluated at bar close. During an unfinished candle, the table retains the previous confirmed values. Users must create their alerts through TradingView.
An alert describes a change in a measurement, not an instruction to trade. The thresholds focus on upward expansion and positive directional separation; a value below a threshold is not a short signal.
Purpose and Limitations
These are established technical-analysis calculations, not newly invented indicators. This implementation brings them together while preserving their individual values, making it easier to compare trend structure, participation, and directional movement without an opaque combined score.
No claim is made that this combination is unique or outperforms other tools. Historical research on a separate strategy does not establish this indicator’s future performance.
Data-provider differences, price adjustments, historical revisions, and missing volume can affect readings. Use standard price charts when comparing calculations.
This is an analytical tool, not personalized investment advice. It does not predict future prices or guarantee trading outcomes. Gösterge

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 Gösterge

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.
Gösterge

Market Mood | Session RangeMarket Mood | Session Range helps traders understand how much a market has moved during each trading session, how that movement compares with previous sessions, and whether today’s range is expanding faster or slower than usual.
The indicator combines session boxes with a compact dashboard covering Frankfurt, London, New York, Sydney, and Tokyo. Each session is calculated independently, including when sessions overlap.
The dashboard presents four core readings:
• MOVE SO FAR — The distance between the highest and lowest prices recorded since the session opened. This measures the session’s range so far, rather than the net change from its opening price or the total distance traveled by price.
• AVG. MOVE — The average range of previous completed sessions of the same type. London is compared with previous London sessions, New York with previous New York sessions, and so on. The default averaging period is 20 completed sessions and can be adjusted.
• AVG. USED — The current session’s movement divided by its historical average, expressed as a percentage. For example, a current movement of 15 pips against an average of 30 pips produces a reading of 50%. Readings above 100% mean the session has exceeded its average range.
• TODAY’S ACTIVITY — A comparison with historical movement at the same elapsed time within the session. This adds time context to the current range.
For example, suppose London has moved 20 pips after its first hour, while previous London sessions averaged 12 pips at that same point. Today’s movement is approximately 167% of the usual first-hour movement.
The activity column classifies this comparison as:
• Slower — Below 80% of the usual movement at that time.
• Usual — Between 80% and 120%, inclusive.
• Faster — Above 120% of the usual movement at that time.
These thresholds are configurable. They describe relative range expansion; they are not probabilities, trend signals, or measures of trading profitability.
Activity assessment starts after 15 minutes by default and updates on confirmed candle closes. “Starting” appears during the initial waiting period. “Learning” appears when there are not enough historical observations at the matching elapsed time. The comparison requires five completed sessions, or the selected averaging period if it is shorter than five. Hovering over an activity value reveals the supporting comparison.
Movement units adapt to the instrument:
• Forex pairs use pips, with an optional custom pip-size setting.
• Non-forex instruments, including metals, indices, energy markets, and cryptocurrencies, use percentages.
For non-forex instruments, session movement is calculated as:
Session Movement (%) = (Session High − Session Low) ÷ Session Opening Price × 100
Each historical session is measured against its own opening price before the percentage average is calculated. A 0.50% movement against a historical average of 1.00% therefore represents 50% of the average used.
Session schedules are configurable in each city’s local time. Location-based timezones automatically account for daylight-saving changes where applicable. The clock display timezone can be set separately.
Display settings include session colors, boxes, opening lines, historical drawings, text size, and dashboard position. The default dashboard shows active sessions. Detailed view also includes closed sessions and their available averages. Hiding a session’s chart drawings does not disable its calculations.
Optional alerts notify users when a session reaches 80%, 100%, or 120% of its average range. Each enabled threshold triggers once per session, on a confirmed candle close. If several thresholds are reached on the same candle, they can appear together in the alert.
The indicator uses completed sessions for historical averages and excludes incomplete sessions from those averages. The current session’s reference average remains fixed throughout that session. Available chart history determines how many past sessions can be included.
Use standard time-based candles from 1 to 60 minutes, with candle boundaries aligned to the configured session times. Missing bars or misaligned boundaries can cause a session to be marked as partial. The optional live-update mode allows movement readings to change during the forming candle; activity assessments and alerts remain close-confirmed.
Market Mood | Session Range provides context for session movement. An average is not a maximum: exceeding 100% does not imply that price must stop or reverse. Faster activity also does not indicate whether price will rise or fall.
Gösterge

Auto Range Detector [QuantAlgo]🟢 Overview
The Auto Range Detector is a structural analysis tool built for traders who work around consolidation. It automatically scans every bar across multiple window sizes, tests each candidate against a set of independent structure filters, and draws a box where price rotated between two boundaries and stayed contained by them. Every stage is volatility normalized against the symbol's own history, so one configuration behaves consistently on a five minute crypto chart and a daily equity chart alike. Whether you fade the edges, trade the resolution, or simply want the ranges on your chart drawn the way you would draw them by hand, the indicator turns raw price into confirmed structures, marked breakouts, and a definition of "range" that you have complete control over on any asset and any interval.
🟢 How It Works
The indicator tests up to three window sizes on every bar: the base scan length, double it, and triple it. Each window places two boundaries using the method you choose, measures the band height, and ranks that height against its own history on the symbol and interval, so the volatility gate reads as a percentile of what the market normally produces. The window then has to pass four independent structure tests: enough midline crossings per bar to establish two sided rotation, enough bars reaching each boundary, a regression slope flat enough to show a stable mean, and enough closes held between the boundaries. The longest window that clears every test defines the range.
Once a structure qualifies, the left edge walks backwards through earlier history for as long as price stayed inside the band, and lands only on a bar held within the boundaries wick and all, so a box begins on a candle that belonged to the structure. The range stays provisional until it has spanned a minimum number of bars, and a provisional structure that breaks is cleared without a marker, leaving only structures that held on the chart. A break is confirmed on a close or a wick beyond the boundary, with an ATR buffer that filters marginal clears.
🟢 Key Features
▶ Multi-Scale Detection
The scan tests up to three window sizes on every bar: the base length, double it, and triple it, with the longest qualifying window defining the range. Boundary Basis then decides where the two edges sit and how range height is measured. Percentile band trims outlying wicks so no single spike defines the box, with the percentile itself adjustable. Absolute extremes places the edges on the extreme wicks and measures peak to trough. Body extremes works from opens and closes only, which suits instruments with erratic wicks such as thin crypto pairs. Signal Timing governs whether everything waits for the bar to close or evaluates the forming bar, and ATR Length sets the volatility unit every distance in the script is expressed in.
▶ Structure Filters
Five settings decide whether a candidate window is a range. Compression Percentile is the volatility gate, ranking band height against the symbol's own history so the threshold means the same thing on any instrument. Min Rotation Rate requires midline crossings per bar, which is what separates a genuine range from a reversal that happens to span the same distance. Min Boundary Touches requires both sides to be visited more than once, so a single spike high paired with a single spike low does not qualify, with Touch Definition and Touch Tolerance controlling what registers as a visit. Max Drift limits how far the mean of the window may tilt. Min Containment requires a share of closes to sit between the boundaries, rejecting structures where price only passed through the zone. Every test has its own control, so the definition can be set to tightly held rectangles or to looser rotational structures.
▶ Range Behavior
Range Anchoring decides where the left edge lands once a structure qualifies. Scan window only draws the box across the window the filters evaluated. Extend to containment walks the edge backwards through earlier bars that stayed inside the band, up to an adjustable ceiling, so the box covers the full consolidation. Minimum Range Bars holds a new structure provisional until it has run long enough, and a provisional structure that breaks is cleared without a marker. Absorb Overshoot lets a boundary take in a marginal wick rather than closing the box on it. Break Confirmation and Breakout Buffer decide what ends the range, on a close or a wick, and how far past the boundary price must clear. Cooldown Bars and Max Range Age govern what happens after a range resolves.
▶ Deviation Merging
Optional handling for a break that closes back inside the range. With this enabled, the broken structure is held open briefly and a close back between the boundaries revives it: the box resumes from its original left edge, the breakout marker is withdrawn, and the excursion is marked at its extreme, leaving one continuous structure with a failed break inside it rather than a breakout followed by a fresh box over the same price. Left disabled, every break is final.
▶ Range Visualization
Each structure is drawn as a gradient shaded box that fades from the boundaries toward equilibrium, with an optional midpoint line and quartile levels marking where a rotation is already extended. A live tag reports whether the structure is forming or confirmed, how many bars it has held, and its height as a percentage of price. Breakout markers print below the bar on an upside break and above it on a downside break.
▶ Built-in Alerts
Ready-made alert conditions fire when a new range is detected, when one breaks to the upside or downside, on any range break, and when a failed break returns price inside the structure.
▶ Color Presets
Six presets (Classic, Aqua, Cosmic, Cyber, Neon, Custom) drive the bullish and bearish pair, with the range color held separate so a live structure always reads as neutral against whichever pair is active. Custom mode exposes individual color pickers. Every border, line, fill, and label is contrast corrected against the chart background automatically, so a color close to your background lifts far enough to read while shading stays light enough to keep price action visible.
Gösterge

Composite HVN/LVN NodesComposite HVN/LVN Nodes
Most volume profile tools show one session at a time. This one accumulates high and low volume nodes across many sessions into a single map, so the prices that keep reappearing stand out from the ones that showed up once.
Each session is profiled separately. Its nodes are extracted and folded into a running composite where repeat sightings reinforce each other, unreinforced levels decay away, and levels price has torn through get demoted. Zones are shaded by relative strength — the darkest bands are the strongest currently on the map.
HOW IT WORKS
Detection finds a run of contiguous rows clearing the threshold, then anchors the zone on that run's actual volume peak. Anchoring on the first qualifying row instead biases every zone toward the lower peak of a multi-peak shelf.
Merging takes the union of two overlapping bands rather than the average of their centres. Averaging places the result in the valley between two shelves, covering neither.
Decay runs at every session close. A node that stops being reinforced fades and is eventually dropped.
Invalidation cuts a zone's weight hard when a single bar rips clean through it.
Conflict resolution removes one of any overlapping HVN/LVN pair. A price cannot be both a shelf and a gap.
Profiles are built from 1-minute intrabars rather than chart bars, so the map is the same on 1m as on 1h. Without this, coarse bars smear volume across rows they only passed through.
DEFAULTS ARE TUNED FOR NQ
Most thresholds are percentages of session range or session volume, so they travel between instruments reasonably well. The session times and the LVN threshold do not.
Sessions: Globex (1800-0930) and New York (0930-1700). For equities, use a single 0930-1600 and disable the other. Sessions must not overlap.
Resolution: 1 minute. The most important setting for consistency. The "Intrabars/bar" readout in the status line shows whether it is active; 0 means it has fallen back to chart bars, which happens past roughly 100k intrabars of history.
Detection: 200 rows, sensitivity 6, HVN 70%, LVN 10%. Roughly one row per point on a typical NQ session range. The thresholds are asymmetric on purpose: 70% is permissive enough to catch shoulders as well as the POC, while 10% is strict because on a liquid instrument nearly everything trades a little and a loose setting produces gaps that aren't really gaps. On thinner instruments 10% may find nothing.
Node width: max 12% of range. Mainly restrains LVNs. At a 10% threshold a genuinely dead pocket can run a long way, and without a ceiling one gap swallows half the range.
Volume weighting — each session's contribution is scaled by how active it was against a rolling 20-session average, capped at 3x either way so one event day cannot dominate. Sessions below 35% of average volume are skipped entirely, which filters holidays and half days on NQ. Set to 0 to disable.
Composite: half-life 50 sessions. Note that is sessions, not days: with both enabled that is two per weekday, so about five trading weeks. Halve it for a faster-moving map.
Conflicts: stronger wins. The lighter of an overlapping pair is removed, ties going to the HVN, since volume that demonstrably traded is harder evidence than volume that didn't. Zones that merely touch are left alone — an HVN against an LVN is a real structure, the edge of a shelf against a gap.
Archive: off. When on, invalidated nodes freeze in place with a dashed border instead of disappearing, so you can see where a level sat and how long it lasted. Useful for review, cluttered live.
ADAPTING IT
Start with the session times; everything depends on those being right. Then check LVN detection, which assumes NQ-like liquidity. If the map is too sparse or too crowded, adjust "Drop below weight" and "Max nodes kept".
NOTES
Nodes are computed at session close and are not recalculated afterwards, but their appearance changes as weights decay and merge — shading is relative to the strongest node currently on the map, not an absolute scale.
TradingView caps drawing objects at 500 boxes. Active and archived nodes share that budget.
This is an analysis tool, not a signal generator. It marks prices where volume repeatedly concentrated or repeatedly didn't. What that means for any given trade is up to you.
Gösterge

XAUUSD FVG Supertrend SignalsXAUUSD FVG Supertrend Signals
XAUUSD FVG Supertrend Signals is a clean technical analysis indicator designed for Gold (XAUUSD), combining Supertrend, EMA 200, and Fair Value Gap (FVG) concepts to identify potential BUY and SELL opportunities.
How It Works
The indicator looks for alignment between three key market concepts:
Supertrend — identifies the current market direction and helps filter bullish and bearish conditions.
EMA 200 — provides a broader trend filter. BUY setups are favored above the EMA, while SELL setups are favored below it.
Fair Value Gap (FVG) — identifies areas of potential imbalance that may act as important reaction zones.
When the trend, price position, and FVG conditions align, the indicator generates a visual BUY or SELL signal.
Target & Stop Levels
The indicator also displays projected target and stop levels for each signal.
Default settings:
Target: $40
Stop: $15
Risk/Reward: approximately 2.67:1
These values are adjustable and should be adapted to the trader's preferred risk management and market conditions.
Best Use
The indicator is designed primarily for XAUUSD and can be used on multiple timeframes.
It is recommended to combine the signals with:
Market structure
Support and resistance
Session timing
Higher-timeframe analysis
Proper risk management
The indicator should be treated as a technical analysis and decision-support tool, not as a guarantee of future market movement.
Important Disclaimer
No indicator can predict the market with certainty. BUY and SELL signals are based on historical price calculations and technical conditions and may produce false signals, especially during sideways markets, high-impact news, and unusual volatility.
Always perform your own analysis and use appropriate risk management. Past performance does not guarantee future results.
Key Features
✓ Supertrend trend detection
✓ EMA 200 trend filter
✓ Bullish & bearish FVG detection
✓ BUY / SELL signals
✓ Projected targets
✓ Stop levels
✓ TradingView alerts
✓ Designed for XAUUSD
✓ Fully adjustable settings
✓ No automatic trade execution Gösterge

The Power of 3 [Multi-RSI]The Power Of Three
A multi-length RSI oscillator that puts three (optionally four) RSI readings on one pane, marks divergences on each of them, and flags the moments when the readings agree.
---
## What it plots
**Three RSI lines.** Defaults are 5, 14 and 21 — fast, standard and slow. Each has its own length, colour and visibility toggle, and all three share a single source input.
**Shaded overbought / oversold zones.** The region above the OB level and below the OS level is filled at an adjustable opacity, with solid boundary lines at the levels themselves and a dotted midline at 50. Levels, colours, and the opacity of the fill, the outlines and the midline are all separately adjustable.
**Divergence lines.** Regular and hidden, bullish and bearish, detected independently on each RSI and drawn at the thinnest width Pine allows. Each RSI has its own detection toggle, so you can narrow it to the one length that reads cleanest on your instrument. Pivot lookback and the minimum and maximum bar range between pivots are configurable.
**Confluence dots.** A dot near the top of the pane when every enabled RSI is simultaneously overbought, and near the bottom when all are oversold. By default a dot appears only on the first bar of an alignment rather than on every bar it persists.
**Optional fourth RSI.** Off by default. Length 34, with its own source and its own OB/OS thresholds at 60/40, since a slower RSI rarely reaches 70 or 30. It can act as a required confirmation leg for the confluence dots, or simply plot as a reference line without gating anything.
---
## Alerts
Six conditions are exposed: triple RSI overbought, triple RSI oversold, and regular and hidden divergence in both directions.
---
## Notes and limitations
Divergence lines are pivot-based, so they confirm only after the right-hand lookback has elapsed — five bars by default. They cannot appear on the forming candle. Reducing the right lookback speeds up confirmation at the cost of more false pivots.
Running divergence detection on all four RSIs at once produces a lot of lines on lower timeframes. Starting with everything enabled and then disabling what adds noise is usually the faster path to a clean chart.
The fourth RSI uses looser thresholds by design. If you set it to share the 70/30 levels while leaving it at a long length, the confluence dots will rarely or never fire.
---
## Disclaimer
This is an analysis tool, not a strategy. It places no orders and performs no backtest. Nothing here is financial advice. Gösterge

Sequence Snap | RSI-Confirmed Reversal ScalperExplanation
This strategy hunts for a specific price-action pattern: a candle that closes against the prevailing short-term move, followed by a run of consecutive candles pushing hard in the opposite direction — each one holding above (or below) the reversal candle's extreme. Once that shape completes, RSI is checked to confirm real momentum is behind the move rather than just noise. Entries use a single fixed stop (placed at the reversal candle's low/high) and a single fixed reward target defined as a multiple of that risk — no trailing, no dynamic exits, so every trade is comparably sized for easy backtesting analysis.
Features
Adjustable "run length" (2–5 candles) to control how strict the pattern is
A wobble-allowance setting so one weak candle in the run doesn't invalidate the whole setup
Optional RSI confirmation filter with separate floor/ceiling thresholds for longs and shorts
Long/short trades can be toggled independently
Fixed R-multiple take-profit (0.5R–2R) paired with a structural stop-loss
Dark dashboard showing live RSI, position status, and current settings
Background flash on the exact bar a signal fires, plus clean entry arrows
Tips
Test with the RSI filter both on and off — it may cut too many valid patterns depending on the instrument, so compare win rate/profit factor both ways before deciding.
Start with Wobble Allowance near 0 to match the strictest version of the pattern, then loosen gradually if it's not finding enough setups.
Warnings
This is a price-action pattern strategy, not a trend or oscillator strategy — its win rate and trade frequency will look very different from momentum or mean-reversion scripts, so don't compare metrics directly across strategy types.
Past backtest performance does not guarantee future results. Always forward-test on a paper account before risking real capital.
Fixed R-multiple exits mean the strategy needs a minimum win rate to be profitable after commission and slippage — check that math against your actual backtest numbers.
Strateji

SBSniper - HTF PSPHTF PSP
Six higher timeframes drawn as a compact candle column beside price, with correlated-asset
disagreement marked across all of them. Correlated markets normally move together. When one takes
out a high or low and the other refuses to follow, or one closes up while the other closes down,
that disagreement is information. This finds it on six timeframes at once so you are not flipping
charts to check.
Built for index traders watching NQ, ES and YM against each other, but it works on any correlated
set — metals, energies, or symbols you choose yourself.
CREDIT
Built on "ICT HTF Candles (fadi)" by @fadizeidan, published open-source under the
Mozilla Public License 2.0:
The HTF candle column, its swing and equilibrium lines, the fair value gap and volume imbalance
boxes, the trace lines, the info table, and the SMT divergence feature itself all come from that
script. Full credit for those to the original author. This publication is open-source under the
same licence.
WHAT IT MARKS
PSP — Precision Swing Point
An HTF candle that closes up while a correlated asset closes down, or the reverse. The candle takes
a coloured border and a halo, with a label naming which correlations disagreed and whether you are
on the strong (S) or weak (W) side. A still-forming candle is coloured differently, because a PSP
can vanish before the candle closes.
SMT divergence
One asset takes out a prior high or low, its partner fails to. Drawn as a line between the two
candles on the HTF column, and optionally across the real swing on your chart. It looks at every
pair of candles in a lookback window, not only the newest two, so a divergence anchored a few
candles back still shows. A divergence disappears once price takes the level it was built on — if
the line is still there, the level is still intact.
SMTF — divergence into a gap
An SMT where the diverging high or low landed inside a fair value gap that already existed. Price
reaching into an old imbalance at the same moment the correlation cracks. Prefixed "SMTF".
SSMT — sequential divergence
Divergence filtered by time. A cycle splits into four quarters, each quarter being one candle of the
timeframe below: the day into four 6H candles (Asia, London, NY AM, NY PM), the session into 90m,
the week into days, the month into weeks. A divergence between two CONSECUTIVE quarters is
sequential, prefixed "SSMT" — or "SSMTF" if it also delivered into a gap. Skip a quarter and it is
an ordinary divergence again, whatever the timeframe. These are never hidden by the decluttering
settings.
Strength Switch — off by default
Divergence filtered by the sweep instead of by time: which asset took the prior extreme, and which
failed to pair it. Tagged onto labels that are already on the chart rather than adding new marks.
"SS" for a single formation, "SS²" where a second confirms it.
NOTES
An analysis aid, not a trading system. It shows where correlated markets disagree. It does not
generate entries, exits, targets or alerts, and disagreement alone is not a reason to trade.
Readings on the currently forming HTF candle are live and can change until it closes — that is why
forming PSPs have their own colour.
Correlated data is requested with lookahead off. Gösterge

Footprint Delta Profile [SDT]A session volume profile built from TradingView's native footprint data. Every row is split into aggressive buys at the ask and sells at the bid, with a point of control and a value area.
Most delta profiles on the platform infer the side from candle direction: if a bar closes up, its whole volume counts as buying. That is an approximation, and it breaks exactly where it matters, on bars that reverse. This script takes the side from request.footprint(), where the aggressor is known per price row, so the split is measured rather than guessed.
HOW THE PROFILE IS BUILT
request.footprint() returns the volume rows of one bar at a time. Each confirmed bar is folded into a composite: every footprint row is assigned to a price bucket by its midpoint, and the bucket accumulates volume and delta. Buckets stay sorted, so the profile remains ordered as the window fills.
Aggressive volume per bucket is derived from bucket volume V and bucket delta D as sell = (V - D) / 2 and buy = (V + D) / 2. This is exact by the definition of delta.
The point of control is the heaviest bucket. The value area grows outward from it, repeatedly taking the heavier of the two neighbouring buckets until the requested share of total volume is enclosed.
The window resets on a period that is strictly larger than the chart timeframe. Auto uses the day on intraday charts, the month on daily charts, and no reset on weekly and above. A period that is not larger than the chart timeframe would reset on every bar, so it falls back to a bar count instead.
THREE INDEPENDENT DISPLAY SETTINGS
Data mode decides what the row length measures. Volume is the total traded at that price, coloured by delta sign. Delta is the size of the imbalance itself. Bid x Ask measures aggressive sells and buys separately.
Layout decides how the row is laid out. One-sided grows right from the axis. Two-sided sends one part left and the other right. The two combine freely: delta two-sided gives a multidirectional imbalance histogram, bid x ask two-sided gives the classic two-column profile, volume two-sided gives a symmetric butterfly.
Style decides how the row is drawn: filled blocks, a volume gradient, a single filled outline drawn as one polyline, or thin ticks.
A note on what to expect: under a shared wing scale, bid x ask looks nearly symmetric. That is a property of the data, not a drawing fault. Aggressive buying and selling at a given price are usually within a few percent of each other, so both wings are close to half the row volume. Switch the wing scale to independent to see the shape difference, or use the delta mode, where only the dominant side is drawn.
ROW RESOLUTION
ticks_per_row is declared as a simple int, so it cannot be computed from the bar range or the ATR at runtime. Auto scales it by chart timeframe, which keeps the row count sane but cannot account for the difference between instruments: four ticks is about one point on Nasdaq futures and a quarter of a five-minute range on Euro futures.
The script therefore measures the average bar range over the last fifty bars and shows, in the table, the tick count that would give the requested number of rows per bar on the current symbol. Set the input to that number. Where even the finest resolution cannot reach the target, as on Euro futures intraday, the readout says so instead of flagging an error.
The profile bucket height is a separate matter and is chosen automatically. On the first bar with data the script takes the footprint row height and an ATR-based estimate of the window range, then rounds the bucket up to the smallest multiple of the row height that keeps the profile under the row limit. Nothing to tune by hand, and the drawing limit cannot be exceeded.
ABSORPTION MARKERS
A circle appears when one third of a bar's range holds at least the configured share of that bar's volume while the delta in that third points against the direction of the bar. Aggression that meets size and fails to move price is the signature of a passive participant taking the other side. The circle sits below the bar when sellers were absorbed on an up bar, above it when buyers were absorbed on a down bar.
TABLE
Rows per bar shows the measured average, the tick setting in use, and the suggestion when it differs. Window shows the active reset period. Then the point of control, the value area bounds, the cumulative delta of the window and its total volume, and the number of profile rows currently held.
THEME
The palette follows the chart. Auto reads the background through chart.bg_color, computes its relative luminance and switches between a dark and a light variant of the chosen palette; text colour comes from chart.fg_color. Five palettes are included, plus a custom option.
NOTES AND LIMITS
Footprint data requires a TradingView plan that includes it, and is not available on every symbol. Without it the script draws nothing rather than substituting an estimate.
The forming bar is added to the profile only when it closes, so the profile lags the live bar by one bar. This keeps the composite free of double counting during real-time updates.
This is an observation tool. It produces no entries, exits or directional calls.
Built on FootprintKit, an open-source Pine library by the same author, which performs the row statistics and the composite profile. This script requests the footprint, feeds the profile and draws it.
Gösterge

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. Gösterge

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➖
Gösterge

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. Gösterge

Gecko ORB Small Range Breakout Strategy v1.4**ORB Small Range Breakout Strategy**
This strategy trades breakouts of the opening range, but only when that range is small or medium relative to price — the idea being that a tight, low-volatility opening range has more room left to run than one that has already made a large move.
**How it works**
1. **Opening Range (ORB):** The script builds a high/low range over a configurable start and end time (default 08:00–08:25, exchange-local time). This window is fully configurable, so the script works on any market/session — LSE, JSE, or otherwise — without modification.
2. **Classification:** Once the opening range closes, its size is measured as a percentage of the opening price and classified as SMALL, MEDIUM, or LARGE based on two adjustable thresholds. Only SMALL and MEDIUM ranges are considered tradeable; LARGE ranges are skipped for that session.
3. **Entry:** Within a configurable entry window after the opening range closes (default cutoff 11:00), a long is triggered on a close above the range high, and a short on a close below the range low — one trade per session, first breakout only.
4. **Stop/Target:** The stop is placed at the opposite side of the opening range. Take-profit can be set to a fixed R-multiple, a projection of the opening range's size, or disabled entirely (stop-only).
5. **Session close:** Optionally, any open position is force-closed at a configurable time of day.
**Inputs**
- Opening Range start/end time
- Entry cutoff time
- SMALL/LARGE classification thresholds (%)
- Take-profit mode (R-multiple, ORB projection, or none) and multiplier
- Optional end-of-session exit time
**Notes**
- The opening range and entry window are drawn on the chart (box + lines) each session so you can visually verify what the strategy is reacting to.
- This script does not use repainting logic — all decisions are based on confirmed price action within the defined windows.
- Backtest results shown in the Strategy Tester do not account for slippage or commissions unless configured in the strategy properties; please set these to match your broker before drawing conclusions from the equity curve.
- This script is provided for educational and informational purposes only. Past performance, whether real or simulated, is not indicative of future results. Nothing here constitutes financial advice — always test thoroughly and understand the logic before using any strategy with real capital. Strateji

Clock_Live and Replay AwareClock — Live / Replay Aware
A simple on-chart clock that always tells you the truth about what time it's showing — whether you're trading live or running Bar Replay.
Why this exists
Most clock indicators only show your real-world time, which becomes misleading (or useless) the moment you activate TradingView's Bar Replay feature — you end up staring at a clock that has nothing to do with the price action on screen. This indicator detects which mode you're in and adapts automatically.
Features
LIVE mode (green): Displays your actual real-time clock, synced to live incoming ticks.
REPLAY mode (orange): Displays the timestamp of the bar currently being replayed, so the clock always matches what you're watching, not your wall clock.
CHART mode (gray): Shown when you're simply scrolled through history with no live feed active.
Countdown timer: Shows time remaining until the next bar closes — exact in live mode, and estimated in replay mode using a rolling average of how long recent replayed bars have taken to form (adapts automatically if you change replay speed).
Configurable timezone, 12h/24h format, date display, table position, and colors.
How replay detection works
Pine Script has no official flag for "is Bar Replay active." This script uses a reliable heuristic instead: on a genuine live (still-forming) bar, its scheduled close time is always in the future relative to the current time. During replay, the bar being replayed is historical, so its close time has already passed. Comparing the two lets the script tell live and replay bars apart with no false positives in normal use.
Notes
The replay countdown is an estimate, not exact — replay speed isn't exposed to Pine Script, so it's inferred from recent bar timing and may lag by a bar or two after you change speeds.
Clock updates are tick-driven (a Pine Script constraint), so on very quiet symbols the seconds display may not tick with perfect real-time smoothness. Gösterge

ES Clean Major Market Structure - HH HL LH LLES Clean Major Market Structure – HH HL LH LL
This indicator is designed to provide a clean visual representation of market structure by identifying meaningful swing highs and swing lows while filtering out smaller price movements.
The script classifies confirmed swing points as:
HH – Higher High: A swing high above the previous swing high.
HL – Higher Low: A swing low above the previous swing low.
LH – Lower High: A swing high below the previous swing high.
LL – Lower Low: A swing low below the previous swing low.
The goal is to make it easier to identify developing bullish and bearish market structure without filling the chart with signals from every small price fluctuation.
Market Structure
The indicator maintains a directional structure bias:
Bullish Structure
Higher Highs (HH)
Higher Lows (HL)
Dashboard displays: BULLISH
Watch for continued HL → HH development
Bearish Structure
Lower Lows (LL)
Lower Highs (LH)
Dashboard displays: BEARISH
Watch for continued LH → LL development
The structure dashboard is intended as a quick visual reference and should not be interpreted as an automatic trade signal.
Swing Strength
Swing Strength determines how many bars on each side of a potential swing are required before that swing can be confirmed.
For example, with Swing Strength set to 2, a pivot requires two bars on the left and two bars on the right.
Because right-side bars are required, HH/HL/LH/LL labels are confirmed after the actual pivot occurs and are plotted back on the pivot bar. They should not be interpreted as signals that were available at the exact moment of the labeled candle.
Minimum Swing Move
Minimum Swing Move filters smaller changes between swing points.
Increasing this value produces fewer, more significant structure labels. Decreasing it makes the indicator more sensitive to smaller price movements.
For ES, the default settings are:
Swing Strength: 2
Minimum Swing Move: 1.50 points
These settings can be adjusted depending on timeframe and trading style.
Additional Chart References
The indicator also displays:
EMA 14 – Short-term price momentum reference
SMA 20 – Trend reference
Session Open – Daily/session opening level
50% Session Midpoint – Midpoint between the developing session high and session low
Intended Use
This indicator is designed primarily as a market-structure visualization tool, not an automated entry system.
One possible way to interpret the structure is:
Bullish: HH → HL → HH
Bearish: LL → LH → LL
Traders may use the structure labels together with their own price-action, support/resistance, liquidity, risk-management, and higher-timeframe analysis.
The indicator can be used on different intraday timeframes. Lower timeframes generally produce more structure changes, while higher timeframes naturally filter more market noise.
Disclaimer: This script is provided for educational and informational purposes only. It does not provide financial advice or guarantee future market performance. Users are responsible for their own trading decisions and risk management. Gösterge

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. Gösterge

Gösterge

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. Gösterge

FrenchFinance_Funding v0.1Shows the perpetual funding rate of the charted coin, averaged across Binance, Bybit and OKX USDT perpetuals, as coloured columns. It is a display tool: it tells you who is paying to hold a position and how unusual that is. It gives no buy or sell signal.
HOW IT WORKS
• The coin is detected from the chart's base currency (BTC, ETH…). The funding rate of its USDT perpetual is requested on each selected venue through TradingView's crypto derivatives data (the same "Funding Rate" metric as TradingView's built-in indicators) and averaged with equal weights; venues without that perpetual are skipped. On a stock, index or forex chart nothing is shown, unless you set a coin manually.
• Column height: z-score of the funding over the last 100 bars (default), or the raw funding in %.
• Colour: green when longs pay, red when shorts pay. The further the value is from its recent norm, the brighter the colour.
• Label on the last bar: current funding in %, or "Funding not available on this pair".
SETTINGS
• Extremes: z-score threshold (default 1.5 over 100 bars) or absolute thresholds in %.
• Venues can be switched on and off. Bar height, clipping, data scale and colours are adjustable.
ALERTS
Two alerts: funding extremely positive (longs pay) and funding extremely negative (shorts pay). They report a state, not a trade.
NOTES
• The last bar shows the predicted funding, which keeps updating until settlement; closed bars do not change.
• Built with the open-source TradingView "Request" library (cryptoDerivativeMetric). Funding is information about positioning, not a forecast. Gösterge

OSOK Opening TimesOSOK Opening Times marks the opening times of active trading periods with vertical lines. It automatically adjusts the periods shown to match your chart timeframe, using solid lines for the larger period and dotted lines for the smaller active period.
Each boundary pair marks the current period's opening and the next period's opening . This creates a clear time reference for the active day, week, month or quarter.
Timeframe visibility
The breakdown below shows the default line styles when all visibility settings are enabled.
Intraday below 1D, including 15m, 1H and 4H
Solid: current week opening to next week opening.
Dotted: active day opening to next day opening.
Daily - 1D
Solid: current month opening to next month opening.
Dotted: active week opening to next week opening.
Weekly - 1W
Solid: current quarter opening to next quarter opening.
Dotted: active month opening to next month opening.
Monthly - 1M
Solid: none.
Dotted: current quarter opening to next quarter opening.
Other intervals above 1D, such as 2D, 2W and 3M
No lines are displayed.
A quarter is a three-month period. Quarterly boundaries appear on the 1W and 1M charts; the 3M chart itself displays no lines.
Active periods and shared boundaries
Only the active periods are displayed. As new periods begin, their boundaries replace the previous markers. On intraday charts, daily dotted lines bracket only the active daily candle.
When two displayed boundaries coincide, the larger period's line takes precedence. The first daily candle of the week uses the weekly opening line as its starting boundary, avoiding a duplicate daily line.
Appearance and customization
Solid lines: black at 30% opacity by default.
Dotted lines: black at 100% opacity by default.
Line width: 1 by default.
Visibility, color, opacity, style and width can be adjusted in the indicator's settings. Separate style settings are available for the different chart contexts.
Opening times and chart support
The indicator follows the symbol's TradingView candle sessions. Changing the chart's display timezone does not redefine those openings.
Upcoming boundaries use projected opening times. The active periods are determined by the latest chart bar, including when using Bar Replay.
The indicator supports standard time-based charts and Heikin Ashi. Tick, Renko, Range, Kagi, Line Break and Point & Figure charts are excluded.
Gösterge

ORB 15 Break + Retest ConfirmationThis indicator is designed for use on a 5-minute chart and identifies a specific Opening Range Breakout setup using the first 15 minutes of the regular trading session.
It automatically calculates the ORB 15 High (15H) and ORB 15 Low (15L) from the 9:30 AM to 9:45 AM New York session. Once those levels are established, the script waits for a valid breakout.
A bullish setup begins only when a completed 5-minute candle closes above ORB 15H. After the breakout, the indicator waits for price to return and retest the 15H level. If price touches or slightly penetrates the level and the 5-minute candle closes back above it, the script generates a LONG confirmation.
A bearish setup works the same way in reverse. A completed 5-minute candle must first close below ORB 15L. The script then waits for price to retest the 15L level from below. If price touches or slightly crosses the level and the candle closes back below it, the script generates a SHORT confirmation.
The script uses a sequential state-based approach, so a retest signal cannot occur unless a valid breakout happened first. Wick-only breakouts are ignored, and signals are evaluated only on completed 5-minute candles.
The indicator also includes a configurable retest tolerance and a maximum number of bars allowed for the retest to occur. If the breakout fails or the retest does not happen within the defined window, the setup is reset.
This tool is intended to help identify structured breakout → retest → confirmation setups around the 15-minute opening range.
Disclaimer: This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. Signals may be inaccurate, delayed, or fail under certain market conditions. Always perform your own analysis, use appropriate risk management, and trade at your own risk. The author is not responsible for any losses resulting from the use of this script. Gösterge
