High Volume Rejection Zones [BOSWaves]High Volume Rejection Zones - Volume-Validated Swing Rejection Detection with Quality-Scored Dual-Layer Zones and Flip Tracking
Overview
High Volume Rejection Zones is a swing-anchored supply and demand zone system that identifies price levels where confirmed pivot highs and lows were accompanied by meaningful rejection wick structure and above-average volume participation, where zone depth, inner core sizing, and visual intensity are driven by a composite rejection quality score derived from wick magnitude, close distance from the extreme, and relative volume strength rather than arbitrary fixed zone dimensions.
Instead of marking every swing pivot regardless of the conviction behind it, each zone requires three simultaneous conditions to be satisfied: the pivot candle's volume must exceed its rolling average by the configured multiple, the rejection wick must represent a minimum fraction of the candle's total range, and the close must have moved sufficiently far from the extreme, confirming that price was decisively pushed away from the level rather than drifting. Only when all three conditions are met does a zone form, ensuring every level on the chart has measurable evidence of genuine rejection activity behind it.
This creates a zone framework that goes beyond simple level marking into active lifecycle management. Each zone tracks whether price retests and holds the level, displaying a hold signal when the interaction confirms structural defense, then converts visually when price breaks through the zone, flipping from resistance to potential support or from support to potential resistance and monitoring for a subsequent flip retest where the former opposing level is tested from the new side. Zones fade progressively with age using a cubic opacity curve, expired zones dissolve automatically, and a configurable historical limit manages the total object count across the chart history.
Price is therefore evaluated not just against levels that meet structural swing criteria but against levels with quantified rejection evidence, active hold and flip tracking, and aging-aware visual treatment that communicates zone relevance at a glance.
Conceptual Framework
High Volume Rejection Zones is founded on the principle that meaningful supply and demand zones require simultaneous evidence across three independent dimensions: the price was structurally significant enough to form a confirmed swing, the rejection from that level was decisive enough to produce a meaningful wick, and volume participation was sufficient to indicate that the rejection was driven by genuine market activity rather than low-liquidity price movement.
Traditional pivot-based zone tools mark levels from confirmed swings without filtering for the quality of the rejection at those pivots, producing charts populated with zones where price barely paused rather than zones where price was actively defended by participating volume. This framework requires all three rejection dimensions to exceed their configured thresholds simultaneously before a zone is committed, concentrating the chart on the subset of swing pivots with the strongest combined evidence of institutional rejection activity.
Three core principles guide the design:
Zone formation should require concurrent validation across wick structure, close positioning, and volume significance, ensuring each zone reflects a genuine multi-dimensional rejection event rather than a mechanical pivot detection.
Zone depth should scale with rejection quality, with the inner core zone growing proportionally as wick conviction, close distance, and volume strength increase, providing a visual quality gradient across zones of varying rejection evidence.
Zones should track their own lifecycle through hold detection, break identification, flip conversion, and age-based fading, communicating structural relevance dynamically rather than remaining static rectangles regardless of subsequent price interaction.
This shifts supply and demand zone analysis from pivot-counting into evidence-weighted rejection identification where every visible zone carries quantified conviction credentials and active interaction tracking.
Theoretical Foundation
The indicator combines confirmed pivot detection with simultaneous three-condition rejection filtering, a composite quality score derived from normalized wick, close, and volume components, dual-layer zone construction with quality-proportional inner core sizing, cubic fade curve aging, hold retest detection, break detection with visual flip conversion, and flip retest detection with independent completion tracking per zone.
Pivot confirmation uses a symmetric left-right bar requirement to identify structurally validated swing highs and lows. The rejection quality score weights the wick component at forty percent, the close distance component at thirty-five percent, and the relative volume component at twenty-five percent, each normalized to a zero-to-one scale against their respective reference values. The coreDepth variable maps this composite score to an inner zone boundary that ranges from twenty-two percent to seventy percent of the total zone height, producing inner zones that are small for borderline rejections and deep for high-conviction rejections. The cubic fade curve applies a non-linear aging effect that preserves zone visibility through most of the maximum age before accelerating the fade near expiry.
Four internal systems operate in tandem:
Rejection Validation Engine : Tests each confirmed pivot against the relative volume threshold, minimum wick ratio, and minimum close distance simultaneously, qualifying only pivots where all three conditions are met and calculating the composite rejection quality score from the normalized component values.
Zone Construction System : Creates dual-layer outer and inner zone boxes with ATR-scaled height and quality-proportional inner boundary positioning, adds a precise pivot price level line, and displays the relative volume multiple as a label when the show volume setting is enabled.
Hold and Break Tracking System : On each bar after zone creation, tests for hold retests where price touches the zone without closing through it and generates hold signals. Tests for full breaks where price closes beyond the outer zone boundary, converts zone coloring and border style to the opposing direction, and begins monitoring for flip retests.
Aging and Lifecycle Management System : Applies a cubic opacity fade curve based on zone age relative to the configured maximum, dissolves expired zones with a near-transparent final state before removing them, and enforces the historical zone count limit by removing oldest objects first.
This design ensures every zone carries its own rejection quality credentials, tracks its own lifecycle state, and communicates both structural relevance and interaction history through its visual properties at all times.
How It Works
High Volume Rejection Zones evaluates price through a sequence of pivot-aware and evidence-validated processes:
Pivot Detection : Swing highs and lows are confirmed when the configured number of bars to the left and right validate the structural significance of the pivot, providing the structural anchor for rejection testing.
Wick Ratio Measurement : The upper wick of a pivot high is measured as a fraction of the full candle range. The lower wick of a pivot low is measured similarly. Values below the configured minimum exclude the pivot from zone formation.
Close Distance Measurement : The distance between the pivot extreme and the close is expressed as a fraction of the candle range, measuring how decisively price moved away from the extreme before the bar closed. Values below the minimum threshold exclude the pivot.
Relative Volume Test : The pivot candle's volume is divided by its rolling SMA baseline. Values below the configured multiple exclude the pivot, ensuring only bars with meaningful participation qualify.
Rejection Quality Scoring : For qualifying pivots, each of the three components is normalized to a zero-to-one scale against its reference value and combined with the configured weightings to produce a composite rejection quality score.
Zone Depth Calculation : The composite quality score maps linearly to a core depth fraction that determines how far the inner zone boundary sits within the total ATR-scaled zone height, producing quality-proportional inner zones.
Dual-Layer Zone Creation : An outer zone box spans the full ATR height with a transparent fill. An inner zone box spans the quality-proportional depth with a denser fill. A level line marks the precise pivot price. A relative volume label displays the RVOL multiple when enabled.
Hold Retest Detection : After zone creation, each bar tests whether price touched the zone without closing through it in the opposing direction. A qualifying touch generates a hold signal diamond marker and brightens the zone border.
Break Detection and Flip Conversion : When price closes beyond the outer zone boundary in the opposing direction, the zone converts visually to the opposing direction color with dotted borders, indicating the former resistance or support level has been broken and may now function as the opposing structural reference.
Flip Retest Detection : After a zone break, each subsequent bar tests whether price retouched the outer boundary from the new side and closed beyond it, generating a flip signal diamond marker and brightening the converted zone's border.
Age-Based Fading : On each bar, the zone age is calculated and a cubic fade curve maps the age fraction to increasing transparency values applied to all zone visual properties, causing zones to gradually dissolve toward invisibility as they approach the maximum age.
Expiry and Cleanup : Zones reaching maximum age are set to near-transparent final state and all references are cleared. The historical object arrays are trimmed when the maximum zone count is exceeded by removing the oldest entries.
Together, these elements form a continuously updating rejection zone system where every visible level has passed a multi-condition evidence filter, carries a quality-proportional visual footprint, and reflects its current lifecycle state through color, opacity, border style, and signal markers.
Interpretation
High Volume Rejection Zones should be interpreted as an evidence-filtered structural level system with active lifecycle state communication:
Bearish Rejection Zone (Red) : Formed at a confirmed pivot high where volume, wick, and close distance thresholds were all satisfied simultaneously, identifying a price level where selling pressure was both structurally significant and volume-backed.
Bullish Rejection Zone (Green) : Formed at a confirmed pivot low where the equivalent buying pressure thresholds were satisfied, identifying a level where buying activity was structurally significant and volume-backed.
Outer Zone : The full ATR-scaled zone box with the lighter fill represents the complete rejection range anchored to the pivot extreme, serving as the primary zone boundary and the reference for break detection.
Inner Core Zone : The denser inner fill occupying a quality-proportional fraction of the outer zone height represents the highest-confidence portion of the rejection zone where price and volume evidence was strongest. Larger inner cores indicate higher composite rejection quality.
Level Line : The solid line at the precise pivot price provides a pin-point structural reference at the exact level where the rejection candle's extreme registered.
Relative Volume Label : The RVOL multiple displayed on each zone quantifies how significantly above average the pivot candle's volume was, providing an immediate conviction reading for each zone.
Zone Fading : Progressively increasing transparency as zones age reflects diminishing structural relevance over time. Fresh zones are fully opaque and most relevant; older zones are more transparent and carry reduced structural weight.
Flipped Zone (Converted Color) : When price closes through a zone's outer boundary, the zone converts to the opposing direction's color with dotted borders, indicating the former support or resistance may now function in the opposite structural role.
◆ Hold Signal : Diamond marker appearing when price retests an active unbroken zone and closes without penetrating through it, confirming that the rejection level is actively defending its structural role.
◆ Flip Signal : Diamond marker appearing when price retests a previously broken and converted zone from the new side, confirming that the former opposing level has been accepted in its new structural role.
Zone opacity, inner core depth, RVOL label, and lifecycle state collectively communicate more about each level's structural relevance than zone location alone.
Signal Logic & Visual Cues
High Volume Rejection Zones generates four distinct signal types across two lifecycle phases:
Bullish Hold Signal (◆) : Generated when price touches a bullish rejection zone from above and closes back above the pivot price level without closing through the outer zone bottom, confirming structural defense of the demand level.
Bearish Hold Signal (◆) : Generated when price touches a bearish rejection zone from below and closes back below the pivot price level without closing through the outer zone top, confirming structural defense of the supply level.
Bullish Flip Signal (◆) : Generated when price retests the top boundary of a previously broken bearish zone from above and closes above it, confirming that former resistance has been accepted as support.
Bearish Flip Signal (◆) : Generated when price retests the bottom boundary of a previously broken bullish zone from below and closes below it, confirming that former support has been accepted as resistance.
Each zone generates at most one hold signal and one flip signal across its full lifecycle, preventing repeated signals on the same level and focusing attention on the first confirming interaction of each type.
Alert generation covers bullish and bearish zone formation, bullish and bearish hold events, and bullish and bearish flip confirmations for comprehensive systematic monitoring.
Strategy Integration
High Volume Rejection Zones fits within volume-validated structural level and supply and demand zone-based trading approaches:
RVOL-Weighted Zone Prioritization : Favor zones displaying higher relative volume multiples in the label over borderline-qualifying zones, as greater volume participation at the rejection provides stronger evidence of institutional activity at that level.
Inner Core Precision Entries : Use the inner core zone as a precision entry reference rather than the full outer boundary, placing entries where the quality-weighted evidence was most concentrated rather than at the outer ATR extent of the zone.
Hold Signal Confirmation Entries : Use hold signals as lower-risk re-entry or initial entry triggers within established trends, treating a confirmed zone defense as evidence that the structural level remains operationally relevant rather than merely marked.
Flip Zone Framework : Monitor converted zones as potential support-to-resistance and resistance-to-support levels, using flip signals as confirmation that the role conversion has been accepted by subsequent price action before committing to the new directional interpretation.
Zone Age and Opacity Context : Weight fresher, more opaque zones more heavily than faded older zones in trade planning, as recent rejections formed under current market conditions carry more relevance than historical rejections formed in different volatility or volume regimes.
Multi-Timeframe Zone Hierarchy : Apply higher-timeframe rejection zones as primary directional structural context, using lower-timeframe zone interactions for entry timing precision within the structural bias established by the higher-timeframe level.
Technical Implementation Details
Pivot Detection : Symmetric left-right bar confirmation for swing highs and lows with configurable lookback
Rejection Filter : Simultaneous three-condition testing across relative volume, wick ratio, and close distance thresholds
Quality Score : Weighted composite from normalized wick, close, and RVOL components mapping to inner core depth fraction
Zone Construction : Dual-layer outer and inner ATR-scaled boxes with quality-proportional inner boundary and pivot price level line
Lifecycle System : Hold detection, break identification with flip conversion, flip retest detection with per-zone completion flags
Aging System : Cubic fade curve applied to all visual properties with automatic expiry and object cleanup
Historical Management : Array-based object tracking with configurable maximum count enforced by oldest-first removal
Performance Profile : Optimized with calc_bars_count and max_bars_back configuration for deep historical pivot detection across extended chart histories
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday rejection zone mapping for scalping with shorter pivot lookback and tighter volume threshold for responsive zone formation on fast intraday swings
15 - 60 min : Session-level supply and demand identification with balanced pivot lookback and moderate rejection thresholds for meaningful zone density across typical session structures
4H - Daily : Swing-level institutional rejection mapping with longer pivot lookback and higher volume thresholds reflecting the larger participation events that define significant higher-timeframe levels
Suggested Baseline Configuration:
Pivot Lookback Left : 12
Pivot Lookback Right : 12
Volume Average Length : 20
Minimum Relative Volume : 1.15
Minimum Rejection Wick : 0.25
Minimum Close Rejection : 0.50
ATR Length : 200
Zone ATR Width : 0.30
Maximum Zone Age : 200
Historical Zones : 60
Show Relative Volume : Enabled
Retest Signals : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's swing frequency, volume behavior, and preferred zone density, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Too many zones forming : Increase Minimum Relative Volume to demand stronger volume participation, increase Minimum Rejection Wick to require more decisive wick structure, or increase both Pivot Lookback values to demand more structurally significant swings.
Zones not forming frequently enough : Decrease Minimum Relative Volume toward 1.0 for more inclusive volume qualification, or decrease Pivot Lookback values toward 5 for faster swing confirmation on shorter structural moves.
Zone height too large or small : Adjust Zone ATR Width to scale the vertical zone extent relative to the instrument's typical volatility, calibrating zone depth to realistic price interaction ranges at the target timeframe.
Inner cores consistently too small : The inner core scales with rejection quality. Consistently small cores indicate borderline-qualifying rejections. This is expected behavior and reflects the lower composite evidence at those levels rather than a parameter issue.
Zones fading too quickly or slowly : Adjust Maximum Zone Age to control how many bars zones remain visible before expiring. Shorter ages produce a chart showing only recent levels; longer ages retain historical structural references for extended analysis.
Too many historical zones cluttering the chart : Reduce Historical Zones to limit the total object count, focusing the chart on the most recent qualifying levels within the retained history.
Volume baseline distorted by outlier sessions : Increase Volume Average Length to smooth the SMA baseline across more history, reducing the influence of individual extreme volume sessions on the relative volume threshold calculation.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets where swing pivots form at structurally significant levels and are accompanied by volume-backed rejection that creates reliable supply and demand references for subsequent pullback interactions
Liquid instruments with consistent volume participation where the SMA baseline accurately classifies above-average bars and relative volume readings reliably indicate genuine institutional activity at pivot levels
Supply and demand zone trading approaches where the multi-condition rejection filter concentrates attention on the highest-conviction structural levels rather than marking every mechanical pivot
Flip zone strategies where broken levels converting to opposing structural roles provide high-probability setups as price returns to test the former level from the new side
Reduced Effectiveness:
Choppy, low-volume markets where pivot formation is frequent but volume at each swing is consistently below average, causing the RVOL filter to suppress most zone formation and leave the chart sparse
Instruments with inconsistent volume distribution where the SMA baseline is distorted by session type variation, producing unreliable relative volume classifications across different trading periods
Very fast-moving markets where swing confirmation requires sufficient right-side bars that pivots are confirmed significantly after the actual structural event, reducing the timeliness of zone placement
Markets with extremely small bar ranges where wick ratios become unreliable as noise rather than genuine rejection structure, causing the wick filter to produce inconsistent zone qualification
Consolidation environments where price oscillates near prior rejection zones without clear directional follow-through, generating frequent hold signals without the subsequent trending behavior that validates the zone's structural significance
Integration Guidelines
Confluence : Combine with BOSWaves momentum tools, market structure indicators, or volume profile analysis to validate rejection zone interactions with broader analytical context before committing to structural level-based trades
RVOL Hierarchy : Build a priority hierarchy among active zones based on RVOL multiples. Zones with the highest relative volume readings represent the most convincing institutional rejection events and should be treated as primary structural references over borderline-qualifying zones.
Hold Signal Discipline : Treat hold signals as structural confirmation rather than automatic entries. A hold signal confirms the level defended but not the direction or magnitude of the subsequent move. Combine with trend alignment and momentum context before acting.
Flip Zone Patience : Allow converted zones to develop their flip retest naturally rather than anticipating the interaction. The flip signal requires price to retest the converted boundary and close through it from the new side, confirming role acceptance rather than mere proximity.
Age Awareness : Monitor zone opacity as a relevance indicator. Fully opaque fresh zones reflect current market conditions while heavily faded older zones may have formed under different volatility and volume regimes that are no longer representative of current structure.
Disclaimer
High Volume Rejection Zones is a professional-grade volume-validated supply and demand zone detection and lifecycle tracking tool. It uses multi-condition rejection filtering with quality-scored zone construction but does not predict future price movements. Results depend on market conditions, instrument volume characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates momentum context, trend structure, and comprehensive risk management. Indicator

SATTAM | Lost Balance | Digital LevelsOVERVIEW
Lost Balance plots a price grid derived from digit-sum arithmetic on a swing pivot, then looks for break-and-retest entries at those levels with a full risk map attached.
The idea is that a market's reaction distances are not arbitrary: the digits of a significant swing price are reduced to a single root number, and that root selects one of three fixed spacing "families". Every level in the grid sits an exact multiple of that spacing away from the pivot.
HOW IT WORKS
1 — Core code
The script finds the most recent confirmed pivot high or low on a higher timeframe. It takes the first four digits of that price from the left (ignoring the decimal point), adds them, then reduces the sum to a single digit between 1 and 9.
Example: pivot 4065.33 → 4065 → 4+0+6+5 = 15 → 1+5 = 6. Core code = 6.
2 — Family law
The core code selects the grid spacing:
• codes 1, 4, 7 → family 12 → 12.0 price units
• codes 2, 5, 8 → family 15 → 15.0 price units
• codes 3, 6, 9 → family 18 → 18.0 price units
3 — Level grid
From the pivot, the script draws N levels above and N below, each exactly one family step apart. The pivot line itself is highlighted.
4 — Structure filter
Market bias is read from the same higher timeframe using swing sequence: higher high plus higher low is bullish, lower high plus lower low is bearish, anything else is neutral. Longs are only allowed in a bullish structure, shorts only in a bearish one, and no signals are produced when structure is neutral.
5 — Entry
On the chart timeframe, a signal requires two events in order. First a candle closes through a grid level. Then price returns to that same level and closes back in the direction of the break. The setup is discarded if price closes back on the wrong side, or if the retest does not occur within the configured bar window.
6 — Risk map
Entry is placed at the broken level itself, which makes every distance a whole number of family steps:
• Stop loss — one step back (the previous level)
• Target 1 — one step forward, 1:1
• Target 2 — two steps forward, 1:2
• Target 3 — three steps forward, 1:3
A red box marks the risk zone and a green box the reward zone. When Target 1 is touched, a "SL → BE" marker appears and the script switches its own stop tracking to breakeven.
SETTINGS
• Level timeframe — where the pivot and grid come from (15 / 30 / 60 / 120 / 240)
• Pivot length — left/right bars required to confirm a swing
• Manual pivot price — type a swing price yourself to override auto-detection
• Levels per side — how many grid lines to draw above and below
• Structure filter — enable or disable the directional filter
• Max bars to wait for retest — how long a break stays valid
• Enable Target 3
• Colors for levels, pivot, risk zone and reward zone
An on-chart table shows the pivot price, its first four digits, the digit sum, the core code, the family, the step in price units, and the current structure.
ALERTS
Four alerts are available through "Any alert() function call": long signal, short signal, Target 1 touched (move stop to breakeven), and stop loss hit.
HOW TO USE
Open a 3-minute chart, leave the level timeframe on 60 minutes, and wait for the grid and structure to settle. When a signal prints, the entry, stop and targets are already drawn at exact grid prices — no measuring required.
IMPORTANT NOTES
The family steps of 12, 15 and 18 are absolute price units, not percentages or ATR multiples. This makes the script meaningful on gold, where those values correspond to 120, 150 and 180 points, and meaningless on instruments quoted at a very different scale such as major FX pairs. Adjust your expectations accordingly, or use the manual pivot input to experiment.
The source method does not define how market structure should be measured, so a standard swing-sequence read is used here. It can be turned off if you prefer to set the bias yourself.
Only one position is tracked at a time. A new signal is not accepted until the current one resolves at its stop or final target.
This script draws levels and setups for study and execution assistance. It does not place orders and it is not financial advice.
CREDITS
The digital-levels method — core code extraction, the three spacing families, and the step-based stop and target map — comes from the "Lost Balance" chapter of the SOVEREIGN trading book. The Pine implementation, structure filter, break-and-retest state machine and trade tracking are original work.
نظرة عامة
يرسم المؤشر شبكة أسعار مشتقة من جمع أرقام سعر بيفوت، ثم يبحث عن دخول بكسر وإعادة اختبار عند تلك المستويات مع خريطة مخاطرة كاملة.
آلية العمل
1. الشفرة المركزية — يرصد آخر قمة أو قاع مؤكد على فريم أعلى، يأخذ أول 4 أرقام من اليسار، يجمعها، ثم يبسّط الناتج لرقم واحد بين 1 و 9.
مثال: 4065.33 ← 4065 ← 4+0+6+5 = 15 ← 1+5 = 6.
2. قانون العائلات — الشفرات 1-4-7 تعطي عائلة 12، والشفرات 2-5-8 عائلة 15، والشفرات 3-6-9 عائلة 18. وهذه هي المسافة الثابتة بين المستويات.
3. الشبكة — من البيفوت تُرسم مستويات فوق وتحت، المسافة بينها خطوة العائلة بالضبط.
4. الهيكلة — قمة أعلى مع قاع أعلى = صاعد، وقمة أدنى مع قاع أدنى = هابط. الشراء مسموح في الصاعد فقط والبيع في الهابط فقط، ولا إشارات في العرضي.
5. الدخول — إغلاق شمعة خارج المستوى، ثم عودة السعر للمستوى نفسه وإغلاقه في اتجاه الكسر.
6. خريطة المخاطرة — الدخول عند المستوى المكسور، والوقف عند المستوى السابق، والأهداف الثلاثة عند المستويات التالية بنسب 1:1 و 1:2 و 1:3. عند لمس الهدف الأول يظهر وسم SL → BE.
ملاحظة مهمة
خطوات العائلة (12 و 15 و 18) قيم سعرية مطلقة وليست نسباً، فهي ذات معنى على الذهب حيث تعادل 120 و 150 و 180 نقطة، وبلا معنى على أدوات ذات تسعير مختلف كلياً مثل أزواج العملات الرئيسية.
المؤشر أداة رسم ومساعدة تنفيذ، لا ينفّذ أوامر ولا يُعد نصيحة مالية.
المصدر
منهج المستويات الرقمية مأخوذ من فصل "التوازن المفقود" في كتاب SOVEREIGN. التنفيذ بلغة Pine وفلتر الهيكلة وآلة حالة الكسر وإعادة الاختبار ومتابعة الصفقة عمل أصلي. Indicator

Auto Fibo Multi-Channel Reversal Retest by WiselyWealthComprehensive Guide: Auto Fibo Multi-Channel Reversal Retest Indicator
Introduction: What is this script and its purpose?
The "Auto Fibo Multi-Channel Reversal Retest" script, developed by WiselyWealth, is a highly advanced, multi-layered technical analysis tool built using Pine Script v6. Its primary purpose is to identify high-probability market reversal zones by aggressively filtering out market noise and false breakouts.
Unlike traditional indicators that rely on a single mathematical concept, this system is engineered to demand confluence from four distinct technical dimensions before confirming a trade setup: volatility boundaries, momentum exhaustion, dynamic structural support/resistance, and an execution retest protocol. This script is specifically designed for analytical traders who prioritize setup quality over sheer quantity, aiming to catch precise pivot points in the market while optimizing the risk-to-reward ratio through delayed, confirmed entries.
Working Mechanism: How the Script Detects Signals
The core strength of this script lies in its rigorous, four-step filtering engine. A final "Buy" or "Sell" signal is only painted on the chart when price action satisfies all of the following technical criteria consecutively:
1. Multi-Channel Volatility Extremes (The Boundary Check):
The script features a dual-channel trigger system, allowing users to select a primary and secondary volatility band or price channel. The available options include Bollinger Bands, Keltner Channels, Donchian Channels, Envelopes, and Linear Regression. The algorithm calculates the mathematical upper and lower bounds of these selected systems. For a setup to even begin formulating, the asset's price must simultaneously pierce or touch the extreme outer boundaries of *both* selected channels (for example, the low of the candle must be equal to or lower than both the primary lower band and the secondary lower band). This ensures the market is severely overextended and deviating heavily from its historical mean.
2. Reversal Signatures and Momentum Exhaustion (The Trigger):
Once price reaches the extreme boundaries, the script scans for a reversal catalyst. It detects foundational candlestick patterns, specifically Bullish and Bearish Engulfing candles, as well as Pinbars like Hammers and Shooting Stars. Furthermore, it incorporates momentum oscillators by scanning for Relative Strength Index (RSI) crossovers from overbought or oversold territories, alongside Stochastic oscillator crosses (below 20 for buys, above 80 for sells). This ensures the structural overextension is accompanied by a genuine, measurable shift in buying or selling pressure.
3. Dynamic Auto-Fibonacci Proximity (The Structural Filter):
To prevent taking reversals in the middle of a chart with no structural backing, the script automatically calculates a macro range by identifying the highest high and lowest low over a user-defined lookback period (defaulting to 100 bars). It dynamically plots key Fibonacci retracement levels (0.000, 0.236, 0.382, 0.500, 0.618, 0.786, and 1.000). A raw reversal signal is only validated if the price action occurs within a strict, customizable percentage tolerance (defaulting to 0.5% of the range) of these specific Fibonacci levels. This mathematical check guarantees that trades are only considered at major, historically proven support or resistance zones.
4. The ATR-Based Retest Engine (The Execution Delay):
This is the script's most robust feature. Even if all prior conditions are perfectly met, the script does not immediately issue a final order. Instead, it enters a "pending trend" state and calculates a required "Retest Price" using the Average True Range (ATR).
For a Buy setup, it subtracts a user-defined ATR multiplier (default 1.0) from the close price.
The system then waits for up to a maximum number of candles (default 4 bars) for the price to pull back and touch this specific delayed level.
If the price successfully drops to the retest level within the time limit, the final Buy order is fired and painted on the chart. This engine prevents traders from buying the absolute top of a fake-out and secures a significantly safer entry price.
How to Use: Settings and Optimal Market Conditions
Recommended Configuration & Settings:
Channel Confluence: Pairing Bollinger Bands as System 1 and Keltner Channels as System 2 is highly recommended. Because Bollinger Bands measure standard deviation and Keltner Channels measure ATR, requiring price to break both ensures you are capturing true volatility anomalies (often referred to as a "Volatility Squeeze" reversal).
Retest Engine Tuning: The default ATR multiplier of 1.0 with a 4-bar max wait limit provides a balanced, conservative approach. If you find that valid signals are expiring before execution because the market runs away too quickly, you should either increase the "Max Candles to wait" to 6-8 bars or lower the "Retest Value" to 0.5 for shallower pullbacks.
Fibonacci Tolerance: Keep the "Fibo Level Tolerance" relatively tight (between 0.3% and 0.8%). Expanding it too much defeats the purpose of precision support and resistance filtering.
Suitable Markets and Timeframes:
This indicator thrives in mean-reverting and broadly ranging market conditions, making it exceptionally well-suited for high-liquidity Forex pairs (such as EUR/USD or GBP/JPY), major Cryptocurrencies, and Equity Indices.
Optimal Timeframes: It performs best on medium to higher timeframes, such as the 15-minute, 1-hour, or 4-hour charts. Lower timeframes (like 1-minute or 3-minute charts) contain too much micro-volatility, which may cause erratic Fibonacci plotting and premature retest triggers.
Trend Context: By default, the script takes both Buy and Sell signals ("Trade Direction: Both"). However, in a strong macro-trending market, users should actively utilize the Trade Direction setting to take only pullbacks in the direction of the dominant trend. For example, selecting "Buy Only" during a structural bull market will filter out dangerous counter-trend short positions. Indicator

Fractal ZigZag with Retest & Filters By WiselyWealthIndicator ; Fractal ZigZag with Retest & Filters
Introduction
Welcome to the comprehensive guide for the 'Fractal ZigZag with Retest & Filters' indicator. This custom-built Pine Script indicator is an advanced technical analysis tool designed explicitly for the PulseWire platform. At its core, the primary objective of this script is to provide traders with high-probability entry signals by systematically filtering out market noise, avoiding false breakouts, and ensuring alignment with the overarching macroeconomic trend.
Many retail traders fall into the trap of entering positions during sudden, volatile price spikes, only to suffer heavy drawdowns when the market naturally pulls back. This script mitigates that risk by enforcing a strict, rules-based approach: identifying structural shifts, confirming the initial breakout, and mathematically demanding a pullback (or "retest") before issuing a final trading signal. Additionally, it features built-in alert conditions, making it perfectly suited for algorithmic traders who wish to automate their strategies via Webhooks, Telegram bots, or MT5 API integrations.
Technical Mechanism
The mechanical operation of this script is multi-layered, relying on a confluence of structural mapping, trend filtering, and volatility-based retest calculations. Here is a detailed, step-by-step technical breakdown of how the script detects and generates its buy and sell signals:
Mapping Market Structure with Williams Fractals:The foundation of the script relies on identifying key swing highs and swing lows using Williams Fractals. By default, the indicator evaluates a 5-bar lookback and look-forward period to pinpoint these structural pivots. Once a valid upward or downward fractal is identified, the script connects them using a dynamic ZigZag line. This creates an unambiguous visual map of the market's underlying structure, cleanly displaying the sequence of higher highs or lower lows.
Initial Breakout Identification: The indicator actively monitors the current closing price in relation to the most recently confirmed fractal levels. A raw bullish breakout is registered the moment a candle closes definitively above the last established fractal high. Conversely, a raw bearish breakout is noted when the closing price drops below the most recent fractal low. To prevent redundant alerts, the script locks the current trend state upon a successful breakout.
The ATR-Based Retest Engine: This is the most sophisticated aspect of the indicator. When "Enable Retest Mode" is activated, the script refuses to issue an immediate entry signal at the exact moment of the breakout. Instead, it uses the Average True Range (ATR) over a 14-period lookback to measure current market volatility. For a bullish setup, it calculates a "Retest Target" by subtracting a user-defined ATR multiplier (default 1.0) from the breakout close price. It then starts a countdown timer, allowing a maximum number of candles (default 3) for the price to drop back down and touch this target. If the pullback is successful within the time limit, the raw buy signal is triggered. If the time expires without a retest, the setup is safely invalidated.
Macro Trend Filtering: Before finalizing any signal, the script consults a 200-period Exponential Moving Average (EMA). If the trend filter is enabled, a buy signal is entirely suppressed unless the closing price is strictly above the EMA200. Sell signals similarly require the price to remain below the EMA200. Users can also force the script into a "Buy Only" or "Sell Only" mode to align with their long-term directional bias.
How to Use and Best Practices
To extract maximum profitability and accuracy from this script, traders must apply the correct settings and deploy it in appropriate market environments.
Recommended Settings and Configuration:
Conservative Swing Trading: Ensure the EMA200 Trend Filter remains enabled to keep you on the side of institutional momentum. You may also want to increase the Fractal Periods from 5 to 7 or 9. This filters out minor price fluctuations and forces the script to base its breakouts on major structural swing points.
Retest Calibration for Volatility:** The default ATR multiplier is 1.0, and the wait limit is 3 candles. If you are trading on lower timeframes (e.g., 5-minute or 15-minute charts), breakouts can take slightly longer to retest. Consider increasing the "Max Candles to wait" to 5 or 6. For highly volatile assets, increasing the ATR Multiplier to 1.5 can help you secure a deeper, more favorable pullback entry.
Directional Lock: If higher timeframe analysis dictates a strong bull market, use the "Trade Direction" setting to restrict signals to "Buy Only," eliminating counter-trend noise during minor market corrections.
Suitable Markets and Timeframes:
Forex and Indices: This indicator performs exceptionally well on major Forex pairs (EUR/USD, GBP/JPY) and Global Indices (US30, NAS100) on the 1-Hour and 4-Hour timeframes. These assets heavily respect market structure, and liquidity grabs (retests) are highly common after structural breakouts.
Cryptocurrency: Bitcoin and Ethereum on the 15-minute to 1-Hour charts are excellent candidates, provided you adjust the ATR multiplier to account for crypto's volatile, whipsaw movements.
Markets to Avoid: Avoid using this script in heavily consolidated, range-bound, or sideways markets. Breakout and trend-continuation logic inherently struggles during prolonged periods of low volatility, where price chops indiscriminately around the 200 EMA without clear directional follow-through. Indicator

Pressure Transfer ZoneMany reversal indicators tell you when a market looks stretched. Pressure Transfer Zone asks a harder question: when price returns to the extreme, can the side that drove it there still make meaningful progress?
This indicator was built to identify a specific form of failed continuation. It waits for a strong directional drive, a real retreat, and then a second attempt at the extreme. If that second attempt makes little progress and closes with clear rejection, the script freezes the structure into a decision zone. From there, price must prove that control has actually transferred before a signal is confirmed.
The goal is not to call every top or bottom. The goal is to isolate the moments when a mature move may be losing control, show that process directly on the chart, and give the trader clear confirmation and invalidation levels.
WHO IT IS FOR
Pressure Transfer Zone is designed for intraday, swing, and position traders who use price action and want a more disciplined way to evaluate exhaustion, failed breakouts, failed continuation, and early reversals.
It is designed for liquid stocks, futures, forex, and cryptocurrency on standard candlestick charts. The engine does not run on Heikin Ashi, Renko, or other synthetic chart types because their prices can distort the structure being measured.
THE IDEA BEHIND IT
A strong trend does not end simply because price is overbought, oversold, or extended. Strong moves can remain extended for a long time. What matters is whether the original side can still produce results when it gets another opportunity.
The pattern develops in five stages:
1. A mature directional drive establishes real displacement.
2. Price makes a meaningful retreat away from the extreme.
3. The original side returns for a second attempt.
4. That second attempt produces limited progress and a weaker close.
5. Price confirms the transfer with a qualified break of the selected boundary or, in Sniper mode, with that break followed by a successful first retest.
This is an effort-versus-result test expressed entirely through price. The script does not claim to measure order flow, bid/ask delta, institutional activity, hidden liquidity, or volume pressure.
HOW THE MATHEMATICS WORKS
The first filter is directional efficiency:
Directional efficiency = net directional change / total absolute bar-to-bar movement
A clean drive that travels mostly in one direction receives a higher score. A noisy move that covers a lot of distance but makes little net progress receives a lower score.
The selected Source is used for net displacement and path efficiency. The zone itself is always built from confirmed OHLC prices.
The drive must also meet volatility, range, closing-location, and local-extreme requirements. Under the default pace profiles, it must:
* Produce at least 1.25 ATR of net directional displacement.
* Span at least 2.00 to 2.50 ATR, depending on the selected pace.
* Meet a directional-efficiency threshold of 0.40 to 0.48.
* Close in the outer 28% of the drive range.
* Create a fresh local extreme.
ATR is measured with a 14-bar lookback and frozen when the sequence begins. This prevents later volatility changes from moving the event’s established thresholds.
The retreat must travel at least the greater of 0.55 ATR or 18% of the original drive range, and the closing price must confirm that full retreat distance.
When price returns to the extreme, the second attempt must show deterioration. By default:
* Price must return to within the greater of 0.30 ATR or 8% of the original drive range from the first extreme.
* New progress beyond the first extreme cannot exceed 0.20 ATR.
* The second push cannot exceed 72% of the original drive range.
* The close must migrate away from the first attempt by at least 0.10 ATR.
* Rejection must equal at least the greater of 0.25 ATR or 25% of the developing zone.
* The rejection bar must close within the directional outer 45% of its range.
* The completed zone cannot exceed 60% of the original drive range.
Together, these filters are intended to remove many one-candle reactions, shallow pauses, and weak two-test formations. The model wants to see a legitimate first drive, real separation between attempts, and measurable deterioration on the return.
THE ZONE
Once the second attempt qualifies, the structure is armed and its levels are frozen:
* Outer edge: the most extreme price reached by the two attempts.
* Inner edge: the counter-extreme formed between the two attempts.
* Midpoint: the halfway point of the zone.
* Invalidation: 0.15 ATR beyond the outer edge in the direction of the original move.
For a bullish setup, price must transfer upward after a mature downward drive. For a bearish setup, price must transfer downward after a mature upward drive.
Invalidation requires a confirmed close beyond the buffered outer edge. The invalidation level is structural information, not an automatic stop-loss recommendation.
ENTRY TIMING
Early
Confirms on a qualified close through the zone midpoint. This is the fastest mode and can trigger on the same confirmed bar that arms the zone. It offers earlier recognition with a greater risk of false starts.
Balanced
Confirms on a later qualified close beyond the structural inner edge. Balanced is the default middle ground between earlier recognition and additional structural confirmation.
Sniper
Requires a qualified break of the inner edge followed by the first later retest of that level. The retest must remain shallow and close back in the transfer direction. The first retest decides the setup; a failed first retest cannot become a signal later.
The breakout candle must move in the transfer direction, span at least 0.35 ATR, have a real body covering at least 45% of its range, close within the directional outer 32% of the candle, and finish no more than 0.45 ATR beyond the selected boundary. The final limit is an anti-chase filter.
A valid Sniper retest must stay within 15% of the frozen zone depth, close at least 0.05 ATR back beyond the inner edge, have a directional body covering at least 35% of the candle, and close within the directional outer 40% of its range.
HOW TO READ THE CHART
With the default color palette:
* Amber: the pattern is still developing. It is information, not an entry signal.
* Violet: the structure is complete, armed, and waiting for confirmation.
* Cyan: the action area between the midpoint and inner edge.
* Green: a bullish pressure transfer has been confirmed.
* Red: a bearish pressure transfer has been confirmed.
* Faint gray: an armed setup failed, expired, or was invalidated.
The right-edge label shows the current phase and the next required action. Once the structure is armed, it also displays the confirmation boundary and invalidation price. A diamond appears only when the selected timing mode produces a confirmed trigger.
When Keep Recent Resolved Zones is enabled, the script retains a limited number of recent successful and failed zones. The default is eight, adjustable from one to twelve, so failures remain visible without overwhelming the chart.
PRACTICAL USE
1. Treat an amber zone as a developing idea, not permission to trade.
2. When the zone turns violet, note its direction, confirmation boundary, and invalidation price.
3. Wait for the exact requirement of Early, Balanced, or Sniper mode.
4. Use the broader trend, nearby support and resistance, liquidity, session conditions, and scheduled news as separate context.
5. Apply your own position sizing, stop placement, targets, and trade-management rules.
ADAPTIVE PACE
Auto mode adjusts the engine according to the chart timeframe:
* Fast: 15-minute charts and below.
* Swing: above 15 minutes through 4 hours.
* Position: above 4 hours.
Fast, Swing, and Position can also be selected manually. The selected pace changes the drive and local-extreme lookbacks, minimum drive size, efficiency threshold, formation lifetime, armed lifetime, and Sniper retest window. It does not change the meaning of the pattern.
ALERTS
The indicator includes five alerts:
* Long Zone Armed
* Short Zone Armed
* Long Pressure Transfer
* Short Pressure Transfer
* Pressure Transfer Invalidated
Create alerts using Once Per Bar Close.
Trigger alerts and chart diamonds use the same confirmed-bar event. If an Early setup resolves on the same bar it arms, the temporary armed alert is suppressed so users do not receive a stale or redundant notification.
CONFIRMED-BAR DESIGN
Actionable signals are confirmed only after the chart bar closes. They are not backdated and do not use future data, pivot backpainting, negative offsets, higher-timeframe requests, or lookahead logic.
Amber developing zones are intentionally provisional and can change or disappear because the pattern is not complete. Once a zone turns violet, its structural prices and invalidation level are frozen for that event.
LIMITATIONS
Pressure Transfer Zone identifies structural-exhaustion candidates, not guaranteed reversals. It tracks one active sequence at a time and can miss fast V-shaped turns that never form two separate attempts.
Strong trends can repeatedly invalidate countertrend setups. Thin markets, price gaps, news shocks, and irregular sessions can also reduce the usefulness of ATR-based thresholds.
This is an indicator, not a strategy. It does not place orders, calculate position size, set profit targets, or claim a win rate. Its job is narrower: determine whether the original directional side returned to the extreme, failed to produce enough additional progress, and then met the model’s confirmation rule at a clearly defined price.
Indicator

Adaptive Trend Rails [NICK789]Adaptive Trend Rails
OVERVIEW
Adaptive Trend Rails is a market-structure and break-and-retest framework built around one shared price channel. It is designed to answer four practical questions:
1. Which direction currently controls the chart?
2. What exact price level would confirm continuation or a trend change?
3. Is pressure building against the active trend before that change is confirmed?
4. Has price completed a valid breakout, retest and rejection sequence that can be turned into a structured trade plan?
This is not a collection of unrelated indicators placed on the same chart. The rail engine is the foundation of the script, and every additional component—equilibrium, reversal pressure, trend-change quality, multi-timeframe context and the break-and-retest plan—uses information derived from that same structure.
CORE RAIL ENGINE
The script builds an upper and lower rail from the highest high and lowest low of an adaptive lookback. The lookback changes according to the chart timeframe, while the user-selected Narrow, Medium or Wide setting adjusts how quickly the rails react.
A bullish break occurs when price crosses above the previous upper rail. A bearish break occurs when price crosses below the previous lower rail.
The script then classifies each break according to the existing trend state:
• A break in the current direction is treated as continuation.
• A break against the current direction is treated as a trend change.
Because the decision level is taken from the previous rail value rather than the rail currently expanding with price, users can see the actual level that must be crossed. The live “Continue?” and “Trend Change?” guides therefore act as decision levels, not predicted targets.
ADAPTIVE EQUILIBRIUM
The centre line is not a simple midpoint or fixed moving average.
First, the script measures where price is positioned between the active upper and lower rails. That normalized position is then smoothed using EMA and volume-weighted information, with a WMA fallback when volume-weighted data is unavailable. The accepted position is shifted toward the centre and constrained so the equilibrium cannot sit directly on the outer rails.
The resulting line represents an adaptive accepted-value area inside the current structure.
Equilibrium is used throughout the script:
• Its slope helps determine whether internal momentum is rising or falling.
• Its curl helps identify a possible change in pressure.
• Retest plans require price to remain on the correct side of equilibrium.
• Optional entry filtering can require equilibrium to slope in the proposed trade direction.
• A pending retest is cancelled when price loses the required equilibrium relationship.
For this reason, equilibrium is part of the calculation engine and not merely a decorative average.
REVERSAL-PRESSURE WARNINGS
The yellow reversal dots are early warnings, not reversal signals.
While a trend is active, the script measures opposing pressure using a weighted combination of:
• Candle closing location
• Upper or lower wick rejection
• Directional candle-body strength
• Relative volume participation
• Relative candle-range expansion
• Equilibrium slope or curl
• Price location within the rail structure
A bearish warning is only considered while the rail trend is bullish and price is positioned in the upper portion of the structure. A bullish warning is only considered while the rail trend is bearish and price is positioned in the lower portion.
The warning means pressure is building against the current trend. It does not change the trend by itself. Price must still close through the displayed Trend Change level before the rail state is considered reversed.
A cooldown is applied to prevent repeated warning dots from being printed on every nearby candle.
TREND-CHANGE QUALITY
When a confirmed trend change occurs, the script assigns a compact quality reading based on the breakout candle.
The score combines:
• Relative volume
• Relative candle range
• Directional body strength
• Closing location in the breakout direction
The resulting label is shown as Weak, Moderate, Good or Strong.
The tooltip also describes the character of the breakout, such as Clean Break, Expansion, Absorption, Weak Close or Low Participation. This is intended to provide context, not to guarantee that a strong-rated break will continue.
MULTI-TIMEFRAME CONTEXT
The horizontal trend strip rebuilds the same rail-state method across nine timeframes:
1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 1 day and 1 week.
This is important because the table is not mixing unrelated moving-average or oscillator definitions. Every timeframe is evaluated with the same upper-rail/lower-rail breakout method used on the chart.
The script also assigns a practical paired timeframe to the active chart—for example, a 1-minute chart is paired with 5 minutes, a 5-minute chart with 15 minutes, and a 15-minute chart with 1 hour.
Paired-timeframe information is warning-only. It does not silently block, delay or change an entry. When a plan triggers against the paired rail trend, the table and dedicated alert identify that conflict so the trader can make the final decision.
BREAK-AND-RETEST PLAN
The optional trade-plan engine does not enter immediately when a rail breaks.
Its sequence is:
1. Price closes through a continuation or trend-change level.
2. The exact broken rail level is stored.
3. Price must return on a later candle and touch or sweep that level.
4. The candle must reject the level and close back through it in the breakout direction.
5. Price must remain on the correct side of equilibrium.
6. Optional filters check equilibrium slope and whether the rail structure is wide enough relative to the configured stop distance.
All confirmed setups are labelled simply as “RETEST” to avoid implying that one setup carries a guaranteed grade or outcome. The tooltip still identifies whether the retest followed a Trend Change or a Continuation break.
The user may enable both setup types or restrict the engine to trend changes, continuations, longs or shorts.
Pending setups expire after the selected number of bars. They are also cancelled when the rail trend changes or price invalidates the required equilibrium relationship. This prevents an old breakout level from remaining armed after its original context has disappeared.
RISK AND PLAN DISPLAY
When a retest entry is confirmed, the script can display:
• Entry level
• ATR-adaptive or fixed-tick stop
• Reward/risk or fixed-tick target
• Active-plan direction
• Target-hit or stop-hit result
The default ATR Adaptive method scales the stop to current volatility and calculates the target from the selected reward/risk ratio. This makes the plan transferable across forex, metals, crypto, stocks and futures even when their price increments differ. A Fixed Ticks mode remains available for traders who intentionally use exchange tick distances on instruments such as futures. All values remain examples and must be adjusted for the instrument, timeframe and personal risk limits.
The tool is an indicator, not an automated strategy. It does not calculate position size, brokerage fees, commissions, spread or slippage, and it does not place orders.
HISTORICAL REVIEW
Historical plans and review statistics are optional and disabled by default.
The review panel counts completed target and stop outcomes visible in the loaded chart data and reports the net result in R-multiples. Replaced plans are excluded. If both the target and stop are touched within the same ordinary chart candle, the script records the stop first because the true intrabar sequence cannot be known from standard OHLC data.
Win rate is hidden until a minimum sample is available. These statistics are intended for chart review and configuration comparison only. They are not a full strategy backtest and should not be presented as expected future performance.
HOW TO USE
A simple workflow is:
1. Select Narrow, Medium or Wide rails according to the desired reaction speed.
2. Read the active rail colour to identify the current structural direction.
3. Use the Continue and Trend Change levels as the prices that would confirm the next structural event.
4. Treat reversal dots as preparation warnings only.
5. Use the quality label to inspect the participation and candle character of a confirmed trend change.
6. Check the multi-timeframe strip for broader alignment or conflict.
7. Enable the Break & Retest Plan when structured retest signals, ATR-adaptive or fixed-tick levels and review tools are required.
8. Adjust stop and target ticks for the traded symbol rather than assuming the defaults fit every market.
DEFAULT DISPLAY
The default view focuses on the rails, adaptive equilibrium, live decision levels, trend-change quality and multi-timeframe context.
Candle colouring, the trade-plan engine, historical plans and review statistics are optional so users can keep the chart clean and enable only the tools relevant to their workflow.
ALERTS
Alerts are provided for:
• Bullish and bearish continuation
• Bullish and bearish trend change
• Bullish and bearish reversal pressure
• Long and short break-and-retest entries
• Entries against the paired timeframe
• Replacement of an unresolved plan by an opposite valid setup
• Target hit
• Stop hit
Confirmed continuation, trend-change and retest-entry alerts are intended for candle-close use. Reversal-pressure warnings are intentionally earlier and should always be treated as unconfirmed until the relevant Trend Change level is closed through.
LIMITATIONS
Adaptive Trend Rails is a structure and planning tool, not a prediction engine.
Rail breaks can fail, strong breakout candles can reverse, and multi-timeframe alignment does not guarantee continuation. ATR-based distances expand and contract with recent volatility, while fixed-tick distances behave differently across instruments and feeds. Historical review results are displayed in R-multiples and depend on the loaded chart, selected settings and available OHLC data.
Users should combine the tool with their own risk management, market-session awareness and execution rules.
ORIGINAL CONTRIBUTION
The original purpose of this script is to turn one adaptive rail structure into a complete decision sequence:
current trend → live confirmation level → opposing-pressure warning → confirmed structural break → quality context → multi-timeframe comparison → delayed retest validation → risk-plan display → optional historical review.
Each component exists to explain or validate another part of that sequence. The script is therefore designed as one integrated framework rather than a mashup of independent indicators. Indicator

Breakout & Retest Entry Signals & the Break-vs-RetestOVERVIEW
"Wait for the retest" is the most repeated piece of advice in breakout trading. It is also, as far as I can tell, completely untested by the people who repeat it.
This tool settles it — on your instrument, with your settings — by taking BOTH entries on the SAME breaks and grading them against the same control:
PER-TRADE EDGE expectancy vs control · n
Break entry +0.09R +0.02R · n=412
Retest — CLEAN +0.31R +0.02R · n=118
Retest — DEEP -0.04R +0.02R · n=76
clean vs deep (t) 3.41 CLEAN IS BETTER
BUT — HOW OFTEN DO YOU GET IT?
Breaks that ever retested 47.0% (194/412)
after a run of >3 closes 31.2% vs 55.8% otherwise
False-break rate 13.3%
EXPECTED VALUE PER BREAK
Take every break +0.09R (100% of breaks)
Wait for the retest +0.06R (47% of breaks)
VERDICT NO DIFFERENCE — pick either
That last block is the entire point. A better per-trade edge is worthless if you only get the trade half the time — so the WAIT policy is scored as P(retest) x E , because on every break that never retests you get NOTHING. The two are then compared with a significance test, and the verdict is allowed to be "no difference".
It is a research and framing tool. NOT a strategy, NOT a signal service, NOT a validated edge.
WHAT IT ALREADY FOUND — measured live on NIFTY futures
timeframe breaks retested false breaks verdict
1m 334 49.4% 29.6% NO DIFFERENCE
3m 323 53.3% 13.6% NO DIFFERENCE
5m 328 53.4% 14.0% NO DIFFERENCE
15m 306 51.0% 12.7% TAKE THE BREAK
1h 274 50.0% 16.4% NO DIFFERENCE
TWO THINGS JUMP OUT.
The retest rate is 50-53% on every timeframe. Bulkowski, measuring throwbacks across 10,348 chart patterns on US daily stocks, found 50-60%. A completely different market, a completely different method, and the same number. That is a real phenomenon, not an artefact of the detector.
The false-break rate is 26.5% on the 1m and 13-15% everywhere else. THE ONE-MINUTE BREAK IS TWICE AS LIKELY TO BE A LIE. That is not folklore, it is this instrument's own number, and it is exactly the kind of thing a trader should know before choosing a timeframe.
And the verdict, on four of the five: NO DIFFERENCE — pick either. Once the geometry is honest and the test is a real one, the great break-versus-retest argument simply does not resolve on this instrument at most speeds. On the 15m it does resolve — and it says TAKE THE BREAK, which is the opposite of what almost everyone will tell you.
That is what a measurement looks like. It disagrees with the folklore on one timeframe, refuses to take a side on four others, and does not care what you were hoping for. No tool that needs to sell you a signal would ever print "NO DIFFERENCE".
THE ONE THING EVERYONE GETS BACKWARDS
Thomas Bulkowski measured throwbacks and pullbacks across 10,348 chart patterns. His finding:
"Do throwbacks hurt performance? YES: 97% of the time chart patterns with upward breakouts
perform better post-breakout WITHOUT a throwback."
"Do pullbacks hurt performance? YES: 91% of chart pattern types with downward breakouts
perform better if a pullback does NOT occur."
Read that again. The retest is not a gift. It is a SYMPTOM — evidence that the move is weak, that supply came back, that the break did not have the strength to run.
And yet "wait for the retest" is good advice for a completely different reason: it gives you a better price and a tighter stop.
BOTH ARE TRUE AT ONCE. They are two opposing effects on the same trade, and they have never been put on one scale and netted out. That is what this script does. The retest may still win — a better entry can outweigh a weaker move — but nobody has ever checked, and the answer is different on every instrument and every timeframe.
A CLEAN RETEST AND A DEEP ONE ARE NOT THE SAME EVENT
Bulkowski again, and this is his sharpest single finding on the subject: during a throwback, if price REMAINS ABOVE the breakout price the subsequent rise averages 40%. If it drops BELOW the breakout price and then recovers, the rise averages 29%. That is 400 samples versus 2,767.
Pooling those two throws away the strongest signal in the whole idea. So they are separated:
CLEAN retest — price came back and touched the level, but never CLOSED back through it.
DEEP retest — price CLOSED back through the level, then recovered.
They are graded separately, tested against each other, and labelled separately on the chart. If clean beats deep on your instrument, then "wait for the retest" is not one rule — it is two, and only one of them works.
AND CAN YOU SEE IT COMING?
The real, unpriced cost of a WAIT policy is that roughly half the time you never get filled. So it matters enormously whether you can predict which breaks will retest.
Bulkowski found that if price has more than three consecutively higher closes ending the day before the breakout, the throwback probability drops materially. So the panel reports the retest rate SPLIT BY THAT:
after a run of >3 closes 31.2% vs 55.8% otherwise
If the split is real on your instrument, then after a strong run into the break you should simply TAKE IT — because the retest you are waiting for is probably never coming.
IS YOUR VOLUME FILTER EARNING ITS KEEP?
Every trader is taught that a breakout must be confirmed by volume. Bulkowski's volume study says that after an ABOVE-average-volume breakout, FAILURES DOUBLE and the likelihood of a throwback TRIPLES, while the move itself is barely better.
That is testable — but only if the low-volume breaks are allowed into the sample. So VOLUME IS NOT A GATE ON THE RECORD. Every break is recorded; volume gates only the SIGNAL. The panel then reports what your filter is actually worth:
Break ON volume +0.11R n=246
Break OFF volume +0.06R n=166
on vs off (t) 0.82 no difference — it is doing nothing
The record is a fact about the market. The filter is a decision about the trade. They are kept apart, and this is what happens when you stop assuming and start measuring.
IDENTICAL GEOMETRY — and why this is not a detail
The target used to be THE NEXT OPPOSING LEVEL. That quietly destroyed the entire experiment.
The BREAK entry sits PAST the level (it closed through it). The RETEST entry sits BACK AT the level. So the retest is systematically FARTHER from the next opposing level, and was therefore being handed a BIGGER R:R for the SAME RISK — on every single trade, by construction. Live, that produced an R:R of 5.0 on one timeframe and 0.66 on another, and the on-chart key was cheerfully claiming "identical geometry" while the geometry was tilted toward the retest.
The trade now uses a FIXED R multiple, identical for the break, the retest and the control. The next opposing level is still drawn, and still tested — separately, as a descriptive statistic, with its hit rate reported next to its distance in R.
THE ANTI-BIAS GUARDS
ENTRY IS THE CLOSE, for both entries and for the control. Entering the retest AT the level — a better price than the close — while the break enters at its close would hand the retest a free head start on every trade, and settle the oldest argument in trading by rigging it.
THE CONTROL IS DIRECTION-MATCHED. Breaks run with the trend, so a direction-skewed event set measured against a symmetric 50/50 control inherits the drift for free and calls it an edge. Longs are compared only with control longs, shorts only with control shorts, and the control is blended back using the events' OWN direction mix.
EVERY VERDICT IS A TEST, NOT A COMPARISON. Break-vs-wait, clean-vs-deep, volume-on-vs-off — each is a Welch t-test that has to clear |t| > 1.96 before it is allowed to be a finding. For the wait policy, the variance of P(retest) x E is propagated by the delta method, because it is a product of two estimates and both carry error. A verdict that flips on a tenth of an R is not a verdict, it is noise wearing a costume.
Both barriers on one bar: the STOP is assumed first — conservative, and the only assumption that cannot flatter the result. Unresolved trades at the horizon are marked to market, not booked as losses.
THE LEVELS
Levels come from the extrema of a KERNEL-SMOOTHED price series (Nadaraya-Watson) rather than raw pivots, so they track the structure rather than the noise. A break requires a CLOSE beyond the level with displacement, not a wick. A false break is one that closes back inside quickly. All of it is computed on confirmed bars; the kernel is causal and never looks forward.
NON-REPAINT
The kernel confirms an extremum a half-window late, so a level appears some bars AFTER the swing that created it. That lag is the price of not repainting and it is paid deliberately. Levels, breaks, false breaks, retests, signals and every calibration event are computed on CONFIRMED bars only. Nothing is drawn and then moved.
DATA AND SCOPE
Any symbol, any timeframe. ATR-normalised throughout. Volume improves the SIGNAL but is not required, and it never gates the RECORD.
EXPORTS (Data Window — consume from other scripts via input.source())
EXP_Level, EXP_Break, EXP_FalseBreak, EXP_Retest, EXP_Entry, EXP_Stop, EXP_Target, EXP_NextLevel, EXP_WaitEdge
CONCEPT CREDIT
Support/resistance, polarity and the breakout-retest idea are long-standing public trading concepts with no single author; the written tradition runs through Charles Dow, Richard Wyckoff and Edwards & Magee. The formal TRADING-RANGE BREAK was first tested at scale by William Brock, Josef Lakonishok and Blake LeBaron, Journal of Finance 47(5), 1992 — and their results were later shown to be vulnerable to data-snooping (Sullivan, Timmermann and White, 1999), which is exactly why this tool measures the rule on YOUR instrument rather than asserting it.
The throwback and pullback statistics that motivate the clean/deep split, the run-length predictor and the volume test are from Thomas Bulkowski ("Encyclopedia of Chart Patterns"; thepatternsite.com). His numbers are measured on US daily stocks. Whether they hold on YOUR instrument is precisely the question this script exists to answer — and it may well answer "no".
Nadaraya-Watson kernel regression — Nadaraya and Watson (1964); its use for technical pattern recognition — Lo, Mamaysky and Wang, Journal of Finance 55(4), 2000. Triple-barrier forward labelling — Marcos Lopez de Prado. Welch's t-test — B. L. Welch. ATR — J. Welles Wilder.
The break-vs-wait availability weighting, the delta-method significance test, the clean/deep retest split, the volume-filter test and the direction-matched control are the author's own. Clean-room implementation; no third-party Pine code is reused. Not affiliated with, nor endorsed by, any of the above.
HONESTY AND LIMITATIONS
Calibration is IN-SAMPLE, with no costs or slippage, and uses overlapping windows. A proven in-sample edge is NOT a guarantee out-of-sample. Real fills, spreads and commissions will reduce it — and they will hurt the break entry more than the retest entry, because the break enters into momentum.
Bulkowski's throwback statistics are measured on US daily stocks over decades. They are the reason the questions are asked. They are NOT the answer, and this tool will tell you so if your instrument disagrees.
The verdict is allowed to be "NO DIFFERENCE — pick either", and on many instruments it will be. That is a real result. A tool that cannot report its own failure is an advertisement, not a measurement.
Nothing in this script predicts price.
DISCLAIMER
Research and educational tool only. NOT financial advice, NOT a recommendation, and NO guarantee of results. Entry, stop and target output is arithmetic, not advice. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use.
Indicator

Trendline Architect [Quantum Algo]Trendline Architect
====================================================
🔶 OVERVIEW
Trendline Architect is an automatic trendline indicator that does what most trendline tools skip: it validates every line before drawing it, makes each line earn its status through real touches, grades every breakout by quality, and then automates the break-and-retest sequence that trendline traders normally track by hand. Lines are born as dotted candidates, promoted to solid confirmed trendlines only after the market validates them with a third touch, graded on breakout, kept on a retest watch after they break, and paired into parallel channels automatically — all with a deliberately quiet chart: one-letter signals whose full context lives in hover tooltips.
The problem this script solves is trendline spaghetti and trendline noise. Automatic trendline tools typically draw every pivot-to-pivot connection and alert on every violation. This engine rejects invalid lines at birth, refuses duplicates, caps how many lines can exist per side, silences the breaks of unproven lines by default, and filters weak breakouts by grade — so what remains on the chart is only what the market has actually respected.
🔶 WHAT IS A TRENDLINE BREAK AND RETEST?
A trendline connects successive swing points and acts as dynamic support or resistance while price respects it. A breakout occurs when price closes decisively through the line. The retest is what disciplined traders wait for next: price returning to the broken line from the other side and rejecting — old support acting as new resistance, or old resistance reclaimed as support. That return-and-reject is one of the most traded patterns in classical charting, and this engine detects the entire sequence automatically: validated line, graded break, watch window, confirmed retest.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. Geometric validity at birth. A candidate line is rejected before it is ever drawn if any candle close violated the segment between its two anchor pivots. Lines that were never respected never reach the chart.
2. Touch-earned lifecycle. Every line starts as a dotted, untagged candidate. Each validated touch — a wick into tolerance with a close that respects the line — is counted, and only at the configured touch count is the line promoted: solid, thicker, fully colored, with a live ×N touch tag. The chart itself shows which lines the market obeys.
3. Anti-spaghetti engineering. Duplicate candidates with similar slope and position are refused, each side is capped at a configurable number of active lines with the weakest evicted first, and stale lines expire by age. The chart stays readable on every timeframe.
4. Breakout quality grading. Every breakout is scored from three observable components — volume z-score, penetration depth in Average True Range units, and breakout candle body ratio — into grades A, B, and C. Grade A signals highlight in the accent color.
5. A retest engine. Broken lines are not deleted; they turn into gray watch lines for a configurable window. A return to the broken line with a rejecting close prints the Retest signal — the classic polarity flip, automated.
6. Silence by default, depth on demand. Signals print as single letters — B for breakout, R for retest — with the full context (direction, grade, volume, penetration) in the hover tooltip. Two noise filters ship enabled: breaks of unconfirmed lines retire silently, and breakouts below a minimum grade stay off the chart and out of the alerts.
7. Automatic channel detection. When an active support line and resistance line run parallel within a slope tolerance, the engine fills the channel between them and reports it on the dashboard.
8. A live architecture dashboard. Active support and resistance counts, the nearest line with its distance in Average True Range units, a trend read derived from confirmed line slopes, the last break grade, the retest watch count, and channel status — in a compact, fully themeable panel.
🔶 HOW IT WORKS
Line construction: Confirmed swing pivots anchor every candidate line. Each new pivot is paired with the previous same-side pivot, the segment is checked for historical violations, duplicates are rejected, and side capacity is enforced before the line is created.
Touch validation: A touch counts only when the wick enters the tolerance band around the line and the close still respects it. Touches accumulate on the line's tag; the confirming touch promotes the line and, from that point, validated touches are marked with dots.
Breakouts: A close through the line beyond the buffer triggers the break. Confirmed lines produce graded signals; forming lines retire silently when the default filter is on. The broken line converts to a gray dashed watch line.
Retests: Within the watch window, a return to the broken line with a rejecting close prints R — upward reclaim of broken resistance, or downward rejection at broken support. Watch lines that see no retest expire quietly.
Channels: Active opposite-side lines are compared by slope; the closest parallel pair within tolerance is filled as a channel.
Non-repainting: Pivots require confirmation, and all touches, promotions, breaks, and retests are evaluated on closed bars only. Once printed, nothing moves.
Chart hygiene: Completed lines, touch dots, and signals are all capped by input, keeping the chart clean and the auto-scale anchored to current price.
🔶 HOW TO USE IT
1. Works on any market — cryptocurrency, forex, gold, indices, stocks, futures — and any timeframe. Raise the pivot length for larger structures.
2. Trust the visual hierarchy: dotted lines are candidates, solid lines with ×N tags are market-validated, gray dashed lines are broken and on retest watch.
3. Treat B signals as regime information: grade A breakouts with volume and penetration carry far more weight than the minimum-grade ones, and the grade is one hover away.
4. The R signal is the classic entry location: the broken line has flipped roles and price has confirmed the flip. Stops belong on the far side of the retested line.
5. Use the dashboard's Nearest row to know how far price is from the closest active line in Average True Range units before it gets there.
6. If you want the raw, unfiltered feed, disable the two noise filters in Signals — the engine detects everything either way.
🔶 SETTINGS
- Detection: pivot length, maximum anchor span, active lines per side, line expiry, completed lines to keep.
- Touches, breaks and retests: touch tolerance, touches to confirm, breakout buffer, retest watch window.
- Signals: breakout and retest toggles, confirmed-lines-only filter, minimum breakout grade.
- Channel detection with slope similarity tolerance.
- Full color customization, extension length, touch dots toggle.
- Themeable dashboard: position, four text sizes, title band, background, frame, grid, and three text colors.
🔶 ALERTS
- Trendline Confirmed — a line collected its confirming touch.
- Bullish / Bearish Trendline Breakout — a qualified close through a line, honoring the grade filter.
- Bullish / Bearish Retest Confirmed — a broken line was retested and rejected.
- Parallel Channel Detected — an active support and resistance pair is running as a channel.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Anchors are confirmed pivots and every touch, break, and retest is evaluated at bar close. Pivot confirmation introduces intentional lag equal to the pivot length.
Why do I see so few lines? By design. Between geometric validation, duplicate rejection, side caps, and expiry, only lines with genuine market respect survive. Raise the per-side cap or lower the confirmation count for a busier chart.
What do B and R mean? B is a graded breakout and R is a confirmed retest of the broken line. Hover either label for direction, grade, volume, and penetration details.
Why did a breakout print no signal? Either the line was still unconfirmed while the confirmed-only filter is on, or the break graded below your minimum. The line still changed state; only the signal was filtered.
What makes a grade A breakout? Elevated volume, deep penetration beyond the line in Average True Range terms, and a strong-bodied breakout candle — all three together.
🔶 CREDITS
Trendline analysis, breakout trading, and the break-and-retest pattern are classical charting techniques in the public domain, refined by generations of technicians. This script gratefully acknowledges that shared lineage. The geometric validity engine, touch-earned lifecycle, breakout grading model, retest watch engine, channel detection, noise-filtering architecture, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Trendlines are geometry, not guarantees: valid lines break and graded breakouts fail. Pivot confirmation delays anchor recognition by design. Volume grading is less meaningful on symbols with unreliable volume reporting. Channel detection reports the closest parallel pair, not every possible channel. No indicator replaces independent analysis.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past behavior of any trendline, breakout, or retest does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently.
Indicator

High Volume Pivot Support & Resistance Zones [BigBeluga]High Volume Pivot Support & Resistance Zones is a market-structure indicator built for PulseWire. It helps traders find key support and resistance levels by looking for major pivot points backed by institutional volume.
Instead of drawing simple unweighted lines, this tool tracks the volume of swing highs and lows. When a high-volume pivot is found, the script creates a dynamic zone box on your chart and fits a live Cumulative Volume Delta (CVD) trendline inside it. This lets you monitor real-time buying and selling pressure exactly where the market is most likely to reverse.
🔵 MAIN ENGINE & VOLUME ZONE LOGIC
1. Volume-Validated Pivots
Swing Isolation Fields: The tool uses customizable lookback settings ( Resistance/Support Pivot Length ) to find prominent structural swing highs and lows.
Institutional Volume Filters: Every new swing point is checked against a volume baseline ( Volume MA Length ). A zone is only plotted if the pivot bar's volume beats the baseline multiplier ( Volume Threshold Multiplier ), filtering out weak retail moves.
2. Embedded Zone CVD Lines
Intra-Box Order Flow Tracking: The script counts the volume delta (buying volume minus selling volume based on candle closes) from the exact bar the pivot formed.
Normalized Inside the Box: Using custom polylines, the script scales and plots the rolling CVD trend directly inside the height of the zone box. This lets you see order-flow accumulation without cluttering your screen with bottom dashboard panels.
Live Labels: A small text readout updates on the leading edge of the box, showing the current net CVD volume.
// Normalize and scale running CVD values perfectly inside the zone box coordinates
normalizeDeltaToBox(float currentDelta, float minDelta, float maxDelta, float boxBottom, float boxTop) =>
float rangeDelta = maxDelta - minDelta
float rangeBox = boxTop - boxBottom
rangeDelta == 0 ? boxBottom + rangeBox / 2 : boxBottom + (currentDelta - minDelta) / rangeDelta * rangeBox
🔵 DYNAMIC ZONE FLIPS & SIGNALS
1. Support and Resistance Flips
Automatic Re-Coloring: When a strong candle close breaks entirely through a zone, the script changes its role. Broken resistance boxes switch to your Support Zone Color (yellow), and broken support boxes turn into your Resistance Zone Color (blue).
Border Style Changes: The box outline instantly switches from a solid line to a dashed line the moment a zone is breached, flagging a clear shift in institutional liquidity.
2. Retest and Breakout Plots
Breakout Arrows: The system prints clean triangle up or down arrows ( ▲ or ▼ ) on your chart labeled "Res Breakout" or "Sup Breakdown" the exact bar a zone boundary fails.
Proximity Retest Shapes: It plots tiny circle markers when price pulls back to successfully test a normal support/resistance hold. If price tests a broken zone that has reversed roles, it prints a diamond marker to flag an advanced flipped S/R retest.
// Zone Breakout and Role Inversion Logic snippet
if close > rTop
box.set_bgcolor(lastResBox, color.new(supColor, 90))
box.set_border_color(lastResBox, supLine)
box.set_text_color(lastResBox, supLine)
box.set_border_style(lastResBox, line.style_dotted)
if not resBroken
triggerResBreak := true
resBroken := true
🔵 TRADING STRATEGIES & RISK
CVD Absorption Entries: When price rallies up into a blue resistance box, check the internal dotted CVD line.
If price pushes high into the box but the internal CVD trend slopes down, sellers are absorbing the buy orders. This sets up a high-probability short entry.
Flipped Support Re-Entries: When a bullish breakout triggers a "Res Breakout" arrow, wait for price to pull back to the top border of the broken box. A clean bounce marked by a diamond shape confirms the old resistance has flipped to support, offering a safe continuation trade.
Clear Risk Invalidation floors: You can use the exact borders of the generated boxes to place your stop loss. If you buy a support hold retest, your clear risk invalidation point sits right below the bottom line of that specific support box.
🔵 SETTINGS & CONFIGURATION
Pivot Geometry Controls: Easily fine-tune lookback lengths and volume multipliers to adapt the indicator for volatile crypto assets, indexes, or liquid forex pairs.
Visual Zone Overrides: Adjust background colors, transparency levels, and text label sizing to match your dark or light charting interface seamlessly.
Clean up your layout and trade with volume-weighted precision using the High Volume Pivot Support & Resistance Zones terminal. Indicator

Sweep Retest ReversalTitle: Sweep Retest Reversal
Description:
This indicator detects a two-candle liquidity sweep reversal pattern and tracks the resulting retest level until it is either confirmed with a bounce or invalidated.
BULLISH SETUP:
A bearish candle (body >= X% of its range, configurable) is followed by a bullish candle (same body filter) whose low sweeps below the bearish candle's low, and whose close finishes above the bearish candle's open. When this occurs, a horizontal line is drawn at the swept low. That level remains active and is monitored on every subsequent bar:
- If a future candle's low touches the line and that same candle closes above it, the bounce is confirmed (green "Bounce" label) and the line is removed.
- If a future candle's low touches the line but closes at or below it, the setup is invalidated on that same bar and the line is removed without a label.
BEARISH SETUP (mirror logic):
A bullish candle is followed by a bearish candle whose high sweeps above the bullish candle's high, and whose close finishes below the bullish candle's open. A horizontal line is drawn at the swept high and monitored the same way:
- A future candle's high touching the line with a close below it confirms the bounce (red "Bounce" label).
- A touch with a close at or above the line invalidates the setup silently.
HOW TO INTERPRET IT:
The two-candle sequence represents a liquidity sweep: the first candle establishes a level, and the second candle pierces through it with its wick while closing back on the opposite side of the first candle's open. This signals that stops resting beyond that level were likely triggered and absorbed, leaving the swept point as a level worth watching again. The line marks that exact point. Price is expected to return to it at some later time. What happens on that return matters more than the touch itself: a wick that pokes through but a close that snaps back in the sweep's original direction supports the reversal thesis (confirmed bounce). A close that pushes through and stays there suggests the level failed to hold and the setup should be discarded (invalidation).
HOW TO USE IT:
1. Wait for the pattern to print: an orange triangle (bullish) or purple triangle (bearish) marks the bar where the sweep candle closed.
2. Once a line appears, treat it as an active level to watch — do not act on it yet, since it has not been retested.
3. When price returns to the line, watch how that specific candle closes:
- Bullish line + candle closes above it -> bounce confirmed, label appears. This is the point of interest for a potential long reaction.
- Bearish line + candle closes below it -> bounce confirmed, label appears. This is the point of interest for a potential short reaction.
- Any touch that closes on the wrong side invalidates the line immediately and it disappears with no label — that level is no longer relevant.
4. The indicator only flags the level and its resolution; it does not place entries, stops, or targets. Combine the confirmed bounce with your own entry, stop, and target rules (e.g. your existing Fibonacci stop-liquidity zone and 1:2 management) for actual trade execution.
5. Adjust the Min Body/Range Ratio input to control how strict the "big body" filter is — lower values surface more setups (including weaker ones), higher values restrict it to cleaner, more decisive sweep candles.
INPUTS:
- Min Body/Range Ratio (%): minimum body-to-range percentage required for both candles in the pattern (default 50%).
- Bullish/Bearish Retest Line Color: line color for each setup type.
- Bullish/Bearish Bounce Label Color: label color for each confirmed bounce.
- Show Bullish Pattern / Show Bearish Pattern: toggle each setup independently.
VISUAL MARKERS:
- Orange upward triangle below the bar: bullish pattern detected.
- Purple downward triangle above the bar: bearish pattern detected.
- Green "Bounce" label: confirmed bullish bounce.
- Red "Bounce" label: confirmed bearish bounce.
NOTES:
Each retest line resolves on the first touch - either confirming or invalidating immediately on that bar, never lingering across multiple touches. This keeps the chart clean and ensures every line on the chart represents a level that is still actively awaited. Indicator

Retest & Break Setup [LuxAlgo]The Retest & Break Setup indicator identifies and tracks price action structures where price breaks a pivot level, retests it multiple times, and subsequently breaks out to confirm the trend.
🔶 USAGE
The indicator identifies "Retest & Break" patterns by monitoring pivot levels (Pivot Highs for bullish setups and Pivot Lows for bearish setups). A setup begins when a pivot is broken by price. The script then tracks whether price returns to "retest" this broken level as support or resistance.
A setup is considered "completed" once the required number of retests is met and price breaks out past the newly formed extreme established during the retest phase. For bullish setups, this means price must close above the highest high reached during the retest period. For bearish setups, price must close below the lowest low reached during the retest period.
A completed bullish setup suggests that price is likely to continue moving higher, while a bearish setup suggests a move lower. The logic behind this is often linked to liquidity; as price retests a level multiple times without breaking back through, liquidity (such as stop-loss orders) builds up just beyond the retest extremes.
When price finally breaches these levels, this concentrated liquidity can act as fuel, accelerating the breakout and confirming the new trend direction.
🔹 Parameters and Setup Sensitivity
The behavior of the indicator is highly dependent on four primary settings:
Length: Determines the significance of the initial pivot. A higher value identifies major swing points, while a lower value identifies minor intraday levels.
Required Consecutive Retests (K): Specifies how many times price must touch the broken level without breaking back through it. Increasing this value requires more confirmation before a setup is considered valid.
Max Bars between Retests (P): Controls the "tightness" of the retest phase. If price takes too long to return for a retest, the setup is invalidated.
Max Bars for Break (N): Defines the window of opportunity for the final breakout. After the required retests are met, price must break the recent extreme (high for bullish, low for bearish) within this many bars.
🔹 Finding Long-Term vs. Short-Term Setups
For users looking for longer-term, more significant setups, it is recommended to increase the Length (e.g., 10-20) and the Max Bars parameters ( N and P ) to allow for the slower price development typical of higher timeframes or major trend shifts.
Conversely, for scalping or fast-moving markets, lower values for Length and P will highlight quick "touch-and-go" patterns.
🔶 DETAILS
The indicator includes a comprehensive dashboard to help users evaluate the historical reliability of the identified structures on the current chart and timeframe.
🔹 Dashboard Metrics
Total: This counts the number of setups that successfully completed the initial break and all required K retests. It represents the "Potential" setups that reached the final stage.
Completion: This tracks how many of the "Total" setups actually achieved a confirmed breakout past the retest extreme within the N bars limit.
Win Rate: This is a predictive performance metric. For every "Completed" setup, the script records the price at the moment of breakout. After N bars have passed since that breakout, it checks if price is still above (bullish) or below (bearish) the breakout level.
🔹 Visualization
The script uses dashed lines to represent the broken pivot level being retested. Solid lines represent the "trigger" level (the extreme of the retest phase). When a setup is completed, a shaded box appears, and a "Break" label is plotted. If "Only Show Complete Setups" is disabled, invalidated setups will remain on the chart in a faded gray color for study.
🔶 SETTINGS
Length: The lookback period used to detect Pivot Highs and Lows.
Max Bars for Break (N): The maximum time allowed for price to break out after the final retest.
Max Bars between Retests (P): The maximum time allowed between the initial break and the first retest, or between subsequent retests.
Required Consecutive Retests (K): The number of successful retests required to validate the zone.
Only Show Complete Setups: When enabled, removes setups from the chart that failed to meet the retest or breakout criteria.
Setup Colors: Customizable colors for bullish, bearish, and invalidated patterns.
Dashboard Settings: Options to toggle the dashboard visibility, change its position on the chart, and adjust its size.
Indicator

Impulse Memory Engine [JOAT]Impulse Memory Engine is an open-source Pine Script v6 overlay that measures fresh displacement, stores directional memory with exponential decay, and displays adaptive retest rails after significant impulse bars. It is built to answer a simple question: is the most recent meaningful impulse still fresh enough to matter?
The script blends MAD-style distance, ATR, trend basis, and decay memory. This creates a visual layer that distinguishes fresh impulse, fading impulse, and reset conditions while keeping the chart clean.
Core Concepts
1. MAD and ATR Normalized Displacement
The script estimates a robust distance unit using median absolute deviation and ATR. The impulse score is the one-bar displacement divided by this unit.
medianSource = ta.median(sourceInput, madLengthInput)
madDistance = ta.median(math.abs(sourceInput - medianSource), madLengthInput)
unitDistance = math.max(atrValue * 0.35, madDistance * 1.4826)
impulseRaw = safeRatio(sourceInput - sourceInput , unitDistance)
2. Trend Basis and Fast Track
A slower EMA defines the trend basis while a faster EMA tracks near-term movement. The distance between them contributes to the heat score.
3. Freshness Decay
When a bullish or bearish impulse appears, the script measures bars since that impulse and applies exponential decay. Fresh impulses have more weight; older impulses fade naturally.
bullBars = ta.barssince(bullImpulse)
bearBars = ta.barssince(bearImpulse)
bullFresh = na(bullBars) ? 0.0 : math.exp(-bullBars / decayLengthInput)
bearFresh = na(bearBars) ? 0.0 : math.exp(-bearBars / decayLengthInput)
memorySigned = bullFresh - bearFresh
4. Adaptive Bands
The trend band widens when memory strength increases. This helps separate quiet reset states from active impulse regimes.
5. Retest Rails
After a fresh impulse, the script stores a rail near the impulse bar. A confirmed retest occurs when price revisits the rail while memory remains directionally active.
Features
Impulse score: Measures displacement relative to MAD and ATR distance
Memory decay model: Tracks whether the last strong impulse is fresh or fading
Adaptive trend cloud: EMA basis and fast track are filled by memory state
Dynamic bands: Band width expands with volatility and impulse memory
Retest rails: Bull and bear rails remain visible for a configurable window
Rail labels: Active bull and bear rails are labeled at the right edge with spacing protection when both rails are close
Confirmed buy/sell labels: Compact BUY and SELL labels mark fresh impulse continuation or rail retest continuation on confirmed bars
Heat candles: Optional candle coloring by impulse and memory strength
Dashboard: Top-right panel shows impulse, memory, state, and rail status
Alerts: Fresh impulse, rail retest, confirmed buy, and confirmed sell conditions
Input Parameters
Source: Price source used for calculations
Trend Length: Slow EMA basis length
Fast Track Length: Faster EMA used inside the cloud
MAD Length: Median distance length
ATR Length: ATR distance length
Band Multiplier: Scales adaptive bands
Impulse Threshold: Minimum normalized displacement for a fresh impulse
Memory Half Window: Controls decay speed
Rail Visibility: Bars a rail remains eligible for retests
Heat Candles: Enables candle coloring
Dashboard: Shows or hides the top-right dashboard
Rail Labels: Shows active bull and bear rail labels
Buy/Sell Signals: Shows confirmed continuation signal labels
Palette: Selects the local JOAT color preset
Dashboard: Shows the panel
Palette: Selects color pair
How to Use This Indicator
Step 1: Read the Memory State
The dashboard state shows whether the script is tracking bull memory, bear memory, or resetting.
Step 2: Watch Fresh Impulse Events
Fresh impulse alerts show that displacement exceeded the configured threshold in the direction of the trend basis.
Step 3: Use Retest Rails
Rails act as reference levels after impulse. A retest is most meaningful when the dashboard memory state still agrees with the rail direction.
Indicator Limitations
Impulse detection is sensitive to the selected source and threshold
Very low volatility can make normalized movement appear larger
A rail retest is contextual and does not define risk by itself
The memory model fades old impulses; it does not predict the next impulse
Originality Statement
Impulse Memory Engine is original in its use of robust distance normalization, exponential impulse decay, adaptive bands, and retest rails in one compact overlay. It is built with original Pine v6 logic and public mathematical functions.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Impulse readings can fail during choppy markets or sudden volatility shifts. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Indicator

Kalman Auction Ribbon [JOAT]Kalman Auction Ribbon is an open-source Pine Script v6 overlay that builds a six-layer adaptive ribbon from a zero-lag source and Kalman-style velocity smoothing. The goal is to show trend alignment, slope strength, deviation zones, and confirmed retest behavior in one restrained chart layer.
The script focuses on auction behavior around a dynamic ribbon. When the ribbon layers align and slope together, the state becomes directional. When price stretches beyond the deviation envelope and then returns, the script can mark supply or demand zones for later retests.
Core Concepts
1. Zero-Lag Source
The source is adjusted by comparing current price with a half-length historical value. This produces a more responsive input for the ribbon calculations.
zeroLagOffset = math.max(1, int(math.round(baseLength * 0.50)))
zeroLagSource = src + (src - nz(src , src))
2. Kalman-Style Velocity Estimate
Each ribbon layer uses a compact velocity smoother that maintains an estimate and speed component. The speed term helps the estimate respond to directional movement without relying on future bars.
prior = na(estimate ) ? value : estimate + nz(speed ) * gain
error = value - prior
speed := nz(speed ) * (1.0 - alpha * 0.50) + error * alpha * gain
estimate := prior + error * alpha
3. Six-Layer Ribbon Alignment
The script calculates six different ribbon lengths. Alignment and slope scores are combined into a trend score from -100 to +100. This score controls the ribbon color and dashboard power reading.
4. Deviation Zones
Upper and lower deviation levels are built around the ribbon midpoint using ATR. If price pushes beyond a deviation level and closes back inside, the script creates a compact supply or demand zone.
5. Retest Logic
Retest signals occur when price interacts with a live zone or the ribbon itself while the ribbon state remains directional. These signals are confirmed on closed bars.
Features
Six-layer adaptive ribbon: Multiple Kalman-style layers reveal alignment and spread
Velocity weighting: Gain input changes how aggressively the smoother responds
Deviation envelope: ATR-based upper and lower zones around the ribbon midpoint
Soft supply and demand boxes: Created only on confirmed deviation rejection behavior, with overlap suppression so the chart does not stack redundant boxes
Labeled deviation boxes: Supply and Demand Deviation boxes include midpoint guide lines and fade after invalidation
Confirmed buy/sell markers: Compact BUY and SELL dots appear only after confirmed ribbon or zone retest behavior
Trend-state candles: Optional bar coloring by ribbon state
Dashboard: Shows state, power, distance, and retest status
Alerts: Confirmed buy, confirmed sell, lower deviation zone, and upper deviation zone
Input Parameters
Core:
Source: Price source used by the ribbon
Base Length: Main length from which all ribbon layers are derived
Velocity Weight: Strength of the speed component
Deviation ATR Length: ATR length for deviation zones
Deviation Width: ATR multiplier for the envelope
Zones:
Show Deviation Zones: Toggles supply and demand boxes
Zone Extension Bars: How far active boxes extend to the right
Maximum Zones Per Side: Caps active supply and demand boxes
Signals:
Show Confirmed Buy/Sell: Toggles compact confirmed signal dots
Signal Spacing Bars: Minimum spacing between signal markers
Zone Extension Bars: Forward box extension length
Maximum Zones Per Side: Object cap for zone storage
Visual:
Palette: Selects the color pair
Show Ribbon: Toggles ribbon plots and fill
Trend-State Candles: Enables candle coloring
Dashboard: Shows the top-right panel
How to Use This Indicator
Step 1: Read Ribbon Alignment
A strongly stacked ribbon with a high dashboard power value indicates directional alignment. A mixed ribbon shows a less decisive state.
Step 2: Watch Deviation Zones
Zones are created when price rejects beyond an ATR deviation envelope. These boxes represent areas where price stretched away from the ribbon and returned.
Step 3: Use Retests With Context
Retest dots identify confirmed interactions with the ribbon or zones. They should be evaluated with trend state, market structure, and risk placement.
Indicator Limitations
Kalman-style smoothing is reactive and does not know future price direction
Strong news bars can move through deviation zones without meaningful retests
Object limits require older zones to be removed when the maximum is exceeded
The ribbon can compress during range conditions and produce mixed readings
Originality Statement
Kalman Auction Ribbon is original in its combination of zero-lag preprocessing, six independent Kalman-style layers, ATR deviation boxes, and confirmed retest tracking. It uses public Pine primitives in a custom structure and does not paste or disguise another author's source.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Ribbon states and zones can fail during unusual volatility or thin liquidity. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Indicator

Gravity Trend Levels [BOSWaves]Gravity Trend Levels - Acceleration-Derived Gravity Modeling with Adaptive Cloud Trail and Fail Level Projection
Overview
Gravity Trend Levels is a momentum acceleration-based trend system that models directional gravity through the normalized rate of change of an EMA-derived velocity measurement, where cloud thickness, trail distance, and trend state are continuously adapted based on whether gravitational pull is building, sustained, or decaying rather than through fixed volatility multipliers or static band thresholds.
Instead of relying on conventional moving average crossovers or ATR-scaled bands that treat all market conditions identically, trend state and cloud positioning are determined by measuring price acceleration relative to MAD-normalized volatility, converting that acceleration into a gravity score that decays exponentially when momentum diminishes and drives adaptive band interpolation between configurable tight and wide trail distances.
This creates a trend framework where the cloud reflects genuine momentum dynamics rather than arbitrary indicator levels. The cloud tightens and hugs price during high gravity periods when acceleration is strong and directional pull is confirmed, expands during gravity decay when momentum is weakening, and generates gravity fail levels at the precise price points where trend state changed, marking the exact locations where prior gravitational force collapsed and direction reversed.
Price is therefore evaluated against a cloud that continuously updates its distance from price based on measured acceleration dynamics, producing a trail that reflects the actual pull state of the current trend rather than applying a uniform band regardless of momentum conditions.
Conceptual Framework
Gravity Trend Levels is founded on the principle that trend confidence should be measured through the acceleration characteristics of price momentum rather than through price position relative to fixed indicators, and that the distance between price and its trailing cloud boundary should dynamically reflect whether momentum is actively pulling price in the trend direction or losing gravitational force.
Traditional trend-following tools apply consistent band distances regardless of whether momentum is surging or stalling, producing identical visual representations for high-conviction and deteriorating trend conditions. This framework replaces uniform band geometry with an acceleration-driven gravity model where band distance shrinks under strong gravitational pull and expands as gravity decays, communicating trend health through cloud behavior rather than requiring separate momentum indicators for context.
Three core principles guide the design:
Gravitational pull should be derived from normalized price acceleration rather than from price position alone, ensuring that cloud behavior reflects actual momentum intensity rather than the mere direction of a smoothed average.
Cloud thickness and trail distance should adapt continuously to the measured pull state, contracting during strong gravity and expanding during decay to provide a visual representation of trend conviction at all times.
Gravity fail levels should be projected from the precise price points where trend state changed, marking the locations where gravitational force reversed as permanent structural references for future price interaction.
This shifts trend analysis from static band monitoring into continuous gravitational force measurement where cloud dynamics communicate momentum state and fail levels preserve the structural evidence of prior gravity collapses.
Theoretical Foundation
The indicator combines EMA-based trend baseline construction, MAD volatility measurement, velocity and acceleration derivation from baseline rate of change, gravity scoring with exponential decay, and adaptive trail interpolation that maps pull strength to band distance.
The trend baseline is calculated as an EMA of close over the configured length, providing a smoothed directional reference. Velocity measures the change in baseline over the gravity lookback period, and acceleration measures the bar-to-bar change in velocity. Acceleration is normalized by MAD to produce a dimensionless score that reflects momentum change intensity relative to current volatility. When normalized acceleration exceeds the minimum threshold, gravity is set proportionally to the acceleration reading and capped at a maximum value. When acceleration falls below the threshold, gravity decays multiplicatively by the configured decay rate each bar. Pull converts gravity to a normalized 0-1 range that drives trail multiplier interpolation between the minimum tight distance and the maximum wide distance.
Four internal systems operate in tandem:
Gravity Detection Engine : Derives velocity from EMA baseline change over the gravity lookback, calculates acceleration as the bar-to-bar velocity change, normalizes against MAD, and updates the gravity state either by setting it proportional to current acceleration or applying exponential decay when acceleration subsides.
Adaptive Trail Construction : Converts gravity to a normalized pull value and interpolates the trail multiplier between the configured minimum and maximum settings, scaling MAD to produce upper and lower band distances from the baseline that tighten with strong pull and widen with decay.
Gravity Cloud System : Constructs a one-sided cloud positioned below price in uptrends and above price in downtrends, with cloud thickness scaling proportionally to current pull strength through a separate MAD-scaled thickness calculation that produces a visually dynamic pull indicator.
Gravity Fail Level Engine : On each trend state switch, projects a horizontal line from the flip bar's low for bullish flips and high for bearish flips, extending forward for the configured projection length to mark the price level where prior gravitational force collapsed and direction changed.
This design allows the cloud and trail to respond continuously to gravity dynamics while fail levels accumulate as a historical record of structural gravity collapses.
How It Works
Gravity Trend Levels evaluates price through a sequence of acceleration-aware and gravity-driven processes:
Baseline Calculation : EMA smoothing of close over the configured trend length produces the directional reference from which velocity and acceleration are derived.
MAD Volatility Measurement : Mean Absolute Deviation over the configured length provides the adaptive volatility unit that normalizes acceleration and scales all band and cloud distances.
Velocity Derivation : The difference between the current baseline and the baseline a configurable number of bars ago provides the velocity reading that captures the rate of directional change in the smoothed trend.
Acceleration Calculation : The bar-to-bar change in velocity produces the acceleration reading, which captures whether directional momentum is intensifying or diminishing.
Gravity State Update : Normalized acceleration above the minimum threshold sets gravity proportionally to the acceleration magnitude scaled by eight and capped at two. Below the threshold, gravity decays by multiplying by the configured decay rate each bar.
Pull Normalization : Gravity is divided by 1.5 and capped at one to produce a normalized pull value that maps the full gravity range to a 0-1 scale for trail interpolation.
Trail Multiplier Interpolation : The pull value interpolates between the maximum trail distance at zero pull and the minimum trail distance at full pull, producing a continuously adapting multiplier that scales MAD into upper and lower band distances.
Trend State Logic : Price crossing above the upper band triggers bullish state. Price crossing below the lower band triggers bearish state. State persists until the opposing band is breached.
Cloud Construction : The active cloud positions at the lower band in uptrends and upper band in downtrends, with an inner boundary offset by a pull-scaled thickness producing a two-edge cloud whose depth visually reflects current gravitational pull.
Gravity Fail Level Projection : On each trend switch, a horizontal line is projected from the flip bar at the bar's low for bullish flips and high for bearish flips, extending forward for the configured projection length as a structural fail reference.
Retest Diamond Detection : After the configured signal buffer period from the most recent flip, price touching the cloud inner edge triggers a retest diamond marker with a configurable minimum bar cooldown between consecutive signals on the same side.
Together, these elements form a continuously updating gravity-driven trend system where cloud dynamics reveal pull strength, fail levels mark structural collapse points, and retest diamonds identify price interactions with the inner cloud boundary throughout the trend.
Interpretation
Gravity Trend Levels should be interpreted as a momentum-gravity conviction system with dynamically adaptive cloud geometry and structural fail level mapping:
Bullish Trend State (Green) : Established when price closes above the upper adaptive band, with the gravity cloud positioned below price reflecting the upward gravitational pull state.
Bearish Trend State (Red) : Established when price closes below the lower adaptive band, with the gravity cloud positioned above price reflecting the downward gravitational pull state.
Gravity Cloud : The one-sided filled zone between the outer and inner cloud boundaries reflects current pull strength through its thickness. A thick cloud indicates strong gravitational pull with high trend conviction. A thin cloud indicates gravity decay and diminishing directional force.
Cloud Outer Edge : The primary structural boundary of the gravity cloud, positioned at the active adaptive band and colored fully in the trend direction, representing the outer limit of the gravitational field.
Cloud Inner Edge : The pull-scaled inner boundary of the cloud, representing the nearer edge of the gravitational zone and the threshold for retest diamond detection.
Gravity Fail Levels : Horizontal lines projected from trend flip bars at the flip bar's low for bullish flips and high for bearish flips, marking the exact price level where prior gravitational force collapsed. These levels persist as structural references for the configured projection length.
𝑩 Buy Signals : Green labels appearing below the bar when trend state switches from bearish to bullish, marking the gravity flip bar where upward pull has been established.
𝑺 Sell Signals : Red labels appearing above the bar when trend state switches from bullish to bearish, marking the gravity flip bar where downward pull has been established.
✦ Retest Diamonds : Small star diamonds plotted below bars during bullish retests and above bars during bearish retests when price touches the cloud inner edge after the signal buffer period, identifying interactions with the gravitational boundary during the trend.
Colored Candles : Optional bar coloring reflects current trend state direction, providing continuous directional context independent of cloud proximity or signal generation. Note: The original chart candles must be disabled in chart settings for the trend-colored candles to display properly.
Cloud thickness dynamics, fail level locations, and retest diamond positioning collectively provide more information than trend direction alone.
Signal Logic & Visual Cues
Gravity Trend Levels presents two primary trend transition signals alongside continuous cloud retest monitoring:
Buy Signal (𝑩) : Green label appears when trend state switches from bearish to bullish via upper band crossover, indicating gravitational pull has reversed to the upside and a fail level is projected from the flip bar's low.
Sell Signal (𝑺) : Red label appears when trend state switches from bullish to bearish via lower band crossunder, indicating gravitational pull has reversed to the downside and a fail level is projected from the flip bar's high.
Retest diamond detection provides continuous secondary monitoring, marking price touches of the cloud inner edge throughout the established trend after the signal buffer period with per-side cooldown enforcement.
Alert generation covers bullish and bearish gravity trend flips and any retest diamond occurrence for systematic monitoring workflows.
Strategy Integration
Gravity Trend Levels fits within momentum-informed and adaptive trend-following approaches:
Gravity Flip Entries : Use trend state switches as primary entry triggers where gravitational acceleration has driven price through the adaptive band, entering in the flip direction with the projected fail level providing an immediate structural reference for invalidation.
Cloud Thickness Conviction Reading : Monitor cloud thickness as a real-time gravity strength gauge. A thick, prominent cloud indicates strong active pull supporting the trend. A thin, contracting cloud warns of gravitational decay and warrants reduced confidence in trend continuation.
Fail Level Framework : Use gravity fail levels as structural references for subsequent price interaction, monitoring whether price respects or violates the level where prior gravity collapsed to assess the structural significance of the most recent trend change.
Retest Diamond Re-entry : Treat cloud inner edge retests after the signal buffer period as potential continuation opportunities within the established trend, using the diamond signal as a lower-risk re-entry reference relative to the initial flip signal.
Cloud Proximity Risk Management : Use the outer cloud edge as a dynamic trailing reference for position management, maintaining directional bias while price remains beyond the cloud and reassessing when price approaches or enters the gravitational zone.
Multi-Timeframe Gravity Alignment : Apply higher-timeframe gravity trend state as a directional bias filter, engaging with lower-timeframe flip signals only when they align with the established higher-timeframe gravitational direction.
Technical Implementation Details
Core Engine : EMA baseline with MAD volatility measurement for adaptive scaling
Gravity Model : Velocity from baseline rate of change, acceleration from velocity change, MAD normalization, proportional gravity setting with exponential decay
Adaptive Trail : Pull-normalized interpolation between configurable minimum and maximum MAD multipliers
Cloud Construction : One-sided pull-scaled thickness fill between outer and inner boundaries with EMA smoothing on both edges
Fail Levels : Flip-triggered horizontal line projection from bar extreme at configurable length and width
Retest System : Inner cloud edge proximity detection with signal buffer and per-side cooldown enforcement
Visualization : Gravity cloud fill, fail level lines, trend flip labels, retest diamond markers, and optional trend candle coloring
Performance Profile : Optimized for real-time execution across all timeframes with stateful gravity variable maintaining continuous decay between acceleration events
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday gravity tracking for scalping with shorter trend length and gravity lookback for faster acceleration detection and responsive cloud behavior
15 - 60 min : Session-level trend identification with balanced gravity decay and moderate trail settings for reliable intraday directional framing
4H - Daily : Swing-level gravity trend mapping with longer trend length and higher decay rate for sustained gravitational pull persistence across multi-session moves
Suggested Baseline Configuration:
Trend Length : 14
Gravity Lookback : 19
Gravity Decay : 0.96
MAD Length : 24
Trail Min (Strong Pull) : 1.0
Trail Max (Weak Pull) : 1.0
Show Gravity Cloud : Enabled
Show Gravity Fail Levels : Enabled
Show Buy/Sell Signals : Enabled
Retest Diamonds : Enabled
Color Bars : Enabled (requires disabling original chart candles in chart settings)
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's momentum characteristics, volatility behavior, and preferred signal frequency, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Cloud too wide throughout : Decrease Trail Max to reduce band distance during low gravity periods, bringing the cloud closer to price during momentum decay phases.
Cloud too tight throughout : Increase Trail Max to allow greater band expansion during gravity decay, producing a more visually prominent cloud separation during low-conviction conditions.
Gravity builds too slowly : Decrease Gravity Lookback toward 5 for a shorter velocity measurement window that captures acceleration shifts more rapidly, producing faster gravity activation on momentum changes.
Gravity activates too frequently : Increase Gravity Lookback to smooth the velocity measurement across more bars, requiring more sustained directional change before acceleration registers as gravitational pull.
Gravity decays too quickly : Increase Gravity Decay toward 0.99 to sustain gravitational pull longer between acceleration events, maintaining cloud contraction for more bars after acceleration subsides.
Gravity lingers too long : Decrease Gravity Decay toward 0.80 for faster pull dissipation, allowing the cloud to expand more quickly when momentum weakens and reducing lag between gravity collapse and visual cloud response.
Too many retest diamonds : Increase Retest Cooldown to enforce greater bar separation between consecutive diamond markers, or increase Signal Buffer Period to delay retest detection further from each flip event.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear momentum phases where gravitational acceleration builds and sustains across multiple bars, producing thick, persistent clouds that visually confirm directional pull throughout the move
Instruments with consistent volatility behavior where MAD normalization accurately calibrates acceleration significance and cloud distance across varying market conditions
Momentum continuation strategies where cloud retest diamonds identify lower-risk re-entry points within established gravity trends after the initial flip signal
Structural reference frameworks where gravity fail levels provide meaningful historical markers at the exact price points where prior directional momentum collapsed
Reduced Effectiveness:
Choppy, low-momentum markets where acceleration readings oscillate without sustained directional pull, producing frequent gravity flips and thin clouds that fail to establish meaningful directional framing
Extremely volatile environments where individual bar acceleration spikes generate momentary gravity readings that decay before producing sustained cloud contraction or reliable trend state persistence
News-driven or gap-heavy instruments where instantaneous momentum changes trigger gravity activation and immediate flip signals without the gradual acceleration buildup the model is designed to detect
Consolidation and sideways conditions where velocity and acceleration remain near zero, preventing meaningful gravity generation and causing the cloud to remain in its expanded low-pull state without directional conviction
Mean-reversion dominant markets where band crossovers trigger frequent state changes that repeatedly project fail levels without the subsequent directional follow-through that validates their structural significance
Integration Guidelines
Confluence : Combine with BOSWaves order flow tools, volume analysis, or structural indicators to validate gravity flip signals with participation context before committing to directional positions
Cloud Thickness Monitoring : Track cloud thickness evolution throughout the trend as an ongoing gravity health assessment. Consistently thick clouds support continuation confidence while progressive thinning signals approaching decay and warrants defensive position management.
Fail Level Awareness : Monitor price behavior when it returns to prior gravity fail levels. These levels mark the exact prices where directional force previously collapsed, making them structurally meaningful references for future support, resistance, or reversal reactions.
Decay Anticipation : Use cloud thinning as an early warning of approaching gravity decay before a formal flip signal is generated. Thinning during an extended trend suggests acceleration is subsiding and the probability of a state change is increasing.
State Discipline : Maintain directional bias aligned with current gravity trend state until a confirmed band crossover flip occurs. Cloud retests and fail level interactions within an established trend do not constitute state changes and should be interpreted as continuation context rather than reversal signals.
Disclaimer
Gravity Trend Levels is a professional-grade momentum acceleration and trend conviction analysis tool. It uses acceleration-derived gravity modeling with adaptive cloud construction and structural fail level projection but does not predict future price movements. Results depend on market conditions, instrument momentum characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, volume analysis, and comprehensive risk management. Indicator

Swing Volume Structure [JOAT] Swing Volume Structure
Introduction
Swing Volume Structure is an open-source market structure indicator focused on confirmed pivots, volume-backed breakouts, sweeps, retests, and compression. It is designed to keep structure analysis clean by confirming pivots with right-side bars and confirming actionable states on bar close.
The script helps traders distinguish ordinary swing movement from structure breaks that occur with volume expansion or sweep behavior.
Core Concepts
1. Confirmed Pivot Structure
Pivot highs and lows are confirmed using configurable left and right bars. Once confirmed, pivots are classified into structural context such as higher high, higher low, lower high, or lower low.
2. Volume Confirmation
Breakout states are scored using volume relative to a moving average. Expansion volume strengthens breakout quality, while quiet volume can mark compression.
3. Sweep and Reclaim Behavior
The script detects when price probes beyond a prior swing and then reclaims or rejects the level. This helps separate liquidity sweeps from clean breakouts.
4. Retest Logic
After a structural break, retest behavior can support continuation when price returns to the broken area and holds.
5. Entry and Exit Rails
Confirmed breakout or sweep states can draw entry, stop, TP1, and TP2 references using ATR and structure.
Features
Confirmed HH/HL/LH/LL structure: Pivots are classified after confirmation.
Volume-backed breakouts: Break quality is strengthened by relative volume expansion.
Sweep reclaim/reject states: Identifies failed breaks beyond prior swing levels.
Inside compression detection: Detects quiet, compressed conditions.
Supply/demand zones: Optional zones around important swing areas.
Entry/exit rails: Optional risk references for accepted states.
Candle tinting: Bars can reflect current structure state.
HUD: Shows state, bias, pivot class, volume, nearest support/resistance, score, and bar counts.
Alerts: Long breakout, short breakout, bullish sweep, bearish sweep, inside compression, and volume expansion.
Input Parameters
Structure: Pivot Left, Pivot Right, ATR Length, Zone ATR Thickness, Zone Extension Bars.
Volume and Signals: Volume Average Length, Expansion Multiplier, Quiet Compression Threshold, Minimum Breakout Score, State Cooldown Bars.
Risk and Visuals: Stop ATR Buffer, TP1 R, TP2 R, Rail Projection Bars, Tint Candles by State, Connect Confirmed Swings, Show Supply/Demand Zones, Pivot Labels, Active Support/Resistance, Structure HUD.
How to Use This Indicator
Step 1: Read structure bias
Use the HUD and swing context to identify whether structure is improving, deteriorating, or balanced.
Step 2: Separate breakouts from sweeps
A breakout shows acceptance beyond structure. A sweep shows a probe and rejection or reclaim. These are different conditions.
Step 3: Check volume
Volume expansion can increase the importance of a break. Quiet volume can identify compression or lower-conviction movement.
Indicator Limitations
Pivots confirm only after the configured right bars complete.
Volume confirmation depends on the quality of the symbol's volume feed.
Supply/demand zones are approximations around swing areas, not exact order book data.
Breakout and sweep states can fail during high-volatility reversals.
Originality Statement
Swing Volume Structure is original in how it combines confirmed pivot classification, volume expansion scoring, sweep/reclaim logic, retests, compression states, optional zones, candle states, and ATR risk rails into a single structure tool.
Disclaimer
This script is provided for educational and informational purposes only. It is not financial advice or a trade recommendation. Structure signals are based on historical candles and can fail. Use proper risk management.
Made with passion by jackofalltrades
Indicator

Volume-Weighted S/R Zones [WillyAlgoTrader]📊 Volume-Weighted S/R Zones is an overlay indicator that automatically detects support and resistance zones from price pivots, scores them by volume and price reaction, tracks breaks and retests, and instantly places a full risk-management plan on the chart with a stop-loss and three take-profits. No manual lines — everything is calculated and drawn automatically.
The core idea: not all levels are equal. A level where price reversed on heavy volume and ran far from it is dozens of times more valuable than a level formed on thin volume with no reaction. The indicator assigns each zone a Strength Score from 0 to 100 , combining volume at the pivot bar, price reaction strength, and touch count — and displays only the zones that actually work.
The indicator is completely free and open-source . Works on any instrument (crypto, forex, stocks, futures, indices) and any timeframe.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A classic pivot indicator draws lines on every local high and low — the chart turns into a mess of dozens of levels, and it's impossible to tell which ones matter. Volume profiles show where heavy trading happened, but don't tie that to specific reversal levels. Pure Price Action gives the right zones, but requires manual markup.
This indicator solves all three problems with one integrated pipeline:
Pivot Detection → Volume Score + Reaction Score → ATR clustering of nearby pivots → Strength Score 0..100 → Age Decay → Break Detection (with filters) → Retest Detection → Zone-Aware SL/TP → Trade Statistics
Each step adds something the previous one cannot. Pivot Detection finds raw reversal points. Volume Score answers the question "was there heavy trading here". Reaction Score answers "did price bounce off the level". ATR clustering merges pivots into a single zone if they sit within N×ATR — giving zone width instead of a thin line. Age Decay gradually reduces the weight of old zones. Break/Retest turn zones into trade signals. Zone-Aware SL places the stop behind the broken zone instead of at an abstract ATR distance. Trade Stats show whether your settings actually work on your instrument.
Remove any component and the system breaks: pivots without scoring are noise, scoring without clustering produces dozens of thin lines, clustering without break/retest gives no signals, signals without zone-aware SL get stopped out on noise.
🔍 WHAT MAKES THIS INDICATOR ORIGINAL
1️⃣ Strength Score 0..100 — three-component zone quality measurement.
Each zone receives a strength score by the formula:
Score = VolScore + ReactionScore + 10 (base bonus), then clamp(0, 100)
Where:
— VolScore (0..40) : computed as min(40, volumeRatio × 20) , where volumeRatio = volume on the pivot bar / average volume over N bars (default 20). On instruments without volume (some forex pairs) a base value of 20 is assigned.
— ReactionScore (0..30) : measured as min(30, max_move / ATR × 10) , where max_move is the maximum price movement AWAY from the pivot in the first N bars after it (default 5). Computed against ATR at the pivot bar, not current ATR — this is the correct normalization.
When the same zone is touched again (a new pivot within ATR × MergeDistance radius, default 0.5), zones merge, the touch counter grows, and a bonus of min(20, √touches × 4) × 0.5 is added to the score. This means: 4 touches give +4, 9 touches +6, 16 touches +8. Logarithmic growth to avoid over-weighting.
Zones are divided into 4 tiers by score: ★ (weak, 0-30), ★★ (medium, 30-60), ★★★ (strong, 60-85), 🔥 (very strong, 85+) . The tier is shown directly on the zone label and affects box transparency — stronger zones are more visually prominent.
2️⃣ Age Decay — old zones lose strength gradually, not abruptly.
Each bar the zone score is reduced by ageDecayRate × 0.1 . By default (0.5) that's −0.05 per bar, so a zone loses about 25 points over 500 bars. This gives an honest forgetting mechanism: a level from last week matters, but not as much as a level from last hour. Can be disabled (set to 0) or made aggressive (1.0 = −0.10 per bar).
Additionally zones are removed by three conditions: age exceeds Max Zone Age (default 30 Days, measured independently of timeframe), score drops below MIN_VIABLE_SCORE = 5.0 , or zone is broken and more than 2×ReactionWindow bars have passed since the break (nobody will retest a stale broken zone).
3️⃣ Break Detection with a dual-volume filter (floor + cap).
The standard "break volume ≥ N×average" filter is easily bypassed by news spikes and gaps. Solution:
— Volume Floor : volume ≥ avg × VolMult (default 1.3) — filters thin-volume breakouts.
— Volume Cap (optional) : volume ≤ avg × VolCap (default 5.0) — filters abnormally large candles (opening gaps, news spikes). Especially important on stocks.
Additionally: Momentum Filter requires the break candle's range to be ≥ N×ATR (default 1.0). This filters "doji breaks" where the candle body barely crossed the level.
4️⃣ Retest Detection with reaction validation.
After a break, the indicator waits for a retest within a Min..Max bars window (default 2..30). A retest counts only if:
— Price touched the broken zone (low ≤ zoneTop for a bullish break)
— Price closed back in trend direction (close > zoneTop)
— Reaction from the zone ≥ ATR × ReactionMin (default 0.5×ATR)
Optionally enable Mitigation Filter , which skips a retest if the zone was already tested once — for traders who only want the first retest.
5️⃣ Zone-Aware Stop-Loss — stops behind real structure, not in thin air.
With Zone-Aware SL enabled, the stop is placed not just at ATR×Mult distance, but by formula:
— For long: SL = max(close − ATR×SLMult, zoneBot − ATR×0.2)
— For short: SL = min(close + ATR×SLMult, zoneTop + ATR×0.2)
The LESS aggressive stop is chosen: either the standard ATR stop, or "behind the zone with a 0.2×ATR buffer". Logic: if the zone is broken, it became resistance (for longs) or support (for shorts). If price returns back INTO the zone — the breakout idea is invalidated, you should exit. This gives a clear exit criterion and usually a wider but more meaningful stop.
6️⃣ Risk presets and three take-profits with partial scaling.
Four ready-made risk presets:
— Conservative : SL 2.5×ATR, TP 1R / 2R / 4R
— Balanced (default): SL 1.5×ATR, TP 1R / 2R / 3R
— Aggressive : SL 1.0×ATR, TP 1.5R / 2.5R / 4R
— Scalping : SL 0.8×ATR, TP 0.8R / 1.5R / 2R
— Custom : configure manually
The model assumes splitting the position into three equal parts: 1/3 on TP1, 1/3 on TP2, 1/3 on TP3. When a TP is touched, the line turns solid cyan with a ✓ checkmark.
7️⃣ Break-Even Trail — after TP1 the stop automatically moves to entry.
With Break-Even After TP1 enabled, on first touch of TP1 the SL is pulled to the entry price. Only TP2 and TP3 remain in play — but the risk is now zero. If price reverses, the trade closes at break-even instead of the original stop. Classic "protect profit, let winners run" model.
Implemented carefully: BE activates only after a confirmed TP1 touch (with no SL break on the same bar), and on the same bar TP1 + SL is always resolved as a stop (conservative model — real brokers don't guarantee limit fills before stops on the same wick).
8️⃣ Session Trade Statistics — tracking real effectiveness.
The dashboard tracks stats right on the chart:
— Trades : total closed trades
— W/L : wins vs losses
— Win Rate : % of wins. A WIN = TP1 reached . This is a deliberate classification: if the idea worked and TP1 closed — that's a success, even if TP2/TP3 didn't fill and exited at BE.
— BE saves : diagnostic counter. How many wins closed via BE-stop rather than TP3. High BE saves ratio → TP3 is set too far.
— Avg R : average R-multiple per trade. Calculated assuming partial scaling (1/3 at each TP).
Stats reset on any settings change (including a dedicated Reset Stats Counter input made specifically for manual resets).
9️⃣ Fully adaptive theme and WCAG-contrast colors.
All colors are calculated for both PulseWire themes (Dark/Light) with WCAG AA contrast verification (4.5:1 minimum). Label text on tinted backgrounds is chosen so it remains readable on both themes. Auto-detection by chart background color, or manual Dark/Light selection in settings.
🔟 TF-independent zone aging.
Max Zone Age can be set in Bars / Hours / Days . This means "30 Days" is always 30 calendar days regardless of timeframe (on 5m it's 8640 bars, on 1h — 720, on 1D — 30). Legacy indicators use bars only, which makes them break when you switch TFs — fixed here.
🧠 HOW IT WORKS — step-by-step calculation flow
Step 1 — Pivot Detection: on each bar, ta.pivothigh and ta.pivotlow are checked with equal left/right lookback (default 21). A pivot is confirmed only after N bars pass — so the indicator does NOT repaint already-drawn zones.
Step 2 — Volume Score: for a confirmed pivot, VolScore is computed against the volume on the pivot bar itself (not the current bar).
Step 3 — Reaction Score: the maximum price movement AWAY from the pivot is measured over the next N bars. ATR at the pivot bar is used for correct normalization.
Step 4 — Merge or Create: if there's already a same-type zone within ATR × MergeDistance — the pivot merges into it (zone widens, score updates, touch counter increments). Otherwise a new zone is created with boundaries ±0.15×ATR from the pivot price.
Step 5 — Age Decay & Cleanup: a reverse pass over the zone array applies decay, removes too-old, too-weak, and stale broken zones. If active zones exceed Max Active Zones — the weakest is removed.
Step 6 — Break Detection: on every confirmed bar, every unbroken zone is checked for a break. Volume Floor, Volume Cap, and Momentum Filter are applied if enabled.
Step 7 — Retest Detection: after a break, a retest with confirmed reaction is searched for in the Min..Max bars window.
Step 8 — Risk Management: on a signal (Break or Retest), with risk management enabled, a virtual position opens with SL and three TPs calculated.
Step 9 — Trade Lifecycle: on each bar, SL/TP touches are checked. TP1 → BE activates. SL or TP3 → position closes, stats update.
Step 10 — Visual & Alerts: zone boxes, SL/TP lines, BRK/RT markers, dashboard — all refresh on the last bar. Alerts fire on bar close.
📖 HOW TO USE — EVEN IF YOU'RE NEW
🎯 Quick start (3 minutes):
1. Add the indicator to your chart (any instrument, any timeframe).
2. Wait 30–50 bars — the indicator needs history for calculations. Zones will appear after that.
3. Look at the dashboard in the top-right corner — it shows current trend, active signal, and position state.
4. Don't change settings on day one. Work with defaults to understand how the indicator "breathes" on your instrument.
5. When you see a BRK or RT signal — look at the horizontal SL/TP1/TP2/TP3 lines. That's your trade plan.
👁️ Reading the chart:
— 🟢 Green box = support zone (Demand). Price approaches from below.
— 🔴 Red box = resistance zone (Supply). Price approaches from above.
— Box transparency = zone strength. The more opaque, the stronger.
— Icon on the label : ★ weak, ★★ medium, ★★★ strong, 🔥 very strong.
— ×N on label = number of zone touches.
— ✕ on label = zone already broken (you can hunt for a retest).
— BRK green below bar = resistance broken upward.
— BRK red above bar = support broken downward.
— RT = confirmed retest of broken level.
— Dotted blue line = entry price of the active trade.
— Solid red line = stop-loss. When it becomes dimmed + ENTRY label says "→ SL (BE)" — stop has moved to break-even.
— Dashed green lines = TP1, TP2, TP3. When they turn solid cyan with ✓ — that TP is reached.
📊 Dashboard (top-right by default):
— Trend : Bullish / Bearish / Neutral. Calculated as weighted difference of zone strength above vs below price.
— Signal : current status (BREAK ▲, RETEST ▼, Long Active, Wait, etc.).
— Score : strength of active signal or strongest zone.
— Zones : number of active zones on chart.
— TF : timeframe.
— SL / TP1 / TP2 / TP3 : risk management prices for the active trade.
— R:R : risk/reward ratio to TP1.
— Risk : % of price you risk to the stop.
— Trades / W/L / Win Rate / BE saves / Avg R : session stats.
🔧 Tuning — what to change and when:
— Too many zones, chart cluttered: raise Min Score to Display to 30–40. Raise Zone Merge Distance to 0.7–1.0.
— Too few zones: lower Pivot Lookback to 10–15. Lower Min Score to 0–10.
— Scalping 1m–5m: use Scalping preset, Pivot Lookback 5–8, ATR Length 10.
— Swing 1h–4h: Balanced preset, Pivot Lookback 21 (default), Max Zone Age 30 Days.
— Position trading 1D: Conservative preset, Pivot Lookback 10–15, Max Zone Age 90 Days.
— False breakouts eat your account: enable Volume Filter for Breaks + Momentum Filter.
— Trading stocks/indices with gaps: keep Volume Cap on (it's on by default).
— Want only the first retest: enable Mitigation Filter for Retests.
— Frequently closing at BE without profit: check BE saves in dashboard. If >50% of wins — TP3 is too far, shorten it.
💡 Trading ideas:
— Most reliable setup: retest of a strong zone (★★★ or 🔥) in the dashboard trend direction .
— Don't trade against the strongest zone (🔥) in your path — wait for it to break first.
— A zone touch without confirmed reaction is NOT a signal. The indicator filters this for you, but don't try to "guess" the bounce in advance.
— Use Trade Stats as feedback. If after 50 trades Win Rate < 40% and Avg R < 0 — change settings or timeframe.
⚙️ KEY SETTINGS
⚙️ Main Settings:
— Pivot Lookback (default 21): how many bars on each side must be lower/higher for a pivot
— Max Active Zones (default 8): max number of active zones on chart
— Zone Merge Distance (default 0.5×ATR): merge radius for nearby pivots
— Min Score to Display (default 15): hide zones weaker than this
📦 Zone Detection:
— ATR Length (default 14): ATR period for all calculations
— Volume Avg Lookback (default 20): average volume window
— Reaction Window (default 5): bars to measure reaction after a pivot
— Age Decay Rate (default 0.5): zone aging speed
— Max Zone Age (default 30 Days): maximum zone age
— Max Zone Age Unit (Bars / Hours / Days)
🔍 Filters (optional):
— Volume Filter for Breaks (default off): require volume ≥ N×average on break
— Volume Multiplier (default 1.3)
— Volume Cap (default on, 5.0): filter abnormal spikes
— Momentum Filter (default off): require candle range ≥ N×ATR
— Mitigation Filter (default off): first retest only
🎯 Signals:
— Show Break Signals / Show Retest Signals
— Min/Max Bars for Retest (default 2 / 30)
— Min Retest Reaction (default 0.5×ATR)
🛡️ Risk Management:
— Enable Risk Management (default on)
— Risk Preset (Conservative / Balanced / Aggressive / Scalping / Custom)
— SL ×ATR , TP1/TP2/TP3 ×Risk (for Custom)
— Zone-Aware SL (default on): place stop behind the zone
— Break-Even After TP1 (default on)
— Show SL/TP Lines / Labels
— Show % Distance on Labels
— Entry/SL/TP Line Style (Solid / Dashed / Dotted)
🎨 Visual:
— Theme (Auto / Dark / Light)
— Show Zones / Score Labels / Watermark
— Zone Forward Bars (default 5): how many bars to project zones forward
— SL/TP Label Font Size , Signal Marker Size
📊 Dashboard:
— Show Dashboard , Position
— Show Trade Stats (W/L, Win Rate, Avg R, BE saves)
— Reset Stats Counter : changing the value resets stats
🔔 ALERTS
— 🟢 BREAK UP — resistance broken upward, with price, score, SL, and three TPs
— 🔴 BREAK DOWN — support broken downward
— 🟢 RETEST LONG — confirmed long retest
— 🔴 RETEST SHORT — confirmed short retest
— 🎯 TP1 / TP2 / TP3 HIT — target reached (optional)
— 🛑 SL HIT / 🛡️ BE STOP-OUT — stop-loss hit or break-even close
— 🛡️ BREAK-EVEN ACTIVATED — stop moved to entry
All alerts available in two formats: plain text (readable for Telegram/Discord) and JSON (for webhook automation). Fire on bar close (alert.freq_once_per_bar_close) — no intra-bar flooding.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals use barstate.isconfirmed. Pivots are confirmed with equal left/right lookback — meaning the pivot point is always N bars in the past. This is delayed confirmation, not repainting of future values. Zones don't move after they appear.
— 📐 Zones are built from confirmed pivots. This means a zone appears on the chart N (Pivot Lookback) bars after the extreme formed. On the most recent 21 bars to the right there will be no zones — this is normal and correct.
— ⚖️ On instruments without volume (some forex pairs, some indices) VolScore defaults to 20 out of 40. Zone quality scoring is lower than on crypto/stocks with real volume.
— 🛠️ This is an analysis tool, not an automated bot. The indicator finds zones, marks signals, and proposes a structured trade plan — but entry decisions are YOURS. Past performance does not guarantee future results.
— 📊 Trade Stats counts virtual trades based on indicator signals, without slippage, commissions, or real liquidity. Use as a reference, not as a promise of results.
— 🌐 Universal compatibility: works on any ticker and timeframe. On tick/Renko charts, Hours/Days options for Max Zone Age automatically fall back to 500 bars.
— 💯 Completely free, open-source. Study the code, fork it, modify it for yourself.
If you found this indicator useful — leave a 🚀 and follow the author profile to see updates and new publications. Questions and feedback welcome in the comments. Indicator

Helios Volatility Atlas [JOAT]Helios Volatility Atlas
Introduction
Helios Volatility Atlas is an open-source regime and volatility mapping indicator. It combines an adaptive baseline, DMI/ADX trend strength, volatility scoring, VWAP sigma bands, premium/discount structure, squeeze detection, retest zones, right-side level rails, and a top-right dashboard.
The problem Helios addresses is market context. A trend signal means something different in compression than it does during expansion. A retest means something different near discount than it does at an outer volatility channel. Helios brings those layers into one chart so users can interpret price action with regime, volatility, and location in view.
Core Concepts
1. Adaptive Baseline
The baseline blends an EMA-style trend component with an efficiency-ratio adaptive component. When price moves efficiently, the adaptive side reacts more. During choppy movement, the baseline becomes slower and more stable.
2. Volatility Score
ATR is compared against its own moving average and standard deviation. The result is normalized into a 0-100 volatility score so the dashboard can distinguish low, moderate, and high volatility states.
3. Institutional Channels
Helios draws a channel around a mean using ATR-based distances. Inner channels describe normal volatility, while outer pockets mark more extended price areas where reversion or continuation context may matter.
4. Squeeze and Expansion State
The squeeze model compares a Bollinger-style width against a Keltner-style width. When compression releases, the chart highlights a transition from low-energy conditions into expansion.
5. Retest Zones and Rails
Confirmed retests can create projected zones. Right-side rails label important live references such as baseline, VWAP, channels, premium/discount levels, and previous day levels.
Features
Adaptive baseline: Blends trend-following and efficiency-aware smoothing
Volatility score: Converts ATR expansion/compression into a dashboard value
Trend cloud: Fills the space between baseline and VWAP
VWAP sigma bands: Shows price stretch around VWAP
Premium/discount map: Uses a rolling anchor range with equilibrium, discount, and premium levels
Squeeze detection: Highlights compression and release states
Retest zones: Projects confirmed bullish and bearish retest areas
Right-side rails: Labels baseline, VWAP, channels, premium/discount, and day levels
Theme presets: Includes Helios, Consensus Aqua, Sentinel Neon, and Cobalt Risk color families
Top-right dashboard: Shows regime, bias, volatility, squeeze, channel, VWAP sigma, price state, and key levels
Input Parameters
Core Engine:
Adaptive Baseline Length
Efficiency Lookback
ATR Length
ADX / DMI Length
Volatility Window
Volatility System:
Channel Memory
Base Channel ATR Multiple
Outer Channel ATR Multiple
Squeeze Length
Squeeze BB and KC multipliers
Display:
Show Trend Cloud
Show VWAP Sigma Bands
Show Retest Zones
Show Right-Side Level Rails
Theme Preset
Dashboard Text Size
How to Use This Indicator
Step 1: Read the regime
The dashboard classifies the current state as bullish, bearish, expansion, or range.
Step 2: Check volatility
Use the volatility score and squeeze row to decide whether the market is compressed or expanding.
Step 3: Compare price to VWAP and channels
VWAP sigma and ATR channels show whether price is near value, stretched, or reverting from an outer area.
Step 4: Use retest zones as context
Retest zones mark recent confirmed reactions. They are contextual levels, not automatic entries.
Indicator Limitations
Adaptive baselines can lag during sudden reversals
Squeeze release does not define direction by itself
Retest zones can fail in strong momentum conditions
Higher volatility symbols may require adjusted ATR/channel settings
Originality Statement
Helios Volatility Atlas combines adaptive trend state, DMI/ADX confirmation, ATR volatility scoring, VWAP sigma distance, squeeze detection, premium/discount location, projected retest zones, and right-edge rails into a single open-source Pine v6 regime atlas. The components are designed to work as one context engine, not as a loose mashup.
Disclaimer
This script is for educational and informational use only. It is not financial advice and does not predict future price direction. Use independent analysis and risk management.
-Made with passion by jackofalltrades
Indicator

Breakout and Retest Signals - FloAlgoThis indicator detects breakout and retest signals by identifying key pivot zones and validating price rejection through wick sweeps and volume analysis.
How It Works
The script operates in three stages:
Pivot Zone Detection — Identifies swing highs and lows, then constructs zones anchored to the candle body and wick that formed the pivot. Demand zones span from body top down to wick low; supply zones span from wick high down to body bottom.
Rejection Validation — Confirms a valid signal when price sweeps beyond the zone extreme (wick tip) and closes back through the zone body, indicating institutional liquidity capture.
Volume Confirmation — Uses lower timeframe volume delta and buy/sell ratio to validate signal strength, filtering weak rejections with insufficient conviction.
Key Advantages
No Repaint — Single-period pivot detection ensures signals fire on confirmed historical bars, eliminating repaint delay between alert and visual.
Fixed Width Zones — Zones do not grow indefinitely; they are drawn with fixed horizontal width and trimmed only on signal, keeping charts clean.
Range-Based Overlap Guard — Demand and supply zones cannot overlap; range-based checking prevents conflicting zones from occupying the same price area.
Professional Visuals — No text labels or arrow clutter; only shaded zones and volume ratio splits for clean, professional appearance.
Accurate Zone Geometry — Zones anchored to actual candle body and wick formations, not flat ATR bands.
Auto-Cleanup — Zones are automatically removed one bar after signal or on expiry, preventing chart clutter.
Seconds Chart Support — Volume timeframe input guarded to prevent errors on sub-minute charts.
No Signal Conflicts — Removed confirmation divisor that caused opposing signals on the same bar.
Zone Lifecycle
Unlike traditional indicators that grow zones indefinitely, this script uses a fixed-width approach:
Zones are drawn from the pivot candle to a fixed future bar (born + maxLife)
Upon signal, the zone right edge is trimmed to the signal bar
The zone remains visible for one bar after the signal, then is automatically removed
Expired zones without signals are cleanly purged to prevent chart clutter
Visual Elements
Shaded boxes marking demand (green) and supply (red) pivot zones
Volume ratio split boxes within zones showing buy/sell pressure balance
Dashed target projection lines from signal bars
Zone borders fade and thin out after signal confirmation
Key Settings
Swing Length — Sensitivity of pivot high/low detection
Max Bars Active — Fixed horizontal width of zones in bars
Min Bars Between — Minimum bars between consecutive signals
Max Zones Per Side — Maximum active zones per direction
Volume TF — Frame for volume delta analysis
Show Ratio Split — Display buy/sell volume ratio inside zones
Show TP Line — Display target projection lines
Indicator

Smooths IB MapSmooths IB Map — Initial Balance Probability Engine
Overview
Smooths IB Map is an Initial Balance indicator built around a statistical probability engine rather than simple level plotting. The Initial Balance (IB) is the price range established during the first hour of the regular trading session (9:30–10:30 ET by default). This range has long been used by institutional and retail traders as a reference for the day's expected price behavior — price frequently sweeps one or both IB extremes before reversing or continuing. This indicator quantifies that tendency and makes it actionable.
What makes this different
1 — Timeframe-independent data collection. Most IB indicators compute statistics directly from chart bars. This means the sample size — and therefore the probabilities — change depending on which timeframe the chart is set to. A 1-minute chart may only hold 16 days of history while a 15-minute chart holds 240, producing completely different numbers from the same lookback setting. This indicator solves that problem by anchoring all data collection inside request.security("5") — a fixed 5-minute reference feed. Probabilities are identical on any chart timeframe.
2 — Exponential decay weighted probability. A raw historical average gives equal weight to a sweep that happened 200 days ago and one that happened last week. This indicator applies exponential decay (factor 0.85 per day of age) so that recent sessions contribute proportionally more to the probability estimate. When market regime shifts, the indicator adapts faster than a simple percentage would.
3 — Range-conditional probability. Every historical IB day is classified as SMALL (<70% of the historical average range), NORMAL (70–130%), or LARGE (>130%). The indicator then computes the IBH and IBL sweep rate specifically for days that match today's size bucket. If today's IB is unusually tight, the conditional column in the table shows the sweep rate from similar tight-range days only — a more relevant reference than the overall average.
4 — First-break direction tracking. The table shows what percentage of historical days saw the IBH break first vs the IBL break first vs both sweeping on the same bar. Over a large enough sample this can reveal directional tendencies for specific instruments and sessions.
5 — Failed retest signal. After a level is swept, price often pulls back to retest it from the other side. If the retesting candle closes back on the swept side (confirming rejection), the level has flipped from resistance to support or vice versa. The indicator detects this condition and plots a colored circle directly on the wick of the confirming bar — one signal per level per day, first confirmed retest only.
How to use it
Add the indicator to any intraday chart (1m through 60m). Set your IB Open and IB Close times to match your instrument's session. Set the Data Cutoff to the time after which you do not want sweeps counted — for US equities, 16:00 ET is appropriate. Increase the Lookback Days to the maximum your plan supports (the tooltip explains approximate limits by plan). The probability labels display inside the IB box as a percentage — green indicates a historically high sweep rate (≥65%), red indicates low (≤35%), and white is neutral. The third column of the data table shows the conditional probability for today's IB size bucket. A teal circle on a bar's low signals a bullish failed retest of the IBH. A red circle on a bar's high signals a bearish failed retest of the IBL. All four alert conditions (IB formed, IBH swept, IBL swept, failed retest) are available for notification.
Notes
Designed and built for MNQ/NQ futures but compatible with any intraday instrument. A minimum of 5 completed historical sessions is required before probability values are shown. Statistics are always computed from completed days only — the current in-progress session is excluded. The failed retest signal requires the sweep to have been established on at least one prior bar before it can trigger, preventing false fires on the original sweep candle itself. Indicator

Breakout Participation Gate [AGPro Series]Breakout Participation Gate
🧠 Core Idea
Does the breakout have enough participation and structure to deserve attention?
📌 Overview / What it does
Breakout Participation Gate is a breakout validation tool built to separate structured breakouts from weak breaks and fakeout-prone moves.
The script builds upper and lower breakout gate levels from recent structure, evaluates breakout candle quality, checks relative volume, body commitment, close location, trend context, retest behavior, expansion potential, and fakeout risk.
It does not predict price direction, automate trades, or claim that a gate-open event must continue. It is a structured visualization and decision-support tool for breakout participation review.
🎯 Purpose & Design Philosophy
Breakouts are among the most searched and most misunderstood market events.
Many tools mark every move above resistance or below support.
This script was built to ask a stricter question:
Did the breakout pass the participation gate?
The design goal is to help traders avoid treating every structural break as equally meaningful.
⚡ Why This Script Is Different
Most breakout tools focus on the break itself.
This script does NOT mark every breakout as valid.
Instead, it checks whether the breakout had enough relative volume, body commitment, close location, range expansion, trend context, and retest behavior. It also keeps the active gate visible so users can watch whether the breakout holds, expands, or fails back inside the structure.
⚙️ Methodology
1. Context Detection
The script identifies recent upper and lower gate levels using a structure lookback.
2. Breakout Qualification
When price closes beyond a gate, the script scores participation through volume, candle body, close location, range expansion, and trend context.
3. Gate Classification
High-quality breakouts can become GATE OPEN events. Lower-quality breaks can be classified as WEAK BREAK.
4. Retest Evaluation
After a gate opens, the script projects a retest shelf and watches whether price defends the shelf.
5. Fakeout and Expansion Review
The script tracks whether price closes back inside the gate shelf or expands beyond the active gate with acceptable participation.
6. Visual Output
The chart displays breakout gate lines, retest shelf, event labels, right-side tags, alerts, and a compact AG Pro panel.
🗺️ How to Read the Chart
Upper Gate = recent upper structure level that price must break to start an upside gate evaluation.
Lower Gate = recent lower structure level that price must break to start a downside gate evaluation.
Breakout Retest Shelf = the active zone around the gate where retest behavior is evaluated.
GATE OPEN = breakout passed the participation gate.
WEAK BREAK = price broke the gate but participation quality was not strong enough.
RETEST HOLD = price defended the active retest shelf after the breakout.
FAKEOUT RISK = price closed back inside the gate shelf after the breakout.
EXPANSION READY = price expanded beyond the gate while participation remained acceptable.
Panel = summarizes gate status, quality score, direction, relative volume, body commitment, retest health, fakeout risk, and next context.
🚦 Signals & States
• GATE OPEN → breakout passed the participation gate.
• WEAK BREAK → price broke structure but did not show enough participation quality.
• GATE WATCH → active gate is being monitored after a breakout.
• RETEST HOLD → active retest shelf was defended.
• FAKEOUT RISK → price closed back through the gate shelf.
• EXPANSION READY → price expanded beyond the gate with acceptable participation.
• WAIT BREAKOUT → no active gate has been triggered.
🔔 Alerts Logic
Alerts trigger when a major breakout-gate state appears.
• Breakout Gate Open → breakout passed the participation gate.
• Weak Breakout → price broke a gate level without enough participation quality.
• Breakout Retest Hold → active retest shelf was defended.
• Breakout Fakeout Risk → price closed back inside the gate shelf after the breakout.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The context becomes stronger when:
• Price closes beyond a defined structure gate
• Relative volume is above normal
• Candle body commitment is strong
• Close location supports the breakout direction
• Range expands versus ATR
• The breakout direction agrees with trend context
• Retest behavior respects the active gate shelf
When these elements do not align, the script avoids treating the breakout as automatically valid.
📊 When to Use
• Breakout validation
• Failed breakout review
• Retest planning
• Trend continuation review
• Crypto, stocks, futures, forex, and liquid markets
• 15m, 30m, 1H, 4H, and 1D charts
⚠️ When NOT to Use
• Very low-liquidity assets
• Extremely noisy micro timeframes
• Symbols with unreliable volume
• News-driven spikes where structure can be distorted
• Markets where every wick break is being over-interpreted
• Situations where a single breakout label is expected to act as a guaranteed signal
🎛️ Key Inputs
• Gate Structure Lookback → defines the recent structure window used for upper and lower gates.
• Breakout Close Buffer ATR → controls how far beyond the gate price must close.
• Minimum Breakout Relative Volume → defines how much participation is required for strong volume credit.
• Minimum Body Commitment % → controls how much candle body participation is required.
• Gate Quality Threshold → separates gate-open breakouts from weak breaks.
• Retest Evaluation Window → defines how long the active gate shelf remains under review.
• Retest Shelf Width ATR → controls the thickness of the retest shelf around the active gate.
• Expansion Ready Distance ATR → defines when a breakout has expanded far enough to be monitored as continuation-ready.
• Event Label Mode → Premium focuses on higher-quality gate states. Detailed allows more weak-break labels.
🖥️ Interface & Visual Design
The visual hierarchy is built around the gate:
Gate lines define the structure.
The retest shelf shows where the breakout should hold.
Event labels mark gate-open, weak-break, retest-hold, fakeout-risk, and expansion-ready states.
Right-side tags keep the active gate context visible.
The AG Pro panel compresses the current breakout context into a fast, readable summary.
🧪 Practical Usage Workflow
1. Read the panel gate status.
2. Check whether price has broken the upper or lower gate.
3. Compare quality score with the event label.
4. Watch the active retest shelf.
5. Check whether price holds, expands, or fails back inside the gate.
6. Confirm with broader market structure, liquidity, volume, and risk planning.
🔍 Interpretation Guidelines
A gate-open label does not guarantee continuation.
A weak-break label does not guarantee reversal.
A retest-hold label means the active shelf was defended according to the script's rules.
A fakeout-risk label means the breakout structure weakened.
The script is best used as a breakout-quality layer, not as a standalone trading system.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an auto-trading system.
It does not provide guaranteed entry or exit signals.
It is not a simple support/resistance breakout marker.
⚠️ Limitations & Transparency
Breakout quality depends on market structure and liquidity.
Volume behavior can differ across crypto, futures, stocks, and forex.
Choppy ranges can create repeated weak-break and fakeout states.
Different timeframes may show different gate behavior.
Highly volatile news events can distort breakout quality.
🧠 Market Context Notes
Breakouts are strongest when structure, candle commitment, participation, and retest behavior align.
The first break is only one part of the story.
The active gate shelf helps users watch whether the market accepts the breakout after the first impulse.
🧾 Use Case Examples
If price closes above the upper gate with strong participation, the script may mark GATE OPEN.
If price breaks a gate but quality is weak, the script may mark WEAK BREAK.
If price returns to the active shelf and defends it, the script may mark RETEST HOLD.
If price closes back through the shelf, the script may mark FAKEOUT RISK.
🧱 System Philosophy
The goal is not to chase every breakout.
The goal is to filter breakout attention.
This script treats breakout quality as a sequence:
structure break → participation gate → retest shelf → expansion or failure.
🔐 Non-Promise Statement
No breakout label guarantees continuation.
No weak-break label guarantees reversal.
No retest label guarantees a successful trend move.
All outputs should be interpreted as analytical context.
📉 Risk Disclosure
Trading involves risk.
This script is for educational and analytical purposes only.
It does not provide financial advice, investment advice, or guaranteed trading outcomes.
Users are fully responsible for their own decisions, risk management, and trade execution.
📚 Educational Note
Use the script to study which breakouts attract real participation and which breaks fail to hold their gate.
The most useful question is not only whether price broke structure.
The better question is whether the breakout deserved attention after the break.
Indicator

Strategy

Bastion Ledger [JOAT]Bastion Ledger
Introduction
Bastion Ledger is an open-source liquidity and structure overlay designed to track active demand and supply zones through a full lifecycle model. The script builds zones from confirmed pivots and volume impulse events, then tracks how price interacts with those zones over time through active, swept, broken, retested, and archived states.
The problem Bastion Ledger solves is zone ambiguity. Many support and resistance tools simply draw a level and leave interpretation to the user. Bastion Ledger adds structure to that process by classifying how each zone was created and what has happened to it since. This makes the chart easier to read and gives the user a cleaner framework for identifying whether liquidity has held, been swept, failed, or transitioned into a retest state.
Core Concepts
1. Confirmed Pivot Structure
Zones created from pivots only appear after pivot confirmation. This introduces natural delay by design, but it prevents the script from creating forward-looking structure that disappears later.
2. Volume-Impulse Zone Creation
The script can also create zones from candles that exhibit high relative volume and efficient directional body behavior. This allows the overlay to capture not only swing structure but also displacement-origin areas.
3. Zone Lifecycle Model
Each zone progresses through a clear state model:
ACTIVE
SWEEPED
BROKEN
RETESTED
ARCHIVED
This is one of the defining features of the script. Instead of leaving historical rectangles behind with no context, the overlay tracks what has happened to each one.
4. Midpoint and Structure Rails
Every zone can include a midpoint reference and supporting structure rails to make reaction areas easier to inspect. This helps distinguish edge reactions from deeper zone acceptance.
5. Dashboard Context
The top-right dashboard summarizes active counts, nearest demand and supply distance, event state, and structure bias so the user can quickly orient themselves.
Features
Dual-source zone creation: Confirmed pivots and volume impulse zones
Stateful zone lifecycle: Tracks sweeps, breaks, retests, and archival
ATR-aware zone sizing: Zone height adapts to market conditions
Object-efficient rendering: Uses persistent objects with setter updates
Midpoint lines: Helps judge reaction depth inside each zone
Structure bias readout: Gives a quick demand-versus-supply view
Nearest-zone distance readout: Useful for contextual planning
Top-right dashboard: Medium-size summary panel
Confirmed-bar event logic: Creation and transitions are handled safely
Alertconditions: Zone create, sweep, break, retest, and structure breaks
How to Use This Indicator
Step 1: Identify the Nearest Active Zone
Use the plotted boxes and dashboard distance readouts to locate the nearest demand and supply area.
Step 2: Read the Zone State
An active zone is different from a swept or broken zone. The lifecycle state tells you whether the zone is still intact or has already lost integrity.
Step 3: Watch Retests After Breaks
Retested zones can be especially useful because they represent a transition from defended liquidity to broken structure and then a recheck of that failure.
Step 4: Combine with Regime Context
Bastion Ledger works best when combined with a separate trend or regime filter. Use it to map where reactions matter, not to replace directional context.
Indicator Limitations
Pivot-based zones confirm after the pivot completes, which is intentional non-repainting behavior
Very fast markets can move through multiple zone states in a short number of bars
Zone relevance declines over time, so older archived zones should not be treated like fresh liquidity
This script tracks structural interaction, not order flow or real exchange-level liquidity
Originality Statement
Bastion Ledger is original in its combination of pivot structure, volume-impulse zone creation, and lifecycle classification. The script is not just a rectangle drawer. Its core value lies in tracking how a zone evolves after creation and presenting that evolution in a consistent institutional overlay.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Liquidity zones are interpretive tools based on historical price and volume behavior and do not guarantee future reactions.
- Made with passion by jackofalltrades
Indicator

Body Close Break Planner [AGPro Series]TITLE
Body Close Break Planner
🧠 Core Idea
Did price break structure with real body-close acceptance, or was the move only a wick event with weak commitment?
📌 Overview / What it does
Body Close Break Planner is built to evaluate whether a structure break is being accepted with real candle-body commitment. Instead of reacting to every wick beyond a prior high or low, the script focuses on closes that actually establish acceptance beyond the rail.
The script maps the body break rail, an acceptance pocket, a retest shelf, a failure rail, and a first target-room reference. It also adds event labels, right-side tags, and a compact AG Pro panel that summarizes the quality of the active break with a 0-100 Body Break Score.
This script does not predict trend continuation, automate entries, or treat every breakout as valid. It is a rule-based analytical and visualization tool that helps users separate real body-close structure acceptance from weaker noise-driven break attempts.
🎯 Purpose & Design Philosophy
This script was built to solve a very common structural problem: many breakout candles look convincing in the moment, but the move fails because the market never achieved real closing acceptance beyond the level.
The tool was designed for traders who want to evaluate whether a break has genuine body-based commitment, whether the first retest is constructive, and where the structure fails if acceptance is lost.
The mindset behind the script is selective, disciplined, and evidence-based. It supports traders who want to read acceptance quality rather than react to every temporary excursion beyond a level.
⚡ Why This Script Is Different
Most breakout tools focus on level crossing, wick penetration, or generic break-and-retest behavior.
This script does NOT treat every breach of structure as a meaningful breakout.
Instead, it asks whether the move closed through structure with enough body commitment, whether price is still being accepted beyond the rail, whether the retest shelf improves the setup, and whether the move still has room before it becomes extended or fails.
⚙️ Methodology
1. Context Detection
The script maps recent structure highs and lows, then checks whether price closes beyond them with enough candle-body commitment and range expansion.
2. Reference Mapping
Once a valid body-close break is confirmed, the script locks the broken rail, builds an acceptance pocket, marks a retest shelf, and defines a failure line plus a first target-room reference.
3. Reaction Evaluation
Price is then reviewed against the body-break rail and the retest shelf. The script checks whether the move is still accepted, whether the retest improves the structure, or whether the breakout falls back through the failure boundary.
4. Visual Output
The final output includes the acceptance pocket, body-break rail, retest shelf, failure rail, room line, event labels, right-side tags, and dashboard panel.
🗺️ How to Read the Chart
Zones:
The acceptance pocket represents the active post-break area where structure acceptance is being judged.
Labels:
Labels identify new bullish or bearish body-close breaks, accepted structure, retest-ready behavior, target review, and failed breaks.
Colors:
Teal represents stronger constructive break behavior.
Pink represents bearish or failed context.
Gold represents review areas such as target-room interaction.
Indigo represents the main body-break rail.
Panel:
The panel summarizes the active break type, the Body Break Score, current acceptance quality, available room, and the current action state.
🚦 Signals & States
• Bull Break → A bullish body-close structure break has been detected.
• Bear Break → A bearish body-close structure break has been detected.
• Body Accepted → Price is still being accepted beyond the broken structure rail.
• Retest Ready → Price interacted with the retest shelf constructively and the setup quality improved.
• Target Review → The first projected room reference has been reached and context should be reassessed.
• Failed → Price moved back through the failure boundary and the break is no longer structurally clean.
• Wait Break → No valid active body-close break exists.
• Expired → The break is too old to remain active within the current framework.
🔔 Alerts Logic
Alerts can trigger when a new bullish or bearish body-close break is detected, when structure remains accepted, when a retest shelf strengthens the setup, when target room is reached, or when the break fails.
Alerts are attention markers only. They highlight structural events inside the script logic. They are not trade instructions, automated entries, or guarantees of follow-through.
🧩 Confluence Logic
The context becomes stronger when multiple conditions align together.
For example, a structure break with a strong body ratio, clean range expansion, stable hold beyond the break rail, and a constructive retest shelf interaction is much stronger than a shallow close that immediately falls back into the old range.
When body commitment, breakout range, retest quality, and available room align together, the context becomes structurally more reliable.
📊 When to Use
• Breakout or breakdown environments where close quality matters
• Markets with clean price structure and readable swing levels
• Crypto, forex, indices, and liquid stocks
• 1H, 4H, and 1D chart review
• Situations where wick-only breaks create repeated false positives
⚠️ When NOT to Use
• Illiquid markets with distorted price prints
• Extremely noisy sessions with poor candle quality
• Very low-range environments where closes carry little structural information
• Symbols dominated by gaps or erratic price jumps
• Conditions where the market repeatedly overshoots levels without clean follow-through
🎛️ Key Inputs
• Structure Lookback → Controls how recent highs and lows are mapped
• Minimum Range Ratio → Controls how much expansion is required before a break qualifies
• Minimum Body / Range → Filters out weak closes and wick-dominant candles
• Close Buffer ATR → Controls how far beyond structure the close must finish
• Acceptance Pocket ATR → Controls the depth of the post-break pocket
• Retest Shelf Buffer → Controls how shelf interactions are interpreted
• Failure Buffer ATR → Controls where the active break becomes invalid
• Visual Settings → Control labels, panel location, theme, font size, and optional chart styling
🖥️ Interface & Visual Design
The interface is designed to answer one question quickly: is this break actually being accepted?
The panel creates a clean information hierarchy so the user can understand break state, score, room, and current action without reading every chart element manually. The chart layer keeps the acceptance pocket, body-break rail, failure line, and room reference readable without overwhelming candles.
The visual intent is professional, premium, and publication-friendly rather than decorative.
🧪 Practical Usage Workflow
1. Read the panel to confirm whether a valid body-close break is active
2. Check the body-break rail and acceptance pocket
3. Evaluate whether price is simply holding or whether the retest shelf improved the structure
4. Review room to the target reference and distance to failure
5. Use labels and tags as context markers, not as direct commands
🔍 Interpretation Guidelines
A stronger score suggests better body commitment, healthier range expansion, and more reliable post-break structure.
A Body Accepted state means price is still holding beyond the broken rail, but it does not automatically mean the move is early or low-risk.
A Retest Ready state suggests the market pulled back in a controlled way and defended the structure more convincingly.
A Target Review state suggests that the first projected room objective has already been reached and the context should be reassessed rather than assumed to continue indefinitely.
🚫 What This Script Is NOT
This script is not a prediction engine.
This script is not financial advice.
This script is not an automated trading system.
This script does not place orders.
This script does not guarantee continuation, retest success, target reach, or profitability.
⚠️ Limitations & Transparency
This script is rule-based and depends on the quality of the underlying market structure.
Different timeframes can produce very different break quality profiles. In high-volatility or low-liquidity conditions, candle closes may appear meaningful while still failing quickly. In some markets, wick behavior may remain important even when the body-close break model is intentionally strict.
Outputs should always be interpreted within broader market context rather than in isolation.
🧠 Market Context Notes
Body-close acceptance often matters most around obvious swing highs, swing lows, range edges, and post-compression expansion points.
A wick beyond structure can attract attention, but a true close beyond structure often tells a more reliable story about commitment. Even so, not every accepted break becomes a trend. Some become retest traps, and some run directly into higher-timeframe resistance or support.
🧾 Use Case Examples
Example 1:
Price closes above a well-defined swing high with a strong body and good expansion. The script marks a bull break, builds the acceptance pocket, and later upgrades the context when the retest shelf holds.
Example 2:
Price breaks below a swing low with body commitment, but then quickly closes back through the failure boundary. The script marks the break as failed, signaling that the downside acceptance did not hold.
Example 3:
A strong body-close break remains accepted and quickly reaches the first target-room line. The script marks target review, reminding the user to reassess efficiency and extension.
🧱 System Philosophy
AGPro Series tools are built as decision-support frameworks, not generic signal generators.
The philosophy here is to reward quality over noise: stronger closes, cleaner acceptance, clearer structure, and more readable post-break behavior.
🔐 Non-Promise Statement
This script does not promise certainty.
It does not promise that a body-close break will continue, hold, retest cleanly, or reach its projected room. It only organizes the structure so the user can evaluate the break with more discipline and clarity.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly, and any analytical tool can become less reliable under shifting volatility, liquidity, or structural conditions. Users remain fully responsible for their own decisions, execution, and risk management.
This script is for educational and analytical purposes only. It does not provide financial advice.
📚 Educational Note
This tool is most effective when combined with broader market structure, liquidity awareness, and disciplined trade management.
It is designed to improve interpretation quality, not to replace critical thinking.
Indicator
