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. אינדיקטור

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.
אינדיקטור

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.
אינדיקטור

High Volume Pivot Support & Resistance Zones [BigBeluga]High Volume Pivot Support & Resistance Zones is a market-structure indicator built for TradingView. 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. אינדיקטור

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. אינדיקטור

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.
אינדיקטור

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
אינדיקטור

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
אינדיקטור

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. אינדיקטור

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
אינדיקטור

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 TradingView 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. אינדיקטור

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
אינדיקטור

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
אינדיקטור

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. אינדיקטור

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.
אינדיקטור

אסטרטגייה

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
אינדיקטור

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.
אינדיקטור

Volume Ledger [JOAT]JOAT Volume Ledger
Introduction
JOAT Volume Ledger is an open-source participation and volume-zone framework designed to identify where meaningful activity occurred, what type of activity it likely was, and which of those zones still matter now.
It is built around the idea that not all large volume is equal.
Some high-volume behavior represents sponsorship.
Some represents exhaustion.
Some represents churn or absorption.
Some leaves behind a meaningful footprint that the market later reacts to.
The problem the script solves is translation.
Raw volume bars alone do not explain whether heavy activity created useful levels.
They also do not organize those levels for later use.
Volume Ledger attempts to do both.
It begins with relative-volume heat and participation metrics.
It then uses confirmed pivot-based logic to create candidate zones.
Those zones are merged, ranked, extended, and reclassified as support or resistance based on how price returns to them.
Higher-timeframe carry-forward levels can also be displayed.
Core Concepts
1. Relative-Volume Heat
The script normalizes current volume against a baseline and color-grades it.
2. Delta, Churn, and Participation
A delta proxy, churn estimate, and participation line classify the quality of activity.
3. Confirmed Pivot-Zone Creation
When significant participation coincides with confirmed pivots, the script stores those prices as candidate zones.
4. Zone Merging and Ranking
Nearby zones are merged and stronger zones are prioritized.
5. Higher-Timeframe Carry-Forward Levels
Important HTF zones can be projected into the current chart.
6. Retest Logic
The script distinguishes whether an active zone is currently acting as support or resistance.
7. Overlay Box and Line Projection
Zones are projected forward into current chart space using managed boxes, lines, and labels.
8. Participation State Readout
The dashboard summarizes the dominant volume condition, active zones, and current participation quality.
Features
Relative-volume heatmap: current activity is normalized and color-graded
Delta, churn, sigma, and participation analytics: classifies the character of activity
Confirmed volume-origin zones: maps price areas linked to meaningful participation
Zone merging and ranking: reduces clutter and prioritizes stronger regions
Projected overlay boxes and lines: extends active zones into current price
Higher-timeframe ledger context: broader levels can be carried forward
Support / resistance retest logic: distinguishes how price is interacting with the zone
Bar tint and backdrop state: strong participation conditions are easy to spot
Dashboard: summarizes volume state and dominant zone structure
Input Parameters
Ledger Core:
Volume Comparison
Ledger Window
Participation Smoothing
Delta and Churn Settings
Relative Volume Thresholds
Zone Engine / Display:
Zone Extension
Merge Threshold
Zone Ranking Rules
Projected Levels
Higher-Timeframe Carry-Forward
Show Dashboard
Show Average
Show Participation Line
Show Projected Levels
Show Backdrop
Show Bar Tint
How to Use This Indicator
Step 1: Read current participation quality using the relative-volume state and participation line.
Step 2: Identify the dominant projected zones on the chart.
Step 3: Watch retests into those zones and compare them to current participation behavior.
Step 4: Compare active zones with higher-timeframe carry-forward levels.
Step 5: Use the script as confirmation beneath trend, liquidity, or retracement narratives.
Indicator Limitations
Volume proxies do not provide true exchange-level order-flow
High participation does not guarantee reversal or continuation
Very noisy markets can generate many candidate zones before merging and ranking simplify them
The script identifies footprints of activity, not certain turning points
Originality Statement
This script is original in the way it combines relative-volume heat, effort classification, pivot-zone construction, merging, ranking, higher-timeframe carry-forward, and retest-aware styling into a single participation ledger.
The purpose is not merely to show volume.
It is to preserve the most useful consequences of volume.
Disclaimer
This indicator is provided for educational and informational purposes only.
It is not financial advice.
Volume and participation footprints do not guarantee future support or resistance.
Always use independent analysis and risk management.
Best Use Cases
Studying where strong participation likely left a usable footprint
Comparing current price retests to historical participation zones
Separating constructive activity from churn-heavy activity
Adding participation context to trend, liquidity, or retracement narratives
Interpretation Notes
Not every high-volume event deserves the same weight.
The script is most useful when strong participation aligns with structural pivots and later retests.
Higher-timeframe carry-forward levels can be especially helpful when local price is approaching an older but still meaningful participation zone.
The strongest zones are not simply the largest bars.
They are the most meaningful surviving footprints after merging, ranking, and retest context are applied.
Publication Notes
This script is intended to be published with a clean chart where the dominant projected zones and the current participation state are clearly identifiable.
The chart should not be overloaded with extra unrelated studies.
The image should make the volume-to-zone relationship understandable to a first-time viewer.
-Made with passion by jackofalltrades
אינדיקטור

Breakout Base Defense Planner [AGPro Series]Breakout Base Defense Planner
🧠 Core Idea
After a breakout, is the original base being defended or is price losing control back into the base?
📌 Overview / What it does
Breakout Base Defense Planner maps the structure price broke from and tracks whether the broken base edge is being defended.
The script displays the breakout base, a projected base defense zone, defense rail, failure shelf, room reference, defense labels, pressure labels, invalidation labels, right-side tags, and a compact AG Pro dashboard.
It does not predict that a breakout will continue. It helps organize the post-breakout base context: defense score, pressure, room, failure risk, and action state.
🎯 Purpose & Design Philosophy
Many breakout tools focus on the breakout candle or the first follow-through move.
This script was built for a different question: does the original base still matter after the breakout?
It helps traders separate clean base defense from weak breaks that fall back into the structure they came from.
⚡ Why This Script Is Different
Most breakout indicators highlight breakouts or target projections.
This script does NOT build a full R ladder, position planner, or generic breakout continuation system.
Instead, it focuses on the broken base itself: the base box, defense zone, pressure behavior, failure shelf, target room reference, and clear action state.
⚙️ Methodology
1. Base Detection
The script defines a recent base using completed bars and filters it by ATR-based width.
2. Breakout Lock
When price closes beyond the base edge with enough displacement and participation, the base is locked as the active reference.
3. Defense Evaluation
The broken base edge becomes a defense zone. The script checks whether price holds, pressures, or loses that zone.
4. Visual Output
The chart receives a breakout base box, defense zone, defense rail, failure shelf, room rail, labels, right-side tags, optional bar coloring, and a dashboard panel.
🗺️ How to Read the Chart
The breakout base shows the structure price broke from.
The defense zone marks the broken edge that should act as support in bullish breaks or resistance in bearish breaks.
The failure shelf marks where the base defense context fails.
The room rail marks the nearest swing-room reference beyond the breakout direction.
Labels highlight base lock, base defended, defense pressure, room tests, and base lost events.
Colors represent context:
• Teal → bullish base defense
• Pink → bearish base defense or invalidation
• Gold → room reference or waiting context
• Indigo → pressure or monitoring context
The panel summarizes:
• Base
• Defense Score
• Pressure
• Room
• Action
🚦 Signals & States
• Bull Base Breakout → price closed above the base with acceptable quality
• Bear Base Breakout → price closed below the base with acceptable quality
• Base Defended → price tested the broken edge and closed back in the breakout direction
• Defense Pressure → price is testing the defense zone without a clean hold
• Room Test → price reached the active room reference
• Base Lost → price closed beyond the failure shelf
• READY → base defense quality is strong enough to monitor
• MONITOR → price is actively testing the base defense zone
• WAIT → no strong active context exists
• INVALIDATED → the base defense context failed
• EXPIRED → the locked base is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a breakout base is locked, when the base is defended, when READY state appears, when defense pressure appears, when the room rail is reached, or when the base is lost.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The base defense context becomes stronger when the breakout base is well-sized, the breakout close has quality, the defense zone holds, participation is acceptable, and target room remains available.
When base defense and room align, the structure is cleaner. When price presses through the defense zone toward the failure shelf, the context weakens.
📊 When to Use
• After clear breakout moves
• During breakout retests
• When price returns to a broken range edge
• In trending markets where base defense matters
• On liquid symbols with readable structure and volume
• On 4h and 1D charts where base boxes remain visually clear
⚠️ When NOT to Use
• Very low-liquidity markets
• Extremely noisy sideways ranges
• Breakouts without a meaningful base
• News candles with unstable spreads
• Late moves where the base is already too far away to matter
🎛️ Key Inputs
• Base Lookback Bars → controls how the breakout base is detected
• Minimum / Maximum Base Range ATR → filters bases that are too small or too large
• Break Buffer ATR → controls how far beyond the base price must close
• Minimum Break Body Ratio → filters weak wick-only breaks
• Minimum Relative Volume → filters low-participation breaks
• Defense Zone ATR → controls the defended zone around the broken edge
• Failure Buffer ATR → controls where base defense fails
• Target Room Lookback → controls the nearest swing-room reference
• Visual settings → control boxes, rails, labels, tags, panel, and bar colors
🖥️ Interface & Visual Design
The visual design is built around the original base.
The base box provides context, the defense zone shows the key retest area, the failure shelf defines where the idea weakens, and the panel compresses the state into a quick decision-support read.
The goal is a premium, structured chart that feels like a breakout defense map, not a crowded signal board.
🧪 Practical Usage Workflow
1. Check whether a breakout base is active
2. Read the defense score and action state
3. Inspect the defense zone
4. Compare pressure with room
5. Watch the failure shelf for invalidation
6. Confirm the context with broader market structure
🔍 Interpretation Guidelines
A READY state means the base defense context has enough structure to monitor.
Defense pressure means price is testing the broken base edge and the context needs attention.
Base defended means price reacted at the edge, but it does not guarantee continuation.
Room measures available structure beyond the current price, not a promised target.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a guaranteed breakout system.
It is not an R-ladder tool.
It is not a position sizing tool.
It is not an automated trading tool.
It does not provide financial advice.
It does not guarantee continuation, reversal, profit, or a specific target.
⚠️ Limitations & Transparency
Breakout base behavior depends on market structure, volatility, liquidity, timeframe, and participation.
Some defended bases may later fail.
Some failed bases may reclaim again later.
The score is a rule-based context score, not a certainty model.
🧠 Market Context Notes
Breakout bases often become important memory zones.
When price breaks out and later defends the original edge, the structure can remain organized.
When price falls back through the edge and failure shelf, the breakout context becomes weaker.
🧾 Use Case Examples
When price breaks above a recent base, the script locks the base and projects a defense zone around the broken edge.
If price returns to the defense zone and closes back above the edge, the script can mark base defense.
If price closes through the failure shelf, the script marks the base as lost.
🧱 System Philosophy
This script follows the AGPro Series approach: turn one important market structure question into a focused decision-support map.
The focus is not prediction. The focus is base context, defense quality, pressure awareness, failure logic, and visual clarity.
🔐 Non-Promise Statement
No script can remove uncertainty from markets.
This tool does not promise accuracy, profitability, or future price movement.
Its purpose is to organize breakout base defense context so the user can interpret the chart more clearly.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly, and any analytical output can fail.
Users are responsible for their own decisions, risk management, and trade execution.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
A breakout is not complete just because price leaves a base.
The quality of the first base defense can often provide more useful context than the breakout candle alone.
אינדיקטור

Post-Breakout Risk Ladder [AGPro Series]Post-Breakout Risk Ladder
🧠 Core Idea
After a breakout happens, is the move still offering clean target room or is pullback risk taking control?
📌 Overview / What it does
Post-Breakout Risk Ladder maps a breakout base, locks the breakout edge, and converts the post-breakout move into a structured R-based risk ladder.
The script displays a breakout base, pullback risk shelf, entry rail, invalidation rail, 1R / 2R / 3R target rails, target defense labels, pullback test labels, and a compact AG Pro dashboard.
It does not predict that a breakout will continue. It helps organize what happens after a breakout: current R, pullback risk, target room, invalidation, and action state.
🎯 Purpose & Design Philosophy
Many breakout tools focus only on the breakout candle.
This script was built for the part that comes next: the risk management phase after the breakout is already visible.
It helps traders read whether the breakout is still structured, whether the pullback is healthy, whether the next target has room, and whether the breakout context has failed.
⚡ Why This Script Is Different
Most breakout indicators highlight the break itself.
This script does NOT treat the breakout as the end of the analysis.
Instead, it builds a post-breakout planning map with a base, entry reference, invalidation shelf, R ladder, pullback risk score, target room, and target defense context.
⚙️ Methodology
1. Breakout Base Detection
The script defines a recent base using completed bars and checks whether price closes beyond the base edge with enough displacement quality.
2. Breakout Lock
When the breakout qualifies, the script locks the base high/low, breakout edge, entry reference, and invalidation edge.
3. Risk Ladder Mapping
Risk is standardized into R units from the breakout entry to invalidation. Target rails are projected as 1R, 2R, and 3R references.
4. Pullback and Defense Evaluation
The script tracks pullback tests into the breakout shelf, current R, target room, and target defense behavior.
🗺️ How to Read the Chart
The breakout base shows the structure that price broke from.
The pullback shelf marks the zone where a retest may remain constructive or become risky.
The entry rail and invalidation rail define the R unit.
The 1R, 2R, and 3R rails show post-breakout target references.
Labels highlight breakout locks, pullback tests, target defense, and invalidation.
The panel summarizes:
• Breakout state
• Current R
• Pullback risk
• Target room
• Action state
🚦 Signals & States
• Bull Breakout → price closed above the breakout base with acceptable quality
• Bear Breakout → price closed below the breakout base with acceptable quality
• Pullback Test → price is testing the post-breakout shelf
• Target Defense → price has reached or interacted with an R target rail
• Invalidated → price lost the active breakout structure
• Expired → the breakout ladder is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a breakout ladder is locked, when the breakout context is READY, when price tests the pullback shelf, when the ladder invalidates, or when target defense appears.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The breakout context becomes stronger when base quality, breakout body strength, relative volume, pullback shelf behavior, and target room align.
The R ladder helps separate structured continuation from late or overextended movement.
📊 When to Use
• After clear range breaks
• During breakout retests
• In trending markets with continuation attempts
• When evaluating post-breakout risk-to-room structure
• On liquid symbols with readable candles and volume
⚠️ When NOT to Use
• Very low-liquidity markets
• Extremely noisy sideways ranges
• Random spike candles without structure
• News candles with unstable spreads
• When no meaningful base exists before the breakout
🎛️ Key Inputs
• Base Lookback Bars → controls how the breakout base is detected
• Break Buffer ATR → controls how far beyond the base price must close
• Minimum Break Body Ratio → filters weak wick-only breaks
• Minimum Relative Volume → filters low-participation breaks
• Retest Shelf ATR → controls the pullback shelf around the broken edge
• Invalidation Buffer ATR → controls where the ladder fails
• Target R Settings → control the 1R / 2R / 3R ladder rails
🖥️ Interface & Visual Design
The visual hierarchy is designed around post-breakout planning.
The base defines context, the shelf defines pullback risk, the rails define R structure, and the panel provides a quick state read.
The goal is to keep the chart useful, structured, and premium without turning it into a cluttered signal board.
🧪 Practical Usage Workflow
1. Check whether a breakout ladder is active
2. Read current R in the panel
3. Inspect the pullback shelf
4. Compare target room with pullback risk
5. Watch invalidation and target defense labels
🔍 Interpretation Guidelines
A READY state means the breakout ladder has enough structure to monitor.
Current R helps measure how far price has moved from the breakout reference.
Pullback risk helps evaluate whether price is still respecting the breakout shelf.
Target room helps avoid treating late moves the same as early moves.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a guaranteed breakout system.
It is not an automated trading tool.
It does not provide financial advice.
It does not guarantee continuation, reversal, targets, or profit.
⚠️ Limitations & Transparency
Breakout quality depends on market structure, volatility, liquidity, and timeframe.
Some breakouts may fail quickly.
Some slow breakouts may not trigger if candle quality or volume is too weak.
R levels are planning references, not guaranteed destinations.
🧠 Market Context Notes
Breakouts are often strongest when structure, participation, and follow-through align.
A breakout with clean target room and controlled pullback risk is different from a late breakout already pressing into extension.
Use the ladder as context, not certainty.
🧾 Use Case Examples
When price breaks above a recent base, the script locks the breakout edge and projects 1R / 2R / 3R references.
If price later pulls back into the shelf, the script marks pullback risk so the user can evaluate whether the structure remains intact.
If price reaches a target rail, target defense labels help identify where the move may need confirmation.
🧱 System Philosophy
AGPro Series tools are built as decision-support engines.
The purpose is to organize market behavior into structure, score, state, and risk context rather than providing blind buy or sell calls.
🔐 Non-Promise Statement
No breakout is certain.
No target rail is guaranteed.
No script can remove risk.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own analysis, decisions, risk management, and execution.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use this tool to study how breakout bases, retests, invalidation, current R, and target room interact across different markets and timeframes.
אינדיקטור

Supply Demand Flip Planner [AGPro Series]Supply Demand Flip Planner
🧠 Core Idea
Has an old supply or demand zone changed role and started acting as the opposite side of the market?
📌 Overview / What it does
Supply Demand Flip Planner is a role-change price action tool designed to identify when a prior supply zone turns into demand, or when a prior demand zone turns into supply.
The script detects pivot-based supply and demand zones, monitors breaks through those zones, maps the active flip zone, evaluates retest acceptance, and displays a structured 0-100 score. It also shows invalidation shelves, target rails, centered zone text, labels, and a compact AG Pro dashboard.
It does not predict future price movement, automate trades, or provide guaranteed buy/sell signals. It is a visual decision-support framework for reading supply-demand flip behavior.
🎯 Purpose & Design Philosophy
This script was built for traders who watch support/resistance role reversal but want a cleaner way to separate meaningful flips from ordinary breaks.
Many zones break and never matter again. Some zones break, retest, and start acting as the opposite side of the market. This planner focuses on that role-change moment.
The design supports a structured workflow: map supply and demand, wait for break, monitor retest, evaluate acceptance, then track invalidation.
⚡ Why This Script Is Different
Most supply and demand tools draw zones and leave interpretation fully manual.
This script does NOT simply flood the chart with historical zones.
Instead, it focuses on the active role-change zone, measures retest quality, scores acceptance, and presents the result through a clear READY / MONITOR / WAIT / INVALIDATED framework.
⚙️ Methodology
1. Context Detection
The script detects pivot-based supply and demand zones using configurable left/right pivot confirmation.
2. Reference Mapping
It maps source supply and demand shelves, then converts a broken zone into an active flip zone.
3. Reaction Evaluation
When price retests the flip zone, the script evaluates break strength, retest depth, wick response, body quality, source-zone quality, freshness, and relative volume.
4. Visual Output
The active flip zone is shown with centered text, invalidation shelf, target rails, right-side tags, labels, and an AG Pro panel.
🗺️ How to Read the Chart
Supply zones represent pivot-based resistance shelves.
Demand zones represent pivot-based support shelves.
Demand Flip means old supply has been broken and is being evaluated as new demand.
Supply Flip means old demand has been broken and is being evaluated as new supply.
READY FLIP labels mark retests that pass the selected acceptance score.
Invalidation shelf marks where the flip context weakens or fails.
The AG Pro panel summarizes Flip State, Acceptance, Retest, Failure Risk, and Action.
🚦 Signals & States
• DEMAND → pivot-based demand zone mapped.
• SUPPLY → pivot-based supply zone mapped.
• DEMAND FLIP → old supply was broken and is being watched as new demand.
• SUPPLY FLIP → old demand was broken and is being watched as new supply.
• FLIP RETEST → price is interacting with the active flip zone.
• READY FLIP → retest acceptance reached the required score threshold.
• INVALIDATED → the active flip lost its invalidation edge.
• READY → qualified flip acceptance is active.
• MONITOR → the flip zone is active or retesting.
• WAIT → no qualified flip acceptance is active.
🔔 Alerts Logic
Demand Flip Locked triggers when price breaks above a prior supply zone.
Supply Flip Locked triggers when price breaks below a prior demand zone.
Demand Flip Acceptance Ready triggers when a bullish flip retest reaches the score threshold.
Supply Flip Acceptance Ready triggers when a bearish flip retest reaches the score threshold.
Supply Demand Flip Retest triggers when price interacts with the active flip zone.
Supply Demand Flip Invalidated triggers when the flip loses its invalidation shelf.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The strongest flip contexts appear when break strength, retest depth, wick response, close quality, source-zone quality, freshness, and relative volume align.
When a broken zone is retested cleanly and accepted from the opposite side, the score improves and the panel shifts toward a stronger action state.
📊 When to Use
• Support/resistance role reversal
• Breakout retests
• Trend continuation after zone breaks
• Failed range boundaries that become new reaction zones
• Markets with clear swing structure
⚠️ When NOT to Use
• Extremely noisy markets with weak pivot structure
• Very low liquidity symbols
• Markets with large spread or unreliable candles
• News spikes where zones break and fail too quickly
• Timeframes where pivot zones are too dense or too sparse
🎛️ Key Inputs
• Pivot Left / Right Bars → control how strict the source zone detection is.
• Zone Depth ATR → controls the thickness of supply and demand shelves.
• Break Buffer ATR → requires price to break beyond the source zone by a volatility-adjusted amount.
• Retest Window Bars → controls how long the flip remains relevant.
• Acceptance Buffer ATR → defines how much confirmation is required after retest.
• Invalidation Buffer ATR → controls the failure shelf beyond the flip zone.
• Minimum Ready Score → sets how strict READY labels should be.
• Visual Settings → control zones, labels, centered zone text, target rails, and right-side tags.
• Panel Settings → control panel visibility, location, theme, and font size.
🖥️ Interface & Visual Design
The interface is designed to make role-change structure readable without overwhelming the chart.
The active flip zone uses centered text so the purpose of the zone is immediately visible. Source zones are subtle, while READY labels and target rails stand out only when a valid acceptance context appears.
The panel gives a quick summary of the current flip state and risk context.
🧪 Practical Usage Workflow
1. Identify the latest supply and demand zones.
2. Wait for a zone to break and become a flip candidate.
3. Watch for retest interaction inside the flip zone.
4. Check the READY FLIP label and acceptance score.
5. Compare price with invalidation shelf and target rails.
6. Confirm broader trend, volatility, and liquidity before making decisions.
🔍 Interpretation Guidelines
A high acceptance score means the role-change reaction is cleaner according to the script's rules.
A pending retest means price has returned to the zone but has not yet shown enough acceptance.
A failed flip means price lost the invalidation edge and the role-change context should be treated as weakened.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an automated trading system.
It does not guarantee entries, exits, profits, or outcomes.
⚠️ Limitations & Transparency
Pivot-based zones are confirmed after the selected right-side bars, so source zones appear after confirmation.
Different timeframes can create very different supply and demand structures.
High volatility can cause quick break-and-fail behavior around zones.
No rule-based script can fully account for news, liquidity shocks, or sudden market structure changes.
🧠 Market Context Notes
Supply-demand flips are a form of role reversal.
Old resistance can become new support after acceptance. Old support can become new resistance after acceptance.
The script is strongest when used with broader market structure, trend context, liquidity, and volatility analysis.
🧾 Use Case Examples
When price breaks above a supply zone, returns to the zone, and holds above it with clean reaction quality, the script may mark a Demand Flip acceptance.
When price breaks below a demand zone, retests it from below, and rejects cleanly, the script may mark a Supply Flip acceptance.
🧱 System Philosophy
Supply Demand Flip Planner follows the AG Pro Series approach: transform a common market concept into a structured decision map with context, score, risk reference, and clean visuals.
The goal is not to replace judgment. The goal is to make role-change analysis easier to read.
🔐 Non-Promise Statement
No script can provide certainty.
No signal should be treated as guaranteed.
Outputs should always be interpreted with independent analysis and responsible risk control.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly.
Users are responsible for their own decisions, risk management, and trade execution.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
This script is designed to help traders study how supply zones, demand zones, breakout retests, and role-change acceptance behave across different market conditions.
אינדיקטור

Donchian Retest Readiness [AGPro Series]# Donchian Retest Readiness
🧠 Core Idea
After price breaks a Donchian Channel boundary, is the broken edge ready to act as a clean retest and continuation reference?
📌 Overview / What it does
Donchian Retest Readiness is a breakout-boundary decision-support script built around Donchian Channels.
The script maps the rolling Donchian high, low, and midpoint, detects channel breaks, builds a retest pocket around the broken edge, scores retest quality from 0 to 100, and projects continuation lanes with target rails.
It does not predict price direction, automate trades, or provide guaranteed signals. It organizes Donchian break context, retest quality, channel edge, risk, and action state into a clean visual workflow.
🎯 Purpose & Design Philosophy
Many breakout tools mark the moment price leaves a range, but the difficult part often comes after the break: deciding whether the broken edge is being respected.
This script was built for traders who want to evaluate Donchian breakout retests without treating every new high or new low as a complete trading idea.
The design supports structured observation: break first, retest pocket second, hold quality third.
⚡ Why This Script Is Different
Most Donchian tools focus on channel highs and lows.
This script does NOT stop at drawing the Donchian Channel.
Instead, it converts the broken channel edge into a decision zone, evaluates whether price returns to that area, measures hold quality, and summarizes readiness with a clear 0-100 score.
⚙️ Methodology
1. Donchian Channel Mapping
2. Breakout Boundary Detection
3. Retest Pocket Construction
4. Hold / Failure Evaluation
5. 0-100 Retest Readiness Score
6. Panel And Alert Output
🗺️ How to Read the Chart
The Donchian Channel shows the rolling high, low, and midpoint.
The retest pocket appears around the broken channel edge after a breakout.
READY RETEST labels appear when price interacts with the broken edge and holds with enough quality.
Continuation lanes and target rails show the projected area beyond the accepted retest context.
The panel summarizes Break State, Retest Score, Channel Edge, Risk, and Action.
🚦 Signals & States
• READY → A qualified Donchian retest has formed.
• MONITOR → A Donchian break is active and retest behavior is being evaluated.
• WAIT → The channel is valid, but no active break / retest context is present.
• INVALIDATED → Price failed back through the broken channel edge.
• BLOCKED → The Donchian channel is not suitable for evaluation under current settings.
🔔 Alerts Logic
Bullish Donchian Retest Ready triggers when price breaks above the Donchian high, returns to the broken edge, and holds with enough score quality.
Bearish Donchian Retest Ready triggers when price breaks below the Donchian low, returns to the broken edge, and holds with enough score quality.
Donchian Break Watch alerts mark the first boundary break when enabled.
Donchian Retest Invalidated triggers when price fails back through the broken edge.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The retest score combines wick response, close pressure beyond the broken edge, proximity to the retest pocket, breakout impulse, relative volume, and channel width quality.
When several of these conditions align, the retest context becomes stronger.
📊 When to Use
• Breakout markets
• Trend continuation setups
• Pullbacks after new highs or new lows
• Donchian Channel structure analysis
• Intraday or swing contexts where retest behavior matters
⚠️ When NOT to Use
• Very low-liquidity symbols
• Extremely noisy chop
• Abnormal spread conditions
• News spikes where retest behavior is unstable
• Markets where every boundary break immediately reverses
🎛️ Key Inputs
• Donchian Length → controls the rolling channel high and low.
• ATR Length → controls retest pocket depth, buffers, targets, and label spacing.
• Minimum Channel Width → blocks weak channels that are too narrow.
• Retest Pocket ATR → controls how wide the broken-edge retest pocket is.
• Minimum Ready Score → controls how selective READY states are.
• Projection Bars → controls how far pockets and targets extend.
• Visual settings → control channel, fill, pocket, lane, labels, tags, and panel.
🖥️ Interface & Visual Design
The script uses a clean AG Pro panel to summarize the current Donchian context.
The visual hierarchy is designed to keep the channel visible while making the active retest pocket and READY label easy to see.
Default settings keep failed and early watch labels off so publication screenshots remain clean.
🧪 Practical Usage Workflow
1. Read the panel state.
2. Check the Donchian channel boundary.
3. Wait for a break and retest pocket.
4. Evaluate whether price holds the broken edge.
5. Review target rails and failure risk.
🔍 Interpretation Guidelines
A READY retest means the broken Donchian edge is being respected according to the script rules.
It does not mean price must continue.
An invalidated retest means price failed back through the broken edge and the breakout context lost quality.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a buy or sell signal generator.
It is not an automated trading system.
It does not guarantee breakouts, continuation, or reversals.
⚠️ Limitations & Transparency
Donchian behavior can vary by symbol, timeframe, volatility, and liquidity.
Shorter timeframes may produce more noise.
Longer Donchian lengths may react more slowly.
The script should be interpreted within broader structure, market regime, and risk context.
🧠 Market Context Notes
Donchian edges often become meaningful when market participants react to new highs, new lows, and breakout continuation attempts.
The strongest contexts usually combine a clean boundary break, controlled retest, and enough continuation room.
🧾 Use Case Examples
When price breaks above the Donchian high and later retests the broken edge without closing back through it, the script may mark a bullish READY RETEST.
When price breaks below the Donchian low and retests the edge from below with enough quality, the script may mark a bearish READY RETEST.
When price breaks out and then closes back through the broken edge, the retest can become invalidated.
🧱 System Philosophy
This script follows the AGPro Series approach: structured context, practical scoring, clean visuals, and decision-support states instead of noisy prediction claims.
🔐 Non-Promise Statement
No script can provide certainty.
No output should be treated as guaranteed.
All states are rule-based analytical markers.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions, risk management, and position sizing.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
The purpose of this script is to help users study Donchian Channel breakout and retest behavior through a structured visual framework.
אינדיקטור
