مؤشر

Sweep-Reclaim Dashboard-Entry-Alert Sweep-Reclaim Dashboard tracks four key intraday levels — prior-day high (PDH),
prior-day low (PDL), overnight high (ONH), and overnight low (ONL) — and flags
only the specific failed-breakout pattern this script is built around: price
sweeps through one of these levels and then reclaims it (closes back on the
original side) within a limited number of bars, without accepting beyond it.
WHAT IT DOES
Pre-market: builds PDH/PDL from the regular session and ONH/ONL from the
overnight session, checks whether any two levels sit too close together to be
treated as separate zones ("clustered"), and estimates a stop distance from the
previous day's ATR.
Live: watches each active level for a sweep, then runs every reclaim through
five hard rules before calling it valid:
1. Closes beyond the level did not exceed the configured maximum (more than
that is acceptance, not a sweep, and the setup is dead).
2. Price reclaimed the level within the configured max bar count.
3. Sweep depth fell between a configurable minimum (filters out noise/brushes)
and maximum (filters out sweeps that are actually breakouts).
4. The reclaim bar's close sits deep enough into its own range (a
configurable top/bottom fraction) to show real rejection, not a weak wick.
5. Candle color matches the trade direction, if that filter is enabled.
Valid signals also have to fall inside one of two configurable trading windows
and clear a minimum reward:risk versus the nearest opposing level (which is
used as the target). Only then does the script plot a signal label with entry,
stop, target, and R-multiple, and optionally fire an alert.
DASHBOARD
Toggle between two dashboard modes:
- Inputs only: shows the raw levels, previous-day ATR, the ATR-based stop
estimate, current price, and whether price is inside the overnight range —
deliberately does NOT compute direction or R:R for you, if you want to keep
doing that step by hand.
- Full table: computes direction, target, distance, expected R:R, and a
watch/skip verdict for every active level in real time, plus a running list
of any level currently mid-sweep.
A "Study mode" hides close-counts and rule verdicts so you can practice reading
the setups yourself before letting the script confirm them. A "Debug row" shows
the script's raw internal session/level state, useful for verifying it agrees
with any separate PDH/PDL/ONH/ONL reference indicator on your chart.
VISUAL RISK BOXES
Every valid signal draws an entry line, a stop-loss line, and one or two
target lines (T1 at 2R, T2 at the nearest non-swept opposing level), plus
shaded green/red zones showing the profit and loss areas at a glance. Lines
and zones auto-extend to the right while the trade is still open, and each
line/label turns green with a checkmark when its target is hit, or red with
an X when the stop is hit — so you can see how a signal actually played out
without leaving the chart. Only the most recent signal's box is shown at a
time. Box length, colors, and fills are all configurable.
ALERTS
One configurable pre-market "plan" alert per day listing each active level,
direction, target, and estimated R from the ATR-based stop estimate — and one
alert per valid live signal, if enabled.
NOTES
- The live target/R:R math for a signal excludes any opposing level that has
already been swept during the session; the once-daily plan alert message
does not apply that exclusion, so the two can point at different levels
mid-session — check the live dashboard/signal for the level actually being
traded.
- Originally built and tuned against QQQ on a 5-minute chart. Threshold inputs
(cluster tolerance, sweep depth, stop multiplier) are percentage-of-price
based so they scale across instruments, but re-validate the defaults before
relying on this for other symbols or timeframes.
- This is a decision-support indicator, not an auto-trading strategy: it does
not place orders and carries no backtest/win-rate claims. All signals require
the trader's own risk management and judgment.
- The four session inputs (time zone, RTH session, overnight session, session
days) must match any separate PDH/PDL/ONH/ONL indicator on your chart
exactly, or the two will disagree.
This script is provided for educational and informational purposes. It is not
financial advice, and past patterns matching these rules do not guarantee
future results. مؤشر

مؤشر

The Deceit SignatureThe Deceit Signature
WHAT IT IS
The Deceit Signature is a pattern-recognition tool built around a recurring market behavior: a tight range breaks sharply in one direction, only to reverse just as sharply moments later, sweeping the liquidity resting near a prior swing point before the market shows its real direction. This is the same mechanic behind concepts like the ICT "Judas Swing" or Wyckoff's spring/upthrust: a false move designed to trap traders on the wrong side before the actual move develops.
This indicator automates the detection of that sequence and marks it directly on the chart, so it can be studied and monitored without having to spot it manually candle by candle.
WHAT IT DOES
On every closed bar, the indicator looks for the following sequence:
- A range: price consolidates within a band narrow enough relative to the ATR to qualify as a tight range.
- A first sharp break: a strong candle (measured against the ATR) closes beyond one edge of the range. This is the fakeout, the move designed to trap traders positioning in that direction.
- A second sharp break, in the opposite direction, within a configurable number of bars. This is the move that confirms the first one was a trap, and it is the move that goes looking for liquidity.
- A liquidity box: once the second break is confirmed, the script looks back for the two most recent swing pivots on the side opposite to the first break (below the range for a bullish fakeout, above it for a bearish one) and draws a box between them. This is the zone where price is expected to sweep resting liquidity before reversing back in the direction of the original fakeout.
- A touch marker: once price trades back into that liquidity box, a small triangle marks the candle that touched it, and the box is automatically removed a configurable number of bars later, keeping the chart clean while still leaving the range and both breaks visible for reference.
Breaks caused by a price gap (no overlap with the previous candle) are ignored. The pattern only counts when the move happens through actual trading, not through a jump in price with nothing traded in between.
HOW TO USE IT
Add the indicator to any chart, on any timeframe. When the full sequence is detected, it draws the range box, labels both breaks ("Break 1 (fakeout)" and "Break 2 (liquidity grab)"), and plots the liquidity box for that setup. An alert condition is available to notify you as soon as a first break occurs, so you can start watching for the confirming second break, and a general alert fires when the full pattern is confirmed.
This is a visual and analytical tool for identifying the pattern, not an automated entry system. What you do once the liquidity box is drawn, and once price reacts inside it, is a separate decision that requires its own judgment and risk management.
HOW TO CONFIGURE IT
Range group: "Bars to measure the range" sets how many bars are checked for tightness, and "Maximum range width (x ATR)" sets how narrow that range must be relative to the ATR to qualify as a valid consolidation.
Sharp Breaks group: "ATR period" sets the ATR length used throughout the script. "Minimum strength of the breakout candle (x ATR)" sets how large a candle's range must be, relative to the ATR, to count as a sharp break. "Max bars between 1st and 2nd break" sets the window in which the second break must appear for the pattern to be confirmed; if it doesn't arrive in time, the setup is discarded.
Pivots / Liquidity Box group: "Left bars" and "Right bars for pivot" control the swing pivot detection used to build the liquidity box. "Minimum distance from pivot to range edge (x ATR)" filters out minor pivots sitting too close to the range itself, forcing the script to look further back for a pivot that represents an actual separate swing.
Visual group: toggles for the range box and the liquidity box, colors for bullish and bearish setups, and how many bars to wait after the liquidity box is touched before it gets deleted from the chart.
A NOTE ON THE ATR STRENGTH SETTING
"Minimum strength of the breakout candle (x ATR)" is the single most important setting to calibrate for each asset and timeframe. Set it too low and the script will treat ordinary, unremarkable candles as "sharp" breaks, which produces false detections: the pattern will appear far more often than the actual deception behavior occurs, and most of those detections will be noise rather than the real setup. Start around 1.2-1.6x ATR, watch how it performs on the specific instrument and timeframe you trade, and raise it if you see the indicator firing on candles that don't visually stand out from the surrounding price action. There is no universal value: a setting that works well on a 1-hour crypto chart will not necessarily work on a daily stock chart or a weekly bond chart.
DISCLAIMER
This script is provided for educational and analytical purposes only. It identifies a recurring price pattern; it does not predict future price movement, and past instances of the pattern are not a guarantee that price will react the same way again. This is not financial advice, and any trading decision based on what this indicator shows remains the sole responsibility of the person making it. مؤشر

Absorption Shelf Dwell-Coil Reversal Levels█ OVERVIEW
Absorption Shelf finds reversal LEVELS the opposite way round from a pivot or a profile POC: it starts from TIME. A price band becomes a "shelf" because price DWELT there — an anomalous amount of occupation time — while its range COILED (volatility compressed). Only then do orthogonal order-flow lenses CONFIRM whether that shelf is genuinely ABSORBING flow rather than merely balancing, and a confirmed close back out of the band is treated as the reversal. It asserts no signal and no win-rate; it shows, honestly and past-only, how often price has actually rejected off these shelves versus a matched base rate.
█ HOW IT WORKS
Substrate — one lower-timeframe stream (request.security_lower_tf) supplies a per-bar buy/sell split (BVC-Normal / Tick / Geometry) for delta and signed order flow; it falls back to the chart bar when no intrabar data exists. The method in force is shown (REAL / EST).
Dwell field (the level generator) — a rolling, fixed-tick OCCUPATION-TIME map: each confirmed bar adds time to every price level its range covers, and the bar leaving the window subtracts it exactly (a reversible ring buffer). Levels at or above a self-set percentile κ are "hot"; adjacent hot levels merge into candidate BANDS.
Coil + containment (the stall trigger) — a band is promoted to an ACTIVE shelf only when compression (1 − ATRfast/ATRslow) clears a threshold AND enough recent closes sat inside the band. Dwell + coil together are what make a quiet band a shelf — this is the part a pivot- or profile-based level does not have.
Confirmation lenses (on the band only) — Effort-vs-Result √-law residual (E: heavy volume, little price result = absorption), localized Kyle-λ collapse (K: price barely moves per unit signed flow), Dwell-decay (D: the band has stopped accreting time = primed to release), Rejection-wick clustering (W: Wilson-floored), and CVD divergence (V). Each abstains cleanly on missing data.
Fusion — the active lenses combine by correlation-aware Bayesian log-odds: each is reliability-shrunk by its own past edge and Kish-decorrelated so the absorption family (E, K, D) contributes about one lens' worth, not three, then squashed to P_abs → BALANCE / ABSORBING / PRIMED. Shelves are down-weighted in strong trend (a built-in efficiency-ratio regime gauge, or a consumed external one).
Flip + lifecycle — a confirmed close out of the band against the approach is the reversal (a ▲ bullish or ▼ bearish flip, coloured by direction). Shelves carry a lifecycle: forming → active → flipped → spent → naked (kept until retested).
Reject calibration (honesty layer) — when price first touches an active shelf, the script forward-tests whether it REJECTS (turns back by k·ATR) BEFORE it CONTINUES through by k·ATR, versus the matched unconditional reject-vs-continue base rate: reject% (n, Wilson 95% lower bound) vs base% → edge, broken out by tag (does PRIMED out-reject ABSORBING out-reject BALANCE?), split in-sample / out-of-sample, and Bonferroni-deflated. Past-only, non-repaint.
█ HOW TO USE
Read the shelves as context, not as entries. A teal band below price is a support shelf (price is being held from below); a red band above is a resistance shelf. Brightness tracks how strongly the band was dwelt. The tag tells you what the flow says about it — BALANCE is just a quiet level, ABSORBING and PRIMED mean the lenses agree a wall is soaking flow there. A ▲/▼ flip marks where price actually closed back out of a shelf against its approach. The calibration line is the honest part: it tells you, on this symbol and timeframe, how often tagging a shelf has preceded a real rejection versus random — and shows nothing when the sample is small. A flat read with no active shelf is a genuine "no location here", not a broken one. The dashboard defaults to Compact (shelf, tag, dwell %, flip); switch it to Pro for the lens-by-lens glyphs and the calibration breakout. Horizon and holding are yours to decide; it emits no orders.
█ INPUTS
01 · Data & Trade-Side — LTF granularity, classifier, BVC sharpness.
02 · Dwell Field — ticks-per-level, dwell window, hot-level percentile κ, band merge gap, min band width.
03 · Coil & Stall — fast/slow ATR, minimum coil to promote, containment lookback / fraction / buffer.
04 · Confirmation Lenses — enable E / K / D / W / V and their sensitivities.
05 · Fusion — Kish decorrelation, self-set tag percentiles (absorbing / primed).
06 · Flip & Lifecycle — flip distance (×ATR), ghost retention, max shelves tracked.
07 · Regime & Self-Cal — trend down-weight (built-in efficiency ratio, or consume an external regime).
08 · Calibration — reject size (×ATR), horizon, Bonferroni, in/out-of-sample split.
09 · Microstructure Links (optional) — consume external Toxicity or Kyle λ; never recomputed.
10 · Display — bands, how far back to draw, badge, lens glyphs, flip markers, naked shelves, dwell heat spine, dashboard detail (Compact default / Pro).
11 · Style — Auto / Dark / Light theme.
12 · Exports — shelf levels, tag, P_abs, dwell percentile, coil, flip direction, naked levels, reject edge, active lenses.
█ HONESTY & LIMITATIONS
Descriptive, not predictive. Order-flow side is an OHLCV ESTIMATE (BVC / tick / geometry), not a Level-2 book; on symbols with no volume the flow lenses (E, K, V) abstain and the shelf runs on dwell + coil + wick alone, stated in the dashboard. Coil is measured chart-wide (ATR ratio) while containment is per band. The reject calibration is a past-only, first-touch two-barrier (reject-vs-continue) forward test against a matched base rate with a Wilson lower bound, tag buckets, an in/out-of-sample split and a Bonferroni deflation; a small sample is discounted automatically and no edge shown means honest, not broken. Non-repaint by construction: dwell and coil accrue on confirmed bars, shelves promote from confirmed history, the flip fires on a confirmed close, calibration events resolve only after the horizon, and the render recomputes once per confirmed bar. For runtime the script processes the most recent ~5000 bars and gates the calibration engine behind its own toggle. It prints no verdict and no win-rate.
█ ORIGINALITY
One coherent object: a reversal level whose EXISTENCE comes from occupation time plus volatility compression, with order flow demoted to confirmation on that band. This is deliberately distinct from a volume/footprint profile (those build the level from volume-at-price and fire sweeps event-by-event), from pivot- or kernel-based support/resistance (those build the level from swing geometry), and from a potential-well or mean-reversion model (those are price-dynamics with no time-at-price). The dwell-time + coil "absorption shelf" as the level generator, the dwell-decay lens that only this occupation field makes possible, and the correlation-aware fusion that explicitly discounts absorption-lens redundancy are the specific original contributions. Every block was written from scratch for this tool; the lenses feed one decision (is this band absorbing?) rather than being independent indicators stapled together.
█ CREDITS
Occupation-time / TPO at price — Steidlmayer / Market Profile. Price-impact λ (delta-response) — Kyle (1985). Square-root market-impact law — Almgren; Tóth, Bouchaud et al. Bulk Volume Classification — Easley, López de Prado & O'Hara. Trade-side tick rule — Lee & Ready (1991). Two-barrier / triple-barrier forward test — López de Prado. Wilson score interval — Wilson (1927). Design-effect / effective sample — Kish (1965). Code written from scratch; no external script reused.
This script is for analysis and education. It is not financial advice. مؤشر

The Ultimate 50 EMA @JustinPerezTradesUltimate Day Trader — NQ/MNQ Multi-Timeframe 50 EMA Stack
A precision pullback/breakout indicator for NQ and MNQ that only signals when five timeframes of 50 EMAs are stacked in trend order.
Overview
This indicator looks for a specific structural setup on NQ and MNQ futures: a short-term pullback (or push) away from the 1-minute 50 EMA that occurs while the 50 EMA is climbing or falling in a clean, ordered stack across five timeframes (1m, 5m, 10m, 15m, 30m). The idea is to only trade pullbacks that are happening inside a confirmed multi-timeframe trend, rather than reacting to the 1-minute chart in isolation.
It's a signal/alert tool — it plots the EMA stack, marks entries and the exit target on the chart, and can fire alerts. It does not place trades for you.
How it works
Long setup — all of the following must be true at once:
Price is 50–100 points below the 1-minute 50 EMA (a pullback into value, not a full trend break)
5-minute 50 EMA is above the 1-minute 50 EMA
10-minute 50 EMA is above the 5-minute 50 EMA
15-minute 50 EMA is above the 10-minute 50 EMA
30-minute 50 EMA is above the 15-minute 50 EMA
When all five conditions align, the script marks a long entry. The exit target is the 30-minute 50 EMA — the trade is considered closed once price trades up to reach it.
Short setup is the mirror image: price 50–100 points above the 1-minute 50 EMA, with each higher timeframe's 50 EMA stacked below the one before it (5m < 1m, 10m < 5m, 15m < 10m, 30m < 15m). Exit target is the same 30-minute 50 EMA, reached from above.
Entries are edge-triggered — you get one signal per fresh setup, not a repeated marker on every bar the condition happens to remain true.
How to use it
Apply the indicator to a 1-minute chart on NQ or MNQ (front-month continuous contract or a dated expiry). The script checks both conditions and shows a warning label if either isn't met.
Watch the on-chart status table for a live read of: chart/symbol validity, current position state (flat / in long / in short), whether the MTF stack is bullish, bearish, or unaligned, the price's distance from the 1m EMA, and the current exit target level.
Green up-triangles mark long entries, red down-triangles mark short entries; a background tint confirms when the broader EMA stack is aligned even before price reaches the entry zone.
Right-click the chart → Add Alert to get notified on Long Entry, Short Entry, Long Exit, or Short Exit independently.
Inputs
EMA Length — default 50, applies to all five timeframes
Min / Max entry distance from the 1m EMA (points) — default 50 / 100, tuned for NQ/MNQ's typical point range
Restrict signals to NQ/MNQ only — on by default; disable to experiment with the same logic on other instruments
Higher timeframe overrides — 5m/10m/15m/30m are adjustable if you want to test alternate spacing
Display toggles for the EMA plots, stack-aligned background highlight, and the status table
Notes
This script is built BY @JustinPerezTrades specifically around NQ and MNQ's point behavior — the 50–100 point entry zone will not translate directly to instruments with different average ranges. It is a rules-based signal tool, not a guaranteed-profit system, and past alignment of these conditions does not predict future results. Backtest and paper-trade before using it with real capital, and use it alongside your own risk management. مؤشر

Auction Scalper | GainzAlgo
Auction Scalper is built specifically for intraday scalpers. It uses Auction Market Theory to identify two high-quality setups: failed auctions that reverse back toward value and accepted breaks that continue after a retest.
THE TWO SETUPS
Reversal — Failed Auction
Price pushes outside yesterday's value area, fails to hold there, and closes back inside. The setup targets a return toward value, with the POC as TP1 and the stop placed beyond the full sweep with an ATR buffer.
Squeeze — Break & Retest
Price accepts outside value with a strong body close. The broken level is retested and must hold with sufficient participation before a continuation signal fires. Targets use meaningful prior-day levels, with a runner for extended moves.
EVERY SETUP GETS A 0–100 SCORE
Every setup is scored using:
Volume percentile
Buy/sell pressure
Rejection quality
Trade location
Higher-timeframe alignment
Volatility
Reward-to-risk
Time of day
Display the result as stars, a numerical score, or a letter grade.
Two additional rules come from testing: reversals against the higher-timeframe direction require a higher score, and setups requiring a stop wider than 4 ATR are skipped.
KNOW WHY YOU'RE FLAT
The dashboard shows your current trading window and system status.
It tells you whether the market is OPEN, LATE, CLOSED or in lockout, and whether the system is SCANNING, waiting for a higher score because of CHOP, MANAGING A TRADE, or DONE FOR TODAY.
No guessing why the indicator isn't giving you a signal.
BUILT FOR DISCIPLINED SCALPING
Includes:
Session filter & opening lockout
Late-entry cutoff
Chop detection
Signal cooldown
One active trade at a time
One long and one short setup per day
TP1 → break-even management
TP2 runner
Maximum stop-distance filter
Optional slippage-aware stops
Every trade is tracked directly on the chart with Entry, SL, TP1, TP2 and R multiples, including stop-outs.
VALIDATION
A companion strategy uses the same core logic so you can test it on your own market, timeframe, commission and slippage settings.
An earlier engine build tested on AAPL 5-minute data over one year produced a profit factor around 1.3 with drawdown near 2% using realistic costs. The engine has since been updated, so run the current strategy yourself for current results.
Settings were tuned on US stocks. Crypto and FX are supported but were not specifically calibrated.
HOW TO USE
Designed for liquid markets on 1–5 minute charts during active sessions.
Choose a preset, set your session, and wait for qualified setups. Alerts fire once per confirmed bar close with direction, setup type, score, entry, stop and both targets.
HONEST NOTES
Signals confirm on bar close and do not repaint. Higher-timeframe analysis uses only the last confirmed HTF bar.
Buy/sell pressure is estimated from candle structure, not exchange bid/ask data, and no lower-timeframe requests are required. The indicator therefore works across TradingView plans and in Bar Replay.
Some FX feeds have no usable volume, so the volume gate automatically steps aside when volume is unavailable.
This is an analytical tool, not financial advice. Past performance does not guarantee future results. مؤشر

Darvas Box Ladder [ITA]🟠 OVERVIEW
Darvas Box Ladder plots the rectangle Nicolas Darvas traded, and then keeps plotting the ones that follow it. Darvas did not buy a box and sell it - he rode a ladder of them, staying in as each breakout built a new box higher and lifting his stop to the floor of the newest one. He got out when a box finally broke down.
The script builds each box the way Darvas built it, as a sequence of confirmations rather than a rectangle fitted after the fact, and keeps the completed rungs on the chart so the whole run stays visible.
🟠 CONCEPTS
A Darvas box has an order to it. The ceiling comes first: price makes a new high, and that high has to survive a set number of bars unbeaten before it counts. Only then does the floor form, from the lowest low printed since the ceiling, and it has to survive the same test.
That order matters. A rectangle drawn around any quiet stretch of price is just a consolidation range. A Darvas box is a leader pausing after a run to new highs, and the ceiling-then-floor sequence is what separates the two.
Because both levels come from confirmed structure, they are fixed once drawn and do not move afterwards.
🟠 FEATURES
🔹 The full ladder, not one box - completed rungs stay on the chart so you can see the whole advance rather than the current pause in isolation
🔹 Stop line under the active box - a dashed line at the floor, which is where Darvas kept his
🔹 Measured-move target - one box height projected above the ceiling
🔹 Volume-confirmed breakouts - a close above the ceiling only counts when volume beats its 20-bar average by your chosen multiple
🔹 Box under construction - a dashed ceiling shows while the box is still forming, so you can see one coming before it completes
🔹 New-high filter - boxes may only start from a high that is the highest of the lookback window, keeping the script on leaders instead of drawing rectangles inside downtrends
🔹 Height limits - boxes outside your minimum and maximum are discarded
🔹 Alerts on both the breakout and the box breaking down
🟠 HOW TO USE
Add it to a daily chart of a stock that has been making new highs - that is the setup Darvas was looking for, and the new-high filter will keep the script quiet on anything else.
Watch for the dashed ceiling. That is a box forming. When the floor confirms, the box turns solid and the stop line appears underneath it.
A green box with a triangle below the bar is a confirmed breakout on volume, and the next box begins from there. Each new rung is a chance to lift the stop to the newer, higher floor.
A red box marks the end of the run - price closed below the floor.
Confirmation Bars is the main setting. Darvas used 3. Higher values give fewer, cleaner boxes; lower values react faster and produce more of them.
🟠 CONCLUSION
The box is the easy part. The ladder is what Darvas actually traded, and it is what tells you whether a breakout is the start of a run or the end of one. مؤشر

Reaction Weighted Support Resistance [Pineify]Reaction Weighted Support Resistance
Overview
Builds ATR-scaled support and resistance zones from confirmed swing pivots. Opacity encodes decayed completed reactions and bounded relative-volume context. It organizes chart evidence without forecasting price or performance.
Problem Definition
A common baseline draws one line per pivot and adds strength for every return. It scores shallow drift and decisive rejection equally, while old tests can dominate after conditions change. The map becomes crowded, and counts do not explain what happened after contact. The required invariant is a bounded set of areas weighted by subsequent displacement, participation context, and recency without assuming repetition.
Design Rationale
Confirmed pivots replace immediate extrema; zones begin at confirmation, not at the earlier swing bar. ATR width replaces fixed ticks, but geometry is frozen from known volatility. Nearby same-side zones merge only under a height cap. Touch count was rejected: entry opens a finite window, favorable movement is normalized by touch-time ATR, and bounded volume adjusts credibility without claiming directional flow. Decay fades stale reactions. The tradeoff is lag in exchange for auditable path memory.
Key Features
Confirmed pivot zones with ATR geometry.
Completed reaction scoring, volume context, and half-life decay.
Width-limited merging and bounded zone capacity.
Close invalidation, strength opacity, optional visuals, dashboard, and alerts.
How It Works
The engine reads chart OHLC, ATR, and average volume. Confirmed pivot lows create support and highs create resistance. Width is a fraction of pivot-time ATR; signals are not shifted backward.
A same-side candidate merges only below the height limit. Its center is score-weighted, so weak evidence cannot freely drag an established zone. Otherwise it is added; capacity removes the weakest.
A completed entry after cooldown stores ATR and bounded volume credibility, then tracks the best favorable extreme. Support measures upward displacement; resistance measures downward displacement. The result is floored at zero, ATR-normalized, capped, and volume-weighted. Missing volume uses a neutral fallback.
Each completed bar applies half-life decay; a saturating transform maps score to opacity. A close beyond the zone and ATR buffer invalidates it. Warm-up needs ATR, optional volume average, and pivot confirmation. Unclosed bars do not mutate state or fire alerts.
How Multiple Indicators Work Together
The components form one chain: pivots supply location, ATR supplies scale, the path window separates reaction from touch, volume changes confidence, decay tests recency, and invalidation bounds life. Without the window this becomes touch counting; without decay old history dominates; without ATR markets lose comparable units. The boxes expose the combined state rather than stacking unrelated signals.
Trading Ideas and Insights
Compare areas instead of assuming they will hold. Opaque support means prior completed visits produced larger, more recent upward reactions under this model; resistance is symmetric. Observe approach, overlap, departure, and confirmed failure. Entry alerts focus review above the strength threshold, while invalidation ends stored context. They do not define direction, size, execution, return, or reversal probability.
Unique Aspects
Each touch creates a bounded episode whose later displacement, touch-time volatility, volume credibility, and age update one state. Merging is score-weighted and width-limited. Teal and rose encode role, opacity encodes strength, amber marks failure, and the dashboard exposes scores and evaluated touches. This is an independent implementation; retrieved descriptions defined only the baseline, and no source code was reused.
How to Use
Choose pivot lengths for the intended swing horizon.
Set width and merge limits so boxes remain useful areas.
Read opacity with score and evaluated touches; faint zones have little evidence.
Use alerts as review prompts with separate execution and risk rules.
Review several market regimes before using the context.
Customization
Short pivot windows create more candidates; long windows are selective and slower. Width and merge controls set geometry. The evaluation window favors immediate or slower reactions. Half-life controls memory, not signal speed. The invalidation buffer sets tolerated close penetration. Volume length changes its baseline; alert strength changes qualification. Secondary markers, bar colors, and dashboard can be disabled.
Assumptions and Limitations
Pivots are delayed. ATR gaps can distort geometry. Forex or synthetic feeds may supply tick volume or no usable series, so fallback removes participation discrimination. Favorable extremes summarize path outcome, not order flow, causality, liquidity, or execution. Results depend on settings; capacity can evict weak areas. Close invalidation can lag gaps, while intrabar penetration is insufficient. The model does not predict bounces, trade, model costs, or establish profitability. Non-standard and illiquid charts need separate review.
Conclusion
Prominence depends on completed, volatility-normalized reactions, bounded volume context, and recency. Evidence fades, geometry stays controlled, and confirmed invalidation ends the zone. Historical reaction remains inspectable context, not certainty.
مؤشر

Curved Market Structure & SMC Liquidity [ ICT ]================================================================================
CURVED MARKET STRUCTURE & SMC LIQUIDITY
================================================================================
Curved Market Structure and SMC Liquidity ICT is an all-in-one institutional trading suite designed for precision analysis across Crypto, Forex, Commodities, and Stocks. It merges smooth mathematical volatility curves with automated Smart Money Concepts (SMC) structure, body glow momentum candles, dynamic equilibrium range tracking, and a visible right-side volume profile.
--------------------------------------------------------------------------------
1. CORE FEATURES & MECHANICS
--------------------------------------------------------------------------------
• Dynamic Smooth Curve Bands
Uses double-exponential smoothing and standard deviation to generate adaptive high-probability trend curves. The lower curve marks an institutional demand/liquidity sweep zone, while the upper curve identifies overextended supply areas.
• Institutional Structure Mapping (BOS & CHoCH)
Automatically tracks key swing highs and lows. Upon structure breakout, it draws precise Break of Structure (BOS) or Change of Character (CHoCH) lines starting exactly from the broken swing level to the breakout candle.
• Filtered Sweep Signals & Cooldown Engine
Liquidity sweep signals require candle close confirmation and directional momentum alignment. An internal cooldown counter suppresses repetitive signals during tight consolidation phases.
• Body Glow Candle Dynamics
Recolors candle bodies based on directional strength and candle range. Active expansion bars highlight bright green or red, while low-volatility range candles render in neutral gray.
• Dynamic 0.5 Equilibrium & Confluence Zones
Continuously projects the 0.5 discount/premium equilibrium midpoint of the active swing range, alongside borderless demand and supply confluence zones.
• High Visibility Volume Profile
Renders a clean volume profile histogram on the right side of the chart to reveal High Volume Nodes (HVN) and Low Volume Nodes (LVN) over the selected lookback range.
--------------------------------------------------------------------------------
2. HOW TO USE FOR TRADING
--------------------------------------------------------------------------------
1. Determining Market Bias
Check whether current price action is trading above or below the 0.5 Equilibrium level and observe the direction of the latest BOS or CHoCH structural break.
2. Bullish Entry Rules
Wait for price to sweep or touch the lower green curve band. Enter long upon receiving a confirmed Buy Sweep signal accompanied by a green Body Glow candle near the demand zone.
3. Bearish Entry Rules
Wait for price to sweep or touch the upper red curve band. Enter short upon receiving a confirmed Sell Sweep signal accompanied by a red Body Glow candle near the supply zone.
4. Profit Targets & Risk Management
Set primary take-profit targets at the 0.5 Equilibrium line and secondary targets at the opposite curve band or major structural swing levels.
--------------------------------------------------------------------------------
3. SCALPING & TIMEFRAME GUIDANCE
--------------------------------------------------------------------------------
• Lower Timeframe Scalping (1m, 5m, 15m)
Lower the Swing Sensitivity setting to 3 or 5 for rapid structural tracking. Use right-side volume profile peaks to trade reversals back toward low-volume gaps.
• Higher Timeframe Bias (1H, 4H, Daily)
Use the 0.5 Equilibrium line to divide the market into Premium (favorable for shorts) and Discount (favorable for longs) zones before taking trades.
--------------------------------------------------------------------------------
4. SETTINGS BREAKDOWN
--------------------------------------------------------------------------------
• Curve Smoothing Factor: Controls band smoothness and responsiveness to price.
• Curve Multiplier: Adjusts upper/lower curve expansion based on market volatility.
• Signal Cooldown: Sets the required bar gap between signals to filter noise.
• Consolidation Threshold: Sets the body-to-range ratio for identifying neutral gray range candles.
• Swing Sensitivity: Sets pivot lookback length for validating swing highs and lows.
• Text Placement Settings: Customizes horizontal and vertical label alignments.
• Profile Lookback Range: Defines historical bar depth for the volume profile histogram.
--------------------------------------------------------------------------------
5. THINGS TO AVOID
--------------------------------------------------------------------------------
• Do not trade signals against the higher-timeframe trend direction.
• Avoid taking Buy signals during an active bearish BOS sequence without a fresh CHoCH confirmation.
• Avoid entering trades during major economic news releases or low-liquidity market sessions.
• Do not rely on printed shapes in isolation. Always combine signals with SMC structure, 0.5 Equilibrium levels, and volume confluences.
--------------------------------------------------------------------------------
DISCLAIMER
--------------------------------------------------------------------------------
This script is built exclusively for educational and chart visualization purposes. Past performance of visual signals does not guarantee future market results. Always manage risk responsibly. مؤشر

Opening Price Deviation Tracker v2 - Buffer Zones - VWAP [ViZ]OPENING PRICE DEVIATION TRACKER v2 — BUFFER ZONES — VWAP
WHAT IT DOES
Measures how far price has travelled from the opening price of a chosen anchor
period, and maps that distance onto a fixed percentage grid on the chart.
The reasoning is that the open of the current period is a reference every
participant on the instrument shares, and that distance from it expressed in
percent is comparable across instruments and across time in a way raw price
distance is not. A 1% move from the weekly open means the same thing on a
30,000-point index as on a 40-dollar stock.
Around that single idea the script adds a tolerance band on each level, a
permanent record of which levels each period actually reached, a three-timeframe
summary panel, optional trend and volume references, and three alert channels
that differ in what they detect rather than only in speed.
Every component keys back to the same anchor open. This is not a set of unrelated
tools sharing a pane.
1. THE ANCHOR OPEN, AND WHY IT IS LATCHED
The Timeframe input sets the anchor period — weekly by default, but any timeframe
longer than the chart's.
The script obtains that period's opening price by latching it: on the first chart
bar of a new anchor period, that bar's own open IS the period's open, so the value
is stored and held until the next rollover.
There is no request.security() call anywhere in the script. Not for the anchor
open, not for the three table columns, not for VWAP.
That matters for a specific reason worth stating plainly. The obvious way to build
this is request.security with lookahead enabled, and for an OPEN that is actually
defensible — an open is fixed by the first tick of its period, so requesting it
with lookahead never returns a number that was unknowable at the time. Without the
flag the same call returns the PREVIOUS period's open until the current one closes,
which puts the whole grid one full anchor period behind itself, so simply turning
the flag off is not an option. Latching sidesteps the argument entirely: the value
is a chart bar's own open, so it provably cannot look ahead, there is no
higher-timeframe request to disclose, and there is no real-time-to-historical
transition to reason about. Levels drawn on historical bars are the levels that
genuinely existed at the time, and they do not change on reload.
The period high and low used by the panel are accumulated from chart bars for a
different and stronger reason: a period's extremes are only settled when the period
ENDS, so requesting those with lookahead genuinely would leak future data onto
historical bars. Open safe, extremes not — that distinction is the whole substance
of the question.
Latching does cost something, in the form of four documented behaviours. They are
in the LIMITATIONS section, and reading it will explain most of what could
otherwise look like a bug.
2. THE DEVIATION GRID
From the latched open the script builds five levels above and five below, spaced by
a fixed percentage step, with the 0% line marking the open itself. Line width
increases with distance, so ±1 is a hairline and ±5 is the heaviest — depth is
readable without checking the labels. Each level carries a right-edge label showing
both its price and its percentage offset. Colours darken progressively outward from
the two base colours you set.
The step comes from a preset list, each labelled with its own value:
0.25% — scalping / very low volatility
0.3875% — reactive / lower timeframes
0.50% — intraday
1.00% — balanced (default)
2.00% — swing / higher timeframes
3.00% — high volatility / highest timeframes
Custom — any value from 0.1 upward
Because the grid always runs to five levels, the step also fixes its total span: 1%
covers ±5%, 2% covers ±10%, 0.25% covers ±1.25%. Pick the step whose span roughly
brackets what your anchor period typically moves. Too small and price sits
permanently off the top or bottom of the grid; too large and it never leaves the
first band, and nothing the script draws will tell you anything.
As orientation rather than instruction: the lower steps suit major FX pairs and
large-cap equities on intraday anchors, the middle of the range suits indices and
most equities on daily and weekly anchors, and the upper steps suit small caps,
commodities and crypto, or any weekly-and-above anchor. Volatility varies more
inside an asset class than between them, so verify against the instrument in front
of you and switch to Custom once you know what you want.
The step also drives the panel's Zone and To Next rows, the buffer positions, touch
detection and the markers — one number, one grid, everywhere.
3. LINE DISPLAY
Three modes:
Off — no grid lines; panel, markers and alerts still work
Show All — full grid across history and the live period
Touched Only (Historical) — live period shows the full grid; completed periods
keep only the levels price actually reached
The third is the default and is the one worth understanding. On a chart with months
of history, showing all eleven lines per period is unreadable. Retaining only the
levels each period actually reached leaves a permanent record of how far each period
extended — which is usually the only thing you wanted from the older periods.
Those historical segments are stored as drawn objects and accumulate without an
explicit cap, bounded only by TradingView's 500-line budget. When the ceiling is
reached the platform deletes the oldest, so the recent history you actually look at
is never what disappears. The 0% opening line is exempt from filtering and always
renders in full.
4. BUFFER ZONES
Each deviation level, and the open itself, can carry a translucent band drawn a set
percentage of price above and below it — eleven bands in total.
Two reasons for them. Price rarely reacts at an exact tick; it reacts in a region
around a reference, so a band represents the level more honestly than a line. And
the band gives an anticipatory alert trigger: entry into the band fires before the
level is reached.
The live period's bands are drawn spanning the current period. Bands from previous
periods are also retained, but only for levels that were actually touched, so past
structure appears where something happened rather than as uniform wallpaper.
Historical retention is capped at 44 periods, which is the limit of the platform's
500-drawing budget once the live period's own eleven boxes are accounted for; lower
it freely for a cleaner chart, nothing else depends on it.
One interaction to be aware of: buffer size is a percentage of price and does not
scale with the grid step. Lead time depends on the RATIO of the two, not the
absolute size. At roughly a quarter of the deviation step the warning is genuinely
early; at half or more the warning and the touch collapse into the same bar. The
default 0.15 against a 1% grid is 15%. Against the 0.3875% preset the same value is
39%, which effectively eliminates the early warning; against the 3% preset it is 5%,
which may be too tight to see. If you change the step, check the buffer against it.
5. TOUCH MARKERS
Optional, and off by default. A small marker is placed on the first bar of each
period that reaches each level — one marker per level per period, re-armed at every
rollover.
Marker shapes:
● circle — touch: the bar's range reached the level.
▲ ▼ triangle — acceptance: the bar CLOSED beyond the level. Points up above the
open, down below it.
◆ diamond — rejection: the bar tagged the level and closed back, with a retreat wick
larger than the threshold you set.
✕ cross — gap through: the bar reached the level without trading into it.
Three detail modes let you take just the touches, touches plus acceptance, or the
full touch / rejection / acceptance set. Rejection sensitivity is adjustable as a
fraction of the bar's range, 0.5 by default; raise it toward 0.65 for a stricter
read. Marker range is adjustable up to ±5 levels, ±4 by default. The 0% line can be
marked too, optionally. Colours inherit from the grid by default, so a +3 marker
matches the +3 line; the 0% marker is always blue to match the opening-price line.
Each marker's tooltip states the level and the classification.
Markers use the same reach test as the historical line segments — directional above
and below the open, straddle at 0% — so a marker and a retained line segment can
never disagree about whether a level was touched. Markers appear at bar close by
default; an option tags them on the live bar instead, in which case the shape may
still change before the bar closes, because acceptance and rejection both depend on
where the bar ends up. That option is visual only and affects no alert.
6. BAR COLOURING
Optional, with two selectable sources.
Deviation Levels colours each bar by which of the eleven grid zones it closed in,
using the same progressively darkening shades as the lines, with the "between
levels" colour for bars inside the first band. The candles then carry the deviation
reading themselves, which means you can switch the grid off entirely and still see
depth — a genuinely clean chart that still reports.
VWAP / Bands colours by position relative to the anchored VWAP and its bands
instead: five zones, beyond the outer band, beyond the inner band, and between, on
each side. It falls back to plain above/below VWAP when bands are off. Useful when
you want the grid for structure but volume-weighted price for bias. This mode needs
only volume and a valid anchor, so it works with the VWAP line itself hidden.
Bars before the first anchor rollover are deliberately left uncoloured rather than
being painted a default shade, since no zone reading exists for them yet.
7. MOVING AVERAGE
Optional SMA or EMA, adjustable period, 200 by default. Context rather than signal:
it exists so you can see whether a level is being approached with or against the
prevailing trend, which usually matters more than the touch itself.
8. VWAP
Optional anchored VWAP with its own reset selection, independent of the deviation
anchor: daily session, weekly, monthly, quarterly, semi-annual, annual, Match
Deviation Anchor, or a custom timeframe. Daily session matches the standard
TradingView VWAP. The multi-month options are derived from the monthly rollover and
then gated by calendar month, so they land on real calendar boundaries — January /
April / July / October, January / July, and January — rather than drifting from an
arbitrary reference point.
Match Deviation Anchor is the setting for a single consistent frame of reference:
grid and VWAP then reset on the same bar and describe the same period. The
independent options cover the common case of a session VWAP underneath a weekly or
monthly grid.
Two optional band pairs, in either standard-deviation or percentage units, are
independent of the deviation grid preset. The outer pair is rendered a step more
transparent than the inner, so depth reads without a second colour input, and a very
light fill between the inner pair is available but off by default so it does not
compete with the buffer zones. Note that in sigma mode the bands pinch shut at each
anchor reset and flare open over following bars — that is inherent to anchored
standard deviation, not a fault; percentage mode does not do it.
The line and bands are blanked on the anchor bar itself, so the plot BREAKS at each
reset instead of drawing a diagonal from the old period's last value to the new
one's first.
VWAP needs volume, and needs an anchor longer than the chart timeframe. If either
is missing, an on-chart label states which — including when VWAP is hidden but the
VWAP bar-colouring mode is active and starved.
9. THE DATA PANEL
Projects the same deviation grid onto three user-selectable timeframes, each
measured from that timeframe's own latched opening price. Defaults are daily,
weekly and monthly, and the column matching the indicator's own anchor is marked
with a diamond. The title bar shows the active step, for example "1% grid".
Rows, in Full detail:
Open — that period's opening price, at the symbol's own precision.
Δ from Open — percentage move from that open, with a direction arrow. Colour
intensity scales with magnitude, and the saturation ceiling scales as the square
root of the column's length, so at the 1% preset the daily column saturates around
2%, the weekly around 4.5% and the monthly around 9.2%. Each column is therefore
meaningful on its own scale, rather than one fixed ceiling that the longest column
always maxes out.
Zone — which band price currently occupies, shown as "+1 → +2", "0 → -1" and so on,
filled with the SAME colour as the corresponding chart grid line. Beyond the grid it
reads "> +5" or "< -5" rather than silently clamping.
To Next % — distance to the level above and the level below. This is the practical
number for judging whether a target is in reach.
Range Pos — where price sits inside that period's realised high-low range so far, as
a percentage with a small meter. 90% means price is near the top of everything the
period has covered.
State — bullish, bearish or neutral, combining direction from Δ with conviction from
Range Pos, so it is not merely a restatement of the sign of Δ. When the range is
unknown it degrades to direction only.
Compact detail drops To Next and Range Pos and closes the gap rather than leaving
empty rows. The panel's whole surface palette — header band, row banding,
separators, anchor-column wash — is derived from one background colour input, and
text automatically switches to a dark set on light backgrounds. Colour is carried by
text tint throughout, with the Zone row as the single filled block and the panel's
focal point.
Three column states exist. A column SHORTER than the chart timeframe reads "below
chart TF", because a shorter-timeframe open cannot be resolved honestly from a
longer chart bar. A column whose boundary has not appeared inside the loaded chart
history reads "no boundary yet" — see LIMITATIONS. Otherwise it reports normally.
The point of three columns at once is alignment. Bullish daily, bearish weekly,
bullish monthly is a different situation from all three agreeing, and the panel makes
that visible without changing timeframe.
10. ALERTS — THREE CHANNELS
The three channels differ in WHAT THEY DETECT, not only in how fast they report.
Each has its own toggle.
BUFFER (early warning) — fires when price first enters the band around a level.
Dispatches intrabar, the moment the band is entered; delivered at the bar close it
would already have been overtaken by events. On by default.
AT LEVEL — fires on any bar whose range CONTAINS a level, and keeps repeating for
as long as price stays there. Dispatches intrabar, on the first qualifying tick.
This is safe intrabar because the test reads only high and low: inside a live bar
the range only ever widens, so once it engulfs a level no later tick can un-happen
it. The cost is partial reporting — a candle running through +1, +2 and +3 names +1,
because that is what was true at the tick it fired. On by default.
FIRST TOUCH — fires the first time each level is reached in the anchor period, then
stays silent about that level until the next period. Dispatches at bar close,
because its wording carries a classification — touch, closed beyond, rejected — and
all of those read where the bar closed, which on a live bar is only the current
price and could flip tick to tick. Evaluated once on a finished bar, it loops every
level and reports all of them. Off by default. Works with the markers hidden.
The two level channels also DETECT differently, which is why both exist. At Level
requires the bar to straddle the level. First Touch tests directionally, so a bar
that jumps clean over a level without trading back into it is reported by First
Touch and is structurally invisible to At Level. That is the gap-through case, and
it is exactly what a news candle does.
So: buffer and at-level answer "tell me now". First touch answers "tell me
everything, a moment later".
All three messages render as ": | Price: ", with the
buffer channel adding " | Level: ", so anything parsing them downstream sees
one consistent shape. No timestamps are embedded, because every delivery method
TradingView offers already stamps the notification.
TO SET UP: create ONE alert on the indicator with the condition set to "Any alert()
function call". The three toggles decide what it reports. The long string
TradingView pre-fills is the alert's NAME, auto-built from every input — rename it
in the dialog; it is not the message.
If you want a different sound or webhook per channel, add the indicator to the chart
more than once, enable exactly one channel per instance, strip the extra instances
of all drawing, and name each chart alert after its channel. Keep the anchor and
preset identical across instances or the channels start describing different grids.
One known behaviour: if a single bar enters more than one buffer band, the buffer
message names the last one evaluated rather than listing all of them. The alert
still fires; the label is simply not exhaustive. Most visible on fast bars, or when
buffer size approaches half the deviation step and bands begin to overlap.
11. CHOOSING A CHART TIMEFRAME AND ANCHOR
The useful rule of thumb is that the anchor period should span roughly 20 to 100
bars of the chart timeframe. Fewer and the grid has no room to develop; many more
and the levels are too distant to be actionable within a session.
In practice: 1m to 15m charts pair with daily and weekly anchors, hourly and 4-hour
with weekly and monthly, daily and above with monthly, quarterly and annual. For
the panel, suggested column sets are 4H/D/W under a weekly anchor, D/W/M under a
weekly or monthly anchor, and M/3M/12M under a quarterly anchor.
Some ways it gets used:
Mean-reversion context — a level reached early in a period, price stalling inside
the band, moving average leaning the other way, is a different proposition from the
same level reached mid-expansion. The rejection marker is what separates the two
after the fact.
Continuation context — sequential first-touches inside one period, left on the
chart by the touched-only display, show whether a period is expanding steadily or
stalling at the same band repeatedly. Acceptance triangles at successive levels read
differently from a diamond at the same level three times.
Risk framing — because levels are percentage distances, To Next % converts directly
into stop and target distances in the same units you size positions in.
Period bias — the panel alone, grid switched off, works as a compact
three-timeframe bias readout.
Monitoring — the first-touch channel lets you watch a list of instruments for
meaningful extension from their period open without staring at charts, and the
buffer channel gives the heads-up before it happens.
None of the above is prescriptive. The defaults are a reasonable place to start
rather than a recommendation, and the script is deliberately built so that almost
every part of it can be moved without breaking anything else — so move things.
Put the same anchor on three different chart timeframes and watch how the grid
changes character. Run the panel's three columns as 4H/D/W for a session, then as
D/W/M, and see which alignment you actually read. Switch the VWAP anchor from
session to weekly, or match it to the deviation anchor, and notice how differently
the two reference points behave when they reset together versus separately. Try
the bar colouring on one source, then the other, with the grid lines switched off
entirely. Step the deviation preset up and down on an instrument you know well
until the spacing stops feeling arbitrary — that is usually the moment the tool
starts being useful, and it is different for every instrument and every holding
period. Custom exists for when you get there.
Nothing you change is destructive and nothing is hidden behind a setup process:
every input has a tooltip explaining what it does and, where it matters, what it
interacts with. The fastest way to understand any of this is an afternoon of
switching things on and off on a chart you already have an opinion about.
12. LIMITATIONS AND KNOWN BEHAVIOURS
These are consequences of the design choice in section 1, and are stated rather
than hidden.
Leading partial period is blank. Nothing is latched until the first rollover INSIDE
loaded history, so the leftmost partial anchor period has no open and therefore no
grid, no buffers, no labels and no bar colour. It scales inversely with chart
resolution — trivial on a 15-minute chart holding thirty weeks, pronounced on a
1-minute chart holding two. Scroll hard left to see it. It is not a fault, and it is
the exact price of using no lookahead.
Columns longer than loaded history report nothing. No boundary in history means no
open, which cascades through every row, so the Δ cell says "no boundary yet" to make
the cause legible instead of leaving the column looking broken. This is a bar-density
effect: roughly 20,000 loaded one-minute bars is about 2.5 months of a 6.5-hour
equity session but under three weeks of a 24-hour instrument, so a monthly column
resolves on the former and not the latter. It also moves with the viewer's data
plan, so two users on the same chart can see different columns populated. The remedy
in every case is to view the same period on a higher chart timeframe — and in
practice column choice tracks chart timeframe anyway.
The open is session-dependent. It is the first chart bar's open under your CURRENT
session settings, which on an extended-hours symbol need not equal the feed's
official daily open. Verified to line up with session boundaries across equities,
indices and FX; it is simply the property to know about when comparing against a
platform VWAP or a broker's stated open.
The first snapshot is skipped. On the very first rollover in loaded history there is
no preceding period to snapshot, so that one period's historical segments and buffer
boxes are absent. It degrades quietly.
Buffer does not scale with the grid, as described in section 4.
The grid is not volatility-adaptive. Levels are fixed arithmetic percentages of the
open. The script does not measure realised volatility and will not widen the grid in
a volatile regime — step selection is yours to make and to revisit.
References need data. The moving average needs its full lookback before plotting;
VWAP needs volume and an anchor longer than the chart timeframe.
Drawing budgets. Retained line segments and markers share TradingView's per-script
object limits. When a ceiling is reached the oldest objects are dropped, so recent
history is never what goes missing. Reducing the marker range or the historical
buffer lookback extends how far back the rest survives.
Chart type. Use standard candles or bars. Heikin Ashi, Renko, Kagi and range bars
synthesise their own prices, which distorts every level, every touch and every alert
this script produces.
Finally, this is a measurement and context tool. It reports where price is relative
to a period open and tells you when that changes. It does not forecast direction,
and nothing in it should be read as a prediction or as a standalone entry system.
13. NOTES
Open source under the Mozilla Public License 2.0, and the source is heavily
commented — every design decision above, including the ones I chose not to make and
why, is documented in the code itself alongside the reversion instructions.
All logic is self-contained. No external libraries, no imported code from other
authors, no request.security() of any kind.
Defaults ship usable rather than optimal for any one instrument: weekly anchor, 1%
grid, touched-only historical lines, 0.15% buffer with 44 periods of history,
200-period SMA, session VWAP with bands off, deviation bar colouring, markers off,
and the buffer and at-level alert channels enabled.
This is a separate publication from my earlier opening-deviation script rather than
an update to it, because the feature set and default behaviour differ enough that
replacing the original in place would change existing users' charts without warning.
The earlier version remains available and unchanged.
مؤشر

Adaptive Structure Support & ResistanceChinese description is provided below. Chinese readers, please scroll down to read.
A structure-based support and resistance framework using confirmed pivots, price clustering, adaptive search ranges, historical reaction analysis and post-break role reversal.
1. What is this indicator?
Adaptive Structure Support & Resistance is a market-structure tool designed to identify the support and resistance areas that are currently most relevant to price.
The purpose of this script is not to display every historical swing high and swing low.
Instead, it attempts to answer a more practical question:
Among all historical turning points, which price areas still have enough structural significance to matter to the current market?
The script therefore treats support and resistance as a multi-stage structural problem.
The complete process is:
Identify confirmed swing highs and swing lows.
Merge nearby turning points into structural price clusters.
Evaluate the historical importance of each cluster.
Determine how far above and below the current price the model needs to search.
Select the most relevant support and resistance structures.
Evaluate the historical strength of the selected structures.
Convert exact levels into practical support/resistance zones.
Track what happens after a confirmed break.
Require a retest or rebound before confirming a support/resistance role reversal.
This means that the script is not simply:
ta.pivothigh(...)
ta.pivotlow(...)
followed by two horizontal lines.
Confirmed pivots are only the raw structural observations. Several additional stages are used before a level becomes the displayed support or resistance.
2. Why was this model designed?
Traditional automatic support/resistance tools often face several practical problems.
Too many levels
If every historical pivot is plotted independently, the chart can quickly become filled with horizontal lines. Many of those lines represent nearly identical prices or structures that are no longer relevant.
A single pivot may not represent a meaningful structure
A temporary local high or low can occur for many reasons. A more meaningful market structure often forms when price reacts around the same area multiple times.
Fixed search distances do not work equally well for every instrument
A low-volatility instrument may have meaningful support only 10–20% below the current price.
A highly volatile or strongly trending instrument may require a much wider historical price range before a significant support or resistance structure appears.
The nearest level is not always the most important level
A minor pivot located very close to current price may be less meaningful than a slightly more distant area that has produced several strong historical reactions.
A breakout does not automatically mean role reversal
Resistance does not necessarily become support simply because price trades above it once.
Likewise, support does not necessarily become resistance immediately after one breakdown.
The model is designed around these problems.
Its goal is therefore not to maximize the number of detected structures, but to reduce historical information into a smaller set of currently relevant structural areas.
3. Where can this indicator be used?
The script is intended for standard price charts where historical swing structure is meaningful.
Typical applications include:
Stocks
Indices
ETFs
Futures
Foreign exchange
Cryptocurrency
Other liquid instruments with usable price history
It can be used on different timeframes, but the meaning of the detected structure changes with the timeframe.
For example:
A support structure on a 15-minute chart describes short-term intraday structure.
A support structure on a daily chart describes a larger swing structure.
A support structure on a weekly chart may represent a long-term structural price area.
The indicator does not automatically convert a lower-timeframe level into a higher-timeframe level.
The displayed support and resistance always belong to the chart timeframe being analyzed.
4. Core principle: confirmed structural pivots
The first stage identifies confirmed pivot highs and pivot lows.
A pivot requires price bars on both sides of the potential turning point.
Representative logic:
float pivotHigh = ta.pivothigh(
high,
pivotLeftBarsInput,
pivotRightBarsInput)
float pivotLow = ta.pivotlow(
low,
pivotLeftBarsInput,
pivotRightBarsInput)
The important word here is confirmed .
A newly formed high is not immediately considered a structural resistance observation.
A newly formed low is not immediately considered a structural support observation.
The model waits for the configured number of right-side bars before confirming the pivot.
The intention is to sacrifice some immediacy in exchange for more stable structural observations.
This also means that pivot detection naturally contains confirmation delay.
That delay is part of the methodology rather than an attempt to predict a turning point before it exists.
5. Core principle: price clustering
Multiple pivots occurring around similar prices should not necessarily be treated as unrelated horizontal levels.
For this reason, the script groups nearby pivot observations into price clusters.
Conceptually:
float distancePercent =
math.abs(price - clusterPrice) /
clusterPrice *
100.0
if distancePercent <= mergePercent
matchingIndex := clusterIndex
If several historical lows occur around approximately the same area, they can contribute to one support structure.
The same process applies to historical highs when building resistance structures.
This changes the interpretation from:
"Price touched 12.01, 12.05 and 12.09."
to:
"Price has repeatedly reacted around the same structural area."
The cluster center is updated using the accumulated structural contribution of its observations rather than simply keeping the first pivot price.
6. Core principle: structural ranking
Not every cluster deserves the same importance.
Each pivot contributes a base structural score that incorporates relative volume participation and recency.
A simplified representation of the calculation is:
float pivotBaseScore =
1.0 +
volumeWeightInput * volumeRatio +
recencyWeightInput * recencyFactor
When several pivots belong to the same cluster, their contributions accumulate.
After the candidate clusters have been created, the model evaluates structures within the active search range.
The final ranking also gives a limited preference to structures nearer the current price:
float candidateRank =
accumulatedBaseScore +
proximityBonusInput *
proximityFactor
Proximity is therefore useful, but it is not the entire model.
A level is not selected only because it is the nearest pivot.
7. Relative volume participation
Historical price reactions can contain different levels of market participation.
For each pivot observation, volume is compared with its recent average.
Representative logic:
float volumeRatio =
pivotAverageVolume > 0.0
? math.min(
pivotVolume / pivotAverageVolume,
3.0)
: 1.0
Higher relative volume can contribute additional structural weight.
However, volume is only one component.
The model does not assume that high volume by itself automatically creates support or resistance.
8. Historical reaction analysis
A structural level is more informative when historical interactions with that area produced meaningful price responses.
For a support pivot, the model measures the maximum upside response after the confirmed low during a configurable observation window.
Conceptually:
float reactionPercent =
(highestPostPivotPrice / pivotPrice - 1.0) *
100.0
For resistance, the opposite calculation is used:
float reactionPercent =
(pivotPrice - lowestPostPivotPrice) /
pivotPrice *
100.0
This allows the model to distinguish between two different situations.
A level that price touched repeatedly but barely reacted to.
A level where historical interaction repeatedly produced meaningful rejection or recovery.
These situations are not treated as structurally equivalent.
9. Why the search range is adaptive
One of the main design features of this script is that support and resistance do not have to use the same fixed search distance.
A fixed 25% range can work well for one instrument but fail on another.
A fixed 100% range may capture important historical structures, but can also introduce unnecessarily distant structures when meaningful nearby levels already exist.
The Auto mode therefore uses progressive search tiers.
25%
50%
75%
100%
The algorithm first asks whether the nearest tier contains a structure that satisfies minimum structural requirements.
If it does, the search can stop.
If it does not, the model expands to the next tier.
Representative logic:
if distancePercent <= 25.0
result := 25.0
else if distancePercent <= 50.0 and maximumRangePercent >= 50.0
result := 50.0
else if distancePercent <= 75.0 and maximumRangePercent >= 75.0
result := 75.0
else if distancePercent <= 100.0 and maximumRangePercent >= 100.0
result := 100.0
The important feature is that support and resistance are evaluated independently .
For example:
Support search range: 25%
Resistance search range: 75%
This can occur when a meaningful support structure exists close below price, while the next meaningful resistance structure is much farther above the market.
10. The model does not stop at the first nearby pivot
Adaptive search would not be useful if any small nearby pivot could immediately stop expansion.
The model therefore requires a nearby structure to satisfy minimum quality conditions.
Conceptually:
bool qualifiedStructure =
touchCount >= minimumStructureTouchesInput and
structureQuality >= adaptiveQualityThreshold
Only a qualified structure can stop the search from expanding to the next distance tier.
This prevents a minor local pivot from automatically hiding a larger and more meaningful historical structure.
11. Volatility-aware search adjustment
Volatility also affects how much evidence is required from nearby structures.
ATR is converted into a percentage of price:
float currentAtrPercent =
close > 0.0
? averageTrueRange / close * 100.0
: 0.0
When volatility is high, the minimum structural-quality requirement is increased moderately.
Representative logic:
if currentAtrPercent >= 6.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 8.0
else if currentAtrPercent >= 4.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 5.0
The purpose is not simply:
Higher volatility = wider search range.
Instead:
Higher volatility = minor nearby structures need stronger evidence before they are allowed to stop the search.
This distinction is important.
Volatility assists the structural search; it does not independently determine support or resistance.
12. Structural quality used by adaptive search
To decide whether search expansion can stop, a separate quality model evaluates candidate clusters.
The quality assessment combines several components:
Number of structural interactions
Average historical reaction
Relative volume participation
Recency
Accumulated structural contribution
A simplified representation is:
float structureQuality =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
baseScoreComponent
The result is bounded to a 0–100 scale.
clampValue(
structureQuality,
0.0,
100.0)
This quality score primarily answers:
"Is this structure meaningful enough for the adaptive search to stop here?"
It is separate from the final displayed strength score.
13. Selecting the final support and resistance
After the adaptive search distance has been determined, the model evaluates all valid clusters inside that range.
For support:
The cluster must be below or near the current price.
It must remain inside the active support search range.
Its structural score is combined with a proximity adjustment.
For resistance, the same process is applied above current price.
The highest-ranked candidate becomes the primary structural level.
This means that the displayed level represents the outcome of:
confirmed pivots → clustering → structural scoring → adaptive distance selection → final ranking
rather than simply selecting the latest high or low.
14. Strength score: what does 0–100 mean?
After the primary support and resistance levels are selected, the model performs a second evaluation.
This stage describes the historical quality of the selected structure .
The strength score considers:
Touch count
Average reaction after historical interactions
Relative volume participation
Recency
Repeated crossings of the level
Fast failed breaks
The positive components are conceptually:
float rawStrengthScore =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
stabilityComponent -
totalPenalty
Repeated crossings reduce the score:
float totalPenalty =
crossingCount *
crossingPenaltyInput +
failedBreakCount *
failedBreakPenaltyInput
The final value is limited to 0–100.
The interface converts it into:
Weak
Medium
Strong
The score should not be interpreted as:
82 points = 82% probability that support will hold.
It does not represent probability, expected return or strategy win rate.
It is a normalized description of historical structural behavior.
15. Why repeated crossings reduce strength
A price level may appear frequently in historical data simply because the market traded through it many times.
That does not necessarily make the level stronger.
A structurally useful support or resistance area usually produces some degree of rejection, recovery or directional response.
For this reason, the script counts repeated close-to-close crossings.
Representative logic:
bool crossedAbove =
olderClose <= level and
newerClose > level
bool crossedBelow =
olderClose >= level and
newerClose < level
if crossedAbove or crossedBelow
crossingCount += 1
Frequent crossings therefore reduce structural strength instead of increasing it automatically.
16. Why support and resistance are displayed as zones
Real market structure rarely operates at one mathematically exact tick.
Several pivots may occur at slightly different prices while still representing the same area.
The script therefore displays:
A center structural level
A surrounding structural zone
Zone width contains two elements.
First, the actual spread of the clustered pivot prices.
Second, a small volatility-sensitive padding:
float zonePadding =
math.max(
selectedLevel *
minimumZoneWidthPercentInput /
100.0,
averageTrueRange *
atrZoneMultiplierInput)
The center line is useful for reference.
The surrounding area is intended to represent the broader price region where structural interaction may occur.
17. Breakout detection uses the previous structure
There is an important implementation detail in breakout detection.
When price breaks resistance, the current resistance calculation may immediately change because current price itself has changed.
If breakout detection used only the newly recalculated structure, the model could lose the level that price actually broke.
The script therefore references the previously confirmed zone:
float previousResistanceZoneUpperBound =
resistanceZoneUpperBound
float resistanceBreakTrigger =
previousResistanceZoneUpperBound *
(1.0 +
breakoutBufferPercentInput /
100.0)
The same principle applies to support breakdowns.
This allows the structural state machine to remember the actual area involved in the break.
18. Resistance does not immediately become support
A confirmed break starts a new structural state.
The model uses named states internally:
const int STATE_NORMAL = 0
const int STATE_BREAKOUT_WAITING_RETEST = 1
const int STATE_RESISTANCE_TO_SUPPORT = 2
const int STATE_BREAKDOWN_WAITING_REBOUND = -1
const int STATE_SUPPORT_TO_RESISTANCE = -2
After resistance is broken:
The previous resistance area is stored.
The model enters a "waiting for retest" state.
Price is monitored for a return toward the old resistance.
If the retest holds, the former resistance may become support.
If price falls back through the old zone, the breakout is treated as failed.
Representative confirmation logic:
bool testedFormerResistance =
low <=
roleReversalUpperBound *
(1.0 +
retestTolerancePercentInput /
100.0)
bool retestHeld =
testedFormerResistance and
close > roleReversalUpperBound
Only after this process can the old resistance be promoted to support.
19. Support-to-resistance uses the opposite process
After support is broken:
The previous support area is stored.
The model waits for a rebound.
Price must test the former support area.
If price is rejected and cannot recover the area, the former support can become resistance.
Representative logic:
bool testedFormerSupport =
high >=
roleReversalLowerBound *
(1.0 -
retestTolerancePercentInput /
100.0)
bool reboundRejected =
testedFormerSupport and
close < roleReversalLowerBound
This creates a distinction between:
price crossed a level
and:
the market actually completed a structural role reversal.
20. Failed breakout and failed breakdown
The script also monitors invalidation after a break.
If resistance is broken but price quickly returns below the former resistance structure, the event can be treated as a failed breakout.
If support is broken but price quickly recovers the former support structure, the event can be treated as a failed breakdown.
These events reset the pending role-reversal process rather than automatically promoting the old structure to a new role.
21. How to use the indicator
A simple workflow is:
Locate the current support
Identify the support area below the current market.
This is the structural area currently considered most relevant by the model.
Locate the current resistance
Identify the active structural resistance above price.
Read the strength
A stronger score indicates that the selected structure has historically shown better structural characteristics under this model.
It does not mean the level cannot break.
Read "Why this level?"
The dashboard shows the number of historical structural interactions and the average subsequent reaction.
This gives a plain-language explanation for why the level has been selected.
Check how far the algorithm searched
For example:
"Below 25% | Above 75%"
means that qualified support was available relatively close below current price, while the model had to inspect a much wider area to find qualified resistance.
Observe the current structural state
The dashboard may report states such as:
"Price is between support and resistance"
"Resistance broken; waiting for a retest"
"Former resistance is currently acting as support"
"Support broken; waiting for a rebound"
"Former support is currently acting as resistance"
22. Practical interpretation
The indicator is designed primarily as a context tool .
For example:
Price approaching strong support does not automatically mean "buy".
It means price is entering an area that has meaningful structural evidence and may deserve closer observation.
Likewise:
Price approaching resistance does not automatically mean "sell".
It identifies an area where historical supply or rejection has been structurally significant.
A trader can then combine that context with his or her own analysis of:
Price action
Volume
Trend
Market regime
Higher-timeframe structure
Risk/reward
Position sizing
Independent fundamental or macro analysis
The script itself does not generate automatic buy or sell orders.
23. Dashboard explanation
The dashboard intentionally avoids exposing every internal statistical variable.
Instead, it translates the model into simpler trading language.
Support
Current selected support level and its strength evaluation.
Why this level?
Shows how many historical structural interactions contributed to the area and the average subsequent upside response.
Resistance
Current selected resistance level and strength evaluation.
Why this level?
Shows historical interactions and the average subsequent downside response.
How far it searched
Shows the active adaptive search range below and above the current market.
Current state
Explains whether price remains between the structures, has broken one of them, is waiting for confirmation, or has completed a role reversal.
24. Main settings
Lookback Bars
Controls how much historical price data is considered when constructing structural clusters.
A longer lookback includes more historical structure but may also retain older information.
Pivot Left Bars / Pivot Right Bars
Control how strict pivot confirmation is.
Larger values generally identify larger structural turns but require more confirmation.
Price Cluster Width %
Controls how close two pivot observations must be before they can belong to the same structural area.
Search Mode
Auto allows support and resistance to determine their own search distances.
Manual uses a fixed maximum distance.
Maximum Auto Range
Defines the maximum distance the adaptive search is allowed to inspect.
Minimum Structure Quality
Controls how meaningful a structure must be before it can stop automatic search expansion.
Minimum Valid Tests
Defines the minimum number of structural observations required for a candidate to qualify during adaptive search.
Reaction Observation Bars
Defines how many bars after a historical pivot are examined when measuring its subsequent price reaction.
Break Confirmation Buffer
Adds a small margin beyond the old structural zone before a break is considered confirmed.
Retest Tolerance
Controls how close price must return to the former structural area during retest/rebound evaluation.
25. Alerts
Alert conditions are provided for:
Resistance break
Support break
Resistance confirmed as support
Support confirmed as resistance
Failed breakout
Failed breakdown
When close confirmation is enabled, structural break events are evaluated on confirmed bars.
26. About repainting and structural updates
This script should not be interpreted as a system that predicts pivots before they are confirmed.
Pivot highs and lows require right-side confirmation bars.
Therefore:
A newly forming pivot is not shown as confirmed structure until sufficient bars exist to confirm it.
Once new market data arrives, the active support and resistance can still change for legitimate structural reasons.
Examples include:
A new confirmed pivot enters the calculation.
Several new observations create a stronger price cluster.
Current price moves enough to change the relevant search region.
An older observation exits the configured lookback window.
A breakout creates a role-reversal state.
This is dynamic structural recalculation, not a promise that current support and resistance will remain fixed forever.
27. Why these components belong together
This script combines several concepts, but they are not independent indicators placed together for convenience.
Each component solves a different stage of the same problem.
Confirmed pivots identify potential structural observations.
Price clustering converts nearby observations into common price areas.
Structural ranking determines which areas contain more meaningful historical evidence.
Adaptive search determines how far the model needs to inspect for an adequate structure.
Reaction analysis measures how price historically responded to that structure.
Strength evaluation summarizes the historical quality of the selected area.
ATR-based zone construction converts an exact center price into a practical market area.
The role-reversal state machine manages what happens after the structure is broken.
The components are therefore sequential stages of one structural support/resistance framework rather than a mashup of unrelated indicators.
28. What is distinctive about this implementation?
The primary design characteristics of this implementation are:
Nearby pivots are aggregated into structural price clusters rather than displayed independently.
Support and resistance use independent adaptive search ranges.
Search expansion depends on structural quality rather than distance alone.
Volatility modifies the evidence required from nearby structures.
Level selection and level-strength evaluation are deliberately separated.
Repeated crossings and failed breaks can reduce structural strength.
Support and resistance are represented as price areas instead of exact single-price barriers.
Break detection references the previous structural zone.
Role reversal requires confirmation through a state machine instead of occurring immediately after a single crossing.
The chart intentionally focuses on the current relevant structure rather than filling the chart with historical event markers.
29. Limitations
No support/resistance algorithm can know with certainty whether a level will hold or fail.
Important limitations include:
Pivot confirmation introduces intentional delay.
Support and resistance may change as new information becomes available.
Historical reaction does not guarantee future reaction.
A high strength score is not a probability of success.
Very new instruments with limited history may not contain enough structural observations.
Strong trend transitions can invalidate historical structures quickly.
Volume-based components depend on the quality and meaning of the instrument's volume data.
Different timeframes can produce materially different support and resistance structures.
Synthetic or non-standard chart types may use transformed OHLC values and can therefore produce different structural results.
30. Final note
Support and resistance should be understood as areas of market interaction, not guaranteed turning points.
The purpose of this indicator is to organize historical structure and reduce it into a small number of currently relevant price areas.
It is an analytical framework, not an automatic trading system.
This script is intended for market-structure analysis and educational use. It does not constitute investment advice, a recommendation, or a guarantee of future market performance.
────────────────────────────────────
中文说明
1. 这个指标是什么?
Adaptive Structure Support & Resistance 是一个基于市场历史结构,自动寻找当前价格上下方关键支撑与压力区域的分析工具。
它解决的并不是:
“历史上哪里出现过高点和低点?”
而是试图解决一个更实际的问题:
“历史上这么多高低点里,哪些价格区域到现在仍然具有足够的结构意义,值得当前继续关注?”
所以,这个指标不是简单地把每一个 Pivot High 和 Pivot Low 都画成水平线。
完整计算过程包括:
识别已经确认的历史高低结构。
把价格相近的多个结构合并成一个价格簇。
评价不同价格簇的历史结构意义。
分别判断寻找支撑和压力到底需要看多远。
从有效搜索范围中选择当前更重要的支撑与压力。
评价被选中位置过去的实际价格反应。
将精确价格转化为更加符合实际交易的撑压区域。
价格突破或跌破以后保存原结构。
通过回踩或反抽确认撑压角色是否真正发生转换。
因此,Pivot 只是整个模型的第一步,而不是最终结果。
2. 为什么要做这套模型?
传统的自动支撑压力工具经常存在几个问题。
画出来的线太多
如果把每个前高前低全部保留下来,时间稍长以后主图会出现大量水平线。
不仅影响阅读,而且其中很多价格其实属于同一个结构。
单个高低点不一定有意义
市场临时出现一个局部最高点或最低点,并不能说明这个价格一定存在真正的供需结构。
如果不同时间价格多次来到相近区域并产生反应,它所代表的结构意义通常更加完整。
不同标的不能使用完全相同的搜索距离
有些股票距离现价下方 20% 就存在非常明确的历史结构。
有些高波动、长期趋势较强的股票,却可能需要向下或者向上看 50%、75% 甚至更远,才能找到真正有意义的位置。
距离最近的不一定最重要
现价附近可能存在一个很小的 Pivot,但稍微远一点的位置可能历史上被多次验证,并且每次都出现较大价格反应。
突破并不等于立刻完成撑压转换
突破压力一次,不应该马上认为压力已经变成支撑。
跌破支撑一次,也不应该马上认为原支撑已经成为新压力。
所以这套模型的设计目标不是“尽量多找线”。
而是:
尽量把复杂的历史价格结构压缩成少量、当前更值得关注的支撑和压力区域。
3. 可以用在哪里?
只要历史价格结构具有一定参考意义,理论上都可以使用,例如:
股票
指数
ETF
期货
外汇
加密资产
其他具有正常历史行情数据的流动性标的
不同周期看到的是不同级别的结构。
例如:
15分钟图得到的是偏短线结构。
日线得到的是波段级结构。
周线得到的是更长期的历史结构。
指标不会把15分钟的支撑自动解释成日线支撑。
所有计算都基于当前图表所使用的周期。
4. 第一步:确认历史结构高低点
模型首先通过已经确认的 Pivot High 与 Pivot Low 获取历史结构观察点。
核心逻辑:
float pivotHigh = ta.pivothigh(
high,
pivotLeftBarsInput,
pivotRightBarsInput)
float pivotLow = ta.pivotlow(
low,
pivotLeftBarsInput,
pivotRightBarsInput)
这里最重要的是“确认”。
一个刚刚形成的高点不会马上成为正式压力结构。
一个刚刚形成的低点也不会马上成为正式支撑结构。
需要等待右侧一定数量的K线完成确认。
所以模型主动接受一定的确认延迟,用来减少把尚未成立的短期极值直接当成重要结构的情况。
5. 第二步:把相近价格合并成一个结构
如果历史上存在:
12.01
12.05
12.09
这三个低点,实际上它们很可能描述的是同一片支撑区域,而不是三条完全独立的支撑线。
所以系统会计算不同 Pivot 之间的价格距离:
float distancePercent =
math.abs(price - clusterPrice) /
clusterPrice *
100.0
if distancePercent <= mergePercent
matchingIndex := clusterIndex
如果距离足够接近,就把它们合并到同一个价格结构中。
这样模型关注的就不再是:
“12.01碰过一次”
而是:
“12元附近这个区域历史上反复出现过结构反应。”
6. 第三步:给历史结构进行初步排序
并不是所有 Pivot 对结构的重要性都一样。
模型会考虑:
当时成交量相对大小
这个结构距离现在有多久
多个 Pivot 是否属于同一个价格区域
基础贡献大致表现为:
float pivotBaseScore =
1.0 +
volumeWeightInput * volumeRatio +
recencyWeightInput * recencyFactor
多个相近 Pivot 被合并后,它们的结构贡献会累积。
最后选择当前结构时,还会给予距离现价较近的位置一定加分:
float candidateRank =
accumulatedBaseScore +
proximityBonusInput *
proximityFactor
但这里需要注意:
“距离近”只是一个因素,并不是谁离现价最近就一定选择谁。
7. 成交量在这里做什么?
模型会把 Pivot 当时的成交量与近期平均成交量进行比较。
例如:
float volumeRatio =
pivotAverageVolume > 0.0
? math.min(
pivotVolume / pivotAverageVolume,
3.0)
: 1.0
如果某个结构形成时伴随更明显的市场参与,它可以得到额外权重。
但是成交量并不会单独决定支撑压力。
它只是结构评价中的一个辅助信息。
8. 历史触碰以后到底有没有真正反应?
一个位置历史上碰过很多次,并不代表它一定很重要。
关键还要看:
碰到以后,价格到底有没有发生真正的反向运动?
对于历史支撑 Pivot,系统观察之后一定K线范围内出现的最大向上反应。
核心思想:
float reactionPercent =
(highestPostPivotPrice / pivotPrice - 1.0) *
100.0
对于历史压力,则计算后续最大回落:
float reactionPercent =
(pivotPrice - lowestPostPivotPrice) /
pivotPrice *
100.0
这样能够区别:
一个历史上经常出现,但价格几乎没有明显反应的位置。
一个每次靠近以后,价格都出现较明显反转或回撤的位置。
9. 为什么搜索距离必须智能调整?
这是这个模型比较重要的一部分。
固定使用25%的搜索范围并不适合所有标的。
固定使用100%,又可能在不必要的情况下把非常遥远的历史结构纳入计算。
所以自动模式采用:
25%
50%
75%
100%
逐级寻找。
核心映射逻辑:
if distancePercent <= 25.0
result := 25.0
else if distancePercent <= 50.0 and maximumRangePercent >= 50.0
result := 50.0
else if distancePercent <= 75.0 and maximumRangePercent >= 75.0
result := 75.0
else if distancePercent <= 100.0 and maximumRangePercent >= 100.0
result := 100.0
如果25%以内已经存在合格结构,就可以停止。
如果没有,就扩大到50%。
依次类推。
10. 支撑和压力是分别搜索的
支撑和压力并不会强制使用同一个范围。
完全可能出现:
下方支撑搜索:25%
上方压力搜索:75%
它表达的意思是:
下方距离现价比较近的地方已经存在足够明确的历史支撑结构。
但是上方近距离没有达到要求的压力,所以模型继续向更远的位置寻找。
11. 为什么不是25%以内随便有个Pivot就停止?
如果只要附近出现一个 Pivot 就停止寻找,所谓智能搜索就没有意义。
因此,候选结构必须同时满足最低触碰次数和最低结构质量。
例如:
bool qualifiedStructure =
touchCount >= minimumStructureTouchesInput and
structureQuality >= adaptiveQualityThreshold
这意味着:
附近有结构 ≠ 附近有足够好的结构。
如果近端只是一个很弱的小级别价格点,系统仍然可以继续扩大搜索范围。
12. 波动率为什么也参与?
系统使用 ATR 相对于当前价格的比例观察标的自身波动程度。
float currentAtrPercent =
close > 0.0
? averageTrueRange / close * 100.0
: 0.0
高波动股票附近出现小 Pivot 非常正常。
因此,对于高波动标的,系统会适当提高“附近结构足够好”的要求。
例如:
if currentAtrPercent >= 6.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 8.0
else if currentAtrPercent >= 4.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 5.0
这里不是:
“ATR越高,搜索距离一定越远。”
而是:
“波动越高,附近的小结构必须更有说服力,才能阻止系统继续向外寻找。”
13. 智能搜索中的结构质量怎么计算?
用于决定“是否还要继续扩大搜索范围”的结构质量,主要包含:
历史触碰次数
触碰后的平均反应
相对成交量
结构新旧程度
多个结构累积后的基础得分
可以简化理解为:
float structureQuality =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
baseScoreComponent
最后压缩到0–100:
clampValue(
structureQuality,
0.0,
100.0)
这个分数主要解决的是:
“这个位置够不够好,好到可以不用继续向外找了?”
14. 最终支撑压力怎么选?
确定搜索范围以后,系统会重新检查范围内所有候选结构。
支撑必须位于现价下方或附近。
压力必须位于现价上方或附近。
最后比较:
历史结构累积得分
与当前价格的距离
选择当前 Rank 更高的结构。
所以最终看到的线经历了:
Pivot确认
→ 相近价格聚类
→ 结构评价
→ 智能搜索距离
→ 范围内重新排序
→ 最终支撑压力
15. 0–100强度分数到底是什么意思?
当最终支撑压力确定以后,系统会再做一次独立评价。
这一部分不是用来重新选择线,而是告诉你:
“现在已经选中的这条结构,历史质量到底怎么样?”
主要考虑:
触碰次数
历史平均反应
相对成交量
结构是否较新
是否经常被来回穿越
是否出现过快速失败突破
大致计算结构:
float rawStrengthScore =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
stabilityComponent -
totalPenalty
其中反复穿越和失败突破会扣分:
float totalPenalty =
crossingCount *
crossingPenaltyInput +
failedBreakCount *
failedBreakPenaltyInput
最后得到0–100,并转化成:
弱
中
强
但是一定不要理解成:
“82分 = 未来82%概率守住。”
它不是胜率,也不是未来预测概率。
它只是对历史结构质量进行标准化后的评分。
16. 为什么反复穿越反而扣分?
有些价格历史上出现很多次,仅仅是因为市场一直在这个位置上下震荡。
如果价格能够非常轻松地不断穿过这个位置,它未必是真正强支撑或强压力。
所以系统统计价格穿越中心结构的情况:
bool crossedAbove =
olderClose <= level and
newerClose > level
bool crossedBelow =
olderClose >= level and
newerClose < level
穿越越频繁,结构稳定性评价越低。
17. 为什么画的是区域,不只是一条线?
真实交易中,很少存在一个价格精确到最小报价单位以后永远有效。
历史多个 Pivot 本身就可能分布在一个小区间里。
所以模型保留:
中心结构价格
结构区域
区域宽度由:
历史 Pivot 聚类本身的价格范围
少量 ATR 波动缓冲
共同决定。
核心思想:
float zonePadding =
math.max(
selectedLevel *
minimumZoneWidthPercentInput /
100.0,
averageTrueRange *
atrZoneMultiplierInput)
中心线用于定位。
阴影区域用于表达真实市场中的价格博弈带。
18. 为什么突破使用上一根K线的压力?
这是结构判断里很重要的一点。
当价格突破压力以后,如果马上重新计算当前压力,那么旧压力可能已经被系统替换。
这样反而不知道价格刚刚突破的到底是哪一个结构。
所以突破判断使用突破之前已经存在的压力区域:
float previousResistanceZoneUpperBound =
resistanceZoneUpperBound
并基于它计算突破标准:
float resistanceBreakTrigger =
previousResistanceZoneUpperBound *
(1.0 +
breakoutBufferPercentInput /
100.0)
支撑跌破同理。
19. 突破压力以后为什么不能马上变成支撑?
系统内部使用一个状态机:
const int STATE_NORMAL = 0
const int STATE_BREAKOUT_WAITING_RETEST = 1
const int STATE_RESISTANCE_TO_SUPPORT = 2
const int STATE_BREAKDOWN_WAITING_REBOUND = -1
const int STATE_SUPPORT_TO_RESISTANCE = -2
突破压力以后:
保存原来的压力区域。
进入“等待回踩”状态。
观察价格是否重新回来测试原压力。
如果回踩以后守住,才确认压力转支撑。
如果重新跌回原结构下方,则视为突破失败。
回踩逻辑类似:
bool testedFormerResistance =
low <=
roleReversalUpperBound *
(1.0 +
retestTolerancePercentInput /
100.0)
bool retestHeld =
testedFormerResistance and
close > roleReversalUpperBound
20. 支撑转压力同样需要确认
支撑跌破以后:
保存原来的支撑。
等待价格反抽。
观察反抽是否重新接触原支撑区域。
如果无法重新站回,才确认原支撑变成压力。
例如:
bool testedFormerSupport =
high >=
roleReversalLowerBound *
(1.0 -
retestTolerancePercentInput /
100.0)
bool reboundRejected =
testedFormerSupport and
close < roleReversalLowerBound
因此模型会区分:
“价格只是穿过了一下”
与:
“原来的市场结构真正完成了角色转换”
21. 实际怎么使用?
最简单的使用顺序:
先看支撑在哪里
这是当前算法认为下方更值得关注的历史结构区域。
再看压力在哪里
这是当前上方更值得关注的历史结构区域。
看强度
强度越高,代表这个结构在模型评价中具有更好的历史表现。
但再强也可能被突破。
看“为什么是它?”
这里会直接告诉你历史上大致碰过多少次,以及碰到以后平均出现多大的反向运动。
看“算法看了多远”
例如:
下方25%|上方75%
意味着下方较近就找到了合格支撑,但是上方需要看更远,才找到合格压力。
最后看“现在怎么看”
这里会告诉你目前属于:
价格仍在支撑压力之间;
突破压力等待回踩;
原压力已经转为支撑;
跌破支撑等待反抽;
原支撑已经转为压力;
等结构状态。
22. 应该如何理解支撑压力?
这个指标最适合作为“位置和结构背景工具”。
例如:
价格到了强支撑,不等于自动买入。
它代表价格已经进入一个历史结构相对重要的位置,值得进一步观察。
同样:
价格到了强压力,也不等于必须卖出。
它代表价格进入过去曾经出现明显供给或回落反应的区域。
后续仍然可以结合自己的:
价格行为
成交量
趋势结构
大周期方向
市场环境
赔率
风险控制
仓位管理
共同判断。
23. 右上角面板怎么看?
我刻意没有把所有内部统计数据全部堆在面板上。
面板只保留实际使用中更容易理解的信息。
支撑位置
当前支撑在哪里,以及它的结构强弱。
为什么是它?
告诉你历史触碰次数和触碰以后平均反弹幅度。
压力位置
当前压力在哪里,以及强弱。
为什么是它?
告诉你历史触碰次数和之后平均回落幅度。
算法看了多远
显示支撑和压力分别使用了多大的搜索范围。
现在怎么看
使用大白话告诉你当前市场与撑压之间处于什么结构状态。
24. 常用参数怎么理解?
Lookback Bars / 回看K线数
决定使用多少历史K线寻找结构。
周期越长,可以考虑更久以前的结构,但也可能保留更多较旧的信息。
Pivot Left / Right Bars
决定 Pivot 判断严格程度。
数值越大,一般意味着只识别更明显的结构转折,同时确认速度也会更慢。
Price Cluster Width %
决定两个历史 Pivot 相差多少以内可以被认为属于同一结构。
Search Mode
Auto:自动决定支撑和压力分别要搜索多远。
Manual:手动固定搜索范围。
Maximum Auto Range
智能搜索允许向外扩展到的最大距离。
Minimum Structure Quality
决定附近结构必须达到多高质量,才能让系统停止继续扩大搜索。
Minimum Valid Tests
智能搜索中,一个结构至少需要多少次历史观察才能成为有效候选。
Reaction Observation Bars
计算历史 Pivot 出现以后,向后观察多少根K线的价格反应。
Break Confirmation Buffer
突破原撑压区域以后,需要额外超过多少缓冲才认定为有效突破。
Retest Tolerance
回踩或反抽过程中,允许价格距离原结构存在多大误差。
25. 警报
指标支持以下 Alert:
有效突破压力
有效跌破支撑
压力确认转支撑
支撑确认转压力
突破失败
跌破失败
如果启用了收盘确认,那么对应结构事件会等待K线确认以后判断。
26. 关于重绘和结构变化
这个指标不是提前预测 Pivot 的工具。
Pivot 本身必须等待右侧K线确认。
因此:
刚刚形成的最高点或最低点,不会在尚未确认时被当成已经成立的正式结构。
但是当前支撑压力未来仍然可能发生变化。
原因包括:
新的 Pivot 被确认。
新的历史触碰让另一个价格簇变得更重要。
现价移动以后,当前最相关的结构发生变化。
旧数据离开回看范围。
价格突破以后发生撑压角色转换。
这是动态结构模型正常的重新评价过程。
27. 为什么这些模块必须放在一起?
虽然指标中包含多个计算部分,但它们并不是几个无关指标简单拼接。
每一个部分都负责解决同一个支撑压力问题中的不同阶段。
Pivot :找出可能的历史结构观察点。
价格聚类 :把相近观察点合并成真正的价格区域。
结构排序 :判断哪些区域具有更多历史证据。
智能搜索 :判断为了找到有效结构到底需要看多远。
历史反应 :判断价格过去触碰以后是否真的产生明显反应。
强度评分 :评价最终选中结构过去的整体质量。
ATR区域 :把一个中心价格转化为更加符合实际市场的撑压带。
状态机 :处理结构突破以后,到底是真突破、失败突破还是完成撑压转换。
因此:
这是一条连续的结构计算链,而不是把多个独立指标组合到同一个脚本中。
28. 这套实现有什么特点?
主要设计特点包括:
不会把所有 Pivot 独立画线,而是先进行价格聚类。
支撑和压力可以使用完全不同的智能搜索距离。
是否扩大搜索范围由结构质量决定,而不是只有距离。
高波动环境会提高附近小结构的有效要求。
“选哪条线”和“这条线有多强”是两个独立计算阶段。
反复穿越会降低结构评分,而不是因为出现次数多就自动变强。
支撑压力使用区域表达,而不是绝对精确价格。
突破使用之前已经存在的结构,而不是突破以后重新计算出的新位置。
撑压转换必须经过回踩/反抽状态确认。
主图只重点展示当前结构,不保留大量历史突破标签干扰图表。
29. 使用限制
任何支撑压力算法都无法提前确定某个位置未来一定守住或者一定突破。
需要注意:
Pivot 确认天然存在延迟。
随着市场产生新数据,当前支撑压力可能发生变化。
历史上反应明显,不代表未来一定继续反应。
强度分数不是未来成功概率。
刚上市或者历史数据很少的标的可能缺少足够结构样本。
趋势发生巨大变化以后,过去有效的结构可能迅速失效。
成交量相关评价依赖该标的成交量数据本身的有效性。
不同周期得到的撑压位置可以完全不同。
非标准K线可能使用经过转换的 OHLC,因此计算结果可能与真实成交价格图存在差异。
30. 最后
支撑和压力应该被理解为市场可能发生博弈的区域,而不是保证发生反转的价格。
这个指标的核心目标,是把复杂的历史市场结构整理成少量、当前更值得观察的位置。
它是市场结构分析框架,而不是自动交易系统。
本指标仅用于市场结构研究与辅助分析,不构成投资建议、收益承诺或任何形式的买卖推荐。 مؤشر

The Essential Pivots
The Essential Pivots
Not every pivot deserves space on your chart.
The Essential Pivots was designed around a simple idea: emphasize the higher-importance pivot levels that tend to attract greater participation, receive more meaningful reactions, and produce larger directional moves—while removing many of the secondary levels that often add more clutter than clarity.
Traditional pivot indicators can fill the chart with numerous support and resistance lines. Although every calculated level may have a purpose, displaying all of them at once can make it difficult to recognize which areas truly matter. The Essential Pivots takes a more selective approach, giving traders a cleaner view of the market’s most significant reference points.
Why These Pivots Matter
Major pivots can act as areas where:
Price pauses, rejects, or reverses
Breakouts gain momentum
Previous resistance becomes support, or support becomes resistance
Buyers and sellers compete for directional control
Trend indicators react, flatten, or change direction
Larger intraday and multi-session moves begin
Because these levels represent broader reference points, they may be watched by more market participants than many lower-priority pivot levels. This does not mean price will always reverse at a pivot. Instead, the levels identify areas where trader attention and the probability of a meaningful reaction may increase.
A Cleaner Approach to Market Structure
The primary purpose of The Essential Pivots is not to predict every market turn. It is to simplify the chart so traders can quickly answer a more useful question:
Where are the most important decision areas right now?
By concentrating on essential pivot levels, the indicator helps reduce visual noise and prevents the chart from becoming a maze of competing horizontal lines. This makes it easier to combine the pivots with price action, market structure, volume, or a preferred trend indicator without overwhelming the screen.
Ways to Use the Indicator
The Essential Pivots can help traders evaluate:
Rejection entries when price tests a pivot and fails to continue
Breakout opportunities when price closes decisively through a level
Retests after a broken pivot changes its role
Profit targets near the next major pivot
Stop placement beyond a confirmed structural level
Consolidation when price repeatedly crosses the same pivot
Confluence with trendlines, moving averages, opening ranges, or volume-based tools
A pivot should generally be treated as an area of interest rather than an automatic entry signal. The quality of the reaction still matters. A decisive rejection, strong close, successful retest, or expansion in momentum provides more information than price merely touching the line.
Reading Price Around a Pivot
Rejection: Price tests the pivot but closes back away from it, suggesting the level is being defended.
Breakout: Price closes clearly beyond the pivot with directional conviction.
Retest: Price returns to the broken level and holds it from the opposite side.
Acceptance: Price repeatedly trades on both sides of the pivot, suggesting uncertainty or balance rather than a clean directional edge.
Role reversal: A former resistance level begins acting as support, or former support begins acting as resistance.
When price repeatedly moves above and below a pivot, conditions may be too indecisive for the level to provide a reliable directional bias. In these situations, patience may be more valuable than prediction.
Visual Design
The indicator uses a consistent visual hierarchy so the pivots remain easy to identify without competing with candles or other tools. Essential levels are displayed with greater prominence, while the overall presentation remains intentionally minimal.
The quarterly pivot is enabled by default because it can provide valuable higher-timeframe context and may remain relevant across many trading sessions.
Best Practices
The Essential Pivots is most effective when used as a framework for context—not as a standalone buy-or-sell system. Traders may improve selectivity by considering:
The strength and direction of the prevailing trend
The quality of the candle reaction at the pivot
Whether price is rejecting, breaking, or accepting the level
The distance to the next significant pivot
Current volatility and market conditions
Alignment with higher-timeframe structure
The strongest opportunities often occur when price reaches an important pivot with clear directional intent and then confirms whether the level is being defended or surrendered.
Final Perspective
The Essential Pivots is built for traders who want fewer lines and more meaningful information.
Rather than displaying every possible pivot calculation, it focuses attention on the levels most likely to influence price behavior, support larger moves, and provide useful structural context. The result is a cleaner chart, a clearer decision-making process, and more room to observe what matters most: how price actually responds when it reaches an important level.
Important: Pivot levels are reference points, not guarantees. This indicator does not provide financial advice and should be used alongside appropriate confirmation, risk management, and independent analysis.
مؤشر

MTF S&R Confluence DetectorMTF S&R Confluence Detector
OVERVIEW
MTF S&R Confluence Detector automatically maps support and resistance across three independently configurable timeframes, then highlights the spots where those levels stack on top of one another. Confluence — the alignment of multiple structural levels in the same price area — is one of the more reliable ways to identify zones where price is likely to react, and this script does the work of tracking it in real time instead of requiring you to flip between chart timeframes and eyeball it yourself.
Alongside the multi-timeframe pivots, the script also plots Previous Day High/Low and Today's High/Low, and checks those session levels for confluence with your MTF pivots — surfacing "high conviction" areas where intraday structure and prior-session structure line up.
Built and tested on Pine Script v6.
HOW IT WORKS
For each of the three timeframes, the script finds swing highs and swing lows using pivot detection (ta.pivothigh / ta.pivotlow) with independently adjustable lookback and lookahead periods. Each pivot is only confirmed once price has moved the required number of bars past it, so the levels you see are based on confirmed swing points, not predictions.
The most recently confirmed support and resistance level from each timeframe is held on the chart as a line until a new pivot forms and replaces it. A percentage-based "range" is drawn around each level (also configurable per timeframe) to represent a zone rather than a single exact price.
CONFLUENCE DETECTION
The script compares the current support level (and separately, the current resistance level) across all three timeframes. If two levels sit within your chosen confluence threshold (a percentage distance you control), they're flagged as confluent and both lines turn gold. If all three timeframes agree, that's flagged as a "triple confluence" — the strongest signal the script can produce. Confluent zones also get a soft gold fill so they stand out visually from ordinary single-timeframe levels.
The same confluence logic is applied to Previous Day High/Low against your MTF levels, so you can immediately see when a prior session extreme is reinforced by higher-timeframe structure.
KEY FEATURES
- Three independent, fully configurable timeframes for support/resistance detection (defaults: 1H, 4H, Daily)
- Adjustable pivot lookback/lookahead for support and resistance detection separately
- Per-timeframe color, and adjustable percentage "zone" width around each level
- Automatic confluence detection between any two timeframes, plus triple-confluence detection
- Adjustable confluence threshold (%) to control how close levels need to be to count as aligned
- Gold highlighting and zone fills on confluent levels so they stand out at a glance
- Previous Day High/Low and Today's High/Low overlays, each independently toggleable
- Increasing visual weight by timeframe — the highest timeframe is drawn thicker and dashed so higher-timeframe structure reads as more significant
- Clean price-scale labels identifying which timeframe each level belongs to
ALERTS
The indicator ships with a full set of ready-to-use alert conditions, including:
- Pairwise support/resistance confluence for every timeframe combination
- Triple confluence (all three timeframes aligned) for both support and resistance
- Price entering a confluent support or resistance zone
- Price breaking above Previous Day High or below Previous Day Low
- Price making a new session high or low
- Previous Day High/Low aligning with multi-timeframe resistance/support (high-conviction setups)
HOW TO USE IT
1. Set your three timeframes under the "Timeframe 1/2/3" input groups. By default these are 1H, 4H, and Daily, but you can set them to whatever combination fits your trading style (e.g., 15m/1H/4H for intraday, or 4H/D/W for swing trading).
2. Tune the pivot lookback/lookahead under "S&R Detection" to control how sensitive the swing detection is — shorter values find levels faster but produce more of them; longer values are more selective.
3. Adjust the "Confluence Threshold" to set how close levels from different timeframes need to be before they're treated as the same zone. Tighter for precision, wider to catch near-misses.
4. Toggle Previous Day High/Low and Today's High/Low on or off depending on whether you trade session-based levels.
5. Set alerts on any of the built-in alert conditions to get notified the moment a confluence zone forms or price reaches one.
NOTES
- Support and resistance levels are based on confirmed pivots — a pivot only appears after the lookahead period has elapsed, which is standard practice for pivot-based tools and avoids false, unconfirmed levels, but it also means levels are inherently a few bars behind the most recent swing.
- Because the script pulls data from higher timeframes via request.security, values on historical bars from an unclosed higher-timeframe candle can adjust intrabar until that higher-timeframe candle closes — as with any multi-timeframe tool, always wait for confirmation on the current higher-timeframe bar before treating a fresh level as final.
- This indicator is a visual and analytical tool for identifying areas of interest; it does not generate buy or sell signals and should be combined with your own risk management and analysis. Nothing here is financial advice. مؤشر

Previous Day, Week & Month Levels [ITA]🟠 OVERVIEW
Previous Day, Week & Month Levels plots the high and low of each completed higher timeframe period and keeps them on the chart until price trades through them. Once a level is taken, it fades to grey instead of disappearing, so the chart separates liquidity that is still resting from liquidity that has already been collected.
The indicator covers daily, weekly and monthly periods independently, with optional midpoints for each range. This lets an intraday trader run daily levels alone, or stack all three groups to see how short-term and higher timeframe references line up.
🟠 CONCEPTS
* Previous Level - The high or low of the last completed daily, weekly or monthly candle, pulled from the higher timeframe regardless of the chart timeframe in use.
* Untaken Level - A level that price has not traded through since its period closed. Drawn at full opacity because the orders resting behind it are still there.
* Taken Level - A level that price has traded through during the current period. Recolored grey to show the liquidity has been collected and the level has lost its role as a target.
* Level Reset - Each group tracks its own taken state and resets when a new period begins. Daily flags clear every session while weekly and monthly flags run on their own cycles.
* Midpoint - The 50% level of a previous range, marking the equilibrium of that period rather than its extremes.
🟠 FEATURES
* Multi-Period Levels - Plots previous day, week and month highs and lows, each group toggleable on its own.
* Taken Level Fading - Automatically recolors any level that price trades through, leaving untouched levels highlighted.
* Optional Midpoints - Adds the 50% level of each enabled range for equilibrium reference.
* Level Labels - Tags each line with its name on the right edge of the chart, with configurable size.
* Level Alerts - Fires when price trades above a previous high or below a previous low.
🟠 HOW TO USE
* Run daily levels alone for intraday work, or enable weekly and monthly for a broader structural view.
* Treat bright levels as unfinished business and faded levels as history. What stays highlighted is where liquidity has not yet been taken.
* Watch for clusters where a daily level sits close to a weekly one. A single move that clears both tends to produce a sharper reaction than clearing either alone.
* Use midpoints as a filter. Price rotating around the midpoint of the previous day often points to balance rather than direction.
* Adjust Extend Right if the levels project too far past the current candle or stop short of it.
🟠 CONCLUSION
Previous Day, Week & Month Levels combines multi-period reference levels with automatic tracking of which levels have already been traded through. Instead of showing every level identically, it separates active liquidity from collected liquidity, giving traders a clear view of which reference points are still relevant to the current session. مؤشر

Cyber Matrix [Spatial Sync]◆Overview
The "Cyber Matrix " is a next-generation analytical tool that integrates Spatial Volume Profiling, real-time Momentum (RSI) tracking, and Spatial Geometry into a single, highly optimized Head-Up Display (HUD). Expanding upon traditional price action analysis, it renders order flow as a live ASCII matrix to synchronize market liquidity with spatial coordinates.
This allows traders to objectively verify hidden support/resistance zones and momentum accumulation before the market makes its move.
◆ System Modules and Execution Flow
Holographic VP & ASCII Matrix: Scans a defined historical window and reconstructs volume distribution as a dynamic ASCII terminal rather than standard boxes. Projects price levels, the Point of Control (POC), and momentum density directly onto the chart's spatial background. Dynamic Geometric Anchoring: An algorithmic coordinate system that tracks market structure. Users can seamlessly toggle between "Auto Pivot" (snaps to structural swing highs/lows), "Rolling Lookback" (fluidly trails the current price), or "Step Profile" (archives historical matrices).
Spatial Geometry (Hexagonal Matrix) Engine: Automatically projects Hexagonal boundaries anchored to dynamic pivot points. Inspired by W.D. Gann's Hexagon Chart and the mathematical efficiency of honeycomb structures (perfect packing), this visualizes where market liquidity is optimally constrained. Confluence Signal Engine: Fuses the Madrid EMA (baseline trend) with RSI crosses. Emits strict, algorithmic buy/sell signals colored in Neon Cyan (Bullish) and Neon Magenta (Bearish).
◆Configuration and Filtering Options
HUD Resolution & Boundaries: Defines the vertical row count and horizontal text width. Adjusting this allows traders to scale the ASCII projection seamlessly from high-timeframe macro views down to 1-minute scalping environments. Geometry Toggles: Independent visibility controls for Hexagonal polygons, Parallel Channels, and Mathematical Labels, ensuring the UI remains pristine.
Cyber Theme Opacity: Fully customizable Alpha (transparency) controls for grid overlays and glowing polylines, optimized for dark-mode trading environments.
◆Trading Strategy and Practical Applications
The Spatial Sync Setup: Do not trade in the void. Wait for the price to compress near the edge of a Hexagonal boundary. If the ASCII HUD at that exact price level shows thick Volume blocks (█) and the Status reads "OVERRIDE (CYAN)", execute a Long position. The geometry provides the exact spatial entry, while the HUD confirms the liquidity.
Momentum Divergence via ASCII Pulse: Monitor the "TEMPORAL MOMENTUM" array at the bottom of the HUD. If the price is making a new high, but the pulse blocks degrade from solid (█) to hollow (░), algorithmic momentum is bleeding out. Prepare for a reversal.
◆Architecture and Quantitative Logic (Code Breakdown)
This script relies on multi-dimensional array processing and polyline rendering to synthesize geometry and volume.
RSI-Weighted Volume Bins: Standard Volume Profiles only show "how much" was traded, ignoring trend aggression. This engine multiplies the local RSI momentum by the volume traded at that specific price bucket, effectively mapping momentum into a spatial dimension. The output dictates the visual density of the HUD strings.
ASCII Block Normalization: Drawing hundreds of individual boxes per price level crashes TradingView's memory limits. By mathematically normalizing the volume against a maximum width integer and utilizing the str.repeat() function, the script bypasses graphical limits to render an infinitely scalable histogram using raw text strings.
◆Capabilities & Limitations
Capabilities (System Advantages):
Bypassing Draw Limits for High-Res Profiling: By relying on string manipulation (str.repeat) and a minimal number of labels (label.new) instead of heavy box drawings (box.new), the system avoids TradingView's object limits. This deploys a lightweight, steplessly scalable histogram without freezing the browser.
Dimensional Integration of Momentum & Volume: Expresses the RSI strength formed at a specific price tier as visual text density (█, ▒, ░). This allows instant, intuitive analysis of whether buyers or sellers were more aggressive at a specific node.
Dynamic Volatility Tracking & Archiving: The Auto Pivot mode (ta.pivothigh/low) automatically scales geometric shapes to match recent market swings, eliminating manual drawing. The Step Profile mode projects up to 5 historical sessions side-by-side to track liquidity migration.
Limitations (Platform Constraints):
Finite Historical Archiving: Pine Script enforces strict hard limits per script (max 100 polylines, 500 labels). Increasing the archive count (profile_count) to the absolute limit or selecting excessively long periods will trigger hardcoded garbage collection, clipping the oldest HUD elements first.
Mitigations (Practical Countermeasures):
Aggressor Estimation via Alternative Logic: To compensate for the lack of tick data, the script uses a proprietary "Volume × Local RSI Momentum" weighting algorithm. This statistically approximates relative buyer/seller aggression at specific price tiers, achieving accuracy highly viable for live trading without perfect order flow data.
Memory Management & Scope Optimization: Traders are advised to focus analysis on the most recent liquidity (1 to 3 sessions) that directly impacts the current trade. The code features explicit garbage collection (array.pop and delete loops) to safely purge old objects, ensuring the latest market structure is always projected stably without rendering bugs. مؤشر

ADX/DI Profile & Volume Footprint🔶Overview
This script merges two powerful analytical frameworks—"Algorithmic ADX/DI Price Profile" and "High-Precision Volume Footprint"—into a single chart overlay. By moving Directional Movement data from the time axis (X-axis) to the price axis (Y-axis) and scanning lower timeframe (LTF) tick arrays, it accurately visualizes where trend energy is concentrated and how buyers and sellers interact at discrete price levels. This allows you to objectively verify market structure before committing capital.
🔶System Modules and Execution Flow
Volume Footprint Engine: Utilizes request.security_lower_tf() to scan up to 50 historical bars on a lower timeframe (down to 1-second for Premium users) to reconstruct intra-bar order flow. : Toggle between "Individual Bars" mode for per-candle footprints, and "Composite (N Bars)" mode to aggregate order flow over a specified range into a single comprehensive structure.
ADX/DI Profile Matrix: Computes standard 14-period DMI components, scalable via a Multi-Timeframe (MTF) engine. Generates fixed bounding boxes over historical sessions to project +DI, -DI, and ADX intensity as horizontal histograms. : Profiles are visually separated (Left, Right, Center aligned). A real-time heatmap shader shifts from "Cold" to "Hot" based on energy concentration, instantly identifying trend exhaustion or accumulation zones.
Local VWAP & Fibonacci Controller: Using the dynamically calculated profile range as an anchor, it draws a local Volume Weighted Average Price (VWAP) and customizable Fibonacci extensions, providing highly logical stop-loss and take-profit targets.
Analytical HUD (Default OFF): A fixed 50-column matrix table dynamically tracks Delta, Total Volume, Total Buy, and Total Sell orders, eliminating the need to manually decipher individual numbers inside the boxes.
🔶Configuration and Filtering Options
Resolution & Boundaries: Defines profile row counts (10 to 50 tiers; max 40 recommended for perfect stability, though this does not apply to line rendering) and width multipliers. When trading highly volatile assets like crypto or indices, reducing this to 30 thickens the price buckets and improves visibility.
Algorithmic Noise Filter: A critical threshold gate (0.0 to 1.0). Price tiers failing to meet this relative intensity ratio are visually muted. Increasing the default 0.08 to 0.15 (15%) mathematically erases low-impact price zones, leaving only institutional-level support/resistance clusters.
Volume Weight Toggle: An option to fuse volume data into DMI calculations. Prioritizes directional moves backed by real capital over empty price spikes.
Premium Seconds-Timeframe Guard: An automated downgrade protocol to ensure script stability. If a non-Premium plan is detected, it automatically converts 1-second (1S) requests to a 1-minute timeframe to prevent fatal array compilation errors.
🔶Trading Strategy and Practical Applications
"Wait & See" Filter (Avoiding Chop): The system's color shader acts as your first gate of discipline. If the ADX profile (center) shows "Cold" colors (e.g., dark orange/amber), it means trend energy is low. Do not trade; remain in a no-position state until the ADX blocks turn "Hot" (bright yellow), confirming massive algorithmic participation.
Absorption and Exhaustion Setups: Watch the Footprint engine boxes drawn over the candles closely. If a massive spike of aggressive buying (high positive delta, green text) occurs, yet the candle fails to break out and is immediately capped by a dense -DI profile block (right side, Hot Red), this is "Absorption." Buyers are trapped. Enter short right below this Point of Control (POC) with a tight stop-loss just above the profile box.
VWAP / Fibonacci Targeting: Once an entry is validated by Footprint delta, use the dynamically plotted VWAP as a baseline. For longs, target the upper Fibonacci bands (0.618 or 1.000). The beauty of this system is that these bands are derived strictly from the profiled session's "volume", reacting mathematically to the current market environment rather than arbitrary historical swings.
🔶Architecture and Quantitative Logic (Code Breakdown)
This script relies on multiple mathematical matrices to transform time-based indicators into price-based structures.
1. Footprint Volume Distribution (Tick Estimation)
ticks_1s = math.round((c_h - c_l) / syminfo.mintick) + 1
v_tick = c_v / ticks_1s
Why this calculation is performed: TradingView cannot provide sub-second Bid/Ask data. To measure aggressive market participation at specific price levels and objectively distinguish local buying absorption from selling pressure, the engine mathematically divides the lower timeframe bar's spread (High - Low) and distributes volume evenly across each tick to synthesize aggressive trading behavior.
Actual Output Value: A raw Float representing estimated volume at a single price tick. For example, if a 1-second volume (c_v) is 100 contracts and the spread covers 5 ticks, the output (v_tick) is exactly 20.0 per tick. Absolute volumes are formatted as strings (e.g., "1.5K") for the UI, while net delta is output to the HUD summary table as raw positive/negative floats.
2. DMI Profile Allocation and Normalization
net_di_ratio = math.abs(raw_p_plus - raw_p_minus) / (raw_p_plus + raw_p_minus)
p_plus = raw_p_plus * c_vol * (1 + net_di_ratio)
Why this calculation is performed: To pinpoint the exact price nodes where trend strength (ADX) and direction (+DI/-DI) physically occurred, filtering out empty volatility. Standard DMI ignores volume; this script multiplies DI intensity by trading volume (c_vol) and scales it via net_di_ratio to highlight zones where one side completely overwhelmed the other.
Actual Output Value: A large integer/float representing the local energy assigned to that price tier. If raw +DI is 30, raw -DI is 10, and volume is 1,000, the net_di_ratio is 20 / 40 = 0.5. The final p_plus output assigned to that tier is 30 * 1000 * 1.5 = 45,000 energy points.
3. Box Scaling and Noise Filter
ratio_plus = val_plus / max_plus
// If ratio_plus >= noise_filter, render the box
Why this calculation is performed: To eliminate market noise. max_plus is the Point of Control (POC)—the price tier with the absolute maximum energy. All other tiers are divided by this maximum to output a percentage (0.0 to 1.0). The noise filter (default 0.08, or 8%) culls tiers holding less than 8% of the POC's intensity.
Actual Output Value: A Float ratio between 0.0 and 1.0. A tier with 22,500 energy against a POC of 45,000 outputs 0.5. This 0.5 is passed directly to the f_get_heatmap_color function, outputting an RGBA hex color code that dynamically blends "Cold" and "Hot" variables based on intensity.
4. VWAP and Geometric Fibonacci Derivation
Why this calculation is performed: To establish a baseline fair value and logical standard deviation bands derived directly from the profiled session's volume distribution.
Actual Output Value: Exact absolute price coordinates (Y-axis floats). The Local VWAP is calculated by dividing the sum of (Typical Price * Volume) by Total Volume within the profile window. Fibonacci levels are output as the absolute distance from the VWAP to the session high/low multiplied by standard ratios (0.382, 0.618, 1.000). These are mapped as solid, dashed, or dotted lines across the X-axis bounds of the profile box.
🔶Capabilities and Limitations
Capabilities: Synthesizes massive LTF data arrays into clean, readable UI boxes without repainting. Modular layout prevents candlesticks from being obscured.
Limitations: TradingView imposes strict limits of 500 boxes, 500 lines, and 500 labels per script. On highly volatile assets with deep tick resolution, maximizing row_count or setting footprint lookbacks to 50 bars may cause older UI elements to clip (disappear) due to platform-level garbage collection constraints.
مؤشر

All-Markets Movement Extremes ToolA causal all-markets movement tool for identifying retained terminal PEAK/TROUGH extremes and exposing the earliest available confirmation of those extrema after the required price structure develops.
Name:
All-Markets Movement Extremes Tool
Searchable Name:
All-Markets Movement Extremes Tool
Technical Name:
All-Markets Non-Repainting Terminal-to-Causal Directional Movement Extremes Tool
Short title:
Movement Extremes
Summary
All-Markets Movement Extremes Tool identifies terminal peaks and troughs within developing directional movement and preserves the causal confirmation that makes each retained extreme available.
The central difficulty is that a completed extreme and the generated signal capable of establishing that extreme are not necessarily available at the same time.
A trough can already exist before enough upward structure has developed to confirm that the downward movement terminated there.
A peak can already exist before enough downward structure has developed to confirm that the upward movement terminated there.
Price can therefore move meaningfully away from the terminal before the corresponding confirmation becomes available.
The tool is built around that separation.
During an active directional leg, the current extreme remains provisional and can be replaced by a newer same-side high or low.
Once the required opposite structure confirms, the retained extreme becomes:
TROUGH for the completed low of the prior downward movement
PEAK for the completed high of the prior upward movement
The terminal marker remains attached to the retained movement extreme.
The causal confirmation remains attached to the later bar where that extreme became confirmable.
This keeps two important references visible at the same time:
where the directional movement terminated
and
where the corresponding confirmation became available
The confirmed PEAK/TROUGH stream can therefore provide context for directional-movement trading, filtering, confirmation, and broader trading decisions, while the stream itself represents confirmed movement extremes and their causal availability rather than a complete standalone buy/sell signal.
The result is a directional-movement tool that provides:
movement direction and transition context
terminal peak/trough identification
directional-movement trading context
confirmation and filtering context
entry/exit context
movement-cycle review
and comparison of completed movement with what became causally available
Terminal extremes
The script follows an active directional leg and retains its strongest extreme.
During an upward leg, the highest retained high remains the potential terminal PEAK.
During a downward leg, the lowest retained low remains the potential terminal TROUGH.
A newer same-side extreme can replace the previous candidate while that directional movement remains active.
The extreme becomes confirmed only after the required opposite structure develops.
This prevents a temporary move away from a high or low from automatically being treated as the completed terminal.
Causal confirmation
Every confirmed terminal has two important locations.
Terminal
The retained PEAK or TROUGH belonging to the completed directional movement.
Causal confirmation
The later confirmed-bar event where enough completed structure exists to establish that terminal.
The terminal shows where the completed movement ended.
The causal confirmation shows when the script could establish that terminal through its forward process.
Those two points can be close together or separated by several bars.
The optional Causal Confirmation Comparison makes that difference visible directly on the chart.
Earliest available confirmation
The tool attempts to expose a retained terminal on the first confirmed transition that satisfies its active structural requirements.
That does not move the historical terminal forward.
The PEAK or TROUGH remains attached to the completed movement extreme, while the causal marker remains attached to the later confirmation event.
This is what allows the tool to preserve both the final movement location and its actual causal availability.
Directional movement
The PEAK/TROUGH sequence forms a continuing directional structure.
A confirmed TROUGH establishes the completed low of the preceding downward movement.
A confirmed PEAK establishes the completed high of the preceding upward movement.
Consecutive opposite terminals describe the completed movement between retained extrema.
The tool can display those relationships with HOLD paths and directional backgrounds so the broader directional movement remains visible rather than reducing the chart to isolated labels.
Directional-movement trading context
The confirmed extremes and their causal transitions provide directional-movement context that can be examined alongside confirmation rules, filtering, entry/exit context, or other market-state methods.
The value of the output is the movement structure it establishes:
terminal extreme → causal confirmation → directional movement context
That structure remains available for broader trading-related evaluation without changing what the PEAK/TROUGH stream itself represents.
Movement cycles
Consecutive opposite confirmed extrema form completed directional cycles.
The tool keeps two reference systems available.
Terminal-to-terminal
The completed movement between retained extrema.
Confirmation-to-confirmation
The corresponding directional movement between the causal confirmation points.
These measurements can differ substantially because part of the terminal movement can occur before confirmation becomes available.
Last capture / confirm gap
The Movement Cycle page shows Last capture / confirm gap for the most recent completed cycle.
The capture value compares the latest completed terminal-to-terminal directional result with the corresponding confirmation-to-confirmation result when the terminal movement is positive.
The confirm gap shows the difference between those two completed-cycle results.
Together, they provide a compact comparison between the retained movement extremes and the corresponding causal confirmation references.
Unconfirmed context
Not every developing extreme becomes the retained terminal.
An earlier high can be superseded by a higher high.
An earlier low can be superseded by a lower low.
When enabled, the tool can expose this context separately from the confirmed PEAK/TROUGH sequence.
The optional Minimum Reversal Filter can also reject structural transitions that do not meet the selected movement requirement.
Current movement
For the latest confirmed extreme, the tool can compare:
terminal price
confirmation close
current price
terminal-to-confirm move
price change from confirmation to current
directional move from confirmation to current
best move after confirmation
and bars since confirmation
This provides a current directional reference after the extreme has been established.
Status pages
The tool includes four compact status pages:
Summary
Movement Cycle
Timing
Guide
Summary provides the broad state of confirmed extrema and completed movement cycles.
Movement Cycle focuses on the latest terminal, its confirmation, current movement, and the previous completed cycle.
Timing focuses on terminal-to-confirmation separation and structural timing.
Guide provides a compact interpretation of the active PEAK/TROUGH framework.
Alerts
Optional alerts are available for confirmed PEAK and TROUGH events.
The alert occurs when the causal confirmation becomes available.
The terminal remains attached to the retained movement extreme, while the alert reflects the later confirmation event.
This preserves the difference between terminal location and causal availability.
Features
all-markets directional movement framework
retained terminal PEAK identification
retained terminal TROUGH identification
causal confirmed-bar operation
terminal-versus-confirmation separation
Causal Confirmation Comparison
Confirmed Hold Path
Confirmed Hold Background
movement-cycle tracking
terminal-to-current directional movement
confirm-to-current directional movement
best move after confirm
Last capture / confirm gap
Unconfirmed Extreme Context
Minimum Reversal Filter
compact Summary, Movement Cycle, Timing, and Guide pages
confirmed PEAK/TROUGH alerts
Strengths
Terminal Extreme Preservation — the completed PEAK/TROUGH remains anchored to the retained movement endpoint.
Causal Availability — the corresponding confirmation remains separately visible where it actually became available.
Directional Context — the output describes continuing directional movement rather than isolated bar labels.
All-Markets Use — the framework can be applied across different markets because it is based on directional price structure.
Early Causal Exposure — the tool attempts to establish the retained terminal on the first qualifying confirmed transition.
Terminal-versus-Causal Comparison — completed movement and causally available movement remain directly comparable.
Broader Trading Context — the confirmed extrema provide directional, confirmation, filtering, and entry/exit context while retaining their underlying movement-extreme meaning.
Weaknesses
Confirmation Delay — the terminal can exist before enough opposite structure develops to confirm it.
Movement Before Confirmation — part of the next directional movement can occur before the causal confirmation becomes available.
Superseded Extremes — developing terminal candidates can be replaced by newer same-side extremes.
Standalone Trade Outcome Variability — confirmed PEAK/TROUGH extremes can remain structurally reliable movement references while the result of directly trading every confirmation as its own buy/sell action can vary substantially across market conditions.
Structural Dependence — confirmation timing depends on the selected structural requirements.
No Complete Trade Management — position sizing, risk management, stop placement, profit targets, and wider trade-management logic are separate from the movement-extreme output.
Who it’s for
This tool is suited for users interested in:
terminal market peaks and troughs
directional movement trading
movement-transition confirmation
structural filtering
entry/exit context
causal versus completed movement
terminal-to-terminal cycles
confirmation timing
Last capture / confirm gap
and incorporating confirmed extrema into broader trading methods
It is especially relevant when the question is not only:
“Where did the movement terminate?”
but also:
“When did that terminal become causally available?”
Known limitations
The final retained extreme cannot be confirmed until enough opposite structure has developed.
Some movement can therefore occur before confirmation.
Some developing terminal candidates can be superseded.
Some confirmation-to-confirmation cycles can be non-positive.
The distinction between the terminal and the causal confirmation is therefore explicitly preserved as part of the tool's output.
Final note
All-Markets Movement Extremes Tool identifies retained terminal PEAK/TROUGH extremes and exposes the causal confirmation of those extrema.
The terminal remains attached to the completed movement extreme.
The causal confirmation remains attached to the point where the required structure becomes available.
The relationship between those two references provides directional movement context for confirmation, filtering, cycle comparison, and broader trading-related evaluation. مؤشر

Edo Equal Highs/LowsEdo Equal Highs/Lows — Detects Equal Highs and Equal Lows as Resting Liquidity and Flags When Price Takes It
When two swing highs form at the same level, or two swing lows, they create one of the clearest forms of resting liquidity in price action. Traders place their stops just beyond a double top or double bottom, and breakout orders cluster there too — so that matched level becomes a pool of liquidity that price is frequently drawn to take. In the Smart Money Concepts approach these are equal highs (EQH), holding buy-side liquidity above price, and equal lows (EQL), holding sell-side liquidity below it.
Edo Equal Highs/Lows maps these levels automatically and tracks what happens to them. It marks each EQH and EQL when two swings match within an ATR-based tolerance, extends the level as resting liquidity, and flags the exact moment price closes through it and takes that liquidity — all validated on closed bars so the indicator does not repaint. It is the equal-levels specialist of the Edolab structure family, designed to work alongside liquidity sweep and liquidity zone analysis.
EQUAL HIGHS AND EQUAL LOWS
The indicator compares each new swing pivot with the previous one of the same type. When two consecutive swing highs sit at the same price within the tolerance, it draws an Equal Highs (EQH) level — buy-side liquidity resting above. When two swing lows match, it draws an Equal Lows (EQL) level — sell-side liquidity resting below. The level is drawn from the earlier matching pivot and labelled EQH or EQL, extending to the right as a live reference.
THE ATR TOLERANCE
What counts as "equal" is not a single tick but a configurable band. The Equal Tolerance input is expressed as a fraction of ATR (0.10 by default): two swings are treated as equal when their difference is within that fraction of the average true range. A lower value is stricter — only near-perfect matches qualify; a higher value is looser, catching approximate double tops and bottoms. Tying the tolerance to ATR keeps it adaptive across instruments and timeframes, so the same setting behaves consistently whether the chart is a low-volatility index or a fast-moving crypto.
SWING PROFILES
The swings compared for equality come from pivots whose sensitivity is set by the Swing Profile: Scalper (5 bars each side) for short-term levels on low timeframes, Swing (10 bars, the default) for the balanced 4H and daily read, and Long Term (21 bars) for the major levels on weekly and higher horizons.
ACTIVE AND TAKEN
Each equal level lives in one of two states, evaluated on every closed bar. Active: the level is intact, holding its resting liquidity, drawn as a solid coloured line extending to the right — red for EQH, teal for EQL by default. Taken: price has closed through the level and swept the liquidity — the line turns dashed and faded grey and the label gains a ✕. An EQH is taken when price closes above it; an EQL, when price closes below it. Only Active levels count in the panel, since a taken level has already done its job. To keep the chart clean, only the most recent levels per side are kept, up to Max EQ Levels per side (10 by default).
INFORMATION PANEL
The panel condenses the read into a compact table: the number of active EQH and active EQL levels, and the nearest unswept level on each side — the closest Equal Highs above the current price and the closest Equal Lows below it, with their exact prices. Those nearest levels are the most immediate liquidity targets above and below, the quickest way to see where price may be drawn next. The panel sits in any of the four chart corners (Top Right by default), comes in three sizes (Tiny / Small / Normal) and two themes (Dark / Light), and can be hidden entirely.
NO REPAINTING
Equal levels are built on confirmed pivots and their taken state is validated on closed bars, so a level never appears or disappears intrabar. A wick that pierces an equal level but closes back on the same side does not mark it as taken — the indicator waits for the close. There are no higher-timeframe functions: all logic runs on the current chart timeframe.
CONFIGURATION
The inputs are grouped by block. Detection sets the swing profile, the equal tolerance in ATR and the maximum number of levels kept per side. Style exposes the equal highs and equal lows colours, the taken colour, the label size and the Dark/Light theme. Panel controls panel visibility, position and size. The defaults are calibrated to work without adjustment on stocks, crypto, forex, indices and futures, on any timeframe — the inputs most users touch are the Swing Profile and the Equal Tolerance, to set how strict the matching should be.
ALERTS
Four predefined alerts cover the life of an equal level: Equal Highs formed and Equal Lows formed fire when a new EQH or EQL level is drawn; Equal Highs taken and Equal Lows taken fire when price closes through a level and sweeps its liquidity. The formed alerts flag fresh liquidity targets, and the taken alerts fire exactly when that liquidity is swept — often the trigger for a reaction. All alerts fire on bar close, consistent with the indicator's anti-repaint validation.
HOW TO READ IT
Equal highs and lows are liquidity targets, not entries: price is often drawn toward an EQH above or an EQL below to take the stops resting there, so the nearest levels in the panel point to where the move may head next. Watch the take: when price closes through an equal level and it turns Taken, the liquidity has been swept — that sweep frequently precedes a reaction, and classifying it as confirmed or faded turns the event into a fuller read. Trade levels in confluence: an EQL that sits on a demand zone or a higher-timeframe support is a stronger reference than an isolated one. And set inside broader liquidity zones, the equal levels mark precise liquidity pools, completing the liquidity map.
OPEN SOURCE
Edo Equal Highs/Lows is published as a free open source indicator. The full Pine Script is publicly accessible on TradingView for study, adaptation and integration into any workflow. Part of the Edolab Markets free tools ecosystem, with more structure, liquidity and order-flow indicators available on TradingView.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
مؤشر

Smart Money Structure & Dynamic Equilibrium Suite [ICT Pro]Smart Money Structure & Dynamic Equilibrium Suite
Overview & Purpose
Smart Money Structure & Dynamic Equilibrium Suite is an advanced, high-precision technical analysis visual tool engineered for Pine Script v6. Designed specifically for modern Price Action, Smart Money Concepts (SMC), and Inner Circle Trader (ICT) analysts, this script provides clean visual overlays for key liquidity boundaries, trend momentum, and range midpoints without cluttering chart aesthetics.
Instead of displaying unnecessary lines or repainting historical indicators, this suite focuses purely on real-time structural clarity, dynamic range evaluation, and institutional volume tracking.
Key Features & Technical Components
1. Auto-Swept Previous Day High & Low (PDH / PDL)
- Institutional Liquidity Levels: Automatically tracks and plots the Previous Day High (PDH) and Previous Day Low (PDL) as horizontal daily boundaries.
- Dynamic Disappear / Swept Logic: Once price crosses or sweeps a daily liquidity level during an active trading session, the swept level automatically vanishes from the chart. This ensures your view remains clean and focused only on active, unmitigated daily liquidity targets.
- Full Visual Customization: Adjust line colors, text colors, line thickness, and stroke style (Solid, Dashed, or Dotted) directly from the inputs menu.
2. Connected Dynamic Equilibrium Range
- 50% Midpoint Calculation: Continuously calculates the real-time 50% Equilibrium price zone based on customizable local swing lookback periods.
- Connected Line Extension: Features an extended horizontal line that connects seamlessly to the "EQUILIBRIUM" text label on the right margin, eliminating visual gaps or confusion about range boundaries.
3. Smart Volume Spike & Trend Candle Glow Engine
- Directional Candle Glow: Color-codes chart candles based on dual Moving Average alignments—Neon Green during bullish momentum and Neon Red during bearish momentum.
- Golden Volume Spike Highlighting: Dynamically overlays high-volume institutional candles in a distinct Glowing Gold color whenever current bar volume exceeds customizable moving average multipliers. This makes it effortless to spot institutional expansion bars.
4. Major Intermediate Term Swing Badges (ITH / ITL)
- Structural Pivot Badges: Automatically flags confirmed major high and low points using clear ITH (Intermediate Term High) and ITL (Intermediate Term Low) badges.
- Customizable Sensitivity: Adjust the pivot lookback sensitivity to tailor the detector for scalp, intraday, or higher-timeframe swing trading.
Full Inputs & Parameter Configuration Guide
1. Moving Average & Ribbon Controls
- Show MAs: Enables or disables the visibility of the two core Moving Averages on the chart.
- MA Type: Choose between EMA (Exponential), SMA (Simple), or WMA (Weighted) calculation methods.
- Fast MA Length: Defines the lookback period for the fast directional moving average (Default: 9).
- Slow MA Length: Defines the lookback period for the baseline moving average (Default: 21).
- MA Line Thickness: Adjusts stroke width for both moving averages (1 to 4 pixels).
- Show MA Ribbon Glow: Toggles the background color fill between the Fast and Slow MAs on or off.
2. Smart Candle Glow Settings
- Enable Trend Candle Coloring: Toggles custom candle coloring based on MA trend direction.
- Highlight Volume Spikes: Turns on or off the special Golden Candle overlay for high-volume bars.
- Volume Spike Threshold: Set the volume multiplier relative to the 20-period volume average (Default: 1.8x).
3. Equilibrium Settings
- Show Equilibrium Level: Turns the 50% range midpoint line on or off.
- Equilibrium Lookback Period: Sets the number of historical bars evaluated to compute the local range midpoint.
- Line Style & Thickness: Customize whether the line appears Solid, Dashed, or Dotted, as well as its thickness and color.
4. Daily Liquidity Settings (PDH / PDL)
- Show PDH & PDL: Toggles display of Previous Day High and Low levels.
- PDH/PDL Line Style & Thickness: Select custom visual preferences for daily boundaries.
- Color Pickers: Separate line and text color options for both High and Low daily levels.
Step-by-Step Guide: How to Use This Tool Effectively
Step 1: Determine Structural Bias
Use the Trend Ribbon Cloud and candle coloring to establish current market bias. Green candles and ribbons indicate bullish control, while Red candles signify bearish dominance.
Step 2: Monitor Daily Liquidity Targets
Observe active PDH and PDL lines as primary liquidity pools. When a line disappears from your chart, it confirms that liquidity at that level has been swept by price.
Step 3: Evaluate Value Zones
Refer to the Equilibrium step-line to determine whether current price trades above 50% (Premium territory) or below 50% (Discount territory) relative to recent market swings.
Step 4: Identify Institutional Volume Expansion
Pay close attention to Glowing Gold candles. Volume spikes often coincide with smart money entries, order block mitigations, or explosive range breakouts.
Trading Disclaimer & Risk Warning (House Rules Compliance)
Educational Disclaimer:
This script is strictly a visual analysis and charting utility designed for technical educational purposes. It does NOT offer financial advice, trade signals, investment recommendations, or automated buy/sell algorithms.
Risk Acknowledgment:
Financial trading carries inherent risk, and historical market behavior depicted by visual indicators does not guarantee future results. Users are fully responsible for their own trading decisions and risk management strategies. مؤشر

مؤشر

Weinstein Human-Like Stage Layout [v6]This indicator automates the classic Stan Weinstein 4-Stage Market Cycle Analysis (from his legendary book “Secrets for Profiting in Bull and Bear Markets” ) using a custom context-aware layout engine.
Most automated stage analysis scripts create immense visual clutter, resetting indicators and stacking labels on every minor bar cross. This script uses a human-like design philosophy, relying on multi-week absolute price structures to print exactly one clean, dynamic tracking label per macro phase.
Human-Centric Visual Design
The indicator adapts its graphics engine based on the style of phase the market is currently experiencing:
Stage 1 (Accumulation) : Draws a clean, horizontal Dashed Blue Box around the absolute support/resistance boundary floor, with a floating blue label centered over the base.
Stage 2 (Markup) : Strips away consolidation frames and softly tints the entire chart vertical background Green to signify a clean, institutional buying regime.
Stage 3 (Distribution) : Places a precise, horizontal Dashed Orange Box around the macro topping range to track turning points.
Stage 4 (Markdown) : Softly tints the chart vertical background Red to warn traders away from catching a falling knife.
How the Boundary Engine Works
Instead of calculating mathematical slope percentages (which shift falsely on volatile weeks), the engine operates via a shifted Donchian Price Channel Model:
Breakout Tracking : It evaluates the asset's closing price against the Highest High / Lowest Low of the prior 20 weeks (using a lookback offset to remove current bar skew).
Expansion Filtering : A true Stage 2 or Stage 4 regime shift will only trigger when price completely bursts out of the historical multi-month ceiling or floor line while confirming its position relative to the 30-Week Simple Moving Average.
Automatic Clean-Up : The script natively tracks historical nodes. The moment a new cycle phase is mathematically confirmed, it deletes overlapping data to keep your screen spotless.
Best Practices for Setup
Timeframe : To stay true to Weinstein's original methodology, always run this indicator on a Weekly (1W) chart.
Customization : Open the settings gear panel to adjust the Consolidation Range Lookback (Weeks) up or down depending on whether you want to focus on intermediate market movements or structural multi-year cycles.
⚠️ Disclaimer & Risk Disclosure
Educational Purpose Only : This script is an automated open-source visual aid designed solely for educational, historical analysis, and charting convenience. It does not constitute investment advice, financial advice, or a recommendation to buy, sell, or hold any financial asset or security.
No Guarantees of Accuracy : Market conditions are subject to rapid change. Past performance, channel breakouts, or historical bounding boxes generated by this script are not indicative of future market results.
Backtesting & Verification : Systems using algorithmic filters can generate false breakouts or delayed lag-signals during highly volatile or macroeconomic events. Users should always cross-reference these automated stages with their own fundamental analysis, independent price action charting, and volume verification.
Risk of Loss : Trading financial markets involves a high degree of financial risk. The author of this script assumes absolutely no liability or responsibility for any direct or indirect financial losses, trading errors, or damages resulting from the use or interpretation of this indicator.
مؤشر

Auto Fibonacci Retracement, Golden Zone & OTE Levels [LunqFX]Every fibonacci retracement tool draws the same six lines, and every one of them assumes you already picked the right swing. Drag the fib from a different high and the golden pocket lands somewhere else entirely — so the fibonacci level you are about to buy is not a level the market chose, it is a level your cursor chose.
This auto fibonacci indicator takes the swing out of your hands. The leg is anchored to confirmed pivots and re-anchors itself the moment structure makes a new extreme, so the fib retracement on the chart is always drawn from the leg the market is actually trading, and the golden pocket and OTE zone sit where that leg puts them.
And it adds the number no fibonacci retracement indicator has ever given you: how deep this symbol actually retraces.
Included: automatic fibonacci retracement from confirmed swing pivots, an adjustable golden pocket and OTE zone filled on the chart, fibonacci extension targets beyond the leg, gold candles on the bars that traded inside the zone, a measured typical retracement depth for the current symbol, a dashboard reading the live fib retracement, and alerts on the zone.
❶ HOW THE FIBONACCI IS ANCHORED
Swing points come from confirmed pivots, so a leg only exists once the bars on both sides of its pivot have closed. Nothing appears and then vanishes.
The active leg runs from the anchor pivot to the extreme pivot. A new pivot beyond the extreme, in the same direction, extends the leg — the fibonacci retracement stretches with it. A pivot the other way flips the leg and the fib re-anchors to the new one. There is no setting for "which high to use", because the structure decides.
❷ THE GOLDEN POCKET AND THE OTE ZONE
The band between 0.618 and 0.786 is filled, with a soft halo behind it so it reads at a glance on a crowded chart. Smart money traders call this band the OTE — the Optimal Trade Entry — and it is where continuation entries are taken after a pullback, because it is deep enough that the move is discounted and shallow enough that the leg is still intact.
The golden pocket, the narrow 0.618–0.65 strip, sits along the top edge of that band. Both edges are adjustable, so set them to 0.618 and 0.65 if the pocket alone is what you trade, or to 0.5–0.618 if that is your definition of the golden zone. The whole tool follows whatever you set — the depth statistics, the dashboard and the alerts all read from the same two numbers.
❸ EXTENSIONS
Three projections beyond the leg, negative fib values by default at −0.272, −0.618 and −1.0. They are drawn from the same anchors as the retracement, so a target is measured against the same swing the entry came from rather than against a fib you dragged separately.
They ship switched off. A target at −1.0 sits far enough from price that the chart's autoscale stretches to include it and squashes the candles into a band — useful once you are in a trade, in the way while you are reading the chart. Switch them on in the Extensions section when you need them.
❹ A SPENT LEG STOPS SHOUTING
When price trades all the way through the anchor, the leg has done everything it was going to do. The fib cannot re-anchor until the next pivot confirms, so in the meantime the whole drawing fades: the levels dim, the golden zone loses its glow and its label reads spent.
It is a small thing that most tools get wrong. A fib left burning at full brightness over a setup that is already finished is not neutral — it is the chart arguing for a trade that is no longer there.
❺ TYPICAL RETRACEMENT DEPTH — what a fibonacci tool never shows
0.618 is a number from a sequence. It is not a fact about gold, or about the euro, or about this timeframe.
So the indicator measures it. Every time a leg pulls back and then makes a new extreme in the same direction, the depth of that pullback is recorded. The average of those depths is printed on the chart as its own line, and in the panel with the sample size behind it:
Typical depth 0.547 (23 legs)
Read it against the golden zone. When the measured depth sits at 0.55 and the golden zone starts at 0.618, this symbol has been turning BEFORE the golden zone — waiting for 0.618 means the move leaves without you. When it sits at 0.72, shallow entries at 0.5 have been getting run over.
Only pullbacks that were followed by continuation are counted. A leg that reversed outright is not a retracement, and folding those in is how a depth average gets quietly inflated past anything useful. Samples under eight legs are marked with a tilde, because an average of three is not an average.
❻ THE CHART ITSELF
Every candle stands in a soft lit column — an aura drawn behind it, its body stretched across the full range and left almost transparent with its outline switched off. The effect is a neon tube rather than a coloured rectangle.
The glow is not constant. Its brightness is driven by the bar's range against ATR, so a conviction candle burns and a doji barely registers. Strength becomes something you feel across a screen of price action instead of something you measure bar by bar, and the decoration is carrying information rather than existing for its own sake.
The candle on top has a translucent body against a solid outline. That one detail is what makes it read as part of the chart instead of a sticker placed over it: the background shows faintly through while the edge stays crisp.
Five palettes, because one set of colours cannot suit every background. Neon Bloom is turquoise against magenta, a matched pair that leaves gold free for the zone. Midnight Cyan is the common signature dark scheme, Vibrant Neon the high-contrast crypto pairing, Classic Soft the muted everyday version. Cool Blue drops red entirely — a number of full-time traders run blue against grey, since red carries a stress response that gets in the way of reading a chart objectively for eight hours at a stretch.
Bars of the current leg that closed inside the golden zone are drawn in gold, so the OTE is visible in the price action and not only in the band behind it. Only the current leg is marked — a highlight left over from a leg that ended months ago sits nowhere near the zone on screen and reads as a fault.
The levels follow the same restraint, in three tiers rather than nine identical lines: the two ends of the leg carry its direction, the levels between them sit back in muted grey, and the accent is spent once, on the golden zone. Candle colouring can be switched off entirely if you would rather keep your own.
❼ THE DASHBOARD
Leg direction and size, the live retracement as a single large number, whether price is inside the golden zone or has not reached it yet, the measured typical depth with its sample count, and the 0.618 and 0.786 prices ready to be turned into orders.
HOW TO USE IT
1 — Wait for the leg, not the level. The fib only exists after a confirmed pivot. That delay is the point: it is what stops you fibbing a swing that is still forming.
2 — Compare the golden zone with the typical depth line. If they overlap, the zone is doing its job on this symbol. If the typical depth sits well above or below it, trade the measured level and treat 0.618 as decoration.
3 — Use the extensions as the other half of the trade. An entry in the golden zone with a target at −0.272 is a defined structure; an entry with no target is a hope.
4 — Change the swing length to change the timeframe of the analysis. A short length gives the fib of the current intraday leg; a long one gives the fib of the swing the whole session is trading inside. Both are valid, and they answer different questions.
HOW IT WORKS
Pivot highs and lows of your chosen length define the leg. Span is the distance between anchor and extreme; a retracement level is the extreme moved back toward the anchor by its fraction of the span, and an extension is the same arithmetic past the extreme. The live retracement is the current close expressed in that same fraction. Depth statistics keep a rolling window of completed pullbacks and report their mean.
Works on any symbol and any timeframe. On higher timeframes raise the swing length so the fib tracks the swing rather than the noise inside it.
SETTINGS
▸ Swing — pivot length and how far levels extend to the right. ▸ Retracement Levels — each level individually switchable. ▸ Golden Zone / OTE — fill on or off, and both edges of the band. ▸ Extensions — three targets, any fib values you like. ▸ Depth Statistics — on or off, and how many legs are remembered. ▸ Visuals — labels, line width, five candle palettes plus off, aura glow and its strength, gold OTE bars, dashboard position.
ALERTS — price entered the golden zone, 0.618 reached, leg fully retraced, and fib re-anchored. All fire on closed bars.
NON-REPAINTING — the fib is anchored to confirmed pivots, which means a leg is only drawn after the bars either side of its pivot have closed. The depth record is built from completed pullbacks and never changes retroactively.
WHY THESE PARTS ARE ONE SCRIPT
The auto-anchoring, the golden zone and the depth measurement describe one object. Auto-anchoring alone gives you a fib that is correctly placed but still generic. The golden zone alone is a band drawn on an assumption. The measurement exists only to tell you whether that assumption holds on the symbol in front of you — and it needs the anchoring to have legs to measure. Remove any one and the other two lose their point.
This indicator is an educational market-analysis tool, not financial advice. The depth statistic describes pullbacks that have already happened on the loaded chart; it does not predict the next one. Always confirm with your own analysis and manage your risk.
مؤشر
