Volume-Weighted Order Block Zones [BigBeluga]🔵 OVERVIEW
The Volume-Weighted Order Block Zones is an advanced technical indicator created by BigBeluga to identify and map institutional order blocks using pivot points and price displacement. Traditional order block indicators often highlight every single pivot zone, resulting in chart clutter and low-probability setups. In order to provide a solution to this problem, this indicator integrates volume-weighted strength calculations and ATR-based displacement triggers, ensuring that only high-momentum structural zones backed by significant volume are plotted.
The indicator aims to visualize institutional order-building and subsequent market expansions. The core element of its calculation involves tracking volume-weighted metrics against moving averages alongside a dynamic displacement formula defined as:
bearLevel = bearObHigh - atr * displacement
bullLevel = bullObLow + atr * displacement
where atr is the standard Average True Range of period 100, and displacement is the sensitivity multiplier. Higher values of displacement and minVolStrength allow the indicator to filter out weak market noise and focus exclusively on major institutional footprints.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Swing & Volume-Weighted Detection Engine
Pivot Identification: Automatically tracks structural pivot highs and lows using a customizable swing length via pHigh = ta.pivothigh(high, swLen, swLen) and pLow = ta.pivotlow(low, swLen, swLen) .
Volume Strength Filtering: Calculates volume intensity percentages via f_getVolumeColor(vol, sma, baseColor) to filter out blocks falling below the minVolStrength threshold.
2 — Displacement Triggers & Order Block Mapping
Dynamic Trigger Lines: Projects live dashed trigger lines using line.new(bullObBar, bullLevel, bar_index, bullLevel, style=line.style_dashed) that extend dynamically until price achieves the required ATR displacement threshold.
Zone Visualization & Peak Labels: Plots high-precision order block boxes with volume percentage text alongside structural pivot high ( PH ) and pivot low ( PL ) labels.
3 — Active Zone Management & Retest Signals
Mitigation & Invalidation: Continuously monitors active zones inside the loop structure, automatically deleting order blocks when price breaches opposite boundaries or gets fully mitigated.
Retest Signals ( B / S ): Generates clear B (Bullish OB bounce) and S (Bearish OB rejection) signal labels when price retests active institutional zones.
🔵 HOW TO USE
Apart from the basic visualization of institutional market zones, this tool can also act in alternative ways to support decision-making:
Identify High-Volume Order Blocks: Look for newly formed order block boxes displaying strong volume percentages (e.g., above 20%+) to locate institutional liquidity entry points.
Manage Risk with Retest Labels: Monitor B and S retest signal labels to guide entries and manage stop losses as price interacts with active institutional zones.
🔵 NOTES
Why this implementation is unique:
It combines volume profile weighting directly with order block detection, filtering out low-volume traps automatically.
The dynamic live trigger line engine adapts seamlessly to real-time price action without cluttering historical chart data.
The script is fully optimized for Pine Script version 6, integrating robust array management var OB obBoxes = array.new() and dynamic box rendering for maximum performance.
Indicador

Smart Entry Zones [StrixEDGE]█ OVERVIEW
StrixEDGE Smart Entry Zones is a multi-layered trend-following indicator that generates clearly defined trade setups with automatic Entry, Take Profit (TP 1–3), and Stop Loss (SL) levels — all plotted directly on the chart with exact prices and percentage targets.
The indicator is built on three independent analytical layers that work together to assess both timing and conviction:
• Supertrend — determines trend direction and triggers trade levels on each confirmed flip
• Fisher Transform — identifies overbought/oversold extremes for timing quality
• Chaikin Money Flow (CMF) — confirms whether volume supports the directional move
Trade levels appear the moment the Supertrend changes direction. The Fisher Transform and CMF score the quality of each setup on a scale of 1/3 to 3/3 conditions, so you always know how much confirmation backs the signal.
█ HOW IT WORKS
When the Supertrend flips from bearish to bullish, the indicator draws a LONG setup:
• Entry — at the close of the flip candle
• TP 1, TP 2, TP 3 — calculated as multiples of the risk (SL distance), based on your chosen Risk:Reward ratios
• SL — placed below entry at a distance of ATR × your chosen multiplier
When the Supertrend flips from bullish to bearish, a SHORT setup is drawn with the same structure, mirrored.
Each level displays the exact price and the percentage distance from entry (e.g., +4.12%, −2.27%), so you can instantly assess the reward-to-risk profile of every trade.
█ LIVE HIT DETECTION
The indicator tracks price in real time against active levels:
• ✓ appears on the chart when price reaches TP 1, TP 2, or TP 3
• ✕ appears when price hits the Stop Loss
• Once SL is hit, the trade is considered closed — no further TP checks
• Hit status is also reflected in the data table (✓ or ✕ next to each level)
This gives you a clear visual record of how each setup performed without leaving the chart.
█ THE THREE CONFIRMATION LAYERS
1. Supertrend (Direction)
Uses ATR-based dynamic support/resistance to define the prevailing trend. A flip in direction is the primary trigger for new trade levels. Configurable via ATR Period and Multiplier.
2. Fisher Transform (Timing)
A manually calculated oscillator that normalizes price position within its recent range and applies a logarithmic transformation to amplify extremes. When the Fisher value crosses its signal line at overbought or oversold levels, it confirms favorable entry timing. The threshold is adjustable.
3. Chaikin Money Flow (Volume)
Measures the accumulation/distribution pressure over a configurable period. Positive CMF above the threshold confirms buying pressure (for longs); negative CMF below the threshold confirms selling pressure (for shorts).
The Conditions counter in the data table shows how many of the three layers support the current setup (1/3, 2/3, or 3/3). A 3/3 reading means trend, timing, and volume are all aligned — the highest-conviction scenario.
█ SETTINGS
Core Parameters:
• Supertrend ATR Period (default: 10) — lookback for trend calculation
• Supertrend Multiplier (default: 3.0) — band width; lower = more signals, higher = fewer but stronger
• Fisher Transform Lookback (default: 10) — normalization window
• Fisher Extreme Threshold (default: 1.0) — defines overbought/oversold boundary
• CMF Period (default: 20) — volume pressure measurement window
• Minimum CMF Threshold (default: 0.05) — minimum reading for volume confirmation
Trade Levels:
• ATR Period for Levels (default: 14) — ATR used to calculate TP/SL distances
• SL Distance in ATR multiples (default: 1.5×) — how far the stop is placed
• TP1 / TP2 / TP3 Risk:Reward (defaults: 1.0 / 2.0 / 3.0) — each TP as a multiple of the SL distance
• Line Length in bars (default: 30) — how far the level lines extend on chart
• Show Trade Levels — toggle lines and labels on/off
Table Settings:
• Size (Tiny to Huge) and Position (any corner) — fully customizable
• Show/Hide toggle
█ DATA TABLE
A dark-header Style A panel displays all key metrics at a glance:
• Trend direction and current Fisher/CMF readings
• Conditions score (1/3, 2/3, or 3/3)
• Active trade direction (LONG ▲ or SHORT ▼)
• Entry price, TP 1–3 with percentage targets, and SL with percentage risk
• Live hit status: ✓ next to reached TPs, ✕ next to triggered SL
█ NOTES
• No repainting — all signals are based on confirmed bar closes. The Supertrend flip and Fisher Transform are calculated on closed data only.
• The Fisher Transform is manually implemented (not a built-in function) to ensure full transparency and consistency.
• This indicator is an analytical tool, not financial advice. Always use proper risk management and confirm setups with your own analysis.
█ ALERTS
Two built-in alert conditions:
• Supertrend Long — fires when Supertrend flips bullish
• Supertrend Short — fires when Supertrend flips bearish
Set alerts on any timeframe to receive notifications when new trade setups appear. Indicador

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. Indicador

Liquidity Ladder+ (M1D)OVERVIEW
MTF Liquidity Ladder maps where resting orders sit above and below price, read from six timeframes at once — 1H, 4H, 7H, 1D, 3D and 1W — and draws only the closest few from each. Nothing else goes on the chart.
A level here is a SWING: a candle whose high dominated the candles either side of it on its own timeframe. That high is where buy stops rest, so it is buyside liquidity (BSL). A swing low is where sell stops rest, so it is sellside liquidity (SSL). A level comes off the chart the moment price trades through it, because liquidity that has been taken is not liquidity any more.
Every line is black and solid, because a pool carries no direction — it is neither bullish nor bearish, it is simply somewhere price may go to fill orders, and colouring it would imply a bias the level does not hold. Weight is the only ranking: the weekly is the widest line on the chart and the hourly the thinnest, so you know which timeframe a level belongs to before you have read its name.
Everything is evaluated on bar close. Confirmed levels do not repaint.
WHAT IT PLOTS
Swing levels from six timeframes. Buyside (swing highs) above price and sellside (swing lows) below it, for 1H, 4H, 7H, 1D, 3D and 1W. Each timeframe has its own on/off switch, its own line weight and its own right-hand runway.
Only the closest 1-10 per timeframe, per side. A pool forty handles away is not a decision you are about to make, and it costs exactly as much ink as the one you are. The default is two per timeframe per side. Levels further out stay tracked and appear the moment a nearer one is taken.
One label per level, at the right end of its own line. The name sits level with the price, no box behind it, in monospace. The line's right edge and the label's x are the same number used twice, so a name can never end up somewhere its line is not.
Six label columns. Each timeframe stops at its own distance past the live candle — by default 4, 7, 10, 15, 17 and 20 bars from 1H up to 1W — and parks its name there. The families land in six columns instead of contesting one patch of screen, and the column itself tells you the rank.
Dates on daily and above, prices on 4H and above. A daily or weekly level is worth dating, because which day made it changes what it means: the label reads 1D 19/07. An hourly level carries the tag alone. From 4H up, the label also carries the price, since a pool that size is one you plan around.
WHAT SEPARATES IT FROM A PREVIOUS-HIGH / PREVIOUS-LOW SCRIPT
Levels that share a price become ONE level. Two swings resting within a few ticks of each other are one pool, not two. Drawn separately they produce two lines at the same height and two names fighting for the same space. Here they merge into a single line in the senior timeframe's column, at its weight, carrying every tag that sits there — 4H·1H. A candidate is tested against the whole group's envelope rather than just its first member, so a chain of near-misses cannot walk a group away from where it started. Never two names for one price, and never a name nudged off the level it belongs to.
Lines anchor to the exact bar that made the swing. A higher-timeframe pivot only knows which CANDLE made it. Anchor the line at that candle's open and a 4H level begins up to four hours to the left of the high it is named after — visibly adrift from the swing it describes. This script follows each timeframe's candle as it forms, records the exact chart bar its high and its low printed on, and anchors there instead. The date in the label names that same bar. A level older than the chart's loaded history has no bar to anchor to; it falls back to the candle's open, and its origin is off the left edge regardless.
A distance gate, because lines pull the price scale. A weekly pool six hundred points away on a one-minute chart does not sit quietly off-screen. The pane stretches to include it and every candle you were actually reading is flattened into a band. With six timeframes drawing at once that is a chart you cannot trade from. So nothing draws further from price than a multiple of the recent range — the last 300 bars, high to low, which tracks the instrument and the chart timeframe on its own. It gates DRAWING only: the level stays tracked, stays swept, stays alerted, and reappears as soon as price comes back within reach.
SETTINGS
Timeframes
One row per timeframe: draw it, how many bars past the live candle it runs, and how heavy its line is. Defaults 1H 4/1, 4H 7/1, 7H 10/1, 1D 15/2, 3D 17/2, 1W 20/3.
The weekly is always the heaviest line and never thinner than 2. If another timeframe is set wider, the weekly is lifted to match rather than the other being cut — no setting is discarded, but the hierarchy holds.
A timeframe hides itself when the chart timeframe reaches or passes it. A 1H level on a 4H chart is not a level, it is the bar you are standing on.
Levels
Levels per timeframe: 1-10, default 2.
Buyside and Sellside toggles, both on.
Swing strength — bars either side a candle must dominate to count as a swing, default 3.
Merge tolerance in ticks, default 4. Zero merges only prices that match exactly.
Distance gate, as a multiple of the recent range, default 1.5. Zero switches it off.
Labels
Text size, default small.
Date on 1D, 3D and 1W labels, on.
The words BSL and SSL, off by default — a level above price is Buyside and one below is Sellside, so the words repeat what the chart already says.
Price: Off, 4H and above (default), or Every level.
Alerts
Announce a sweep from this timeframe up, default 4H.
ALERTS
Sweeps below the chosen floor stay silent. A 1H pool gets tickled all session, and an alert on every one is an alert you stop reading.
A dynamic alert, at most one per bar, naming the most senior pool taken and the price it went at — for example: 4H BSL taken · 29750.00 · MNQ1!. To use it, choose "Any alert() function call" in the alert dialog.
Two fixed conditions, BSL taken and SSL taken, for anyone who prefers a plain trigger. Both respect the same floor.
NOTES
Dates are read in New York time on every instrument. An exchange's own timezone would date a CME swing in Chicago, putting a late-evening level on a different day to the rest of a New-York-based workflow.
Toggles and the distance gate affect drawing only. Detection keeps running underneath, so tidying the chart never quietly loses the analysis behind it.
Line and label objects are created once and reused rather than deleted and rebuilt each bar, so the chart does not flicker as price moves between levels.
Six request.security() calls, one per timeframe, all with lookahead off.
Disclaimer
This is an analysis tool. It marks where liquidity rests and when it is taken; it does not generate entries, exits or signals, and it makes no claim about what price will do next. Indicador

Indicador

RSI Bottom/Top Retest Scalper [josseliani]RSI Bottom/Top Retest Scalper is a short-term reversal tool built around a simple idea: the first RSI extreme is not always the best moment to act.
Instead, the indicator waits for RSI to leave the extreme area, cool down, form a second structured signal, and then waits for confirmation from price.
The logic is separated into two parts:
→ RSI setup
→ Price entry confirmation
How it works
For a bearish setup:
→ RSI first reaches the upper extreme area.
→ RSI cools down below the selected cooling level.
→ A second local RSI peak forms below the first peak.
→ The second RSI signal is confirmed when RSI starts turning down.
→ Price is then checked against the selected confirmation line.
→ A candle must place the required percentage of its body beyond that line.
→ That candle confirms and arms the setup.
→ The trade calculation starts from the OPEN of the next candle .
The bullish logic is the opposite: RSI forms an extreme bottom, rebounds, returns with a higher second bottom, and price must then confirm above the selected line.
RSI signals
The RSI setup is shown in two stages.
→ The circle marks the first RSI extreme.
→ The triangle marks the confirmed second RSI signal after the cooling and retest process.
These two markers belong to the RSI setup itself . They are not price-entry signals.
Price entry confirmation
After the second RSI signal, the script searches for price confirmation using the selected confirmation line.
A candle must place the required percentage of its body beyond that line.
This candle confirms and arms the setup , but it is not used as the entry candle.
The hollow entry arrow and trade calculation appear on the next candle , using that candle's open as the reference entry price.
So the sequence is:
→ 1 — Circle: first RSI extreme
→ 2 — Triangle: second RSI retest signal
→ 3 — Price confirmation and entry
Trade markup
When Trade Markup is enabled, the script automatically displays:
→ Stop Loss
→ 1R
→ 2R
The stop is normally derived from the price structure formed between the RSI retest signal and the price-confirmation event.
If a suitable structural stop cannot be established, or if the calculated risk is too small to be practical, the script can use an ATR-based fallback stop.
The 1R and 2R levels are calculated from the confirmed entry price and the resulting risk distance.
These levels are visual planning references. They are not predictions that price will necessarily reach a target.
Confirmation line
The confirmation line can be selected from:
→ EMA
→ SMA
→ WMA
→ RMA / SMMA
→ VWMA
→ HMA
→ DEMA
→ TEMA
→ ZLEMA
→ KAMA
→ Kalman
→ ALMA
→ Kijun
The default confirmation line is Kijun 34 .
The user can also select how much of the candle body must be beyond the confirmation line before the setup is considered confirmed.
How I use it
The default settings are tuned for 5-minute gold scalping .
I use Kijun 34 as the default confirmation line because I personally like this line a lot. I use it for both 5-minute and 15-minute scalping.
If you move to a lower timeframe, expect more signals, but also more noise. In that case, pay closer attention to entries and Stop Loss placement and consider using a shorter, faster confirmation line.
The script includes a wide selection of moving averages for scalpers, including some less conventional alternatives.
Besides Kijun, I also like ALMA for scalping. On the 1-minute chart I often use a shorter ALMA because it reacts faster, but this naturally creates a more aggressive trading style.
As a general approach:
→ Lower timeframe → shorter / faster confirmation line → more signals and more noise.
→ Higher timeframe → longer / slower confirmation line → fewer and more selective signals.
You can replace Kijun with EMA, ALMA or another available line and adjust its length for the market and timeframe you trade.
Main settings
→ RSI Length and Source
→ Upper and Lower Extreme Levels
→ Cooling Levels
→ Second Peak / Bottom Re-Entry Levels
→ Minimum Lower High / Higher Low Gap
→ Peak / Bottom Strength
→ Maximum Setup Search Window
→ Optional Midline Invalidation
→ Confirmation Line Type and Length
→ Required Body Beyond Line %
→ Entry Search Window
→ Signal Display
→ Trade Markup
→ RSI / Chart Highlighting
Important
Local RSI peaks and bottoms require confirmed bars on their right side before they can be identified.
For this reason, a second peak or bottom is marked only after its required confirmation is available.
The indicator separates the oscillator setup from price confirmation so that an RSI retest alone is not automatically treated as a trade entry.
The trade levels shown on the chart are generated from the detected setup and are intended for analysis and trade planning. They do not guarantee future performance.
Why the second signal?
The general idea of paying attention to a second oscillator signal has also been discussed in professional technical-analysis research.
Mohamed Ashraf, MFTA, CFTe, CETA presented The Stochastic Oscillator Second Signal through the International Federation of Technical Analysts (IFTA), examining the second oscillator signal as a distinct technical setup across different timeframes and market conditions.
This script does not reproduce that methodology. The referenced work uses the Slow Stochastic Oscillator, while this indicator applies its own RSI-based logic using extreme levels, cooling, second-peak / second-bottom structure and subsequent price confirmation.
Reference
IFTA Journal 2026 — The Stochastic Oscillator Second Signal
www.ifta.org Indicador

SmartFit Trend Channels [MarkitTick]💡 This tool builds a linear regression channel that does not sit on a fixed, arbitrary lookback window. Instead, it continuously re-anchors itself at confirmed swing pivots, filters its regression source through a selectable adaptive smoothing stage, validates every channel against a statistical fit-quality test, and optionally gates its breakout signals behind a trend-strength filter. Confirmed breakouts trigger directional alerts (including ready-to-route webhook JSON payloads), while a compact on-chart dashboard keeps the current channel's statistics visible at all times.
✨ Originality and Utility
Most regression-channel tools on the platform work from a single static bar count chosen by the user, redraw the entire channel on every bar, and offer no way to judge whether the underlying price action is actually behaving linearly enough for a straight-line model to be meaningful. This script addresses all three limitations at once. It measures channel validity using the Pearson correlation coefficient rather than assuming a regression fit is automatically useful, it restarts its lookback window dynamically at the most recent statistically valid swing pivot rather than a fixed period, and it finalizes historical segments as discrete drawn objects instead of continuously repainting a single line across the whole chart.
● Why These Components Are Combined
The regression engine, the pivot-anchoring logic, the adaptive source filter, the ADX gate, and the merge engine are not stacked together arbitrarily; each solves a specific weakness left open by the others. The adaptive smoothing stage reduces the high-frequency noise that a raw-price regression is otherwise highly sensitive to. The pivot-anchoring logic solves the "where should this channel actually start" problem that fixed-length regression channels never address. The Pearson fit-quality filter prevents the tool from drawing a confident-looking straight line through what is statistically a sideways, non-linear market. The ADX filter exists specifically to reduce breakout signals firing inside genuinely trendless conditions. The merge engine exists to prevent the chart from filling with redundant, near-identical channel segments once the pivot-anchoring logic starts producing frequent restarts on lower timeframes. Together, these form one coherent statistically-aware channel system rather than five unrelated features bundled for the sake of it.
🔬 Methodology and Concepts
● Regression Engine
At its core, the script performs an ordinary least-squares linear regression across the bars since the current channel's anchor point, producing a slope and intercept that define the channel's midline. This calculation always runs on confirmed, closed price data, never on the live forming bar.
● Statistical Validity Filter
Every regression is scored with the Pearson correlation coefficient, which measures how well price actually fits a straight line on a scale of -1 to 1. A minimum bar count and a minimum absolute correlation strength (both user-configurable) must be met before a channel, or a breakout signal derived from it, is considered valid. Channels that fail this test are still drawn, but are visually flagged as low-confidence rather than treated as a directional signal.
● Deviation Bands
Upper and lower channel boundaries are placed a user-defined number of standard deviations away from the regression midline, based on the vertical dispersion of price around that line. This produces a statistically scaled envelope rather than a fixed-percentage or fixed-tick band.
● Adaptive Source Filter
Instead of regressing on raw closing price, the script can first pass price through one of several smoothing methods, selectable per chart:
SMA / EMA / RMA — standard simple, exponential, and Wilder-smoothed moving averages, offered as baseline options with different responsiveness-to-noise tradeoffs.
Double WMA — a weighted moving average smoothed a second time through another weighted pass, trading additional lag for a cleaner underlying line.
Triple VWMA — a volume-weighted moving average smoothed through three successive passes, intended for instruments where volume-weighting the trend estimate is meaningful.
HMA — a low-lag moving average designed to track price more closely than a standard average of the same length.
LLAMA — a proprietary MarkitTick method that blends a simple average baseline with a linear slope term measured across the filter length, effectively projecting the recent directional momentum forward onto the smoothing output rather than only averaging past values.
Kalman Filter — a recursive single-state estimator that continuously balances its own prediction against each new price print, with the filter length controlling how much weight is given to new information versus the existing estimate.
Selecting "None" regresses directly on the previous confirmed close.
● Dynamic Pivot Anchoring
The script tracks confirmed swing highs and swing lows using a symmetric bar-confirmation window (either auto-scaled to the chart's timeframe or manually set). These pivots are only accepted once enough bars have closed on both sides of the candidate bar to confirm it, so no pivot is ever assumed before it is actually confirmable. When a breakout occurs, the script evaluates whether the most recent opposite-type pivot has a strong enough regression fit of its own to serve as a more representative channel origin; if it does, the newly drawn segment is anchored there instead of at the current bar.
● Confirmation Lag Notice
Because segment anchors are only finalized once a breakout confirms them, a newly drawn historical segment's starting point is placed at a bar in the past, after the fact. This is standard behavior for any pivot-anchored channel tool and does not involve unconfirmed or future data, but it does mean the visual origin of a finalized segment was not known in real time at that bar; it becomes fixed only once the breakout that closes out the prior segment occurs.
● Channel Merge Logic
When enabled, a newly forming channel is compared against the band edges of the segment it is replacing. If the gap between them falls within a user-selected tolerance (expressed as a multiple of the current standard deviation), no new discrete segment is drawn and the channel is treated as a continuation. This keeps visually similar, closely-spaced channels from cluttering the chart as separate labeled objects.
● ADX Trend Filter
An optional Average Directional Index filter can require a minimum trend strength reading before a breakout is allowed to register as a directional signal, reducing the number of signals generated while the market is directionless.
● Breakout Signal Logic and Webhook Alerts
A directional signal fires only on a confirmed bar, only when the minimum bar count and fit-quality thresholds are met, and only once per new breakout (not on every bar the price remains beyond the band). Each signal type — long entry, short entry, and their corresponding opposite-side close — has its own configurable action label, which is packaged into a JSON payload suitable for forwarding to third-party automation or webhook services.
🎨 Visual Guide
The live, currently forming channel is drawn as three connected lines — an upper band, a midline, and a lower band — with the space between the bands filled in a translucent color. Green indicates a bullish-sloped channel, red indicates a bearish-sloped channel, and gray indicates a channel that has not met the minimum fit-quality threshold and should be treated as statistically unreliable. A small label at the live edge of the channel states its bias, its fit percentage (the Pearson correlation expressed as a percentage), and its standard deviation value. When a segment finalizes, its own colored line-and-fill combination plus a labeled marker remain on the chart as a permanent historical record of that channel. An optional setting recolors the chart's candles using the live channel's bias color for an at-a-glance read of current conditions without needing to look at the channel itself. In the corner of the chart (position configurable), a compact dashboard table lists the ticker and timeframe, current bias, a bar-style fit-quality gauge, the standard deviation value, the current upper and lower band prices, the number of bars in the active channel, the pivot length in use, the current breakout/breakdown state, and — only when the relevant filters are enabled — the live ADX reading and the selected adaptive filter type.
📖 How to Use
Read channel color and the dashboard's Bias row together: a green, high-fit-percentage channel reflects a statistically supported uptrend in the regression sense, while red reflects the equivalent downtrend condition. Treat gray, low-fit-percentage channels as periods where price is not moving in a way a straight line meaningfully describes, and weight any signal generated during those conditions accordingly. A directional signal, visible as a Breakout or Breakdown state on the dashboard and paired with an alert firing, indicates confirmed price has closed beyond the channel's statistical deviation band with sufficient trend history and fit quality behind it — this is a signal generator, not a backtested strategy, so no historical win-rate or equity curve is produced by the script itself. Enabling the ADX filter is most useful on instruments or timeframes prone to frequent whipsaw, where it will suppress breakouts that occur without adequate underlying trend strength. Choosing a smoother adaptive filter (Double WMA, Triple VWMA) will produce fewer but later channel restarts; choosing a more responsive one (HMA, Kalman, LLAMA) will track price more closely at the cost of more frequent re-anchoring. Enable channel merging on lower timeframes or choppier symbols to keep the chart readable; disable it if you want to see every discrete regression segment the script produces. To receive the webhook-ready alerts, create an alert on the script using the "Any alert() function call" option, or select one of the four named alert conditions individually if only a subset of signals is needed.
⚙️ Inputs and Settings
The Core group controls the statistical backbone of the tool: automatic or manual pivot lookback length, whether nearby channels merge and how strict that merge tolerance is, the minimum Pearson fit strength and minimum bar count required for a channel to be considered valid, and the deviation z-score used to size the bands. The Filters group holds the optional ADX trend gate (toggle, threshold, and length) and the adaptive source filter selection along with its length. The Visuals group controls channel line width and whether chart candles are recolored by the live channel bias. The Dashboard group sets which corner of the chart the statistics table is drawn in. The Alerts group defines the text sent in the "action" field of each of the four webhook JSON payloads (long, short, close-long, close-short), allowing the payload vocabulary to be matched to whatever automation platform is receiving it. The Colors group governs the bullish, bearish, and weak-fit channel colors, the support/resistance accent colors used in the dashboard gauge, and the dashboard's background, header, text, and warning colors.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The regression core is an ordinary least-squares fit — the same slope and intercept formulas taught in introductory statistics, chosen because they minimize the sum of squared vertical distances between the line and each price point in the window. Layered on top of this is the Pearson product-moment correlation coefficient, the standard statistical measure of how strongly two variables are linearly related; applying it to price-versus-time is the same logic underlying R²-based confidence filters used in quantitative trend-following research, here repurposed as a simple accept/reject gate for whether a channel is worth trusting. The deviation bands draw on the same statistical foundation as Bollinger-style envelopes — a mean or trend estimate flanked by a multiple of the underlying standard deviation — except the dispersion here is measured as residual distance from a sloped regression line rather than from a flat moving average, and a z-score of 1.96 specifically corresponds to the approximate 95% interval of a normal distribution, a deliberate nod to standard statistical confidence-interval convention. The pivot-confirmation logic is a symmetric-window fractal test in the tradition of classic swing-high/swing-low detection methods, used here purely as a principled way to choose a channel's starting point rather than as a standalone trading signal. The ADX/DMI component follows Welles Wilder's original directional movement framework for measuring trend strength independent of trend direction. Among the adaptive filters, the Kalman option applies a simplified single-state predict-correct estimator common in signal processing and control theory, while the LLAMA option applies a linear-extrapolation-style adjustment to a moving average — conceptually related to trend-adjusted smoothing methods such as Holt's linear exponential smoothing, which projects recent momentum forward rather than only averaging past observations.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicador

Auto Fibonacci AI - Level Respect Statistics [Dots3Red]📐 AUTO FIBONACCI AI - LEVEL RESPECT STATISTICS
Fibonacci retracement is one of the most widely used tools in trading. It is also one of the least verified. "The 0.618 is the golden pocket" gets repeated everywhere and tested nowhere. This script keeps score — not universally, but specifically for the chart you are actually looking at.
✨ WHY THIS IS DIFFERENT
Every other Fibonacci tool draws the levels and stops there. Whether those levels actually work on this instrument, this timeframe, this market condition is left entirely to assumption. This script treats that as a question worth answering. Every touch of every level is graded: did price reject cleanly, or push through? The results accumulate directly in each level's label:
📊 0.618 | 71% bounced (n=24)
That means: on this chart, at this timeframe, price has touched the 0.618 level 24 times across all the swings this script has processed. 71% of those touches resulted in a genuine rejection. 29% broke through. That is a real measurement, not a theoretical assumption.
⚙️ HOW IT WORKS
📐 Auto swing detection — the script identifies the most recent confirmed pivot high and pivot low using a configurable lookback. A minimum swing size filter (in ATR units) rejects small, noisy movements — only swings that represent genuine market structure anchor the Fibonacci grid. Swings are confirmed only on closed bars, so the anchor never changes retroactively.
📏 Retracement levels — the standard five levels are drawn from the detected swing: 0.236, 0.382, 0.500, 0.618, and 0.786. The 0.618 is highlighted in amber since it receives the most attention from traders and institutions. Each level accumulates its own separate statistics.
🎯 Touch grading — every time price approaches a level within a configurable tolerance, a touch is recorded and enters a pending state. Within the outcome window (configurable bars), it resolves as one of three outcomes:
• Bounce — price moved cleanly away from the level without breaking it
• Break — price closed convincingly through the level
• Timeout — neither happened clearly enough to call; counted as a touch but not a bounce or break
Each resolved touch feeds into that level's cumulative percentage — and the labels update to show the live result.
🟢 Extension targets — when price breaks past the swing's extreme (not just retracing to it but genuinely continuing through), the script activates two extension targets: 1.272 and 1.618. These are the levels most commonly used as continuation targets after a structural break. Each is tracked in its own way: did price actually reach 1.272 after the break? 1.618? Over time, the extension labels show:
📊 1.272 | hit 64% (n=11)
📊 1.618 | hit 41% (n=11)
That's a concrete answer to "how far does price usually go when it breaks the swing?" — specific to this chart, not assumed from theory.
🔒 Non-repainting — pivots only confirm after the required bars on each side have closed. The swing anchor only updates when a new qualifying pivot is confirmed. Grading only happens on confirmed bars. The levels and statistics reflect what actually happened, not what the current bar is doing in real time.
🧭 HOW TO USE
1️⃣ Let the sample size build before trusting the percentages. A level that shows "0% bounced (n=2)" is meaningless — two touches is noise. The labels deliberately show the N= count so you can judge reliability yourself. A consistent reading across 15+ touches is worth paying attention to; 3-5 touches is still developing.
2️⃣ Compare across levels. If 0.382 shows 40% bounced on this chart while 0.618 shows 74% bounced, that's telling you something specific about which pullback depth this market tends to respect. That difference is invisible to a plain Fibonacci tool.
3️⃣ Use extension hit rates for target selection. If 1.272 has been reached in 64% of breakout cases but 1.618 only in 41%, the first extension is the more realistic target on this chart — and the second, while possible, has historically been hit less than half the time. This is not a rule; it is an observation about past behavior on this specific chart.
4️⃣ Adjust settings to the timeframe. The defaults (pivot leg 8, minimum swing 3× ATR) are calibrated for mid-range timeframes — 15-minute through 4-hour — where Fibonacci retracement is most actively watched by swing traders and where enough swings complete regularly to build meaningful sample counts. On faster timeframes, reduce both settings so smaller swings qualify. On slower ones, increase them to filter noise.
5️⃣ The statistics describe the past, not the future. A high bounce rate at 0.618 means price has historically respected this level on this chart. It is not a promise that the current touch will also bounce. Use the percentages as context — one input among many — not as an automatic signal.
🛠️ SETTINGS
📐 Swing Detection
• Pivot Leg — bars required on each side to confirm a swing pivot
• Min Swing Size — smallest qualifying swing in ATR units; filters out noise
🎯 Level Grading
• Touch Tolerance — how close price must come to a level to count as a touch
• Break Buffer — how far past a level close must clear to grade as a break
• Bounce Distance — how far price must move away, cleanly, to grade as a bounce
• Outcome Window — bars allowed for a touch to resolve
• Extension Window — bars allowed for an extension target to be reached after a break
🎨 Visualization
• Show Extension Targets — toggle the 1.272 / 1.618 green lines
• Per-Level Stat Labels — toggle the bounce-rate text on each level
🖥️ Dashboard
• Show / hide, position — swing direction and per-level bounce rates in a compact table
📝 NOTES
The script tracks one active Fibonacci grid at a time — the most recent qualifying swing. When a new swing confirms, the grid shifts and per-level statistics carry forward from all previous swings on the chart. The statistics are global across all swings processed since the indicator was added to the chart, not per-swing.
Statistics are most meaningful on timeframes where Fibonacci retracement is genuinely watched and defended by real market participants — typically 15-minute through 4-hour. Very short timeframes will accumulate sample counts quickly but the measurements may reflect microstructure noise rather than true level respect. Very long timeframes will take extended real-world time to build enough data to be informative.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical bounce and hit rates do not guarantee how price will behave at any specific future level touch. Indicador

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.
Indicador

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. Indicador

Precision Volume Profile [AxeAlgo]OVERVIEW
Precision Volume Profile is a native Pine Script volume
profile tool: it rebuilds a full price-by-volume histogram for whatever
range you anchor it to — the visible chart, a fixed bar count, the
current day, week, month, or a custom trading session — and derives the
Point of Control (POC), Value Area High/Low (VAH/VAL), a Prior Period
Value Area with open-type and POC-migration classification, and a
session VWAP with standard-deviation bands, all from the same underlying
bar history.
This is the classic Market Profile / Volume Profile toolkit used to
judge where the market has actually traded the most volume — not just
where price is right now — and how today's activity compares to the
period before it. Everything here runs natively on your own chart data;
there are no external requests, no repainting of confirmed history, and
no hidden calculations.
This script is free and open-source, published so the full methodology
described below is verifiable directly in the source code.
============================================================
HOW IT WORKS
============================================================
Volume Profile Histogram
----------------------------
For the selected range, price is divided into rows (automatically sized
to the range, or set manually) and every historical bar's volume is
distributed across the rows its high-low span touches. Each bar's
volume is split into an estimated buy side and sell side based on where
that bar's close sits between its low and high — a bar that closed near
its high is treated as more buy-weighted, one that closed near its low
as more sell-weighted. The row with the most total volume becomes the
POC; rows are colored on a gradient between two configurable colors
based on that estimated buy/sell split, with opacity scaled to each
row's relative strength versus the POC.
Value Area
----------------------------
The Value Area is expanded outward from the POC two rows at a time —
comparing the volume of the next pair of rows above versus the next
pair below and adding whichever pair holds more volume — until the
accumulated volume reaches the configured Value Area percentage (70% by
default, the standard Market Profile convention). This is the same
textbook two-row-pair expansion method used for both the live profile
and the Prior Period snapshot below, so the two stay directly
comparable.
Anchor Modes
----------------------------
Six ways to define what range the profile is built from: Visible Range
(whatever's currently on screen), Fixed Bars (a set lookback), Day,
Week, Month, or a fully custom Session (configurable start/end time and
timezone, e.g. 0930-1600 for US regular trading hours). A dotted
vertical line marks exactly where the current profile's lookback
begins whenever that boundary isn't simply the edge of your screen.
Prior Period Value Area, Open Type & POC Migration
----------------------------------------------------
At each period boundary (Day or Week, configurable), the script
snapshots the period that just closed: its Value Area is drawn as a
dashed box extending forward, today's open is classified as Above,
Below, or Inside that prior value, and the new POC is compared against
the previous one to report whether it's migrating up, down, or holding
flat. This is the standard "open-type" read used to gauge whether a
session is likely to be rotational or trending.
Session VWAP & Standard Deviation Bands
------------------------------------------
A running volume-weighted average price with up to two configurable
standard-deviation bands on each side, calculated with the same
volume-weighted variance formula as TradingView's own VWAP tool. It can
reset either at calendar midnight or at your custom session's open
time — the same session window used by the Session anchor mode above,
so the two can be kept in sync.
Stats Panel
----------------------------
An optional on-chart table summarizing the active anchor mode, bar/row
count, POC, VAH/VAL, Value Area width, estimated buy/sell split and
delta, total volume, open type, POC migration, and current VWAP —
everything the script computes, in one place, without needing to
hover over individual lines.
Alerts
----------------------------
Two alert conditions: price crossing the POC, and price entering or
exiting the Value Area.
============================================================
ACCURACY NOTE — HOW BUY/SELL VOLUME IS ESTIMATED
============================================================
Pine Script does not have access to real trade-by-trade tape or
bid/ask data on standard bars, so no volume profile indicator can
measure "true" buy versus sell volume directly. This script — like
essentially every volume profile tool on TradingView — estimates it
from each bar's own OHLC: where the close sits between the low and the
high. This is a widely used, reasonable proxy, but it is an estimate,
not measured order flow. Treat the buy/sell split and Delta reading as
directional context, not a precise execution metric.
============================================================
HOW TO USE IT
============================================================
Add the indicator, pick an Anchor mode that matches how you trade
(Visible Range for manual exploration, Day/Week/Session for a
consistent recurring reference), and set the Value Area percentage if
you want something other than the 70% default. Every input has an
in-editor tooltip explaining exactly what it changes. The Prior Period
panel rows (Open Type, POC Migration) are most useful checked once at
the start of a session; the POC/VAH/VAL lines and histogram are
intended as a persistent reference for the rest of the period.
============================================================
REPAINTING & REAL-TIME BEHAVIOR
============================================================
The profile, its lines, and the stats panel are only (re)computed on
the most recent bar (barstate.islast) — not on every historical bar —
for performance, and are cleared and redrawn from scratch each time
they update. In Visible Range or Fixed Bars mode this means the profile
legitimately changes as you scroll, zoom, or as new bars form — that's
the tool responding to a different input range, not repainting of a
fixed historical value. In Day/Week/Month/Session mode, once a period
has closed its POC, VAH, and VAL are fixed and do not change on
subsequent reloads; only the currently forming period's profile updates
live as new bars print. The Prior Period Value Area snapshot is
computed once, at the moment its period closes, and is never
recalculated afterward.
============================================================
LIMITATIONS — PLEASE READ
============================================================
- Buy/sell volume is an OHLC-based estimate, not real tape data (see
the Accuracy Note above).
- The Value Area expansion is a discrete two-row-pair algorithm; on
very coarse row counts it can land a percentage point or two away
from the exact target rather than hitting it precisely.
- "Max Bars Stored" caps how much history is kept in memory for
performance; extremely long Fixed Bars or Visible Range lookbacks on
very low timeframes can exceed it and get truncated.
- The custom Session anchor and VWAP session-open reset depend on the
Session Time and Timezone inputs actually matching your instrument's
real trading session — mismatched inputs will produce a
technically-correct but practically meaningless boundary.
- This is a discretionary analysis tool intended to support your own
read of the market, not a mechanical, guaranteed-signal system.
============================================================
RISK DISCLAIMER
============================================================
This script is provided for educational and informational purposes
only. It is not financial advice, and it is not a recommendation to buy
or sell any security or instrument. Trading and investing involve
substantial risk of loss and are not suitable for every investor. Past
performance is not indicative of future results. Always do your own
research and consider consulting a licensed financial advisor before
making trading decisions. Use this indicator, and any alerts it
generates, entirely at your own risk.
============================================================
ORIGINALITY
============================================================
This is original work: the row-building and Value Area expansion
algorithms, the Prior Period snapshot and open-type/migration logic,
the session-anchor handling, and the visual design are all written
from scratch for this script. It is published free and open-source so
the full methodology described above is verifiable directly in the
source code.
Indicador

Sector/Theme Performance DashboardThis indicator renders a customizable matrix directly on your chart to track sector, sub-industry, and thematic ETF performance across key lookback periods without switching tabs.
Key Features:
Multi-Timeframe Metrics: Track 1-Day, 1-Week, 1-Month, and YTD performance side-by-side.
Theme Mapping: Displays explicit thematic descriptions alongside each ticker (e.g., Capital Markets, Semiconductors, Cloud, Cyber, Volatility).
Visual Customization: Toggle individual timeframe columns on/off, adjust matrix sizing, and set custom color palettes.
Bypassing the 40-Ticker Script Limit:
Because TradingView caps each script to 40 data calls, ETFs are organized into select group batches in the settings.
To display 120+ ETFs simultaneously:
1. Load multiple instances of the indicator onto your chart.
2. Assign a different group batch to each instance.
3. Set the screen placement (Left, Center, Right) in the settings to render side-by-side panels. Indicador

SF Raw Anchored Return LinesSector Rotation Lines
A Plain-English Guide
Authors Stephen_F and Claude, August 19, 2026
What This Tool Shows You
Sector Rotation Lines is a chart tool that answers one simple question: “which parts of the stock market are doing better or worse than the others, right now?”
The U.S. stock market is made up of 11 broad sectors — groups of companies that do similar things. Technology, Financials, Health Care, Energy, and so on. Money doesn't move evenly through all of them at once. At any given time, some sectors are leading (attracting more buying) and some are lagging (falling behind). Traders call the natural ebb and flow between them “sector rotation.”
This tool draws one line per sector, all starting from the same point (zero), so you can see at a glance who's pulling ahead and who's falling behind over whatever time period you choose.
How to Read the Chart
• Every line starts at 0% on the left-hand side. That's the “starting line” for all 11 sectors — they all begin equal, even though the underlying stocks are priced completely differently.
• As you move right across the chart, each line rises or falls based on how much that sector's price has gone up or down since the starting point.
• A line sitting above 0% means that sector has gained value since the start of the window. Below 0% means it has lost value.
• The higher a line sits above the others, the stronger that sector has performed over the period you're looking at.
Why rebase everything to zero?
A single share of one sector fund might cost $40, while another costs $200. Comparing raw prices tells you nothing useful. By resetting every sector to the same starting point, the chart lets you compare percentage moves directly — an apples-to-apples view of performance.
The Dashed Average Line
Alongside the 11 colored sector lines, you'll see one black dashed line. This is the average of all 11 sectors combined — think of it as “the market as a whole,” built directly from the same sectors on your chart (it isn't a separate index or fund).
This line is one of the most useful things on the chart:
• Any sector line sitting above the dashed average is currently outperforming the broad market — it's a leader.
• Any sector line sitting below the dashed average is currently underperforming — it's a laggard.
This is the quickest way to separate the sectors worth paying attention to from the ones that are just drifting along with everything else.
Choosing Your Data Source
Sector performance can be measured a few different ways, depending on which fund family's products you use as the stand-in for each sector. This tool lets you pick from five built-in options, plus a fully custom option:
Option -- SPDR (Cap-Weighted)
The most widely watched sector funds (the “XL” funds). Weighted so larger companies count for more — this is the industry-standard default most people mean when they talk about “the sectors.”
Option -- Vanguard (Total Market)
Vanguard's broader sector funds, covering a wider slice of each sector's companies, not just the biggest names.
Option == Invesco (Equal-Weight)
Every company in a sector counts equally, regardless of size. This can highlight smaller companies that a cap-weighted view would hide behind giants like Apple or Microsoft.
Option -- Fidelity (Total Market)
Fidelity's version of broad sector coverage, similar in spirit to Vanguard's.
Option == S&P 500 Sector Indices
The raw index values behind the sector funds, rather than a tradable fund itself.
Option == Custom
Type in your own preferred symbol for each sector if you have a specific fund family or ticker in mind.
If you're not sure which to pick, the SPDR (Cap-Weighted) option is the most common starting point and matches what most financial news reports.
Choosing Your Time Window
Sector leadership changes over different time horizons — a sector can be the weakest performer this week and the strongest this year. The tool lets you choose how far back the comparison starts:
Window -- 1 Week
The last 5 trading days — a short-term, fast-moving snapshot.
1 Month
The last 21 trading days — a good general-purpose view for spotting a rotation that's building.
1 Quarter
The last 63 trading days — roughly three months, useful for medium-term trends.
1 Year
The last 252 trading days — the big-picture view of which sectors have led all year.
Custom
Pick your own exact start and end dates — useful for comparing a specific news event, earnings season, or period you care about.
A note on the Custom option
When you switch to Custom, you'll set both a start date and an end date yourself. If you leave the end date far in the future, the chart will simply keep updating with today's most recent data — exactly like the preset windows do. Only set a specific end date if you want to “freeze” the comparison at a particular point in the past, for example to study exactly what happened during a specific week.
The Labels and the Table
Two things help you identify each line without guessing:
• End-of-line labels: each line has its ticker symbol sitting right at its endpoint, so you can trace any line back to its name just by looking at the right edge of the chart.
• The legend table: a small table in the corner of the chart lists every sector by name along with its exact percentage return for the period, sorted from best performer to worst. This is the fastest way to get an exact number rather than eyeballing the lines.
A Few Ways to Use This in Practice
• Quick market check: glance at the 1 Month view to see which sectors are currently leading — this is often the first thing worth checking before digging into individual stocks.
• Confirming a trend: if a sector is above the dashed average line on the 1 Week, 1 Month, and 1 Quarter views, that's a sector with real, sustained momentum, not just a one-day blip.
• Spotting a turn: watch for a sector that has been near the bottom of the pack starting to cross above the dashed average — this is often an early signal of money starting to rotate into that area.
• Comparing data sources: if you're unsure whether a move is broad-based or driven by a few large companies, switch between the Cap-Weighted and Equal-Weight presets and see if the picture changes.
This tool is for informational and educational purposes and is not investment advice. Indicador

Momentum Rotor | Basket Breakout & Leadership RotationWhat it does
Momentum Rotor ranks a basket of correlated symbols (default: AAPL, MSFT, NVDA, GOOGL, AMZN, META, TSLA, AVGO — fully user-editable) by N-bar rate-of-change momentum, recalculated every bar via request.security(). It only opens a long position on the chart's own symbol when that symbol is simultaneously the strongest performer in the basket (rank #1 by momentum) and breaking its own N-bar price high. If the held symbol later loses the #1 rank to another basket member, the strategy closes the position — it "rotates out" of a fading leader rather than holding through a reversal.
Core features
Live leaderboard table — ranks the full basket by momentum every bar, with gradient-colored scores and trend glyphs (↑/↓) so you can see who's strengthening or fading at a glance
Regime/leadership dashboard — shows your symbol's current rank, how many bars the leader has held the top spot, and basket-wide breadth (% of symbols with positive momentum) as a quick risk-on/risk-off gauge
Risk-based position sizing — position size is calculated from a fixed % of equity risked against an ATR-based stop distance, not a fixed share count
ATR stop + R-multiple take-profit — stop distance and profit target both scale with volatility instead of using static price offsets
Optional rotation-confirmation filter — require the leader to lose #1 rank for N consecutive bars before exiting, to reduce whipsaw from brief rank flickers
Optional regime filter — require price above a long SMA before taking new entries, to avoid trading breakouts in a broader downtrend
Realistic backtest defaults — includes commission, slippage, and margin settings out of the box rather than assuming frictionless, infinite-leverage fills
How the strategy works
Each bar, the script pulls the N-bar ROC (rate of change) for every symbol in the basket and sorts them from strongest to weakest. Your chart's symbol only becomes eligible to trade when it holds rank #1 and closes above its own N-bar high — combining a relative-strength filter with an absolute breakout trigger, so entries require both "stronger than its peers" and "breaking out on its own chart" to align. Exits are twofold: an ATR stop/target pair from the entry, and a rotation exit that closes the trade the moment (or, with the confirmation filter on, N bars after) another basket member overtakes it in the momentum ranking.
What makes it distinct
Most retail breakout scripts evaluate a single symbol in isolation. Momentum Rotor brings relative-strength rotation — a concept used by institutional sector/factor rotation strategies — into a single-chart script by polling an entire basket with request.security() and gating trade eligibility on relative rank, not just absolute price action. The live leaderboard turns that ranking process into something visible and auditable on the chart itself, rather than a black-box filter.
Tips for use
Chart the strategy on one of the basket's own symbols (or add your target symbol to the basket inputs) — the "am I #1" check only works when your chart's ticker matches a basket entry
This instance only manages a position on its own chart's symbol; it does not automatically route orders to whichever symbol becomes the new leader. To rotate capital across the whole basket, run separate instances on each symbol
Momentum/breakout systems are inherently prone to false breakouts and whipsaws in choppy markets — the optional regime filter and rotation-confirmation delay are there to dampen that; test both on/off for your instrument and timeframe
Sector ETFs (lower dispersion, steadier trends) and mega-cap tech names (higher dispersion, sharper momentum swings) behave differently in this framework — adjust lenMom/lenBreak accordingly
Backtest results depend heavily on commission, slippage, and margin assumptions set in Properties — review and adjust these to match your actual broker before drawing conclusions
Limitations
This is an educational strategy template, not a production-ready system or financial advice. It has not been optimized or validated for any specific instrument, timeframe, or market regime. Past performance in this backtest does not indicate future results. Estratégia

Supply & Demand Zones - Retest Record [FEELS]Draws supply and demand zones, then keeps score of what each one actually did when price came back to it.
Most zone scripts print a "held %" and stop there, with nothing to compare it against. Here every zone on your chart is split by how fast price returned to it, and the two groups are shown side by side.
On Bitcoin daily, zones that were retested within three bars held 69% of the time. Zones that were revisited later held 49%. That second number is the useful one: a stale zone breaks more often than it holds, and it is the one most people are still trading.
WHAT A ZONE IS, IF THE TERM IS NEW
A zone is a spot price shot away from. Not drifted away from, shot away from.
The reasoning behind the idea is that somebody large was buying or selling there and did not finish. A demand zone below price is where buyers stepped in hard; a supply zone above price is where sellers did. If price comes back, whoever was unfinished is supposed to still be there, and price is supposed to turn again. So a zone is read as support or resistance, not as a target.
That is the theory. The measurement in this script says it is true for a while and then stops being true. When price comes straight back the move that made the zone is still running and it holds two times in three. Weeks later it holds less than half the time, which is worse than a coin. Whoever was buying there has finished, or changed their mind, and all that is left is a rectangle on a chart.
WHAT IT DRAWS
- Supply and demand zones from quiet bases that price left with an impulse
- A dot on every retest: held or broke through
- A running record on each zone once it has enough tests to mean anything
- Broken zones stay on the chart as a dashed outline, cut off at the bar that broke them
- A panel with the fast-versus-late split measured on the symbol you are looking at
- Three alerts: zone formed, zone held a retest, zone broken
HOW IT WORKS
A zone starts as a run of quiet candles. If price then leaves that base by more than a set multiple of ATR within a few bars, the base becomes a zone. The box is drawn over the candles it was built from, not from the impulse onward.
From then on the zone is followed bar by bar. When price re-enters it a test opens, and that test resolves one of two ways: price moves back away from the zone by one ATR, which counts as held, or it cuts through the far edge, which breaks the zone permanently.
Every first test is filed into one of two buckets by how many bars passed between the zone forming and price coming back. That is the only split. Both buckets contain real zones on the same symbol, so the two rates are directly comparable.
HOW TO READ IT
1. Green is demand, red is supply. Solid means the zone has never been broken, dashed means it has.
2. A dot marks each retest, green for held and red for broken through. A bigger dot means that retest was a fast one.
3. The label on a zone is its own record. Below a few tests it shows the raw count, because three out of three is not a hundred per cent, it is three out of three.
4. The panel is measured on your symbol and timeframe, not copied from anywhere. Switch symbols and the numbers change.
WHERE IT WORKS AND WHERE IT DOES NOT
The gap between fast and late retests is much wider on crypto than elsewhere. Measured while building this, on four symbols with hourly data:
Bitcoin 67.9 against 55.9 · Ethereum 71.0 against 54.5 · EURUSD 67.8 against 56.3 · Gold 73.6 against 56.6
On the S&P and on EURUSD daily the same split comes out closer to ten per cent rather than thirty. The effect is real on every symbol tested, but it is not the same size everywhere, and the panel will tell you what it is on yours instead of repeating a number from this description.
ORIGINALITY
Zone drawing is a commodity and this script does not claim to draw better boxes. What it adds is the scorekeeping, and one specific finding inside it.
Two control groups were built during development. Both are reported here, including the one that does not favour the script.
The first compared zones against lookalike bases that no impulse ever came out of. It was dropped: a base like that only exists while price is still sitting on top of it, so it always got measured in chop and it flattered the zones by roughly double.
The second is harder to pass. Take each real zone, copy its width and its distance from price, and plant that same shape at a random bar somewhere else in history. Everything is identical except the reason the zone exists. Across all retests, seeded run: Bitcoin 62.5 against 60.0, Ethereum 63.4 against 58.0, EURUSD 62.0 against 55.4, Gold 64.4 against 59.0. Sample sizes 478 to 1015 per cell.
So the location of a zone is worth a few points and no more, and on Bitcoin it is worth almost nothing. What separates a useful zone from a useless one is not where it is. It is how soon price comes back, which is the split the panel measures.
Also measured and discarded: impulse strength, which several ranking scripts use as their main quality factor, came out slightly negative. Zone width mattered more than impulse size, and neither mattered as much as how quickly price returned.
HONESTY
- Everything is counted on closed bars. A zone that has already been drawn never moves, and a broken one is frozen at the bar that broke it.
- The numbers depend on how much history your chart has loaded, and TradingView loads different depths on different timeframes. The same symbol can honestly report a different count on 1h than on 1D. The sample sizes are in the panel for that reason.
- Until twenty-five retests have resolved in each of the two groups, the panel says it is still measuring rather than showing a number built on nothing.
- A zone is a description of what already happened. It is not a forecast, and a fast retest is not a reason to expect a bounce.
- Only the most recent zones per side are drawn, to stay inside TradingView's drawing budget. The panel keeps counting every retest that resolved, including on zones no longer on screen.
- The impulse test uses ATR at the base, so what counts as a zone changes with volatility. A fixed percentage would find nothing in quiet markets and everything in violent ones.
SETTINGS
The main ones: how hard price must leave a base for it to count as a zone, how long the base may be, and how far price must move away from a retest before it counts as held. "Straight back means within this many bars" sets the line between fast and late, and three is what came out of testing twelve variants across four symbols, chosen on two and confirmed on two the search never saw. The rest is appearance: colours, transparency, how many zones per side, text sizes, and whether the panel and its legend are shown.
This is a descriptive tool for reading zone behaviour. It is not financial advice and it does not predict price. Indicador

DMI Spread Dashboard ,5m 30m 1hDMI Spread Dashboard is a multi-timeframe directional-momentum monitor built around the Directional Movement Index (DMI) and Average Directional Index (ADX). It calculates the complete DMI structure independently on the 5-minute, 30-minute, and 1-hour timeframes, then organizes the results into one compact chart dashboard.
The indicator is designed to answer four separate questions:
1. Which side currently has directional control?
2. How large is the difference between positive and negative directional movement?
3. Is that directional difference expanding or contracting?
4. Is the underlying directional movement strong enough to be meaningful according to ADX?
Instead of displaying only a DMI crossover or a single ADX value, the dashboard separates direction, directional separation, trend strength, and momentum development. This helps users distinguish an established directional move from a weak crossover or a move that is losing participation.
HOW THE CALCULATIONS WORK
The script uses the traditional Directional Movement framework associated with J. Welles Wilder Jr.
For every selected timeframe, the script first compares the current high and low with those of the previous bar:
• Positive directional movement measures qualifying upward movement in the high.
• Negative directional movement measures qualifying downward movement in the low.
• When both sides move, only the qualifying dominant directional movement is retained according to the standard DMI comparison.
Positive and negative directional movement are smoothed using Wilder’s moving average method. Each smoothed value is then normalized by a Wilder-smoothed True Range and multiplied by 100 to produce +DI and -DI.
The script calculates ADX from the smoothed absolute difference between +DI and -DI relative to their combined value. ADX measures the strength of directional movement, not its direction. A high ADX can therefore occur during either bullish or bearish conditions.
The indicator then calculates its central measurement:
DMI Spread = +DI - -DI
A positive spread means +DI is greater than -DI and upward directional movement is dominant. A negative spread means -DI is greater than +DI and downward directional movement is dominant. A spread near zero indicates that neither side has established meaningful separation.
WHAT MAKES THE DASHBOARD DIFFERENT
The script does more than place standard DMI values from several timeframes into a table. It converts the relationship between +DI and -DI into a signed spread and then measures the bar-to-bar change in that spread.
This creates two separate forms of information:
• Direction identifies which side is currently dominant.
• Spread development identifies whether that dominance is expanding or contracting.
For a positive spread, an increase in the spread is classified as EXPANDING because bullish directional separation is increasing. A decrease is classified as CONTRACTING because bullish separation is weakening.
For a negative spread, a further decrease below zero is classified as EXPANDING because bearish directional separation is increasing. Movement back toward zero is classified as CONTRACTING because bearish separation is weakening.
This distinction is important because a market can remain technically bullish while its bullish DMI spread contracts. It can also remain technically bearish while bearish separation begins to weaken. The dashboard makes those changes visible without requiring users to compare multiple DMI plots manually.
The 5-minute, 30-minute, and 1-hour calculations are performed independently using each timeframe’s own price data. The 5-minute row can be used for short-term execution context, the 30-minute row for intermediate intraday structure, and the 1-hour row for broader directional context.
DASHBOARD COLUMNS
TIME
Identifies the independently calculated 5-minute, 30-minute, or 1-hour dataset.
+DI
Shows the magnitude of positive directional movement after Wilder smoothing and True Range normalization.
-DI
Shows the magnitude of negative directional movement after Wilder smoothing and True Range normalization.
SPREAD
Shows +DI minus -DI. Positive values indicate bullish directional dominance, while negative values indicate bearish directional dominance. The magnitude describes the separation between the two DMI components.
DIRECTION
Displays BULLISH when the spread is above zero, BEARISH when it is below zero, and NEUTRAL when the two values are equal.
ADX
Displays the Average Directional Index for the corresponding timeframe. ADX measures directional strength and does not determine whether the direction is bullish or bearish.
STRENGTH
Classifies ADX as STRONG or WEAK using the user-defined ADX Strength Threshold. The default threshold is 25. This threshold is a filter and should be adjusted when appropriate for the instrument and trading method.
STATUS
Displays one of four conditions:
• BULL CROSS: +DI has crossed above -DI.
• BEAR CROSS: +DI has crossed below -DI.
• EXPANDING: the prevailing directional spread is moving farther away from zero.
• CONTRACTING: the prevailing directional spread is moving toward zero or is no longer expanding.
When a new DMI cross is detected, the cross message temporarily takes priority over the expanding or contracting classification.
INTERPRETING MULTI-TIMEFRAME ALIGNMENT
Broad bullish alignment is present when all three spreads are positive. The alignment has stronger directional confirmation when the spreads are also expanding and ADX is above the selected threshold.
Broad bearish alignment is present when all three spreads are negative. The alignment has stronger directional confirmation when the negative spreads are expanding and ADX is above the selected threshold.
Mixed readings indicate timeframe disagreement. For example, a bullish 5-minute reading against bearish 30-minute and 1-hour readings may represent a short-term rebound within a broader bearish structure. It does not automatically confirm a larger bullish reversal.
A contracting spread should not automatically be interpreted as a reversal. It only indicates that the existing separation between +DI and -DI is narrowing. A crossover or additional price confirmation is required before directional control has formally changed under this model.
SUGGESTED WORKFLOW
1. Begin with the 1-hour row to identify the broader directional condition.
2. Use the 30-minute row to determine whether intermediate momentum agrees with or opposes the 1-hour condition.
3. Use the 5-minute row to monitor shorter-term changes, contractions, expansions, and DMI crosses.
4. Give greater weight to a setup when direction, spread development, and ADX strength agree across multiple timeframes.
5. Confirm dashboard readings with price structure, support and resistance, liquidity, volume, or another independent execution method.
The dashboard can be moved to the top-right, top-left, bottom-right, or bottom-left corner through the Dashboard Position input.
INPUTS
DI Length controls the smoothing period used to calculate +DI and -DI. The default is 14.
ADX Smoothing controls the smoothing period used for ADX. The default is 14.
ADX Strength Threshold determines when the dashboard labels ADX as STRONG. The default is 25.
Dashboard Position controls where the table appears on the chart.
ALERTS
The script provides separate bullish and bearish DMI cross alert conditions for the 5-minute, 30-minute, and 1-hour timeframes.
For confirmation-based use, alerts should normally be configured as “Once Per Bar Close.” Alerts notify users that a DMI relationship has changed; they are not automatic trade signals.
LIMITATIONS
This indicator does not predict future price direction and does not generate entries, exits, profit targets, or stop-loss levels.
DMI and ADX are derived from historical price movement and are lagging measurements. Crosses can occur after a move has already begun, and repeated crosses may occur during sideways or low-volatility markets.
ADX measures directional strength, not direction. A STRONG reading can accompany either bullish or bearish movement.
EXPANDING and CONTRACTING describe changes in the DMI spread. They do not guarantee price continuation or reversal.
Values from an open timeframe can change while that timeframe’s bar is still developing. A 30-minute or 1-hour reading is not final until its corresponding bar closes. Using “Once Per Bar Close” helps avoid acting on an unfinished alert condition, but users should still understand which timeframe is being evaluated.
When the indicator is used on a chart timeframe above five minutes, TradingView’s standard lower-timeframe request behavior may not reproduce every intermediate 5-minute event. For the most dependable observation of 5-minute changes and alerts, use the indicator on a 5-minute or lower chart.
The script should be used as a directional-context and confirmation tool rather than as a standalone trading system.
ORIGINALITY AND PURPOSE
DMI and ADX are established technical-analysis calculations. This script does not claim ownership of those underlying formulas.
The script’s contribution is its purpose-built interpretation and presentation layer: independently calculated 5-minute, 30-minute, and 1-hour DMI structures; a signed DMI spread; spread-expansion and contraction classification; timeframe-specific ADX strength; cross-state prioritization; configurable dashboard placement; and separate alert conditions.
These components are organized to help users evaluate directional control, separation, strength, and multi-timeframe agreement from one chart interface instead of manually comparing three separate DMI indicators.
Open-source users can inspect the calculations, adjust the parameters, and study how the multi-timeframe dashboard converts standard DMI components into a structured directional framework.
Indicador

ICT BSL / SSL LiquidityICT BSL / SSL Liquidity is a market-structure based liquidity detection indicator designed to identify Buy Side Liquidity (BSL), Sell Side Liquidity (SSL), and potential liquidity sweeps directly on the chart.
The indicator detects confirmed swing highs and swing lows and converts them into visual liquidity zones. It then monitors these zones for specific sweep conditions, helping traders visually identify situations where price takes liquidity and closes back through the corresponding zone.
BSL zones are created from confirmed swing highs, while SSL zones are created from confirmed swing lows. When a valid sweep occurs, the zone is highlighted and a corresponding bullish or bearish sweep signal is displayed on the chart.
The indicator is designed primarily as a liquidity-analysis tool and can be used alongside price action, market structure, support/resistance, order flow, or other ICT/SMC concepts.
SIGNALS LOGIC:
1. SELL SIDE LIQUIDITY (SSL) — BULLISH SWEEP
SSL is created from a confirmed swing low.
The indicator tracks the liquidity level and its associated zone.
A bullish SSL sweep is detected when:
Price trades below the SSL level.
The lookback-period low moves below the liquidity level.
The candle closes above the zone body.
The sweep candle closes bullish.
• Once triggered, the SSL zone is frozen and highlighted.
• A bullish "B" signal is plotted below the candle.
2. BUY SIDE LIQUIDITY (BSL) — BEARISH SWEEP
BSL is created from a confirmed swing high.
The indicator tracks the liquidity level and its associated zone.
A bearish BSL sweep is detected when:
Price trades above the BSL level.
The lookback-period high moves above the liquidity level.
The candle closes below the zone body.
The sweep candle closes bearish.
• Once triggered, the BSL zone is frozen and highlighted.
• A bearish "S" signal is plotted above the candle.
3. LIQUIDITY ZONE INVALIDATION
A liquidity zone can be removed from active tracking when price breaks the level in the opposite direction according to the script's invalidation logic.
4. CONFIRMED SWING DETECTION
Liquidity levels are generated using confirmed swing highs and swing lows based on the selected Swing Length. Increasing the Swing Length generally produces fewer but more significant liquidity levels.
USER INPUTS:
Indicator Settings
• Swing Length
Determines the number of bars used on each side of a pivot to identify swing highs and swing lows. Higher values generally produce fewer and more significant liquidity levels.
• Candles Lookback
Defines the lookback window used when checking whether price has wicked through a liquidity level and reclaimed it.
• Maximum Active BSL Zones
Controls the maximum number of Buy Side Liquidity zones that remain actively tracked.
• Maximum Active SSL Zones
Controls the maximum number of Sell Side Liquidity zones that remain actively tracked.
Visual Settings
• Zone Gradient Bands
Controls the number of gradient bands used to render each liquidity zone. More bands create a smoother visual effect.
• Glow On Swept Level
Adds a visual glow around a liquidity level when it is swept.
• Color The Sweep Candle
Highlights the candle responsible for the detected liquidity sweep.
Color Settings
• Palette Theme
Choose between:
* Neon
* Muted
* Native
* Custom
• BSL Color
Custom color for Buy Side Liquidity when the Custom palette is selected.
• SSL Color
Custom color for Sell Side Liquidity when the Custom palette is selected.
WHY IT IS UNIQUE:
• Separates Buy Side Liquidity and Sell Side Liquidity into dedicated active zones.
• Uses confirmed swing points rather than simply marking every recent high or low.
• Combines liquidity levels with zone-based visualization instead of displaying only horizontal lines.
• Automatically extends active liquidity zones until they are swept or invalidated.
• Clearly distinguishes bullish SSL sweeps from bearish BSL sweeps.
• Uses gradient zone rendering to make liquidity areas easier to identify visually.
• Provides an optional glow effect when liquidity is swept.
• Only the sweep candle is highlighted, keeping the rest of the chart visually clean.
• Includes configurable limits for active BSL and SSL zones to help manage chart clutter and drawing-object usage.
• Built-in alert conditions are available for both bullish SSL sweeps and bearish BSL sweeps.
HOW USER CAN BENEFIT FROM IT:
This indicator can help traders:
• Identify areas where liquidity may be resting above swing highs or below swing lows.
• Spot potential liquidity sweeps and rejection behavior more easily.
• Visually track active liquidity zones as price develops.
• Separate bullish SSL sweep events from bearish BSL sweep events.
• Use liquidity sweeps as an additional confirmation within an existing trading strategy.
• Combine liquidity information with market structure, trend analysis, support/resistance, FVGs, order blocks, or other ICT/SMC concepts.
• Create TradingView alerts for detected liquidity sweep events.
• Reduce manual chart marking by automatically detecting and managing liquidity zones.
IMPORTANT:
This indicator identifies liquidity and sweep conditions based on the rules implemented in the script. A liquidity sweep signal should not automatically be treated as a guaranteed buy or sell signal. Traders should use proper risk management and combine the indicator with their own market analysis and trading methodology.
The script is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice.
Indicador

KevindicatorMTF Supply & Demand Zones
A multi-timeframe supply and demand zone indicator that scans the chart's own timeframe and every higher timeframe you enable (15m through 1D) and automatically draws zones based on a strict base-candle → impulse → follow-through pattern.
How zones are detected:
Demand: a small-bodied red base candle with a lower rejection wick, followed by a visibly large green impulse candle (measured against ATR-14) that closes above the base, with no candle closing back inside the zone during the continuation window.
Supply: the mirror image — a small-bodied green base candle with an upper rejection wick, followed by a visibly large red impulse candle that closes below the base.
Zones are boxed from the base candle's open to its wick extreme, and only wicks (not closes) may re-enter the zone while it's forming.
Zone management:
Zones extend live until broken by a 15-minute close through the zone.
Overlap suppression: when a new zone would sit on top of an existing, still-active zone in the same direction, the lower-timeframe zone is dropped — either the new one is skipped, or the older lower-TF zone is replaced by the new higher-TF one. This keeps the chart from filling up with redundant stacked boxes across timeframes.
Auto-hide broken zones: once a zone breaks, it's automatically removed from the chart after a user-set number of hours (1–72), so invalidated zones don't clutter historical price action.
Inputs:
Toggle which timeframes to scan (15m, 30m, 90m, 1H, 2H, 4H, Daily)
Detection sensitivity (base body size, wick size, impulse strength vs. ATR, continuation candle count)
Zone cleanup controls (overlap % threshold, broken-zone hide duration)
Display options (colors, transparency, timeframe labels, 50% equilibrium line, distance-based hiding, alerts on new zone formation) Indicador

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. 最后
支撑和压力应该被理解为市场可能发生博弈的区域,而不是保证发生反转的价格。
这个指标的核心目标,是把复杂的历史市场结构整理成少量、当前更值得观察的位置。
它是市场结构分析框架,而不是自动交易系统。
本指标仅用于市场结构研究与辅助分析,不构成投资建议、收益承诺或任何形式的买卖推荐。 Indicador

Adaptive Head and Shoulders Detector█ OVERVIEW
Adaptive Head and Shoulders Detector is a highly configurable pattern-detection indicator designed to automatically identify Classic Head & Shoulders and Inverse Head & Shoulders formations using multiple pivot lengths, structural filters and optional neckline-break confirmation.
Instead of relying on a single fixed pivot sensitivity, the indicator can analyse market structure simultaneously at four different pivot lengths. Each length can have its own requirements for shoulder symmetry and minimum head deviation, allowing the detector to identify both relatively compact formations and larger, more significant structures.
A key feature of the indicator is its multi-pivot architecture. Each enabled pivot length acts as a standalone detector and also feeds the shared history used by Mix Mode. Mix Mode can combine pivots detected at different sensitivities within a single pattern, provided those lengths are enabled. Mix Mode does not run on its own: disabling Pivot 1–4 removes those lengths from both standalone detection and mix detection.
The indicator also uses ATR as a common volatility reference. Shoulder symmetry, head deviation and the required preceding trend impulse are expressed in relation to ATR, allowing the pattern criteria to adapt to the current scale of price movement rather than relying exclusively on fixed price distances.
Pattern quality is evaluated not only by the visual arrangement of the five pivots, but also by the relative height of the head and shoulders, time symmetry between the two sides of the formation, and the existence of a preceding directional move. This allows the detector to filter out structures that resemble Head & Shoulders visually but do not satisfy the defined structural conditions.
The confirmation process can be configured in two ways. In the immediate mode, a pattern is confirmed when the right shoulder pivot becomes confirmed. Alternatively, the user can require a confirmed neckline break, in which case the pattern remains pending until price closes beyond the neckline. Neckline-break confirmation is evaluated only on a closed bar, preventing an intrabar price excursion from triggering a premature confirmation.
Another important element is Pivot Source. The user can build pivots from High/Low wicks or exclusively from closing prices. This changes the structural information used by the detector and allows the indicator to ignore long wicks when a close-based interpretation of market structure is preferred.
The visual layer can be customized independently through pattern colours, neckline colour, labels, fill transparency and label positioning. A trend visualization mode can additionally show the preceding trend leg and its measured strength in ATR units, making the operation of the trend filter easier to understand.
As a result, Adaptive Head and Shoulders Detector can be used both as an automatic pattern scanner and as a structural analysis tool for studying how pivot sensitivity, trend strength, symmetry and neckline confirmation influence pattern detection.
█ CONCEPTS
Head & Shoulders Structure
The indicator identifies the classic five-point Head & Shoulders structure:
* R1 — left shoulder
* B2 — first trough
* HEAD — central extreme
* B4 — second trough
* R5 — right shoulder
For a classic bearish Head & Shoulders, the head forms above both shoulders, while the two troughs create the basis for the neckline.
For an Inverse Head & Shoulders, the structure is reversed: the head forms below both shoulders and the two intermediate highs define the neckline.
The detector requires the pivots to alternate correctly and checks the relative position of all five points before accepting the structure as a valid pattern.
ATR-Based Adaptation
ATR is used as the volatility reference for the main structural tolerances.
Instead of defining shoulder differences or head depth using fixed price values, the indicator expresses these requirements as multiples of ATR. This allows the same settings to behave more proportionally across markets and volatility conditions.
ATR is also used to measure the strength of the preceding trend and to determine the visual offset of labels.
Pivot Detection
The indicator can use up to four independent pivot lengths.
A pivot length defines how many bars on each side of a bar are required before a high or low can be confirmed as a pivot. Smaller lengths detect more frequent and smaller structural turning points, while larger lengths produce fewer but generally more significant pivots.
Each pivot length can be enabled or disabled independently. Enabling a given length starts its standalone detection and also adds its pivots to the Mix Mode history.
Pivot Source
Pivot calculations can be based on either High/Low wicks or closing prices.
* High/Low (wick) — uses the actual highs and lows of candles, allowing long wicks to participate in pivot formation.
* Close — uses closing prices exclusively, effectively ignoring wicks when determining structural pivots.
This setting applies across all pivot lengths and also affects Mix Mode.
Shoulder Symmetry
The detector compares the price levels of the left and right shoulders.
The maximum allowed difference is defined as an ATR multiple. A lower tolerance requires the shoulders to be more closely aligned, while a higher tolerance allows more asymmetric formations.
Each standalone pivot length has its own shoulder tolerance, while Mix Mode uses a separate shared tolerance.
Head Deviation
The head must be sufficiently separated from both shoulders.
For a classic H&S, the head must be above both shoulders by at least the specified ATR distance. For an inverse H&S, the head must be below both shoulders by the required amount.
This prevents shallow structures from being classified as valid Head & Shoulders patterns simply because five alternating pivots happen to form a similar shape.
Time Symmetry
The indicator also evaluates the horizontal proportions of the pattern.
The distance from the left shoulder to the head is compared with the distance from the head to the right shoulder. The maximum permitted ratio is controlled by Max. time asymmetry.
A value closer to 1 requires a more symmetrical formation, while higher values allow one side of the pattern to develop over a longer period than the other.
Preceding Trend Filter
A valid Head & Shoulders formation can optionally be required to follow a sufficiently strong preceding trend.
The indicator searches backward from the left shoulder for the relevant preceding extreme and measures the price movement between that extreme and the left shoulder in ATR units.
For a bearish H&S, the structure should be preceded by an upward impulse. For an inverse H&S, the structure should be preceded by a downward impulse.
Setting the minimum trend impulse to 0 disables this filter.
Neckline Confirmation
The neckline is drawn through the two intermediate pivots of the formation and extended to the right by the selected number of bars.
When neckline-break confirmation is enabled, the pattern is stored as pending after its structure and trend conditions are satisfied. The indicator then waits for a candle close beyond the neckline.
For a classic H&S, confirmation occurs when price closes below the neckline.
For an inverse H&S, confirmation occurs when price closes above the neckline.
The neckline break is checked only on a confirmed candle, so a temporary intrabar penetration does not trigger the confirmation.
Mix Mode
Mix Mode builds a pattern from the most recent points in the shared pivot history, which is created exclusively from the enabled Pivot 1–4 lengths.
Instead of requiring all five points to come from the same pivot length, individual points can originate from different enabled pivot lengths. For example, a single pattern can be constructed from a combination such as 5 / 10 / 15 / 5 / 10 if those lengths are enabled and that is how the current tail of the merged history looks.
Mix Mode does not work without the lengths that feed it: disabling Pivot 1–4 removes those pivots from both standalone detection and mix detection. The user can use standalone detection only, standalone detection together with mix, or mix based only on the currently enabled lengths.
The mixed structure is still subjected to the same core requirements for head deviation, shoulder symmetry, time symmetry and preceding trend strength. The largest pivot length participating in the pattern is used as the reference for trend lookback and breakout waiting time.
█ FEATURES
Common
* ATR Length – defines the number of bars used to calculate ATR, which serves as the volatility reference for the indicator's tolerance and trend thresholds.
* Extend neckline to the right (bars) – specifies how many bars the dashed neckline is extended beyond the current confirmation area.
* Show labels – displays the HEAD and R labels at the relevant pattern points.
* Bull color – defines the colour used for Inverse H&S patterns and bullish signals.
* Bear color – defines the colour used for classic H&S patterns and bearish signals.
* Neckline color – sets the colour of the dashed neckline.
* Label text color – defines the text colour used inside all indicator labels.
* Label size – controls the size of HEAD, R, signal and trend-visualization labels.
* Show direction signal – displays a BULL or BEAR signal when the selected pattern confirmation condition is met.
* Show pattern fill – enables or disables the shaded area representing the detected pattern.
* Fill transparency (%) – controls the transparency of the pattern fill.
* Label offset from price (x ATR) – controls the distance between labels and their corresponding price points, expressed as a multiple of ATR.
* Pivot source – selects whether pivots are calculated from High/Low wicks or closing prices.
Structure / Trend / Confirmation
* Require neckline break confirmation – when enabled, the pattern must be confirmed by a candle close beyond the neckline. When disabled, confirmation occurs when the right-shoulder pivot itself becomes confirmed.
* Trend lookback window (x pivot length) – defines how far back the indicator searches for the preceding trend extreme, based on the pivot length used by the pattern.
* Min. trend impulse before pattern (x ATR) – specifies the minimum preceding price movement required before the pattern, expressed in ATR units. Setting it to 0 disables the trend filter.
* Max. time asymmetry (b1→head vs head→b5) – controls the maximum allowed difference between the time spent developing the left and right sides of the pattern.
* Max. wait time for breakout (x pivot length) – defines how long the indicator waits for a neckline break before discarding a pending pattern as stale. Applies only when neckline-break confirmation is enabled.
* Show trend visualization (line to extreme) – displays the preceding trend leg as a dotted line and shows its measured strength in ATR units.
* ...also for patterns that did NOT pass the trend filter – additionally displays trend visualization for structurally matching patterns that failed the minimum trend requirement, helping with filter calibration.
Pivot 1–4
* Enable pivot X – enables standalone H&S / Inverse H&S detection at that sensitivity and also adds those pivots to the Mix Mode history.
* Pivot X length (left/right) – defines the number of bars on each side required to confirm a pivot.
* Shoulder symmetry tolerance X (x ATR) – defines the maximum permitted price difference between the two shoulders.
* Min. head deviation X (x ATR) – defines the minimum required distance between the head and both shoulders.
Mix Mode
* Enable mix mode (different pivot lengths in one pattern) – enables detection of patterns whose individual points can originate from different enabled pivot lengths. Mix Mode uses only the lengths enabled under Pivot 1–4.
* Shoulder symmetry tolerance (mix, x ATR) – defines the maximum permitted difference between the shoulders of a mixed pattern.
* Min. head deviation (mix, x ATR) – defines the minimum required head deviation for mixed patterns.
* Max. number of pivots in merged history – specifies how many recent pivots from all enabled pivot lengths are retained for mixed-pattern searching.
Alerts
* Inverse H&S (Bullish) Signal – triggers when a bullish Inverse Head & Shoulders signal is generated.
* H&S (Bearish) Signal – triggers when a bearish Head & Shoulders signal is generated.
* H&S / Inverse H&S Signal (Any) – triggers for either a bullish or bearish pattern signal.
█ APPLICATIONS
Multi-Scale Head & Shoulders Detection
Using several pivot lengths allows the indicator to analyse different structural scales simultaneously.
Smaller pivot lengths can capture more local formations, while larger lengths focus on broader market structures. This makes it possible to use one indicator for multiple levels of pattern sensitivity instead of relying on a single pivot configuration.
A detected formation is not a trade signal and does not mark an entry. It is information that a structure has appeared on the chart after which a reversal may be expected. The timing and location of any trade should be determined with other methods or strategies.
█ NOTES
* Pivot-based detection requires the selected number of bars on both sides of a pivot before that pivot can be confirmed. Larger pivot lengths therefore produce slower but generally broader structural detection.
* When neckline-break confirmation is enabled, the pattern is confirmed only after a candle closes beyond the neckline. Intrabar movement through the neckline does not trigger the confirmation.
* Pending patterns that do not receive a neckline break within the configured waiting period are discarded.
* Mix Mode uses only the enabled Pivot 1–4 lengths. The same Enable option feeds both standalone detection and the mix history — a given length cannot be disabled as a standalone detector while still being kept in mix only. Indicador

TrendFusion Pro | Multi-MA + ADX + KAMA + VWAP Hariss 369A flexible multi-timeframe trend-following indicator designed to identify bullish and bearish market conditions using configurable Moving Average alignment.
The system allows traders to combine up to three Moving Averages, with independent settings for MA type, length and timeframe. Supported MA types include EMA, SMA, WMA, VWMA, RMA and HMA.
Core Features
• Three independently configurable Moving Averages
• EMA, SMA, WMA, VWMA, RMA and HMA support
• Individual timeframe selection for each MA
• Flexible MA alignment logic for BUY and SELL conditions
• Optional DMI/ADX trend-strength filter
• Optional Higher-Timeframe KAMA trend filter
• Optional Higher-Timeframe VWAP filter
• ATR-based dynamic trailing stop
• Separate long and short ATR trailing stops
• BUY and SELL signals with configurable colours
• Alert conditions for BUY and SELL signals
• Clean chart-based trend visualization
How the Trend Logic Works
When multiple MAs are enabled, the indicator looks for price and MA alignment.
For bullish conditions, price must be above the selected MAs and the enabled MAs must be properly aligned from faster to slower.
For bearish conditions, price must be below the selected MAs and the enabled MAs must be aligned in the opposite direction.
The indicator can also require confirmation from:
• DMI/ADX
• Higher-Timeframe KAMA
• Higher-Timeframe VWAP
These filters are optional and can be enabled or disabled according to the trader's methodology.
ATR Trailing Stop
The indicator calculates a dynamic ATR-based trailing stop.
For long conditions, the stop can only move upward as the trend progresses.
For short conditions, the stop can only move downward.
This provides a dynamic way to manage trend-following trades while allowing the trader to adjust ATR length and multiplier according to the market and timeframe.
Suggested Use
The indicator can be used for:
• Trend identification
• Trend-following entries
• Pullback confirmation
• Multi-timeframe market analysis
• Dynamic trailing-stop management
• Alert-based trading workflows
The default configuration uses 20 EMA, 50 EMA and 200 EMA, but these settings are fully customizable.
Different combinations can be tested depending on the instrument, timeframe and trading style.
Important
This indicator is designed as a technical-analysis and decision-support tool. It does not guarantee profitable trades and should not be treated as a standalone trading system.
Always test settings on historical data and in real-time market conditions before using them with real capital. Indicador

Footprint Delta Auction Map [BullByte]Footprint Delta Auction Map is an Auction-Market-Theory analytical framework that measures directional pressure through a 3-Tier Delta Engine (TradingView native volume footprint, lower-timeframe intrabar reconstruction, and single-bar OHLCV proxy), qualifies it against candle conviction and multi-source level confluence (POC, VAH, VAL, session H/L, prior day H/L, weekly H/L, round numbers), classifies the current session as a Trend, Balance or Neutral Day using an Initial Balance regime detector, and only then marks a directional scenario on the chart with a fully sized reference-level map (Entry, Reaction, Extension, Invalidation).
It is designed for discretionary traders who want a single, transparent framework that brings order flow, price structure, key reference levels and session regime into one auditable qualification process.
---
1. WHAT THIS SCRIPT IS
On each confirmed bar with the required data available, the framework evaluates four complementary questions before a directional scenario can qualify:
Q1 - Is there directional pressure right now?
Measured through a 3-tier delta engine (see Section 4). Normalized to a bounded -100 to +100 Unified Auction Pressure reading.
Q2 - Is the candle itself convincing?
Measured through body-to-range ratio and range-to-ATR ratio. A high pressure reading on a doji inside a compressed range does not qualify.
Q3 - Is this happening at a location the market has already respected?
Measured through a weighted Confluence Ladder that scores proximity to POC, VAH, VAL, session high/low, prior day high/low, weekly high/low, and configurable round numbers.
Q4 - What is today's session character?
Measured through an Initial Balance (IB) day-type classifier (Trend / Balance / Neutral Day) that adjusts the qualification threshold and Extension sizing.
Only when all four align, a higher-timeframe EMA trend agrees, and the current session's IB is fully formed does the script mark a directional scenario and draw a full reference-level map on the chart.
---
2. WHAT PROBLEM IT SOLVES
The framework is designed to bring several normally separate forms of market context into one qualification process.
This script is built on the design premise that directional pressure, candle structure, location and session context each answer a different question about the same market event. Rather than treating any one measurement as a standalone trigger, the framework requires these conditions to agree before it marks a directional scenario. The intent is to provide more context around each signal and make the qualification process auditable, not to claim any specific rate of success.
Concretely, it helps with:
- Deliberate selectivity. A three-criterion gate (Pressure, Candle, Confluence) plus a composite score threshold plus HTF alignment plus IB regime plus cooldown means signals are intentionally infrequent and situational.
- Instrument-adaptive sizing. For sizing purposes, the script automatically derives an instrument-specific volatility band from the symbol's own historical ATR-as-percent-of-price distribution, reducing the need to manually retune the basic Sizing Unit for each market.
- Full transparency. A dashboard and a debug panel show which data tier is active, what the composite score is, which qualification criteria passed, what the session regime is, and where the current scenario stands.
- Session-aware context. An Initial Balance day-type verdict (Trend / Balance / Neutral) recalibrates how demanding the signal threshold is and how far Extension targets project.
---
3. HOW THE FRAMEWORK WORKS
Each layer answers a specific question from auction market theory, and the layers are structured in dependency order:
Delta / Auction Pressure - describes what the directional pressure reading says about the current auction. Sourced from TradingView's native volume footprint when available (Tier 3), from lower-timeframe intrabar reconstruction when not (Tier 2), or from a single-bar OHLCV pressure proxy as a universal fallback (Tier 1). Each tier is normalized independently to a common bounded -100 to +100 scale.
Candle Conviction - did the bar actually travel and close with intent. Prevents a strong pressure reading on a wick-heavy doji from qualifying.
Level Confluence - is this happening at a price the market has already marked as significant. Uses a triangular decay proximity kernel across POC, VAH/VAL, session H/L, prior day H/L, weekly H/L and round numbers, with pre-defined relative weights. When native footprint data is active, the true volume-profile references receive the highest weights; when footprint data is unavailable, their proxy weights are reduced so the ladder does not treat session-derived references as genuine volume-profile levels.
IB Regime Classifier - what kind of day is this. Compares today's Initial Balance range against a rolling historical median of prior sessions (today's IB is never included in its own median). Wider than median → Trend Day (raise threshold, widen Extension). Narrower than median → Balance Day (lower threshold, compress Extension). Otherwise Neutral.
HTF EMA Filter - does the larger timeframe agree with the direction. Uses confirmed previous higher-timeframe EMA slope only (non-repainting pattern with barmerge.lookahead_on on a offset).
Each contributes information the others cannot. Removing any one of them changes what the signal means , not just how many signals fire. That dependency structure is what distinguishes this framework from an aggregation of unrelated indicators.
This is not a mashup of separate published indicators or unrelated indicator modules combined for convenience; it is a single framework in which each measurement was selected and integrated for a specific role in the qualification process.
---
4. THE THREE DATA TIERS
The three-tier architecture allows the script to use native footprint data when available and progressively simpler pressure estimates when it is not. The active tier is always shown on the dashboard so the user knows exactly what data is currently feeding the score.
Tier 3 - Native TradingView Footprint (requires Premium or Ultimate plan and footprint-supported symbol)
Uses request.footprint() . TradingView categorizes lower-timeframe volume via intrabar price action to produce buy volume, sell volume and delta. This is the only tier in this script that uses native footprint data. Not raw exchange bid/ask tick data.
Tier 2 - Intrabar Reconstruction (default, no special plan required)
Uses request.security_lower_tf() to decompose each bar into its lower-timeframe sub-bars, then applies the close-in-range volume heuristic to each sub-bar before summing. A lower-timeframe refinement of the single-bar OHLCV pressure estimate that can better distinguish intrabar two-sided movement than a single-OHLC read alone. This is an auction pressure estimate, not native footprint data.
Tier 1 - OHLCV Proxy (universal fallback)
buyPressure = (close − low) / range × volume
sellPressure = (high − close) / range × volume
A single-bar pressure proxy. Used when native footprint data is not active and lower-timeframe reconstruction is unavailable, disabled, or returns no usable intrabar data. Coarsest estimate.
All three tiers are normalized onto a common bounded -100 to +100 scale before entering the composite score. Same scale does not mean identical statistical distribution: Tier 3 footprint delta and Tier 1 OHLCV pressure have different underlying measurement characteristics. The normalization ensures the score is internally self-consistent per tier.
---
5. COMPOSITE SCORE AND QUALIFICATION
When the required calculation data is available, the framework produces a Composite Score between 0 and 100:
Composite Score = Fingerprint Score × 0.60 + Ladder Score × 0.40
Fingerprint Score (60% weight) combines three sub-components on the current bar:
- Auction Pressure conviction - up to 40 points, based on absolute normalized pressure
- Candle body and range structure - up to 35 points (20 points body ratio, 15 points range-to-ATR ratio)
- Volume/pressure balance magnitude - up to 25 points, using the active tier's available pressure representation
Ladder Score (40% weight) provides location context. Each active reference level is scored using a triangular proximity kernel: score = 1 − (distance / tolerance) when distance is within tolerance; otherwise the score is zero. Levels are then weighted using predefined relative weights. When native footprint data is active, the genuine volume-profile references receive the highest weights; when footprint data is unavailable, those reference weights are reduced because the script uses session-derived proxies rather than true volume-profile levels.
The 60/40 weighting reflects the design choice to give greater influence to pressure, candle structure and volume/pressure balance than to location. Location confirms; pressure and structure trigger.
Signal qualification requires all of the following simultaneously:
- Composite Score at or above the effective threshold (default 58, adjusted ±5 by IB day-type)
- Auction Pressure absolute value at or above Criterion 1 minimum (default 35)
- Candle body ratio at or above Criterion 2 minimum (default 0.50)
- Number of level-confluence hits at or above Criterion 3 minimum (default 2)
- HTF EMA slope aligned with signal direction (if HTF filter is enabled)
- Current session's Initial Balance is fully formed and historical IB sample exists
- Current bar's direction (close vs open) aligns with pressure direction
- No active scenario, and cooldown not in effect
---
6. IB REGIME AND HTF CONTEXT
Initial Balance regime detector. The first N bars of each session define today's IB range. That range is compared to the rolling median of prior sessions' IB ranges (today is never included in its own median). If today's IB is 1.25x or wider than the historical median, the classifier labels the session Trend Day, raises the qualification threshold by 5 points, and sets the IB Extension scalar to 1.15x. If today's IB is 0.75x or narrower, it labels Balance Day, lowers the qualification threshold by 5 points, and sets the IB Extension scalar to 0.85x. Otherwise, the session is classified as Neutral Day. The final Extension multiplier is also affected by the volatility scalar and the minimum effective-multiplier floor described in Section 7. This is a heuristic regime signal, not a factual market classification.
The IB layer adjusts only the qualification threshold and the Extension multiplier. It does not change the 60/40 composite weights. Signals are also suppressed until the current session's IB has formed and at least three completed historical IB samples exist.
HTF EMA trend filter. The higher-timeframe EMA slope is evaluated on the confirmed previous HTF bar ( offset with barmerge.lookahead_on ), which is the documented non-repainting pattern for confirmed HTF references. The HTF resolution is validated to be strictly higher than the chart timeframe before the request is made; if not, the script halts with an explicit error rather than silently misbehaving.
---
7. ENTRY / REACTION / EXTENSION / INVALIDATION
When a scenario qualifies, four reference levels are placed on the chart, all sized as multiples of a shared Sizing Unit (not raw ATR).
The Sizing Unit is a percentile-bounded percentage of price. Its min–max band is, by default, auto-derived from this instrument's own historical ATR-as-percent-of-price distribution (10th and 90th percentiles). This means the sizing base scales naturally with the instrument's own volatility character.
Then:
- Entry = signal bar close
- Reaction = Entry ± k1 × Sizing Unit (default k1 = 1.5)
- Extension = Entry ± effective k2 × Sizing Unit, where effective k2 is the larger of (k1 + 0.5) and (k2 base × IB scalar × volatility regime scalar) when Dynamic Extension Sizing is enabled. When dynamic sizing is disabled, the effective multiplier is the larger of (k1 + 0.5) and k2 base (default k2 base = 2.5)
- Invalidation = Entry ± k3 × Sizing Unit (default k3 = 1.5)
Extension scaling combines two factors:
- IB scalar: 1.15x on Trend Day, 0.85x on Balance Day, 1.00x on Neutral Day
- Volatility regime scalar: current ATR divided by baseline ATR, clamped between 0.8x and 1.6x so a single volatility spike cannot produce a runaway Extension
Same-bar resolution disclosure: When a single bar touches both Extension and Invalidation, OHLC data alone cannot establish which was reached first. The script uses a deterministic proximity convention (the level closer to the prior bar's close is assumed to have been reached first). This is a documented convention, not an observation of intrabar order.
---
8. DASHBOARD AND CHART INTERPRETATION
Directional badge on the signal bar
- Bullish-direction badge for LONG scenarios and Bearish-direction badge for SHORT scenarios; the default colors are green and red and are user-configurable.
- Header line: ▲ LONG or ▼ SHORT
- Second line: "FP Delta N" when Tier 3 is active, "Pressure N" when Tier 1 or Tier 2 is active. N is the absolute normalized Auction Pressure reading (0–100), not a percentage of volume.
- Third line: "near " - the highest-weighted level in proximity
- Fourth line: Session character (Trend Day / Balance Day / Neutral Day)
Four horizontal reference lines
- Entry (neutral color, adaptive to chart theme)
- Reaction (orange)
- Extension (purple)
- Invalidation (red)
Right-edge price tags - each of the four levels has a floating tag on the right edge of the chart showing its exact price. Tags are automatically separated vertically to reduce overlap among the four reference-level labels.
Reference level plots
- Prior Day High / Low (orange) - shown in the recent-bars segment
- Weekly High / Low (blue) - shown in the recent-bars segment
- IB High / Low (yellow, dashed)
- Session Reference (purple, dotted) - represents the footprint POC when Tier 3 is active and a session-derived reference when using Tier 1/2
Scenario lifecycle
- Pending - scenario is live; right-edge tags follow the current bar
- Reaction Zone Reached - an alert fires on the first qualifying post-signal touch of the Reaction level; Reaction does not end the scenario.
- Resolved-Extension - Extension reached first; scenario ends, right-edge tags removed, historical lines frozen
- Resolved-Invalidation - Invalidation reached first; same treatment
Main Dashboard (default: Top Right)
- Data Engine - Footprint (Tick), Intrabar (LTF Recon.), or Proxy (Single-Bar)
- Session Character - Trend Day, Balance Day, or Neutral Day
- Composite Score - current bar's score out of 100
- Score Requirement - effective threshold after IB adjustment
- Qualification Criteria - pass/fail status for Pressure, Candle, and Confluence
- Active Scenario - "None" if flat, or "Long/Short - Active (awaiting resolution)" if in progress
- Cooldown - visible only when active
- Reference Sizing (Inv : Ext) - the ratio currently applied
Debug Dashboard (default: Bottom Right, can be turned off)
- Fingerprint Score (60% wt.)
- Ladder Score (40% wt.) - score plus number of levels in proximity
- Nearest Level - the highest-weighted level currently in proximity
- Footprint Delta / Auction Pressure - the normalized -100 to +100 reading, labeled by active tier
- Extension Sizing Factor - the current volatility scalar and IB scalar
- Active Data Tier - full name of the tier plus (for Tier 2) number of intrabars in the current reconstruction
---
9. ILLUSTRATIVE SIGNAL WALKTHROUGH
The following description is illustrative and is included only to demonstrate how the scoring workflow is interpreted. It is not a historical performance result and does not represent past or future outcomes.
Consider a 15-minute chart of a liquid instrument during a session that has been classified as a Trend Day.
Setup context:
- Session Character: Trend Day (today's IB is wider than the historical median)
- Effective Score Requirement: raised by the IB adjustment
- HTF (1H) EMA slope: rising
- Data Engine: Intrabar (LTF Recon.) - user is on a plan without native footprint access
Bar N (signal bar):
- Bar closes with a strong upward body (body/range ratio comfortably above the 0.50 minimum)
- Intrabar reconstruction shows aggregated buy-side pressure over sell-side, producing a Unified Auction Pressure reading well above the Pressure minimum
- Price is trading close to the Prior Day High and near a Round Number, both within Level Tolerance
- Ladder Score registers multiple levels in proximity
- The Composite Score exceeds the effective Trend-Day threshold; Pressure, Candle and Confluence criteria all pass; HTF direction agrees; session is ready
- Signal qualifies. A bullish-direction LONG badge appears with text similar to:
- ▲ LONG
- Pressure (value)
- near Prior Day High
- Trend Day
Level map plotted from the Entry close:
- Entry = close of bar N
- Reaction = Entry + k1 × Sizing Unit (orange)
- Extension = Entry + effective k2 × Sizing Unit, scaled by Trend-Day and volatility factors (purple)
- Invalidation = Entry − k3 × Sizing Unit (red)
- Dashboard "Active Scenario" changes to: Long - Active (awaiting resolution)
Subsequent bars: As price advances into the Reaction Zone, an alert fires ("Reaction Zone reached"). The scenario stays active - Reaction is a first-touch alert, not a resolution. If price then reaches the Extension level, the scenario resolves as Resolved-Extension: right-edge tags are removed, the four reference lines freeze at the resolution bar, the "Active Scenario" cell returns to "None", and a cooldown period begins during which no new signals can fire. If instead price reached the Invalidation level first, the scenario would resolve as Resolved-Invalidation with the same freeze and cooldown behavior. In the rare case where a single bar touches both Extension and Invalidation, the proximity-based tie-breaking convention (Section 7) determines the resolved outcome.
Note on FVGs and Order Blocks: This script does not natively detect Fair Value Gaps or Order Blocks. Traders who use dedicated FVG/OB analysis can treat those structures as external chart context and compare them with the reference-level map produced by this script. For example, a trader may observe a signal near a Prior Day Low or VAL while independently identifying a bullish Order Block or FVG at the same area. The FVG/OB structure is not generated or validated by this script.
Real Chart Example with explanation
Example 1: A short scenario was marked on Gold when Tier‑2 intrabar-reconstructed Auction Pressure hit 98 on a bearish, high-conviction candle sitting inside confluence tolerance of the Prior Day Low pushing the Composite Score above the 58 threshold under a Neutral Day regime. Footprint (Tier 3) was OFF for this example, so the pressure reading came from OHLCV-based intrabar reconstruction, not native footprint delta. Entry locked at that bar's close (4,363.94); price stalled near PDL for ~30 minutes, then broke down through the Reaction level (4,357.72) and into the Extension zone (4,355.12), with the current bar's intrabar low (4,352.76) already trading beyond Extension, though the scenario still shows "Active" since resolution only confirms on bar close.
Example 2: A long scenario was marked on QQQ when native Footprint (Tier 3) delta hit +66 on a bullish candle confluent with POC, under a Balance Day regime that lowered the qualification threshold by 5 (58 → 53) because today's Initial Balance was narrower than the historical median. Entry locked at 729.35; price consolidated near Entry for roughly an hour, then broke out through Reaction (730.25) toward Extension (730.55), with the Balance Day IB scalar (0.85x) compressing the Extension distance compared to a Trend Day setup. Unlike the earlier Gold example, this signal used genuine tick-based footprint data rather than OHLCV reconstruction.
---
10. SETTINGS
Recommended usage:
Designed primarily for intraday analysis on 5m, 15m, 30m and 1H charts, with the exact usefulness depending on the instrument's session structure and liquidity. Works on liquid crypto pairs, index futures and CFDs, liquid FX pairs, and large-cap equities during regular session hours.
Timeframe defaults:
- On 5m–15m charts : default HTF = 60 (1H), Intrabar Reconstruction = 1m
- On 30m–1H charts : consider raising HTF to 240 (4H)
- On 1m charts: leaving Intrabar Reconstruction at the default "1" causes the lower-timeframe request to fall back to Tier 1 because the requested resolution is not lower than the chart timeframe.
- Do not set Intrabar Reconstruction to a seconds-based resolution on 5m or higher charts - this can exceed TradingView's intrabar request cap
Not recommended for very illiquid instruments, daily or higher timeframes (IB is intraday by design), or symbols with no volume data.
Settings you may want to change frequently:
- Composite Score Requirement (default 58) - raise for more selective signals, lower for more frequent
- HTF Resolution (default 60) - align with your own top-down analysis
- Cooldown Period (default 20 bars) - longer for swing style, shorter for scalping
Settings you may want to tune per market:
- Round Number Step - choose a positive price interval appropriate to the instrument
- IB Window (bars from session open) - on a 15-minute chart, the default 6-bar IB window represents 90 minutes; adjust to match the session structure you want to analyze
These settings are intended as general-purpose defaults and usually do not need frequent adjustment:
- All ATR-related inputs (Length, Outlier Filter, Floor)
- Pressure Normalization Lookback
- Sizing Regime Lookback
- Auto Sizing Band Lookback
- Level Tolerance % - controls how close price must be to a reference level for that level to contribute to confluence; the default is 1.2%; users may adjust it to suit the instrument and timeframe
Advanced toggles:
- Enable Footprint Engine (Tier 3) - leave OFF unless you have Premium/Ultimate and your symbol supports footprint data
- Enable Intrabar Reconstruction (Tier 2) - leave ON by default; with the default 1-minute resolution it falls back to Tier 1 on a 1-minute chart because the requested timeframe is not lower than the chart timeframe
- Use Dynamic Extension Sizing - leave ON for auto-scaled Extension by IB and volatility regime
- Auto-Derive Sizing Band - leave ON to get instrument-appropriate SL/TP sizing automatically
- Require Next-Bar Confirmation - turn ON for fewer, more selective signals at the cost of one bar of lag
---
11. ALERTS
Five alert conditions are available in the TradingView alert dialog:
- FDAM - Long Scenario Marked
- FDAM - Short Scenario Marked
- FDAM - Reaction Zone Reached
- FDAM - Extension Zone Reached
- FDAM - Invalidation Level Reached
The script also uses alert() calls for dynamic messages. Those programmatic alerts are issued once per confirmed bar close. The alertcondition() entries are selectable in the TradingView alert dialog; the script raises those conditions only on confirmed bars, while the selected alert frequency is configured in TradingView.
The dynamic alert() messages for Long and Short scenarios include the direction, active-tier pressure reading, nearest qualifying level, and session character (for example: "▲ LONG - Pressure 64 near Prior Day High (Trend Day)").
---
12. LIMITATIONS
- This is a discretionary analytical indicator rather than a built-in strategy backtest. It does not calculate audited P&L, win rate or historical strategy performance.
- The 3-tier delta engine is not equally precise across tiers. Tier 3 uses native TradingView footprint data. Tier 2 uses lower-timeframe OHLCV reconstruction. Tier 1 uses a single-bar OHLCV proxy. Each is normalized to the same -100 to +100 scale, but same scale does not mean same statistical distribution. The dashboard always shows which tier is active.
- The IB day-type classifier is a heuristic, not a factual market classification. "Session" is defined by whatever session context the chart symbol reports via session.isfirstbar - this varies across equities, futures, crypto and FX. The classifier labels a session based on IB-to-historical-median ratio thresholds; it does not identify participant intent.
- The confluence ladder weights are pre-defined analytical weights, not statistically derived reliability scores. They reflect the relative significance of level types in auction market theory as designed by the author.
- Same-bar Extension/Invalidation resolution uses a deterministic proximity convention based on distance from the prior bar's close. OHLC data alone cannot establish actual intrabar sequence. This is disclosed on-chart via the resolution status and in this description.
- Signals are intentionally suppressed until the current IB is formed and at least three completed historical IB samples are available.
- Footprint mode (Tier 3) may behave inconsistently during Bar Replay because of TradingView's footprint data caching. The script displays an on-chart notice when Footprint mode is enabled and recommends disabling it for replay testing.
---
13. DISCLAIMER
This script is a technical analysis tool built for educational and informational purposes only. It does not constitute financial advice, investment advice, trading advice, or a recommendation to buy or sell any security or instrument. Nothing produced by this script - signals, scores, zones, or labels - should be interpreted as a guarantee of future price behavior. Markets are probabilistic, not deterministic; past patterns in auction structure, delta, or volatility regime do not guarantee repeat outcomes. Trading leveraged instruments (crypto, futures, indices) carries substantial risk of loss. You are solely responsible for your own trading decisions, position sizing, and risk management. The author assumes no liability for losses incurred through the use of this script.
Users on plans that do not support volume-footprint data should leave the Footprint Engine toggle OFF. With Footprint mode disabled, the script uses Tier 2 when a usable lower-timeframe reconstruction is available and Tier 1 otherwise.
Published as open-source under the Mozilla Public License 2.0.
- BullByte Indicador

Indicador
