Auto Trendlines MTF - Break/Retest [AGPro Series]Auto Trendlines MTF - Break/Retest
🔹 OVERVIEW
Auto Trendlines MTF - Break/Retest is a multi-timeframe trendline visualization engine that automatically detects and draws the most structurally significant trendlines across three complementary scales: Micro (current timeframe), Meso (intermediate pivots), and Mega (HTF weekly/monthly overlay). Instead of relying on a single pivot scan, the engine builds a ranked candidate pool from each scale and selects the lines that best represent the active market structure around current price.
The script is designed as a pure analytical visualization tool — it does not generate trading decisions, forecasts, or directional recommendations. Its purpose is to give the chart a clean, hand-drawn-quality trendline layer that updates automatically as new pivots form.
🎯 UNIQUE EDGE
Most auto-trendline tools scan one timeframe and draw whatever fits. This engine operates differently in four specific ways:
• Three-scale MTF engine. Micro pivots on the current TF, Meso pivots with wider sensitivity, and Mega trendlines derived from Weekly/Monthly HTF pivots are computed independently and rendered together with a visual hierarchy (Mega dominant, Meso intermediate, Micro active).
• Log-space geometry. All trendline math runs in log-price space, so long-dated diagonals on volatile assets (crypto, growth stocks) do not distort visually when the chart is viewed in logarithmic mode.
• Touch-weighted ranking with violation penalty. Each candidate line is scored by touch count, line age, slope sanity, price proximity, and intra-line violations. Weak geometry, over-sloped lines, and frequently violated lines are demoted automatically.
• Q quality score (0–100) and confluence tags (x2/x3). Every drawn line carries a Q score that blends touches, freshness, geometry, relevance, and violations into a single number. Confluence tags surface when a Micro line and a Meso line sit within the same ATR band near price, highlighting multi-scale structure overlap.
🧠 METHODOLOGY
1. Pivot detection. Separate pivot streams are maintained for Micro (tight sensitivity), Meso (wider sensitivity), and Mega (HTF pivots via request.security).
2. Candidate generation. For each scale, the engine pairs anchor pivots with subsequent pivots to form line candidates, discards over-sloped ones, and computes touches, violations, and break status in log space.
3. Ranking. Candidates are scored by a weighted combination of touch count, time span, slope sanity, relevance to current price (distance in ATR), and violation count. The best non-duplicate lines are kept per scale.
4. Clutter guards. A minimum ATR separation rule prevents near-duplicate lines from stacking. Smart Focus hides far-from-price lines in Minimal/Balanced density modes to keep the chart readable.
5. Stability mode. In Locked mode, selected lines persist bar-to-bar and are only replaced when they break or fall out of the candidate pool — reducing visual repainting on lower TFs.
6. Break/Retest detection. Once a line is drawn, the engine tracks close-based breaks (with configurable tolerance) and subsequent retests within a time window, emitting labeled signals on TF ≤ 1D.
⚙️ SIGNALS & ALERTS
Break and retest events are plotted for each scale with short ASCII tags:
• µR / µS = Micro Resistance / Support break
• mR / mS = Meso Resistance / Support break
• MR / MS = Mega Resistance / Support break
• rµ / rm / rM = retest on Micro / Meso / Mega respectively
A dedicated alertcondition is exposed for every break and retest event, plus two aggregate alerts (Any BR, Any RT) for users who prefer a single alert stream. A Min Q filter lets the user suppress low-quality signals.
🛠️ KEY INPUTS
• Profile Mode. Auto by Timeframe or Manual (Clean Trader, Balanced, Analyst, Presentation, Custom).
• Density Override. Minimal, Balanced, or Bold visual density.
• Line Weight Override. UltraThin, Thin, or Normal.
• Labels / Signals / Stability / Broken-line behavior. All individually overridable.
• Mega Overlay. Full (lines + cloud + label), Lines Only, or Off.
• Advanced panels. Micro Engine, Meso Engine, Mega Engine, Ranking, Visuals, and Signals each expose their own fine-tuning controls for experienced users.
• HUD. Position, theme (Classic Gray, Premium Accent, Color Coded, Showcase), and text size.
📘 HOW TO USE
• Add the script to any liquid symbol and start on a 1H or 4H chart.
• Leave Profile Mode on "Auto by Timeframe" for a balanced default that adapts to the active TF.
• Read the HUD in the top-right corner to see the active profile, how many Micro/Meso lines are drawn, whether Mega is active, and current Q scores.
• When a line carries a Q score above ~65 and a Conf tag (x2 or x3) appears nearby, that zone is a multi-scale structural pocket — use it as a planning reference, not as a trade trigger on its own.
• Use the Break/Retest tags for situational awareness around drawn lines; combine with your own confirmation logic before acting.
⚠️ LIMITATIONS & TRANSPARENCY
• Lines are drawn from historical pivots and can only confirm after a pivot is established. The engine avoids repainting in Locked mode but cannot predict future pivots.
• Q scores and confluence tags describe structural quality, not directional probability. A high-Q line can still break.
• Mega lines depend on HTF pivot availability; on very young symbols or thin charts, Mega may fall back to a Macro-pivot source or remain hidden.
• The script is published as Public, Open Source so that every ranking rule, weight, and threshold is fully auditable in the source code.
🛡️ RISK DISCLOSURE
This script is a visualization and analysis tool only. It is not financial advice, not a trading strategy, and not a signal service. No performance claims are made or implied. Past structural behavior of trendlines does not guarantee future behavior. All trading decisions, risk sizing, and execution remain the sole responsibility of the user. Indicator

Pivot Channel Map [AGPro Series]Pivot Channel Map
🔹 OVERVIEW
Pivot Channel Map is a structural channel engine that automatically detects and classifies market structure channels from confirmed swing pivots. It organises every qualified channel into a clear 8-family taxonomy (Major / Minor × External / Internal × Up / Down) and renders them as a living map of trend, range and reversal context. The script works on all instruments and timeframes, with a focus on intraday and swing analysis.
Instead of plotting a single trendline or band, the engine maintains a continuously updated structural map: active channels, their midlines, interaction pockets around the rails, preserved broken channels, and post-break retest / reclaim signals. A compact right-corner panel summarises live channel counts, qualification state, nearest channel distance in ATR units, and the prevailing Major tilt.
The goal is to give discretionary traders a moderation-safe, clutter-controlled view of where price is inside the broader structure — not to predict future prices.
🔸 UNIQUE EDGE
Most channel indicators draw one or two parallel lines and call it a day. Pivot Channel Map adds structural classification, qualification, memory and post-event follow-through on top of the channel geometry:
- Eight channel families instead of a single pair of rails
- ATR-normalised qualification engine (Off / Balanced / Strict) to filter structurally weak channels
- Broken Channel Memory that preserves invalidated structure as faded historical context
- Interaction Zones (right-edge ATR pockets) around active channel rails
- Post-Break Retest / Reclaim tracker that tags the first valid touch after a confirmed break
- Break and React event markers on Major channels
- ATR-based distance tagging in the info panel (Near / Mid / Wide / Far)
The result is a richer structural read than a standard channel script, while still staying visually clean through emphasis, opacity and clutter controls.
🔹 METHODOLOGY
1. Pivot detection. A configurable Pivot Period drives ta.pivothigh and ta.pivotlow to produce confirmed swing pivots. The script then classifies each pivot into H / HH / LH / HL / LL / L roles and promotes / demotes them between Major (M*) and Minor (m*) status based on close breaks versus the current Major range.
2. Channel construction. From the classified pivot stream, eight channel families are built:
- Major External Up / Down
- Major Internal Up / Down
- Minor External Up / Down
- Minor Internal Up / Down
External channels trace structural HH/LL extremes, Internal channels trace LH/HL interior swings.
3. Qualification. Each candidate channel is width-measured against ATR and span-measured in bars. The Qualification Engine (Off / Balanced / Strict) filters out structurally weak channels before they are drawn.
4. Life-cycle management. Active channels are redrawn and extended forward each bar until an origin-rail or channel-rail break is confirmed. On break, the previous structure can be preserved by Broken Channel Memory (Off / Major Only / All) with its own style and opacity.
5. Event detection. Confirmed origin-rail breaks produce BREAK events; wick-through-then-close-back moves produce REACT events on Major channels. A cooldown and an ATR-based price-distance filter prevent label clusters when price oscillates around the same rail.
6. Post-break follow-through. After a confirmed break, the script tracks the first valid touch inside a configurable window and tags it as RETEST (channel-rail break) or RECLAIM (origin-rail break).
🔸 SIGNALS & ALERTS
On-chart events:
- BREAK — confirmed close-based break of a Major channel rail
- REACT — wick through the Major rail with a close back inside, filtered by bar cooldown and ATR distance
- RETEST / RECLAIM — first valid touch of the broken rail inside the post-break window
- Interaction Zone contact — visual ATR pocket around active channel rails
- Channel Quick Tags (MEX / MIN / mEX / mIN, Up / Dn) — compact family labels on active channels
Alert conditions (all 16 toggleable, Major alerts On by default, Minor Off by default):
- Break: Major External Up / Down
- React: Major External Up / Down
- Break: Major Internal Up / Down
- React: Major Internal Up / Down
- Break: Minor External Up / Down
- React: Minor External Up / Down
- Break: Minor Internal Up / Down
- React: Minor Internal Up / Down
Message frequency is configurable (All / Once Per Bar / Once Per Bar Close). Alerts include symbol, timeframe, time zone and event description.
🔹 KEY INPUTS
- Pivot Engine: Pivot Period (default 5)
- Per-family Visibility: 8 Show / Delete-Previous / Color / Style / Extend / Width groups
- Channel Qualification: Mode (Off / Balanced / Strict), Apply To (All / Major Only / Minor Only), ATR Length
- Broken Channel Memory: Scope (Off / Major Only / All), Keep (Last 1 / Last 2), Style
- Channel Midline: Show, Apply To, Scope, Style, Width, Opacity
- Active Map Clarity: Line Emphasis, Base-Line Focus, Event Markers, React Cooldown, React Min Price Distance, Quick Tags, Tag Scope, Tag Size, Event / Quick Tag Vertical Offsets
- Interaction Zones: Scope, Rails, Zone Width ATR, Extend Bars, Opacity, Zone Text
- Post-Break Retest / Reclaim: Scope, Window Bars, Label Offset ATR
- Panel: Show, Position, Font Size
- Alerts: 16 per-family Break / React toggles, Alert Name, Frequency, Time Zone
🔸 HOW TO USE
Getting started:
1. Apply the indicator on any symbol and timeframe.
2. Start with default settings: Qualification Off so the full structural map is visible.
3. If the chart feels busy on lower timeframes, switch Qualification to Balanced or Strict.
Reading the panel:
- Major Live / Minor Live — active channels per class
- Nearest Channel — closest active channel, with ATR distance and Near / Mid / Wide / Far tag
- Qualification — current filter mode and scope
- Interaction — interaction zone scope and rails
- Post-Break — tracker scope, window and prevailing Major tilt
Common workflows:
- Trend continuation: wait for price to hold an Active Major channel and look for a REACT at the rail inside the channel direction.
- Break-and-retest: after a BREAK event, watch for the RETEST / RECLAIM label inside the Post-Break window.
- Confluence: use Interaction Zones to spot where Major and Minor rails meet at the right edge of the chart.
- Higher-timeframe context: open a higher timeframe tab with the same script to map macro structure around your execution timeframe.
Suggested defaults:
- Intraday traders: 15m–1H base TF, Balanced qualification
- Swing traders: 4H–1D base TF, Balanced or Off qualification
- Higher-timeframe context: 1D–1W with Qualification Off
🔹 LIMITATIONS & TRANSPARENCY
- Pivot-based. Pivots require the configured number of bars to confirm, so the most recent swing always lags by Pivot Period bars. This is a structural property of confirmed pivots, not a bug.
- Redraw behaviour. Active channels are extended forward each bar until a break is confirmed on close. Channel end-points can therefore adjust as new pivots qualify.
- Alerts fire on confirmed conditions. Break and React alerts require barstate.isconfirmed, so intra-bar touches do not trigger alerts.
- Timeframe behaviour. On very high timeframes with limited history (e.g. weekly / monthly on newer instruments), the total pivot count can be small. Keep Qualification at Off on higher timeframes to avoid over-filtering.
- This is a visualisation / structure tool. It is not a trading strategy, it does not manage risk, and it does not generate buy / sell recommendations. All entries and exits are the trader’s responsibility.
🔸 RISK DISCLOSURE
This script is a technical analysis tool intended for educational and analytical purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any asset. Past chart behaviour does not guarantee future results. Trading involves significant risk and can result in the loss of capital. Always do your own research, use proper risk management, and consider consulting a licensed financial advisor before making trading decisions. Indicator

Structure Retest Engine Delta HybridDescription
Structure Retest Engine Delta Hybrid is a price action tool designed to identify structural shifts (CHoCH) and evaluate their retests using a relative volume delta proxy.
While many structure tools focus only on price location, this script adds a momentum-context layer to help judge whether a breakout appears stronger or weaker when price returns to the level.
--- HOW IT WORKS ---
The engine follows a 4-step process before an entry signal is generated:
1. Structure Shift (CHoCH)
The script identifies a Change of Character when price breaks a significant swing pivot from the opposite trend.
2. Breakout Conviction
Using a relative volume delta proxy, the script captures the momentum profile of the breakout bar. Stronger breakout conditions are marked with a "+" or "⚡", while weaker conditions are marked with a "-".
3. Departure Rule
Unlike basic retest scripts, this engine requires price to clearly leave the level area before a retest can be validated. This helps reduce noise from signals that appear during the initial breakout phase.
4. Hybrid Confirmation
When price returns to the level, the script tracks cumulative delta-proxy behavior during the retest. An entry is only triggered if price respects the level and satisfies the selected confirmation mode:
Touch, Close Outside Level, or Engulfing.
--- DELTA SENTIMENT TAGS ---
Entry labels can include sentiment tags to help judge the quality of the retest:
⚡ = stronger breakout context and retest flow supporting the trend
~ = mixed context
? = weaker or opposing retest sentiment
These tags are context markers, not guarantees of continuation or failure.
--- KEY FEATURES ---
Customizable Confirmation
Choose between Touch, COL (Close Outside Level), or ENG (Engulfing) to match your preferred entry style.
Retest Sensitivity
Adjust the ATR-based proximity buffer to define how close price must come to the level to qualify as a retest.
Departure Logic
Requires price to leave the level area before a new retest entry can be considered.
Visual Clarity
Includes optional CHoCH and Entry triangles, dashed break-level lines, floating entry text, and trend-based bar coloring.
Delta Proxy Context
Adds a relative volume delta proxy to estimate breakout conviction and retest sentiment. This is a candle-and-volume efficiency model, not true bid/ask delta or footprint data.
Alerts
Includes separate alert toggles for CHoCH events and entry confirmations.
--- SETTINGS ---
Pivot Length
The number of bars required on each side to confirm a swing point.
Run Away Threshold
Adjusts the sensitivity of the breakout conviction model relative to recent delta-proxy activity.
Confirmation Mode
Selects how the retest must confirm before an entry is printed.
Entry and CHoCH Visual Controls
Triangle size, text size, and text offset can all be adjusted for readability.
DISCLAIMER
This script is for educational and analytical purposes only.
It is a confirmation and context tool, not a prediction engine.
Past performance does not guarantee future results.
Always use proper risk management. Indicator

AG Pro Donchian Breakout Quality [AGPro Series]AG Pro Donchian Breakout Quality
Overview / What it does
AG Pro Donchian Breakout Quality is an overlay indicator built around a simple but practical question: not every Donchian breakout carries the same informational quality, so how can that difference be visualized directly on the chart? Instead of treating every channel escape as equally meaningful, this script evaluates the structure of the breakout bar, the local channel condition, and the immediate follow-through context, then converts that information into a readable breakout quality framework. The goal is not to predict the future or to classify markets with certainty. The goal is to help the user separate cleaner breakouts from weaker ones inside a familiar Donchian channel structure.
The indicator plots the Donchian upper band, lower band, optional midline, and channel fill, then adds a quality layer on top of the raw channel logic. When price closes through the previous Donchian boundary, the script evaluates the event and assigns a score. That score is then mapped to a simple grade scale so the breakout can be read quickly without losing access to the underlying channel context. This creates a workflow that remains visually intuitive for users who already understand Donchian channels, while adding a more structured interpretation layer for breakout review.
A second focus of the script is post-breakout behavior. In practice, many breakouts are not decided by the break itself, but by what price does after the first expansion bar. For that reason, the indicator tracks an active breakout level, projects a retest zone around that level using ATR, and monitors whether price can hold that area. This makes the tool useful not only for identifying fresh breaks, but also for observing whether the market is accepting or rejecting the newly crossed boundary.
The visual design is intentionally chart-first. The channel remains the primary frame, while breakout labels, retest markers, level tags, the setup tag, and the compact state panel provide context without turning the script into a crowded dashboard. Historical label clutter is reduced by default, and the script is designed so the most recent relevant structure remains readable on active charts.
Unique Edge
The distinctive feature of this script is that it does not stop at “price broke the channel.” Traditional Donchian usage often leaves the interpretation step entirely to the user. This script keeps the Donchian framework intact, but adds an explicit breakout quality model. That means the script is not merely showing an upper-band break or lower-band break; it is also evaluating how that break occurred.
The quality model scores breakouts using multiple components rather than a single threshold. It considers breakout distance relative to ATR, breakout candle body participation, wick behavior, local channel compression, midline slope context, and optional volume confirmation. This matters because many weak breakouts can look similar to stronger ones at first glance, especially when the user is reviewing charts quickly. By ranking the event instead of only flagging it, the indicator introduces a more disciplined read on the same familiar Donchian concept.
Another differentiator is the breakout-to-retest workflow. The script identifies the breakout, stores the active level, builds a retest zone around that level, and then tracks hold behavior within a limited life window. This makes the indicator less about a one-bar event and more about the structural sequence that often matters in live chart reading: approach, break, test, hold, or fail. That sequence is especially helpful for users who do not want a Donchian tool to act like a simple channel overlay with occasional arrows.
The presentation layer is also part of the edge. Active-side emphasis, breakout shelf visualization, level tagging, a right-side setup tag, state detection, and selective event marking are included to help the chart communicate context more clearly. The script is therefore positioned as a Donchian breakout interpretation tool, not as a generic channel plotter.
Methodology
The script starts with a standard Donchian channel calculation using the selected lookback length. The highest high defines the upper boundary, the lowest low defines the lower boundary, and the midpoint between them forms the optional midline. A breakout is detected when the current close moves beyond the previous upper boundary for a bullish event, or beyond the previous lower boundary for a bearish event.
Once a breakout is detected, the script calculates a quality score. The score is built from multiple normalized components. Breakout distance measures how far the close extends beyond the prior Donchian boundary relative to ATR. Candle body participation rewards bars where the real body contributes meaningfully to the range. Wick behavior penalizes less efficient breakout bars. Midline slope acts as a directional context proxy. Channel compression evaluates whether the breakout is emerging from a relatively tighter local structure. Volume, when enabled, adds an additional confirmation layer by comparing current volume to a moving average baseline.
These components are weighted and combined into a single breakout quality score. The result is then translated into a grade scale: A+, A, B, C, or D. This grade is not a claim about trade outcome, and it is not a guarantee of continuation. It is a structured description of breakout quality according to the internal model used by the script.
After the breakout, the indicator records the active breakout level and projects a retest zone around it using ATR-based half-width logic. This active zone remains visible for a user-defined number of bars. During that window, the script monitors whether price revisits the zone and holds it according to the directional logic. When a valid hold occurs, the script can mark that event on the chart. If price invalidates the zone, the active state is cleared.
The panel summarizes the current state and the most recent breakout evaluation. Depending on chart context, the script can display conditions such as Long Breakout, Short Breakout, active retest states, watch states, or Neutral. It also reports the latest breakout score, grade, channel width relative to ATR, and the current volume ratio when volume confirmation is enabled.
Signals & Alerts
The script includes deterministic alert conditions tied to specific structural events rather than vague descriptive states.
Long Breakout
Triggered when price closes above the previous upper Donchian boundary.
Short Breakout
Triggered when price closes below the previous lower Donchian boundary.
Long Retest Hold
Triggered when a bullish breakout remains active and price revisits the retest zone without losing the active breakout level according to the script’s hold logic.
Short Retest Hold
Triggered when a bearish breakout remains active and price revisits the retest zone without reclaiming the active breakout level according to the script’s hold logic.
These alerts are event-based and intended to describe what the script detects on the chart. They are not trade instructions, and they should not be interpreted as a complete execution plan on their own.
Key Inputs
Donchian Length
Controls the lookback used for the channel boundaries.
ATR Length
Used in the quality model and for retest zone construction.
Midline Slope Lookback
Defines how the script measures midline slope for directional context.
Use Volume Confirmation / Volume SMA Length
Enables or disables the volume component and sets the averaging baseline.
Break Distance Full-Score ATR
Defines how far beyond the channel price must extend to receive a full distance score.
Channel Width Full-Penalty ATR
Controls how channel width contributes to the compression component.
Watch Threshold
Helps identify when price is approaching the upper or lower channel region.
Retest Zone Life / Retest Half-Width ATR
Sets how long the active retest zone remains valid and how wide it is.
Minimum Score For Breakout Labels
Helps reduce noise by showing breakout labels only above the chosen threshold.
Label and Panel Controls
Allow adjustment of label visibility, historical label behavior, label size, label shift, panel position, and panel font size.
Visual Style Controls
Enable or disable edge glow, breakout level tags, right-side setup tag, breakout shelf, and event candle tint.
Limitations & Transparency
This indicator is an analytical overlay, not a strategy, not an execution engine, and not a backtest report. It does not place orders, size positions, manage risk, or estimate expected return. A high breakout score does not mean price must continue, and a low breakout score does not mean reversal is guaranteed. The score only reflects how the breakout ranks according to the script’s internal weighting model.
Donchian logic is inherently sensitive to lookback selection and market regime. A shorter channel can produce more frequent events and more noise, while a longer channel can reduce event frequency and delay signals. Volume-based confirmation also depends on the instrument and session structure. On some symbols, volume can be informative; on others, it may be less useful.
Retest logic is also contextual. Not every breakout will retest, not every retest will be clean, and not every valid hold will produce meaningful continuation. The retest zone is an interpretive tool designed to help chart reading, not a universal rule set for all instruments or timeframes.
The visual elements are intended to improve readability, but users may still want to tune label thresholds, style controls, and retest settings to fit their own workflow. As with any chart tool, results can vary across assets, volatility regimes, and timeframes.
Risk Disclosure
This script is for chart analysis and educational use. It is not financial advice, not investment advice, and not a promise of future performance. Markets can move unpredictably, and breakout structures can fail without warning. Any trading or investment decision should be made using independent judgment, personal risk controls, and additional confirmation where appropriate. Indicator

AG Pro EMA 200 Reclaim Map [AGPro Series]AG Pro EMA 200 Reclaim Map
Overview / What it does
AG Pro EMA 200 Reclaim Map is a chart overlay built to organize price behavior around the 200 EMA into a clearer workflow. Instead of treating the 200 EMA as a simple above/below filter, this script tracks how price interacts with that reference during reclaim attempts, acceptance phases, retests, and loss-of-level events. The goal is not to predict future price movement. The goal is to make the structure around a widely used long-horizon moving average easier to read on the chart.
The script highlights when price reclaims the 200 EMA, whether that reclaim is holding with acceptance, whether a retest develops after the move, and whether the reclaim later fails. A compact panel summarizes the current state so the chart can be read more quickly without reducing everything to a single binary signal.
This is designed as a decision-support overlay for traders who already use the 200 EMA as a contextual reference and want a more structured view of how price behaves around that level. It can be used on crypto, stocks, indices, forex, and other liquid markets, but outputs should always be interpreted in the context of the instrument, timeframe, volatility profile, and overall market structure.
Unique Edge
The main objective here is not to create another generic moving-average cross script. The distinctive part of this tool is that it treats the 200 EMA as a behavioral map rather than a yes/no trigger.
In many scripts, the 200 EMA is used only as a directional filter: price above equals bullish context, price below equals bearish context. That can be useful, but it does not say much about the quality of the interaction itself. A reclaim that is accepted cleanly after a controlled retest is different from a reclaim that briefly crosses the line and immediately loses it. Both may appear similar in a simple cross-based tool, but they do not carry the same structural meaning.
This script is built to separate those cases. It tracks whether a reclaim occurred, whether price is holding on the reclaimed side, whether a retest happened, how strong that retest appears relative to the script’s scoring rules, and whether the move later failed. In that sense, the script focuses on reclaim lifecycle mapping rather than raw cross detection.
Methodology
The core reference is the 200-period exponential moving average. From there, the script evaluates several conditions around that line.
1) Reclaim detection
A bullish reclaim occurs when price moves from below the 200 EMA to above it. A bearish reclaim occurs when price moves from above the 200 EMA to below it. These events define the initial transition point, but they are not treated as sufficient on their own.
2) Acceptance / hold logic
After a reclaim, the script tracks whether price remains on the reclaimed side for a defined window. This is used to separate fresh reclaim attempts from accepted holds and weaker continuation states. The panel reflects this with state language rather than presenting the move as an unconditional signal.
3) Retest tracking
After a reclaim, price may revisit the EMA zone. The script evaluates these retest behaviors and can classify them through an internal quality framework. This is intended to distinguish cleaner, more orderly interactions from weaker or less stable ones.
4) Stretch context
The script also measures how extended price is relative to the 200 EMA using an ATR-based context layer. This does not declare a reversal by itself. It simply adds information about whether price is relatively balanced or stretched around the reclaim structure.
5) Failure mapping
If a reclaim is later lost, the script can mark that condition as a failed reclaim. This helps separate accepted transitions from ones that could not maintain structure around the 200 EMA.
The map band around the EMA is only a visual aid. It is there to make the interaction corridor easier to recognize on the chart. It should not be interpreted as an independent support/resistance zone outside the script’s own framework.
States / Signals
This script is best read as a state-mapping overlay, not as a standalone trade engine.
Typical outputs include:
- Bias context relative to the 200 EMA
- Reclaim status
- Acceptance or weak-hold state
- Retest direction and latest retest quality
- Stretch condition relative to the 200 EMA
- Failed reclaim markers when the structure is lost
Depending on settings and chart history, you may see labels such as Bull Reclaim, Bear Reclaim, and retest quality annotations. These labels are visual markers for structural events detected by the script. They are not guarantees of continuation, reversal, or trade outcome.
Alerts
The script includes deterministic alert conditions tied to its event logic. These are designed to support workflow automation for users who want notification when a reclaim or failure condition is detected.
Because alerts are based on chart data and script logic, their usefulness will depend on the selected timeframe, the instrument traded, and the user’s own confirmation process. Alerts should be used as prompts for review, not as standalone execution instructions.
Key Inputs
The exact input list may evolve with future updates, but the script is centered around the following configuration areas:
- EMA length and source settings
- Acceptance / hold window controls
- Retest logic and retest label filtering
- Stretch context based on ATR
- Label visibility, spacing, and display density
- Map / zone display controls
- Panel visibility and panel styling options
These settings allow the script to be adapted for cleaner presentation or more event visibility depending on chart preference. A lower-noise layout may be more suitable for publishing or higher-timeframe review, while a denser layout may be more useful for inspection and testing.
Limitations & Transparency
This script does not forecast price. It does not know future direction, and it does not identify all valid trend continuations or reversals. It is a context tool built around a widely observed moving-average reference.
A reclaim above the 200 EMA does not always lead to continuation. A reclaim below the 200 EMA does not always lead to downside expansion. Retests can succeed or fail. Accepted states can break. Stretch conditions can persist longer than expected. False transitions can occur, especially in choppy or news-driven environments.
Like any moving-average-based framework, this script is also sensitive to timeframe selection. A chart that appears constructive on one timeframe may remain weak on a higher timeframe, or vice versa. Users should interpret the output within their own multi-timeframe and risk-management process.
Label placement, retest visibility, and apparent event density can also vary by volatility regime, zoom level, and chart compression. For that reason, the visual output should be treated as a structured reading aid rather than a complete market model.
This tool should not be viewed as a substitute for market structure analysis, liquidity awareness, execution discipline, or position management.
Risk Disclosure
This script is for chart analysis and educational use. It does not provide investment advice, financial advice, trading advice, or portfolio advice.
Trading and investing involve risk. Markets can move quickly, and losses can occur. No indicator, overlay, or alert system can eliminate that risk. Always use independent judgment, confirm conditions with your own process, and apply risk management appropriate to your market and strategy.
If you use this script in live markets, it is your responsibility to evaluate whether the instrument, timeframe, liquidity, volatility, and execution environment are suitable for your own decisions.
Indicator

Liquidity Trail Signals [BOSWaves]Liquidity Trail Signals - Structural Trend Engine with Liquidity Zone Detection and Position Management
Overview
Liquidity Trail Signals is a structure-aware trend following system that tracks directional price movement through an adaptive trailing stop anchored to a baseline EMA, where signal generation is governed by trail crossovers and confirmed by price structure rather than lagging oscillators or fixed threshold conditions.
Instead of relying on isolated momentum readings or static support and resistance plotting, trend state, signal generation, and level management are determined through volatility-scaled trail construction, pivot-based liquidity zone detection, and configurable position sizing that adapts entries to either immediate signal changes or trail retest confirmations.
This creates a continuously updating trend framework that reflects actual structural conviction rather than noise-reactive triggers - maintaining directional bias while price respects the trail, detecting meaningful liquidity pools at swing pivot levels, and automatically constructing risk-defined position overlays when trend state shifts occur.
Price is therefore evaluated relative to a dynamic trail boundary anchored in volatility and price structure rather than arbitrary fixed-distance rules or subjective level placement.
Conceptual Framework
Liquidity Trail Signals is founded on the principle that durable trend signals emerge when price respects a volatility-scaled trailing stop anchored to a baseline EMA, while actionable liquidity zones form at historical swing pivot highs and lows where institutional order flow is likely concentrated.
Traditional trend following tools either use fixed-distance trails that ignore volatility context or rely on static support and resistance levels that require manual placement. This framework replaces both with a unified system built on normalized trail logic, automated pivot-based zone detection, and an integrated position tool that converts every signal into a structured, risk-defined trade setup.
Three core principles guide the design:
Trend direction should be determined by an EMA-anchored trailing stop that advances in the favorable direction and never retreats until price closes through the trail boundary.
Liquidity zones should form automatically at swing pivot highs and lows, tracking breakout and retest behavior to identify when structural order flow has been absorbed or rejected.
Every trend signal should be immediately translatable into a defined trade with entry, stop loss, and multiple take profit levels without requiring manual measurement.
This shifts trend analysis from reactive signal-following into a structured, position-aware framework with automated liquidity context.
Theoretical Foundation
The indicator combines EMA baseline smoothing, Average True Range volatility measurement, unidirectional trailing stop logic, pivot-based liquidity zone construction, and configurable position sizing methodology.
A fixed-length EMA provides the trend baseline for directional reference and trail anchor calculation, while ATR offers volatility-normalized scaling for trail distance and zone thickness. Pivot detection identifies swing highs and lows that become liquidity zones, tracking break and retest conditions as price interacts with these levels. The position tool converts signal events into visually complete trade setups with risk-proportional take profit projections.
Four internal systems operate in tandem:
Trend Engine : Computes EMA baseline and maintains a volatility-scaled unidirectional trailing stop that advances with trend and reverses only on a confirmed close-based crossover.
Liquidity Zone System : Detects swing pivot highs and lows using a configurable lookback, constructs zones at each pivot, and monitors break and retest behavior with dynamic visual state updates.
Break and Retest Engine : Identifies when price closes through existing liquidity zones, marks broken zones with faded appearance, and detects subsequent retests for continuation confirmation signals.
Position Tool : Generates entry, stop loss, and three configurable R-multiple take profit levels on every signal, with selectable entry mode and optional left-edge pinning behavior.
This design allows each system component to inform the others - trail position sets stop loss distance, liquidity zones provide structural context, and break or retest events produce additional signal conditions beyond the primary trail crossover.
How It Works
Liquidity Trail Signals evaluates price through a sequence of structure-aware processes:
Baseline Calculation : EMA smoothing of close price over a configurable length creates a directional trend reference used as the trail anchor point.
Trail Positioning : In bullish trend, the trail sits below the EMA acting as dynamic support; in bearish trend, the trail sits above the EMA acting as dynamic resistance.
Trail Advancement Logic : The bullish trail can only rise, never fall; the bearish trail can only fall, never rise, creating a unidirectional risk boundary that locks in favorable progress.
Trend State Switches : Price closing below the bullish trail triggers a bearish state switch with a diamond signal marker; price closing above the bearish trail triggers a bullish state switch with a diamond signal marker.
Pivot Detection : Swing highs and lows identified using a configurable lookback window are registered as liquidity zone anchor points at their respective price levels.
Zone Construction : Each pivot creates a forward-extending box sized to current volatility, colored to reflect whether the level represents supply (swing high) or demand (swing low).
Break Detection : A close above a zone's upper boundary triggers a bullish break; a close below the lower boundary triggers a bearish break, updating the zone's appearance to a broken state.
Retest Detection : After a confirmed break, price re-entering the zone and closing back on the correct side registers a retest event, updating the zone label and reinforcing the border.
Zone Management : Maximum zone count is enforced using FIFO rotation; broken zones are optionally retained or removed immediately based on user preference.
Position Tool Construction : On the signal entry bar, close price is used as entry, the trail level is used as stop loss, and R-multiple projections are calculated for three configurable take profit targets.
Position Extension : All position lines, labels, and the risk box extend to the current bar each tick with optional left-edge pinning to the current bar or locking to the original entry bar.
Together, these elements form a continuously updating structural framework that connects trend state, liquidity context, and trade management into a single coherent system.
Interpretation
Liquidity Trail Signals should be interpreted as a unified trend and structure system with integrated position management context:
Bullish Trend State (Green) : Established when price remains above the adaptive trailing stop, indicating sustained upward momentum with the trail acting as dynamic rising support.
Bearish Trend State (Red) : Established when price remains below the adaptive trailing stop, signaling sustained downward momentum with the trail acting as dynamic falling resistance.
Trend Cloud : Gradient-filled zone between the EMA baseline and trailing stop provides visual reference for the structural gap between smoothed price and the dynamic risk boundary.
◆ Buy Signals : Green diamond markers appear on the trail when trend state switches from bearish to bullish, indicating a confirmed structural momentum shift to the upside.
◆ Sell Signals : Red diamond markers appear on the trail when trend state switches from bullish to bearish, signaling a confirmed structural momentum shift to the downside.
Colored Candles : Bar coloring reflects current trend state for immediate directional reference across the full price history.
Supply Zones (Red Boxes) : Volatility-sized zones at swing pivot highs marking areas of likely overhead supply or historical selling pressure.
Demand Zones (Green Boxes) : Volatility-sized zones at swing pivot lows marking areas of likely structural support or historical buying interest.
Broken Zone Appearance : Faded fill with reduced border opacity indicates price has closed through the zone, signaling absorption or displacement of that liquidity pool.
Retested Zone Labels : Updated label text and thickened border indicates a broken zone has been successfully retested, confirming role reversal from support to resistance or vice versa.
Position Tool Overlay : Visual trade layout showing entry level, stop loss at the current trail, and TP1/TP2/TP3 at configurable R-multiples with color-graded lines and labeled price levels.
Trail direction, zone interaction behavior, and the structural position of price relative to liquidity pools outweigh isolated candle patterns or short-term price oscillations.
Liquidity Zones
The liquidity zone system detects swing pivot highs and lows using a configurable lookback window and constructs forward-extending boxes at each pivot level, creating an automated structural map of likely supply and demand concentrations without manual placement.
Zone behavior follows a defined lifecycle:
Active Zones : Newly created zones display with standard fill opacity, indicating an untested liquidity pool that price has not yet interacted with following creation.
Broken Zones : When price closes through a zone boundary, the box transitions to a faded broken state using configurable opacity, signaling that the liquidity pool has been absorbed or displaced. Bullish breaks of supply zones and bearish breaks of demand zones each generate distinct alert conditions.
Retested Zones : After a confirmed break, if price returns to the zone and closes back on the originating side, the zone is marked as retested with updated label text and a reinforced border, confirming role reversal behavior.
Zone Rotation : When the maximum zone count is reached, the oldest zone is removed to maintain chart clarity. Broken zones can optionally be retained using the Keep Broken Zones setting, allowing historical structural context to remain visible until naturally rotated out.
Zone thickness is controlled by the Zone Thickness multiplier, allowing adjustment of how wide each liquidity band appears relative to current volatility. Extending the forward projection through the Extend Bars parameter keeps zones visible further into the right side of the chart for ongoing reference.
Liquidity zone alerts include bullish and bearish break conditions for immediate displacement detection, and bullish and bearish retest conditions for role-reversal confirmation, enabling systematic monitoring of structural level interactions without constant manual observation.
Position Tool
The position tool automatically constructs a complete trade layout on every signal bar, converting trend state switches or trail retest entries into structured, risk-defined setups with entry, stop loss, and three take profit levels calculated from the current risk distance.
Two entry modes are available:
Signal Change : The position tool draws immediately on the bar where trend state flips, using close as entry and the current trail as stop loss. This mode prioritizes responsiveness and captures the full move from the initial crossover.
Trail Retest : After a trend flip, the system waits for price to pull back and touch the trail before triggering, using the touch bar's close as entry. This mode prioritizes confirmation and typically offers a tighter risk-to-reward setup by entering at a structurally tested trail level rather than the initial crossover candle.
Stop loss is always set at the trail level at the time of entry, ensuring the risk boundary reflects the dynamic structural floor or ceiling rather than a fixed distance.
Three take profit levels are calculated as R-multiples of the entry-to-stop distance:
TP1 : First partial target at configurable R, typically used for early profit protection or a break-even scale-out level.
TP2 : Second target at configurable R, representing a standard reward objective relative to the defined risk.
TP3 : Third target at configurable R, displayed with a full-opacity line as the extended profit objective and runner target.
The risk zone between entry and stop loss is shaded with a subtle background fill to provide immediate visual reference for the defined risk area on each setup. Left-edge behavior is controlled by the Pin to Current Bar setting - when disabled, the left edge locks to the original entry bar preserving the historical trade layout; when enabled, it slides with the current bar for a compact forward-looking view. All lines, labels, and the risk box extend automatically to the current bar plus the configured Extend Bars offset.
Signal Logic & Visual Cues
Liquidity Trail Signals presents four primary interaction signals:
Buy Signal (◆) : Green diamond appears when trend state switches from bearish to bullish via trailing stop crossover, suggesting momentum shift to upside with a new dynamic support level established.
Sell Signal (◆) : Red diamond displays when trend state switches from bullish to bearish via trailing stop crossunder, indicating momentum shift to downside with a new dynamic resistance level established.
Liquidity Break : Generated when price closes through an active supply or demand zone, signaling displacement of the identified liquidity pool and potential continuation in the breakout direction.
Liquidity Retest : Generated when price returns to a broken zone and closes back on the originating side, confirming role reversal and offering secondary entry confirmation in the breakout direction.
Alert generation covers all four signal categories - bull and bear trend signals, bull and bear zone breaks, bull and bear zone retests, and bull and bear trail retest entries - enabling systematic monitoring across all interaction types.
Strategy Integration
Liquidity Trail Signals fits within structural trend-following and liquidity-aware approaches:
Trail-Based Risk Management : Use the trailing stop as the primary risk boundary - close long positions when price closes below the bullish trail, close short positions when price closes above the bearish trail.
Liquidity Zone Confluence : Enter trend-aligned positions when price retests broken demand zones during bullish trend states or broken supply zones during bearish trend states for structural confirmation.
Position Tool Execution : Use the automatically generated entry, stop loss, and take profit levels as trade management anchors rather than manually measuring risk-reward from each signal.
Trail Retest Entry Refinement : Switch to Trail Retest mode for entries requiring structural confirmation, accepting a slightly later entry in exchange for a higher-probability setup at a tested trail level.
Zone Cluster Analysis : Monitor areas where multiple liquidity zones stack in close proximity as these represent denser structural memory with heightened probability of meaningful price reactions.
Multi-Level Take Profit Laddering : Use TP1 as an initial scale-out to reduce risk, TP2 as the primary profit objective, and TP3 as a runner target held while the trail continues to advance.
Multi-Timeframe Confirmation : Apply higher-timeframe trend state as a directional filter for lower-timeframe entries, ensuring zone interactions and trail crossovers are taken in the direction of broader structural momentum.
Technical Implementation Details
Core Engine : Configurable EMA baseline with ATR volatility measurement and adjustable trail distance multiplier
Trail Model : Unidirectional advancing logic anchored to EMA, reversing only on confirmed close-based crossover
Pivot System : Configurable swing lookback for high and low detection with forward-extending zone construction
Zone Lifecycle : Active, broken, and retested states with automatic appearance transitions and FIFO rotation at maximum zone capacity
Position Tool : Dual entry mode system (Signal Change / Trail Retest) with R-multiple take profit calculation and optional left-edge pinning
Visualization : Trend cloud fill between EMA and trail, diamond signal markers, colored candles, and full position tool overlay
Signal Logic : State-switch detection for trend signals, close-based break detection for zone signals, and touch-then-close retest confirmation
Performance Profile : Optimized for real-time execution across all timeframes with efficient zone management and minimal object overhead
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Scalping with responsive trail settings and tighter zone thickness for high-frequency structural interaction
15 - 60 min : Intraday momentum following with balanced trail distance and standard zone management
4H - Daily : Swing-level structural trend identification with wider trail tolerance and extended zone projection
Suggested Baseline Configuration:
MA Length : 28
ATR Length : 15
Trail Distance : 1.25 ATR
Swing Lookback : 12
Zone Thickness : 0.35 ATR
Max Zones : 3
Extend Bars : 50
Keep Broken Zones : Enabled
Broken Zone Fade : 88
Entry Mode : Signal Change
TP1 : 1.0R | TP2 : 2.0R | TP3 : 3.0R
Bullish Color : Green (#00ff00)
Bearish Color : Red (#ff0000)
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, trending characteristics, 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:
Trail too close or loose : Adjust Trail Distance to modify how far the trailing stop sits from the EMA baseline - lower values create tighter trails with more frequent flips, higher values create looser trails with greater trend persistence.
Too many liquidity zones cluttering the chart : Reduce Max Zones to focus on the most recent structural levels, or decrease Swing Lookback to reduce pivot detection sensitivity.
Zones breaking too frequently : Reduce Zone Thickness to narrow zone bands, requiring price to move further through the level before a break is registered.
Missing important swing levels : Increase Swing Lookback to detect only the most significant pivots rather than minor swings, creating fewer but higher-conviction zone levels.
Broken zones too distracting : Increase Broken Zone Fade toward 95-100 to make broken zones nearly invisible while retaining chart history, or disable Keep Broken Zones to remove them immediately upon break.
Position tool entries too aggressive : Switch Entry Mode to Trail Retest to require price to return to and confirm the trail before constructing the position layout.
Take profit levels too conservative or extended : Adjust TP1, TP2, and TP3 R-multiple values to match the typical reward structure of the traded instrument and timeframe.
Position tool lines extending too far : Reduce Position Tool Extend Bars to keep the forward projection compact relative to recent price action.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional persistence where the trail advances continuously without frequent state reversals
Instruments with defined swing structure where pivot highs and lows create meaningful liquidity concentrations
Momentum continuation strategies using broken and retested liquidity zones as structured re-entry points
Swing trading approaches benefiting from automated position tool construction and multi-R take profit laddering
Markets where role reversal behavior at broken supply and demand zones occurs with sufficient regularity for zone retest signals to add value
Reduced Effectiveness:
Choppy, range-bound markets with frequent trail crossovers producing whipsaw signals and repeated position tool resets
News-driven or gapped markets with discontinuous price action that bypasses trail logic and creates incomplete zone interactions
Markets with irregular swing structure where pivot detection produces levels at unsuitable price points
Consolidation and sideways price action where trend-following methodologies inherently struggle due to absence of sustained directional movement
Integration Guidelines
Confluence : Combine with BOSWaves structure analysis, volume indicators, or session-based levels for additional zone confirmation
Trail Respect : Honor the trailing stop as the primary risk boundary - maintain positions while price respects the trail and close positions on confirmed breach
Zone Prioritization : Focus on liquidity zones that align with the current trend state - demand zones during bullish trends, supply zones during bearish trends
Position Tool Discipline : Use the automatically constructed position levels as pre-defined management anchors, avoiding manual adjustment of stop loss beyond the trail level
Retest Patience : Where zone retest signals are present in trend direction, treat them as higher-conviction continuation setups relative to raw trail crossover entries
State Discipline : Maintain directional bias aligned with current trend state until a confirmed trail breach occurs, regardless of short-term oscillation within the cloud
Multi-Timeframe Alignment : Use higher timeframe trend state as a directional filter for lower timeframe entries to ensure structural confluence across time horizons
Disclaimer
Liquidity Trail Signals is a professional-grade trend following and structural liquidity detection tool. It uses volatility-normalized trailing stops, pivot-based zone construction, and integrated position sizing but does not predict future price movements. Results depend on market conditions, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates price structure, volume context, and comprehensive risk management. Indicator

Zero Lag Kalman Structure [BOSWaves]Zero Lag Kalman Structure - Adaptive Trend Filtering with Deviation-Based Structure Detection
Overview
Zero Lag Kalman Structure is a precision trend identification system that tracks directional price movement through a zero-lag-compensated Kalman filter ribbon, where deviation-based structural levels dynamically form at volatility-normalized extremes and persist as active support and resistance zones until price invalidates them.
Instead of relying on fixed moving average crossovers or static support/resistance lookbacks, trend state, level formation, and break detection are determined through Kalman velocity tracking, ATR-normalized deviation measurement, and swing-based structure identification.
This creates adaptive trend boundaries and structural zones that reflect actual price conviction rather than arbitrary historical levels - contracting the ribbon during trending conditions when directional certainty is high, forming fresh levels during deviation extremes when price has meaningfully separated from the Kalman baseline, and incorporating BOS/CHoCH detection to reveal whether market structure is continuing or reversing.
Price is therefore evaluated relative to a filter that adapts to momentum velocity rather than conventional lagging averages.
Conceptual Framework
Zero Lag Kalman Structure is founded on the principle that meaningful structural zones emerge when price deviates from its statistically optimal estimated path by a volatility-significant margin, and that trend context is best captured by a filter engineered to eliminate the lag inherent to traditional smoothing methods.
Conventional support/resistance tools identify levels through historical pivot lookbacks, which ignore the dynamic nature of price conviction and the statistical state of the current trend. This framework replaces static pivot logic with Kalman-anchored deviation measurement informed by actual filter velocity and error covariance state.
Three core principles guide the design:
Trend direction should be captured by a velocity-aware Kalman filter with active lag compensation, not by lagging moving averages.
Structural levels must form at statistically significant deviation extremes, normalized to current volatility rather than fixed price distances.
Market structure breaks and character changes should be identified through swing-based logic tied to the same price data the filter operates on.
This shifts trend and structure analysis from static indicator crossovers into adaptive, filter-anchored confidence zones.
Theoretical Foundation
The indicator combines Kalman filter estimation theory, zero-lag error compensation, ATR-normalized deviation measurement, deviation zone persistence modeling, and swing pivot structure detection.
A Kalman filter baseline provides statistically optimal price estimation by balancing process noise and measurement noise parameters, while a velocity tracker within the filter captures directional momentum. Zero-lag compensation applies the residual error between current price and the filter estimate back onto the output, reducing phase delay. Deviation measurement identifies when price has separated from the filter by an ATR-scaled threshold, triggering level creation at the extreme point once price snaps back. BOS/CHoCH detection uses pivot highs and lows to identify structural breaks and character changes.
Four internal systems operate in tandem:
Kalman Filter Engine : Computes error-covariance-weighted price estimates with integrated velocity tracking, Kalman gain adaptation, and zero-lag correction applied to each bar.
Ribbon Construction System : Runs six parallel Kalman instances with incrementally increasing process noise to produce a multi-layered trend ribbon whose spread and color reflect directional strength.
Deviation Level Formation Logic : Monitors ATR-normalized distance from the Kalman estimate, records extreme highs and lows during deviation events, and creates persistent zone boxes upon mean reversion.
Market Structure Detection : Tracks swing pivot highs and lows using configurable lookback, identifies crossovers of those pivots, and classifies each break as either a BOS continuation or a CHoCH reversal depending on prior structural trend.
This design allows the trend filter, structural zones, and structure labels to operate as a unified system rather than independent overlapping indicators.
How It Works
Zero Lag Kalman Structure evaluates price through a sequence of filter-aware and deviation-driven processes:
Kalman State Initialization : On the first bar, filter state initializes with estimate equal to source price, zero velocity, and unit error covariance to establish a clean starting condition.
Prediction Step : Each bar predicts the next estimate by advancing the prior estimate by the velocity component weighted by the velocity weight parameter.
Velocity Tracking : A separate exponential tracker computes price-change velocity using a 95/5 blend of decayed prior velocity and current bar price change.
Kalman Gain Calculation : Gain is computed from current error covariance and measurement noise, controlling the balance between trusting the filter model versus reacting to new price data.
Estimate Update : The filtered estimate updates using the Kalman gain applied to the innovation - the difference between current price and the predicted estimate.
Zero-Lag Correction : Residual lag error between price and estimate is computed, then multiplied by the zero lag factor and current Kalman gain, and added back to the estimate to compress phase delay.
Ribbon Smoothing : The zero-lag estimate passes through a 0.8/0.2 exponential blend each bar to produce the final ribbon line, providing continuity without reintroducing significant lag.
Ribbon Color Gradient : The spread between the fastest and slowest ribbon lines is normalized by ATR to produce a ribbon strength value, which drives a color gradient between the configured bullish and bearish colors.
Deviation Monitoring : Each bar, the distance between close and the main Kalman line is measured in ATR units. When this exceeds the deviation threshold, the system begins tracking the extreme high or low of that deviation event.
Level Creation on Snap-Back : Once price returns inside 50% of the deviation threshold after an extended move, a new zone box is created centered on the tracked extreme, with width scaled to the level width ATR parameter.
Level Management : Active levels extend forward each bar. Broken levels - where price closes beyond the zone boundary - are deleted. When the level count reaches the configured maximum, the oldest level is removed to make space.
Retest Detection : Depending on the selected retest method, the system either monitors price interaction with zone boundaries or price proximity to the main Kalman line, applying cooldown periods to prevent signal clustering.
BOS/CHoCH Detection : Pivot highs and lows are tracked using the swing lookback parameter. Crossovers of the most recent pivot high trigger bullish structural breaks, and crossunders of the most recent pivot low trigger bearish structural breaks. The prior structural trend determines whether each break is classified as continuation (BOS) or reversal (CHoCH).
Together, these elements form a continuously updating trend and structure framework anchored in Kalman estimation theory.
Interpretation
Zero Lag Kalman Structure should be interpreted as a filter-anchored trend state with deviation-driven structural memory:
Ribbon Direction : The relative positioning and color of the six-line ribbon communicates directional trend bias. Bullish gradient color with spread above zero reflects upward trend conviction; bearish gradient with inverted spread reflects downward conviction.
Ribbon Spread Width : A widening spread between the fastest and slowest Kalman lines indicates strong directional momentum. A compressing spread suggests trend deceleration or potential transition.
Resistance Zones (Red) : Created at extreme highs where price deviated significantly above the Kalman line before snapping back, marking areas where price showed unsustainable separation to the upside.
Support Zones (Green) : Created at extreme lows where price deviated significantly below the Kalman line before recovering, marking areas where price showed unsustainable separation to the downside.
Zone Persistence : Active zones extend forward until broken by a close beyond the zone boundary, treating them as live structural reference until price demonstrably invalidates them.
BOS Labels : Dashed lines with "BOS" text mark continuation breaks of prior swing structure in the direction of the established trend.
CHoCH Labels : Dotted lines with "CHoCH" text mark counter-trend breaks of prior swing structure, signaling potential trend character changes.
▲ / ▼ Retest Signals : Small directional arrows identify price retesting either a deviation zone boundary or the main Kalman line, depending on the selected retest method.
Colored Candles : Bar coloring reflects the current ribbon gradient state for immediate directional reference across the entire chart history. Note: The original chart candles must be disabled in chart settings for the trend-colored candles to display properly.
Ribbon gradient strength, zone validity, and structural trend classification outweigh isolated price movements or individual bar reactions.
Signal Logic & Visual Cues
Zero Lag Kalman Structure presents two categories of structural interaction signals:
BOS / CHoCH Events : Labeled lines appear when price crosses a tracked swing pivot. BOS signals continuation of existing structure; CHoCH signals the first counter-trend structural break, indicating potential trend change.
Retest Signals (▲ / ▼) : Arrows appear when price interacts with an active deviation zone boundary (Levels mode) or touches the main Kalman line after sufficient separation (Kalman Line mode), confirmed by cooldown period to prevent rapid repeat signals.
Alert generation covers deviation level creation, BOS and CHoCH events, Kalman line retests, and support/resistance level retests for systematic monitoring across instruments and timeframes.
Strategy Integration
Zero Lag Kalman Structure fits within structure-aware and trend-following analytical frameworks:
Filter-Confirmed Directional Bias : Use ribbon color and spread direction as the primary trend filter before evaluating entries, favoring positions aligned with ribbon gradient.
Deviation Zone Re-entries : Use active support and resistance zones as high-probability re-entry reference areas when price returns to a level from the correct side.
BOS/CHoCH Context Alignment : Treat BOS events as continuation confirmation within established trends; treat CHoCH events as early warning of structural regime change requiring reassessment.
Retest-Based Entries : Use Kalman line or zone retests as lower-risk entry points within an established trend after initial separation has confirmed directional conviction.
Zone Invalidation as Exit Logic : Use level deletion events - where price closes beyond a zone boundary - as structural evidence that the prior support or resistance thesis is no longer valid.
Multi-Timeframe Structure Layering : Apply higher-timeframe deviation zones and BOS/CHoCH context to filter lower-timeframe entry signals for improved precision.
Technical Implementation Details
Core Engine : Kalman filter with error covariance tracking, Kalman gain adaptation, and integrated velocity model
Lag Correction : Zero-lag factor applied multiplicatively with current Kalman gain to preserve filter responsiveness at the correction stage
Ribbon System : Six parallel Kalman instances with linearly incremented process noise, blended via gradient fill
Level Formation : ATR-normalized deviation threshold with extreme tracking, snap-back detection, and box-based zone persistence
Structure Detection : Pivot high/low crossover logic with trend state tracking for BOS/CHoCH classification
Retest Logic : Dual-mode detection supporting zone boundary interaction and Kalman proximity, each with configurable cooldown
Visualization : Gradient ribbon fills, persistent zone boxes, labeled structure lines, and signal arrows
Performance Profile : Optimized for real-time execution with per-bar level management across all timeframes
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Short-term structure tracking with responsive deviation settings for intraday scalping
15 - 60 min : Intraday trend context with balanced deviation threshold and level persistence
4H - Daily : Swing-level structure identification with ATR-normalized zones carrying multi-session significance
Suggested Baseline Configuration:
Process Noise (Q) : 0.01
Measurement Noise (R) : 0.5
Zero Lag Factor : 1.0
Velocity Weight : 0.5
Ribbon Spread : 0.003
Deviation Threshold (ATR) : 1.5
Level Width (ATR) : 0.25
Maximum Levels : 6
Level Extend Bars : 50
Swing Lookback : 5
Retest Method : Kalman Line
Retest Cooldown : 50
Show Ribbon : Enabled
Show Deviation Levels : Enabled
Show BOS / CHoCH : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, structural characteristics, 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:
Filter too reactive to noise : Increase Measurement Noise (R) to make the Kalman gain more conservative and smooth the estimate more aggressively.
Filter too slow to respond : Increase Process Noise (Q) to allow faster adaptation to genuine price movements, or increase Zero Lag Factor to strengthen lag correction.
Levels forming too frequently : Increase Deviation Threshold to require greater ATR-normalized separation before a level is created.
Levels forming too rarely : Decrease Deviation Threshold to trigger level creation at more moderate deviations.
Zones too wide or too narrow : Adjust Level Width multiplier to scale zone thickness proportionally to current ATR.
Too many active levels cluttering the chart : Reduce Maximum Levels so older zones are removed sooner, keeping only the most recent structural reference.
BOS/CHoCH signals too frequent : Increase Swing Lookback to require more significant pivot formations before a structural break is recognized.
BOS/CHoCH signals too infrequent : Decrease Swing Lookback for faster swing detection and more responsive structural classification.
Retest signals clustering : Increase Retest Cooldown to enforce greater bar separation between consecutive retest events.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional phases where Kalman velocity remains consistently signed
Instruments with regular mean-reversion behavior where deviation extremes produce reliable structural zones
Swing and position trading approaches where BOS/CHoCH context informs multi-bar directional bias
Structure-based strategies that benefit from ATR-normalized level placement over fixed-point lookback methods
Reduced Effectiveness:
Choppy, range-bound markets with frequent shallow deviations that trigger premature level creation
Extremely low volatility environments where ATR normalization compresses zones to negligible significance
News-driven or gapped markets with discontinuous price behavior that bypasses zone boundaries without interaction
Markets with highly irregular volatility profiles where ATR scaling produces inconsistently sized zones
Consolidation and sideways price action where trend-following and structure-based methodologies inherently struggle due to lack of sustained directional conviction
Integration Guidelines
Confluence : Combine with volume analysis, higher-timeframe trend context, or momentum oscillators to confirm deviation zone significance
Ribbon Alignment : Trust structural breaks and retest signals occurring in the direction of the current ribbon color gradient
Zone Side Discipline : Treat deviation zones as directional only - approach support zones from above for bullish entries, resistance zones from below for bearish entries
CHoCH Awareness : Reduce directional exposure when CHoCH events occur against the prior established structural trend until a confirming BOS in the new direction appears
Velocity Respect : During periods of high Kalman velocity as reflected by wide ribbon spread, expect price to sustain moves further from the filter before meaningful retests occur
Level Invalidation Response : When a zone is broken, treat the break as structural confirmation of the new directional move rather than a retest opportunity
Disclaimer
Zero Lag Kalman Structure is a professional-grade trend filtering and structure analysis tool. It uses Kalman estimation theory with zero-lag compensation and ATR-normalized deviation measurement but does not predict future price movements. Results depend on market conditions, volatility characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates volume context, higher-timeframe bias, and comprehensive risk management. Indicator

Indicator

MST Medio v1.0MST Medio — 3-Phase Price Action Confirmation
MST Medio is a structured price action indicator that detects high-probability reversal entries using a 3-phase confirmation process: Break → Confirm → Retest. It waits for a confirmed Higher High / Lower Low, validates the impulse wave, then triggers only when price retests the key level.
No repainting. No lagging indicators. Pure price action logic built on swing structure.
────────────────
How It Works
Phase 1 — Break
Price forms a Higher High (HH) above the previous Swing High, or a Lower Low (LL) below the previous Swing Low. The break must pass two filters:
Break Strength — The break distance must exceed a minimum percentage of the previous swing range (configurable, default 0.25×).
Impulse Body Filter — The first candle closing beyond the old high/low must have a body ≥ 1.5× the 20-bar average body. This ensures the break is driven by momentum, not a weak drift.
The indicator then identifies the W1 impulse wave — the highest high (BUY) or lowest low (SELL) from the break candle until the first opposing candle.
Phase 2 — Confirm
After the impulse wave, price must pull back and then close beyond the W1 peak (for BUY) or below the W1 trough (for SELL). This confirms that momentum has resumed after the correction.
Invalidation rules:
Price returns to the entry level (old SH/SL) before confirmation → structure broken, cancel.
Price hits the Stop Loss level → cancel.
Phase 3 — Retest Entry
Once confirmed, the indicator waits for price to retest the original Swing High (BUY) or Swing Low (SELL). This is your entry point — buying at the old resistance turned support, or selling at the old support turned resistance.
Invalidation rules:
Price hits Stop Loss → cancel.
Price breaks below the W1 trough (BUY) or above the W1 peak (SELL) → cancel.
────────────────
Visual Elements
Entry / SL / TP lines (dashed) — Drawn at signal confirmation with labels showing levels and R:R ratio.
Risk/Reward zones — Colored boxes: red zone (Entry → SL) and green zone (Entry → TP) for instant visual assessment.
Confirm Break label — "▲ Confirm Break" / "▼ Confirm Break" at the wave confirmation candle.
Pending state — Dotted lines and phase labels ("Phase 1 BUY", "Phase 2 SELL") showing the indicator is tracking a potential setup before it triggers.
Swing markers (optional) — Small triangles at detected pivot highs and lows.
────────────────
Take Profit Logic
TP is placed at the high of the Confirm Break candle (BUY) or the low of the Confirm Break candle (SELL). This represents the point where momentum was confirmed — a natural target that aligns with the structure of the move.
────────────────
Inputs
Pivot Lookback (default: 5) — Bars left/right to confirm a swing point. Higher values = fewer but stronger pivots.
Break Strength (default: 0.25) — Break distance must be ≥ this multiple of the previous swing range. Set 0 to disable.
Impulse Body Filter (default: 1.5) — The break candle body must be ≥ this multiple of the 20-bar average body. Set 0 to disable.
Show Entry / SL / TP Lines — Toggle dashed level lines and labels.
Show Risk/Reward Zones — Toggle colored risk/reward boxes.
Show Pending State — Toggle the dotted lines and phase labels for setups being tracked.
Show Confirm Break Label — Toggle the confirmation label.
Show Swing Points — Toggle swing high/low markers on the chart.
Full color customization for all visual elements.
────────────────
Alerts
BUY Signal — Fires when Phase 3 retest is triggered on a bullish setup.
SELL Signal — Fires when Phase 3 retest is triggered on a bearish setup.
Any Signal — Fires on either direction.
────────────────
Notes
Works on all timeframes and all instruments.
Non-repainting — All signals use confirmed (closed) pivots. No lookahead.
This is a detection tool , not a strategy. Use it alongside your own risk management and confluence analysis.
Best suited for trending markets where HH/LL structures form clean impulse waves.
The 3-phase confirmation significantly reduces false signals compared to raw breakout detection.
Indicator

Impulse Trend Levels [BOSWaves]Impulse Trend Levels - Momentum-Adaptive Trend Detection with Impulse-Driven Confidence Bands
Overview
Impulse Trend Levels is a momentum-aware trend identification system that tracks directional price movement through adaptive confidence bands, where band width dynamically adjusts based on impulse strength and freshness to reflect real-time conviction in the current trend direction.
Instead of relying on fixed moving average crossovers or static band multipliers, trend state, band positioning, and zone thickness are determined through impulse detection patterns, exponential decay modeling, and volatility-normalized momentum measurement.
This creates dynamic trend boundaries that reflect actual momentum intensity rather than arbitrary technical levels - contracting during fresh impulse conditions when trend conviction is high, expanding during impulse decay periods when directional confidence weakens, and incorporating momentum freshness calculations to reveal whether trends are accelerating or deteriorating.
Price is therefore evaluated relative to bands that adapt to momentum state rather than conventional static thresholds.
Conceptual Framework
Impulse Trend Levels is founded on the principle that meaningful trend signals emerge when price momentum intensity reaches significant thresholds relative to recent volatility rather than when price simply crosses moving averages.
Traditional trend-following methods identify directional changes through price-indicator crossovers, which often ignore the underlying momentum dynamics and conviction levels that sustain those moves. This framework replaces static-threshold logic with impulse-driven band construction informed by actual momentum strength and decay characteristics.
Three core principles guide the design:
Trend direction should be determined by volatility-normalized momentum breaches, not simple price crossovers alone.
Band width must adapt to impulse freshness, reflecting real-time confidence in the current trend.
Momentum decay modeling reveals whether trends are maintaining strength or losing conviction.
This shifts trend analysis from static indicator levels into adaptive, momentum-anchored confidence boundaries.
Theoretical Foundation
The indicator combines exponential moving average smoothing, mean absolute deviation measurement, impulse detection methodology, and exponential decay tracking.
An EMA-based trend baseline provides directional reference, while Mean Absolute Deviation (MAD) offers volatility-normalized scaling for momentum measurement. Impulse detection identifies significant price movements relative to recent volatility, triggering fresh momentum readings that decay exponentially over time. Band multipliers interpolate between tight and wide settings based on calculated impulse freshness.
Four internal systems operate in tandem:
Trend Baseline Engine : Computes EMA-smoothed price levels for directional reference and band anchoring.
Volatility Measurement System : Calculates MAD to provide adaptive scaling that normalizes momentum across varying market conditions.
Impulse Detection Logic : Identifies volatility-normalized price movements exceeding threshold levels, capturing momentum intensity and direction.
Decay-Based Confidence Modeling : Applies exponential decay to impulse readings, converting raw momentum into time-weighted freshness metrics that drive band adaptation.
This design allows trend confidence to reflect actual momentum behavior rather than reacting mechanically to price formations.
How It Works
Impulse Trend Levels evaluates price through a sequence of momentum-aware processes:
Baseline Calculation : EMA smoothing of open and close creates a directional trend reference that filters short-term noise.
Volatility Normalization : MAD calculation over a specified lookback provides dynamic scaling for momentum measurement.
Raw Impulse Detection : Price change over impulse lookback divided by MAD creates volatility-normalized momentum readings.
Threshold-Based Activation : When normalized momentum exceeds threshold (1.0), impulse registers with absolute magnitude and directional sign.
Exponential Decay Application : Between impulse events, stored impulse value decays exponentially via configurable decay rate.
Freshness Conversion : Decaying impulse transforms into freshness metric (0-100%) representing current momentum conviction.
Adaptive Band Construction : Band multiplier interpolates between minimum (fresh) and maximum (stale) settings based on freshness, then scales MAD to determine band width.
Trend State Logic : Price crossing above upper band triggers bullish state; crossing below lower band triggers bearish state; state persists until opposite breach.
Signal Generation : Trend state switches from bearish to bullish produce buy signals; bullish to bearish switches produce sell signals.
Retest Identification : Price touching inner band edge after signal buffer period marks retests, with cooldown periods preventing excessive plotting.
Together, these elements form a continuously updating trend framework anchored in momentum reality.
Interpretation
Impulse Trend Levels should be interpreted as momentum-anchored trend confidence boundaries:
Bullish Trend State (Cyan) : Established when price closes above adaptive upper band, indicating upward momentum breach with associated confidence level.
Bearish Trend State (Magenta) : Established when price closes below adaptive lower band, signaling downward momentum breach with directional conviction.
Trend Cloud : Visual gradient zone displays between outer and inner band edges, with opacity reflecting current trend state and confidence.
Band Width Dynamics : Tighter bands indicate fresh impulse (high confidence), wider bands indicate impulse decay (reduced confidence).
▲ Buy Signals : Green upward triangles mark bullish trend state initiations at crossovers above upper band.
▼ Sell Signals : Red downward triangles mark bearish trend state initiations at crossovers below lower band.
✦ Retest Markers : Small diamonds identify price retouching inner band edge after sufficient buffer period from initial signal.
Retest Extension Lines : Horizontal projections from retest points extend forward, marking potential support/resistance levels.
Colored Candles : Optional bar coloring reflects current trend state for immediate visual reference. Note: The original chart candles must be disabled in chart settings for the trend-colored candles to display properly.
Impulse freshness, band width dynamics, and momentum normalization outweigh isolated price movements.
Signal Logic & Visual Cues
Impulse Trend Levels presents two primary interaction signals:
Buy Signal (▲) : Green label appears when trend state switches from bearish to bullish via upper band crossover, suggesting momentum shift to upside.
Sell Signal (▼) : Red label displays when trend state switches from bullish to bearish via lower band crossunder, indicating momentum shift to downside.
Retest detection provides secondary confirmation when price revisits inner band boundaries after signal buffer cooldown expires.
Alert generation covers trend state switches (long/short), retest occurrences, and impulse freshness decay below 50% threshold for systematic monitoring.
Strategy Integration
Impulse Trend Levels fits within momentum-informed and adaptive trend-following approaches:
Momentum-Confirmed Entries : Use band crossovers as high-probability trend initiation points where volatility-normalized momentum exceeded threshold.
Freshness-Based Position Sizing : Scale exposure based on impulse freshness - larger positions during fresh impulse periods, reduced sizing as impulse decays.
Band-Width Risk Management : Expect wider price ranges when bands expand during decay, tighter ranges when bands contract during fresh impulse.
Retest-Based Re-entry : Use inner band retests as lower-risk entry opportunities within established trends after initial signal cooldown.
Cloud-Aligned Directional Bias : Favor trades aligning with current trend state rather than counter-trend positions.
Multi-Timeframe Momentum Confirmation : Apply higher-timeframe impulse trend state to filter lower-timeframe entry precision.
Technical Implementation Details
Core Engine : EMA-based baseline with MAD volatility measurement
Impulse Model : Volatility-normalized momentum detection with directional sign capture
Decay System : Exponential decay application (0.8-0.99 range) with freshness conversion
Band Construction : Linear interpolation between min/max multipliers scaled by MAD
Visualization : Gradient-filled cloud zones with bar coloring and signal labels
Signal Logic : State-switch detection with retest buffer and cooldown mechanisms
Performance Profile : Optimized for real-time execution across all timeframes
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Micro-trend detection for scalping with responsive impulse settings
15 - 60 min : Intraday momentum tracking with balanced decay characteristics
4H - Daily : Swing-level trend identification with sustained impulse persistence
Suggested Baseline Configuration:
Trend Length : 19
Impulse Lookback : 5
Decay Rate : 0.99
MAD Length : 20
Band Min (Fresh) : 1.5
Band Max (Stale) : 1.9
Signal Buffer Period : 10
Show Trend Cloud : Enabled
Color Bars : Enabled (requires disabling original chart candles in chart settings)
Show Buy/Sell Signals : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, momentum characteristics, 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:
Excessive signal noise : Increase Trend Length to demand smoother baseline crossovers or increase Impulse Lookback for less reactive momentum detection.
Missed momentum shifts : Decrease Impulse Lookback to capture shorter-term momentum changes or reduce Decay Rate to allow faster impulse fade.
Bands too tight/wide : Adjust Band Min and Band Max multipliers to modify confidence zone thickness across freshness spectrum.
Impulse decays too quickly : Increase Decay Rate toward 0.99 to sustain impulse readings longer between fresh events.
Impulse decays too slowly : Decrease Decay Rate toward 0.8 for faster momentum fade and more frequent band expansion.
Unstable volatility scaling : Increase MAD Length to smooth volatility measurement and reduce sensitivity to short-term spikes.
Too many retest markers : Increase retest cooldown period (55 bars hardcoded) or increase Signal Buffer Period to space out signals.
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 and directional persistence
Instruments with consistent volatility characteristics where MAD scaling normalizes effectively
Momentum continuation strategies entering on fresh impulse signals
Trend-following approaches benefiting from adaptive confidence measurement
Reduced Effectiveness:
Choppy, range-bound markets with frequent whipsaw crossovers
Extremely low volatility environments where impulse threshold becomes difficult to breach
News-driven or gapped markets with discontinuous momentum patterns
Mean-reversion dominant conditions where momentum breaches quickly reverse
Consolidation and sideways price action where trend-following methodologies inherently struggle due to lack of sustained directional movement
Integration Guidelines
Confluence : Combine with BOSWaves structure, volume analysis, or traditional trend indicators
Freshness Respect : Trust signals occurring during high impulse freshness periods with contracted bands
Decay Awareness : Reduce position sizing or tighten stops as impulse decays and bands widen
Retest Utilization : Treat inner band retests as continuation confirmation rather than reversal signals
State Discipline : Maintain directional bias aligned with current trend state until opposite band breach occurs
Disclaimer
Impulse Trend Levels is a professional-grade momentum and trend analysis tool. It uses volatility-normalized impulse detection with exponential decay modeling but does not predict future price movements. Results depend on market conditions, volatility characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates price structure, volume context, and comprehensive risk management. Indicator

LogTrend Retest EngineLogTrend Retest Engine (LTRE)
LogTrend Retest Engine (LTRE) is an advanced trend-continuation overlay designed to identify high-probability breakout retests using logarithmic regression , volatility-adjusted deviation bands , and market regime filtering .
Unlike traditional channels or moving averages, LTRE models price behavior in log space , allowing it to adapt naturally to exponential market moves common in crypto, indices, and long-term trends.
🔹 How It Works
Logarithmic Regression Core
Performs linear regression on log-transformed price and time
Produces a structurally accurate trend midline that scales with price growth
Volatility-Adjusted Deviation Bands
Dynamic upper and lower zones based on statistical deviation
ATR weighting expands or contracts bands as volatility changes
Adaptive Lookback (Optional)
Automatically adjusts regression length using volatility pressure
Faster response in high-volatility environments, smoother in consolidation
🔹 Market Regime Detection
LTRE actively filters conditions using:
R² trend strength (trend quality, not just slope)
Volatility compression vs expansion
User-defined minimum trend strength threshold
Signals are disabled during ranging or low-quality conditions .
🔹 Breakout → Retest Signal Logic
LTRE does not chase breakouts.
Signals trigger only when:
1. Price breaks cleanly outside the deviation band
2. Market regime is confirmed as trending
3. Price performs a controlled retest within a user-defined tolerance
BUY
Break above upper band → retest → trend confirmed
SELL
Break below lower band → retest → trend confirmed
This structure is designed to reduce false breakouts and late entries.
🔹 Visual & Projection Tools
Clean midline and deviation bands
Optional filled zones
Optional future trend projection for forward structure planning
On-chart statistics for trend strength and volatility compression
🔹 Best Use Cases
Trend continuation & pullback strategies
Crypto, Forex, Indices, and equities
Works best on 15m and higher timeframes
⚠️ Disclaimer
LTRE is a decision-support tool , not a complete trading system. Always use proper risk management and confirm signals with additional structure, volume, or higher-timeframe context.
Built for traders who wait for structure — not noise.
Indicator

Adaptive Log Trend Zones + Retest SignalsAdaptive Log Trend Zones + Retest Signals
Adaptive Log Trend Zones is a trend-following overlay built to identify high-probability breakout retests in strong market conditions. It combines logarithmic regression , volatility-adaptive behavior , and ATR-based trend zones to help traders stay aligned with dominant momentum while avoiding chop.
🔹 Core Features
Logarithmic Regression Midline
Uses linear regression on log price to better handle exponential market moves
Produces smoother, more realistic trend structure on higher timeframes
Volatility-Adaptive Lookback
Automatically expands or contracts the regression length based on ATR volatility
Reacts faster in high volatility, smoother in consolidation
Dynamic Trend Zones
Upper and lower bands are ATR-adjusted and trend-colored
Optional future projection for visual trend guidance
Breakout → Retest Signal Logic
Detects clean breakouts beyond the trend zone
Waits for a controlled pullback (retest) before signaling
Signals only trigger when trend strength is confirmed
Trend Quality Filter
Internal regime detection filters out low-quality, sideways conditions
Uses slope strength and volatility compression to validate entries
🔹 Signals
BUY : Bullish breakout followed by a valid retest in a trending regime
SELL : Bearish breakout followed by a valid retest in a trending regime
Signals are designed for trend continuation , not mean reversion.
🔹 Best Use Cases
Crypto, Forex, and Index markets
Higher timeframes (15m+ recommended)
Trend continuation and pullback strategies
⚠️ Notes
This indicator is not a standalone trading system . Always use proper risk management and confirm signals with structure, volume, or higher-timeframe context.
Designed for traders who prefer structure, patience, and momentum alignment.
Indicator

Specter Trend Cloud [ChartPrime]⯁ OVERVIEW
Specter Trend Cloud is a flexible moving-average–based trend tool that builds a colored “cloud” around market direction and highlights key retest opportunities. Using two adaptive MAs (short vs. long), offset by ATR for volatility adjustment, it shades the background with a gradient cloud that switches color on trend flips. When price pulls back to retest the short MA during an active trend, the script plots diamond markers and extends dotted levels from that retest price. If price later breaks through that level, the extension is terminated—giving traders a clean visual of valid vs. invalid retests.
⯁ KEY FEATURES
Multi-MA Core Engine:
Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA as the base. The indicator tracks both a short-term MA (Length) and a longer twin (2 × Length).
Volatility-Adjusted Offset:
Both MAs are shifted by ATR(200) depending on trend direction—pulling them down in uptrends, up in downtrends—so the cloud reflects realistic breathing room instead of razor-thin bands.
Gradient Trend Cloud:
Between the two shifted MAs, the script fills a shaded region:
• Aqua cloud = bullish trend
• Orange cloud = bearish trend
Gradient intensity increases toward the active edge, providing a visual sense of strength.
Trend Flip Logic:
A flip occurs whenever the short MA crosses above or below the long MA. The cloud instantly changes color and begins tracking the new regime.
Retest Detection:
During an ongoing trend (no flip), if price retests the short MA within a 5-bar “cooldown,” the tool:
• Marks the retest with diamond shapes below/above the bar.
• Draws a dotted horizontal line from the retest price, extending into the future.
Automatic Level Termination:
If price later closes through that dotted level, the line disappears—keeping only active, respected retest levels on your chart.
⯁ HOW IT WORKS (UNDER THE HOOD)
MA Calculations:
ma1 = MA(src, Length), ma2 = MA(src, 2 × Length).
Trend = ma1 > ma2 (bull) or ma1 < ma2 (bear).
ATR shift offsets both ma1 and ma2 by ±ATR depending on trend.
Cloud Fill:
Plots ma1 and ma2 (invisible for long MA). Uses fill() with semi-transparent aqua/orange gradient between the two.
Retest Logic:
• Bullish retest: ta.crossover(low, ma1) while trend = bull.
• Bearish retest: ta.crossunder(high, ma1) while trend = bear.
Only valid if at least 5 bars have passed since last retest.
When triggered, it stores bar index and price, draws diamonds, and extends a dotted line.
Level Clearing:
If current high > retest upper line (bearish case) or low < retest lower line (bullish case), that line is deleted (stops extending).
⯁ USAGE
Use the cloud color as the higher-level trend bias (aqua = long, orange = short).
Look for diamonds + dotted lines as pullback/retest zones where trend continuation may launch.
If a retest level holds and price rebounds, it strengthens confidence in the trend.
If a retest level is broken, treat it as a warning of weakening trend or possible reversal.
Experiment with MA Type (SMA vs. EMA, etc.) to align sensitivity with your asset or timeframe.
Adjust Length for faster flips on low timeframes or smoother signals on higher ones.
⯁ CONCLUSION
Specter Trend Cloud combines trend detection, volatility-adjusted shading, and retest visualization into a single tool. The gradient cloud provides instant clarity on direction, while diamonds and dotted retest levels give you tactical entry/retest zones that self-clean when invalidated. It’s a versatile trend-following and confirmation layer, adaptable across multiple assets and styles. Indicator

Indicator

Support and Resistance Logistic Regression | Flux Charts💎 GENERAL OVERVIEW
Introducing our new Logistic Regression Support / Resistance indicator! This tool leverages advanced statistical modeling "Logistic Regressions" to identify and project key price levels where the market is likely to find support or resistance. For more information about the process, please check the "HOW DOES IT WORK ?" section.
Logistic Regression Support / Resistance Features :
Intelligent S/R Identification : The indicator uses a logistic regression model to intelligently identify and plot significant support and resistance levels.
Predictive Probability : Each identified level comes with a calculated probability, indicating how likely it is to act as a true support or resistance based on historical data.
Retest & Break Labels : The indicator clearly marks on your chart when a detected support or resistance level is retested (price touches and respects the level) or broken (price decisively crosses through the level).
Alerts : Real-time alerts for support retests, resistance retests, support breaks, and resistance breaks.
Customizable : You can change support & resistance line style, width and colors.
🚩 UNIQUENESS
What makes this indicator truly unique is its application of logistic regression to the concept of support and resistance. Instead of merely identifying historical highs and lows, our indicator uses a statistical model to predict the future efficacy of these levels. It analyzes underlying market conditions (like RSI and body size at pivot formation) to assign a probability to each potential S/R zone. This predictive insight, combined with dynamic, real-time labeling of retests and breaks, provides a more robust and adaptive understanding of market structure than traditional, purely historical methods.
📌HOW DOES IT WORK ?
The Logistic Regression Support / Resistance indicator operates in several key steps:
First, it identifies significant pivot highs and lows on the chart based on a user-defined "Pivot Length." These pivots are potential areas of support or resistance.
For each detected pivot, the indicator extracts relevant market data at that specific point, including the RSI (Relative Strength Index) and the Body Size (the absolute difference between the open and close price of the candle). These serve as input features for the model.
The core of the indicator lies in its logistic regression model. This model is continuously trained on past pivot data and their subsequent behavior (i.e., whether they were "respected" as support/resistance multiple times). It learns the relationship between the extracted features (RSI, Body Size) and the likelihood of a pivot becoming a significant S/R level.
When a new pivot is identified, the model uses its learned insights to calculate a prediction value—a probability (from 0 to 1) that this specific pivot will act as a strong support or resistance.
If the calculated probability exceeds a user-defined "Probability Threshold," the pivot is designated a "Regression Pivot" and drawn on the chart as a support or resistance line. The indicator then actively tracks how price interacts with these levels, displaying "R" labels for retests when the price bounces off the level and "B" labels for breaks when the price closes beyond it.
⚙️ SETTINGS
1. General Configuration
Pivot Length: This setting defines the number of bars used to determine a significant high or low for pivot detection.
Target Respects: This input specifies how many times a level must be "respected" by price action for it to be considered a strong support or resistance level by the underlying model.
Probability Threshold: This is the minimum probability output from the logistic regression model for a detected pivot to be considered a valid support or resistance level and be plotted on the chart.
2. Style
Show Prediction Labels: Enable or disable labels that display the calculated probability of a newly identified regression S/R level.
Show Retests: Toggle the visibility of "R" labels on the chart, which mark instances where price has retested a support or resistance level.
Show Breaks: Toggle the visibility of "B" labels on the chart, which mark instances where price has broken through a support or resistance level. Indicator

Indicator

Breaks and Retests - Free990Strategy Description: "Breaks and Retests - Free990"
The "Breaks and Retests - Free990" strategy is based on identifying breakout and retest opportunities for potential entries in both long and short trades. The idea is to detect price breakouts above resistance levels or below support levels, and subsequently identify retests that confirm the breakout levels. The strategy offers an automated approach to enter trades after a breakout followed by a retest, which serves as a confirmation of trend continuation.
Key Components:
Support and Resistance Detection:
The strategy calculates pivot levels based on historical price movements to define support and resistance areas. A lookback range is used to determine these key levels.
Breakouts and Retests:
The system identifies when a breakout occurs above a resistance level or below a support level.
It then waits for a retest of the previously broken level as confirmation, which is often a better entry opportunity.
Trade Direction Selection:
Users can choose between "Long Only," "Short Only," or "Both" directions for trading based on their market view.
Stop Loss and Trailing Stop:
An initial stop loss is placed at a defined percentage away from the entry.
The trailing stop loss is activated after the position gains a specified percentage in profit.
Long Entry:
A long entry is triggered if the price breaks above a resistance level and subsequently retests that level successfully.
The entry condition checks if the breakout was confirmed and if a retest was valid.
The long entry is only executed if the user-selected direction is either "Long Only" or "Both."
Short Entry:
A short entry is triggered if the price breaks below a support level and subsequently retests that level.
The short entry is only executed if the user-selected direction is either "Short Only" or "Both."
sell_condition checks whether the support has been broken and whether the retest condition is valid.
An initial stop loss is placed when the trade is opened to limit the risk if the trade moves against the position.
The stop loss is calculated based on a user-defined percentage (stop_loss_percent) of the entry price.
pinescript
Copy code
stop_loss_price := strategy.position_avg_price * (1 - stop_loss_percent / 100)
For long positions, the stop loss is placed below the entry price.
For short positions, the stop loss is placed above the entry price.
Trailing Stop:
When a position achieves a certain profit threshold (profit_threshold_percent), the trailing stop mechanism is activated.
For long positions, the trailing stop follows the highest price reached, ensuring that some profit is locked in if the price reverses.
For short positions, the trailing stop follows the lowest price reached.
Code Logic for Trailing Stop:
Exit Execution:
The strategy exits the position when the price hits the calculated stop loss level.
This includes both the initial stop loss and the trailing stop that adjusts as the trade progresses.
Code Logic for Exit:
Summary:
Breaks and Retests - Free990 uses support and resistance levels to identify breakouts, followed by retests for confirmation.
Entry Points: Triggered when a breakout is confirmed and a retest occurs, for both long and short trades.
Exit Points:
Initial Stop Loss: Limits risk for both long and short trades.
Trailing Stop Loss: Locks in profits as the price moves in favor of the position.
This strategy aims to capture the momentum after breakouts and minimize losses through effective use of stop loss and trailing stops. It gives the flexibility of selecting trade direction and ensures trades are taken with confirmation through the retest, which helps to reduce false breakouts.
Original Code by @HoanGhetti
Strategy

Moving Average Pullback Signals [UAlgo]The "Moving Average Pullback Signals " indicator is designed to identify potential trend continuation or reversal points based on moving average (MA) pullback patterns. This tool combines multiple types of moving averages, customized trend validation parameters, and candlestick wick patterns to provide reliable buy and sell signals. By leveraging several advanced MA methods (such as TEMA, DEMA, ZLSMA, and McGinley-D), this script can adapt to different market conditions, providing traders with flexibility and more precise trend-based entries and exits. The addition of a gradient color-coded moving average line and wick validation logic enables traders to visualize market sentiment and trend strength dynamically.
🔶 Key Features
Multiple Moving Average (MA) Calculation Methods: This indicator offers various MA calculation types, including SMA, EMA, DEMA, TEMA, ZLSMA, and McGinley-D, allowing traders to select the MA that best fits their strategy.
Trend Validation and Pattern Recognition: The indicator includes a customizable trend validation length, ensuring that the trend is consistent before buy/sell signals are generated. The "Trend Pattern Mode" setting provides flexibility between "No Trend in Progress," "Trend Continuation," and "Both," tailoring signals to the trader’s preferred style.
Wick Validation Logic: To enhance the accuracy of entries, this indicator identifies specific wick patterns for bullish or bearish pullbacks, which signal potential trend continuation or reversal. Wick length and validation factor are adjustable to suit various market conditions and timeframes.
Gradient Color-coded MA Line: This feature provides a quick visual cue for trend strength, with color changes reflecting relative highs and lows of the MA, enhancing market sentiment interpretation.
Alerts for Buy and Sell Signals: Alerts are triggered when either a bullish or bearish pullback is detected, allowing traders to receive instant notifications without continuously monitoring the chart.
Visual Labels for Reversal Points: The indicator plots labels ("R") at potential reversal points, with color-coded labels for bullish (green) and bearish (red) pullbacks, highlighting pullback opportunities that align with the trend or reversal potential.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results. Indicator

DTFX Algo Zones [LuxAlgo]DTFX Algo Zones are auto-generated Fibonacci Retracements based on market structure shifts.
These retracement levels are intended to be used as support and resistance levels to look for price to bounce off of to confirm direction.
🔶 USAGE
Due to the retracement levels only being generated from identified market structure shifts, the retracements are confined to only draw from areas considered more important due to the technical Break of Structure (BOS) or Change of Character (CHoCH).
The simple action that causes a market structure shift occurs is price breaking above or below a specific swing point. When a market structure shift happens, a retracement is drawn from the point of break to the highest or lowest point since that point. Due to the price action necessary for a market structure shift, these retracements will not always be immediately actionable.
These retracement levels are intended to be used as points to watch for price to retrace to and bounce from, confirming the current direction of price.
In the example below, after the retracement is initiated, by bouncing off of the retracement levels formed from the previous market structure shift it would further confirm the bias of the market structure shift. A break going through these levels would display a weakness from the current market structure shift, implying that it could simply be noise.
🔶 DETAILS
The script uses standard SMC Market structure identification to determine Break of Structures (BOS) and Change of Characters (CHoCH). The specific swing points can be identified by the shapes placed above or below the specific swing high/low candle.
By unchecking the "Display All Zones" setting, users are able to specify the exact number of retracement zones to display using the "Show Last" parameter. This is handy for cleaning up the chart to stay focused on the most recent retracements.
Additionally, when displaying multiple zones, the "Clean-Up Level Overlap" setting may be helpful for decluttering as well. This option optimizes the display of retracement levels to minimize their overlap on other adjacent zones.
The script allows for up to 5 Fib levels to be displayed from each zone, with options for display, value, line style, and color for each of the 5.
The calculation for Fib Levels changes depending on the direction of market structure shifts. When an upwards (Bullish) zone is generated, the retracement is drawn with the bottom of the zone being 0 and the top of the zone being 1. This is reversed for downwards (Bearish) zones.
🔶 SETTINGS
Structure Length: Sets the SMC structure length to use for finding MMS.
Show Last: Displays this number of retracement zones. (Display All Zones Must be Unchecked)
Display All Zones: Ignores "Show Last" number and displays all historical MMS Retracement Zones.
Zone Display: Choose which zones to display, only bearish, only bullish, or both.
Clean-Up Level Overlap: Minimizes overlap between adjacent zones and levels.
Fib Levels: Settings to display and customize up to 5 Fib levels for each zone.
Indicator

Inversion Fair Value Gaps [TradingFinder] IFVG ICT Signal| Alert🔵 Introduction
🟣 Inversion Fair Value Gap (IFVG)
An ICT Inversion Fair Value Gap, or reverse FVG, occurs when a fair value gap fails to hold its price, resulting in the price moving beyond and breaking the gap. This situation marks the initial change in price momentum.
Generally, prices respect fair value gaps and continue in their trend direction. However, when a fair value gap is breached, it transforms into an inversion fair value gap, signaling a potential short-term reversal or a subsequent change in direction.
🔵 How to Use
🟣 Identifying an Inversion Fair Value Gap
To spot an IFVG, you must first identify a fair value gap.
Inversion fair value gaps can be categorized into two types :
🟣 Bullish Inversion Fair Value Gap
A bullish IFVG occurs when a bearish fair value gap is invalidated by the price closing above it.
Steps to identify it :
Identify a bearish fair value gap.
When the price closes above this gap, it becomes a bullish inversion fair value gap.
This gap acts as a support level, pushing the price upwards and indicating a shift in momentum from sellers to buyers.
🟣 Bearish Inversion Fair Value Gap
A bearish IFVG happens when a bullish fair value gap fails, with the price closing below it.
Steps to identify it :
Identify a bullish fair value gap.
When the price closes below this gap, it becomes a bearish inversion fair value gap.
This gap acts as a resistance level, pushing the price downwards and indicating a shift in momentum from buyers to sellers.
🔵 Settings
🟣 Global Settings
Show All Inversion FVG: If disabled, only the most recent FVG will be displayed.
IFVG Validity Period (Bar): Determines the maximum duration (in number of candles) that the FVG and IFVG remain valid.Switching Colors Theme Mode: Includes three modes: "Off", "Light", and "Dark". "Light" mode adjusts colors for light mode use, "Dark" mode adjusts colors for dark mode use, and "Off" disables color adjustments.
🟣 Logic Settings
FVG Filter : This refines the number of identified FVG areas based on a specified algorithm to focus on higher quality signals and reduce noise.
Types of FVG filters :
Very Aggressive Filter : Adds a condition where, for an upward FVG, the last candle's highest price must exceed the middle candle's highest price, and for a downward FVG, the last candle's lowest price must be lower than the middle candle's lowest price. This minimally filters out FVGs.
Aggressive Filte r: Builds on the Very Aggressive mode by ensuring the middle candle is not too small, filtering out more FVGs.
Defensive Filter : Adds criteria regarding the size and structure of the middle candle, requiring it to have a substantial body and specific polarity conditions, filtering out a significant number of FVGs.
Very Defensive Filter : Further refines filtering by ensuring the first and third candles are not small-bodied doji candles, retaining only the highest quality signals.
Mitigation Level FVG and IFVG : Options include "Proximal", "Distal", or "50 % OB" modes, which you can choose based on your needs. The "50 % OB" line is the midpoint between distal and proximal.
🟣 Display Settings
Show Bullish IFVG : Toggles the display of demand-related boxes.
Show Bearish IFVG : Toggles the display of supply-related boxes.
🟣 Alert Settings
Alert Inversion FVG Mitigation : Enables alerts for Inversion FVG mitigation.
Message Frequency : Determines the frequency of alerts. Options include 'All' (every function call), 'Once Per Bar' (first call within the bar), and 'Once Per Bar Close' (final script execution of the real-time bar). Default is 'Once per Bar'.
Show Alert Time by Time Zone : Configures the time zone for alert messages. Default is 'UTC'.
Display More Info : Provides additional details in alert messages, including price range, date, hour, and minute. Set to 'Off' to exclude this information.
Indicator

Support and Resistance (High Volume Boxes) [ChartPrime]Support and Resistance (High Volume Boxes)
◆ Overview:
The "Support and Resistance" indicator identifies key support and resistance levels using pivot points and volume analysis. It visually represents these levels with dynamically colored boxes, indicating the strength of the volume. This helps traders recognize potential price reversals and key zones for buy and sell opportunities.
◆ Key Features:
Dynamic Support and Resistance Boxes:
The indicator plots support and resistance boxes based on pivot points and volume above threshold for positive volume boxes and below lower threshold for negative volume boxes.
Box colors change from transparent to more intense based on volume, reflecting the strength of support or resistance.
Boxes expands until a new box of the same type appears.
Volume-Based Color Coding:
Boxes are color-coded based on the amount of volume:
Green boxes indicate support levels with positive volume.
Red boxes indicate resistance levels with negative volume.
Hold Signals:
Green diamonds (◆) indicate when support holds, signaling potential buy opportunities.
Red diamonds (◆) indicate when resistance holds, signaling potential sell opportunities.
Breakout Labels:
If the price falls below a support level, that level will become resistance. If the price rises above a resistance level, it will often become support. As the price moves past a level of support or resistance, it is thought that supply and demand has shifted, causing the breached level to reverse its role.
Labels "Break Sup" and "Break Res" are displayed when support or resistance levels are broken, indicating significant market movements.
◆ Break Resistance:
◆Break Support:
◆ Usage Notes:
This indicator helps traders identify strong support and resistance levels, offering visual cues for potential price reversals.
By analyzing volume at these levels, traders can gauge the strength of these zones and make more informed trading decisions.
◆ Settings:
Lookback Period: The number of bars to look back for pivot points.
Delta Volume Filter Length: The length of the volume filter for more accurate volume analysis. (Higher input, will filter low volume boxes)
Adjust Box Width: Adjusts the width of the support and resistance boxes.
This indicator is designed to enhance your trading by providing clear visual cues for support and resistance levels based on volume, making it easier to spot potential price reversals and key trading opportunities. Indicator

Breakouts with Tests & Retests [LuxAlgo]The Breakouts Tests & Retests indicator highlights tests and retests of levels constructed from detected swing points. A swing area of interest switches colors when a breakout occurs.
Users can control the sensitivity of the swing point detection and the width of the swing areas.
🔶 USAGE
When a Swing point is detected, an area of interest is drawn, colored green for a bullish swing and red when bearish.
A test is confirmed when the opening price is situated in the area of interest, and the closing price is above or below the area, depending on whether it is a bullish or bearish swing. Tests are highlighted with a solid-colored triangle.
A breakout is confirmed when the price closes in the opposite position, below or above the area, in which case the area will switch colors.
If the opening price is located within the area and the closing price closes outside the area, in the same direction as the breakout, this is considered a retest . Retests are highlighted with a hollow-colored triangle.
Note that tests/retests do not act on wicks. The main factor is that the opening price is in the area of interest, while the closing price is outside.
🔹 Area Of Interest Width
The user can adjust the width of the swing areas. Changing the " Width " is a fast and easy way to find different areas of interest.
A higher "Multiple" setting would return a wider area, allowing price to develop within it for a longer period of time and potentially provide later test signals.
When a swing area is broken, a higher "Width" setting can make it more complicated for the price to break it again, allowing a swing area to remain valid for a longer period of time thus potentially providing more retest signals.
🔶 DETAILS
Generally, only one bullish/bearish pattern can be active at a time. This means that no more than 1 bullish or bearish area will be active.
The " Display " settings, however, can help control how areas of different types are displayed.
Bullish AND Bearish: Both, bullish and bearish patterns can be drawn at the same time
Bullish OR Bearish: Only 1 bullish or 1 bearish pattern is drawn at a time
Bullish: Only bullish patterns
Bearish: Only bearish patterns
🔹 Test/Retest Labels
The user can adjust the settings so only the latest test/retest label is shown or set a minimum number of bars until the next test/retest can be drawn.
🔹 Maximum Bars
Users can set a limit of bars for when there is no test/retest in that period; the area of interest won't be updated anymore and will be available and ready for the next Swing.
An option for pulling the area back to the last retest is included.
🔶 SETTINGS
Display: Determines which swing areas are displayed by the indicator. See the "DETAILS" section for more information
Multiple: Adjusts the width of the areas of interest
Maximum Bars: Limit of bars for when there is no test/retest
Display Test/Retest Labels: Show all labels or just the last test/retest label associated with a swing area
Minimum Bars: Minimum bars required for a subsequent test/retest label are allowed to be displayed
Set Back To Last Retest: When after "Maximum Bars" no test/retest is found, place the right side of the area at the last test/retest
🔹 Swings
Left: x amount of wicks on the left of a potential Swing need to be higher/lower for a Swing to be confirmed.
Right: The number of wicks on the right of a potential swing needs to be higher/lower for a Swing to be confirmed.
🔹 Style
Bullish: color for test period (before a breakout) / retest period (after a breakout)
Bearish: color for test period (before a breakout) / retest period (after a breakout)
Label Size
Indicator

Range Average Retest Model [LuxAlgo]The Range Average Retest Model tool highlights setups from the range average retest entry model, a model using the retest of the average between two opposite swing points as an entry.
This tool uses long-term volatility coupled with user-defined multipliers to filter out swing areas and set take profit and stop loss levels for all trades.
Key features include:
Draw up to 165 swing areas and their associated trades
Filter out swing areas using Pivot Length , Selection Mode and Threshold parameters
Filter out trades with Maximum Distance and Minimum Distance parameters
Enable or disable swing areas and select default colors
Enable or disable overlapping trades and change the default colors for Take Profit and Stop Loss zones
🔶 USAGE
The "Range Average Retest Model" is an entry model that enters a position when the price retests the average made between two swing points. Users can determine the period of the detected swing points from the "Pivot Length" setting.
The conditions for long or short trades, regardless of whether the swing area is bullish or bearish, are as follows:
Long positions: the current bar close is below the swing area average and the last bar close was above it.
Short positions: the current bar close is above the swing area average price and the last bar close was below it.
Each trade is displayed on the chart with a line connecting it to its swing area highlighting the range average, a green area for the take profit, and a red area for the stop loss.
Both the Take Profit and Stop Loss levels are calculated by applying your own multiplier in the settings panel to the long-term volatility measure, in this case, the average true range over the last 200 bars.
Trades will remain open until they reach either the Stop Loss or Take Profit price levels.
🔹 Filtering Swing Areas
The daily chart of the Nasdaq-100 futures (NQ) with pivot length 2 and bullish selection mode: it only detects bullish swing areas, but they are smaller and more numerous.
Traders can manipulate the behavior of the swing areas from the settings panel.
The Selection mode will filter areas by bias: it will detect bullish areas, bearish areas, or both.
The Threshold parameter is applied to the long-term volatility to filter out areas where the average prices are too close together; the higher the value, the greater the difference between the average prices must be.
🔹 Trades
3-minute chart of the Nasdaq-100 futures (NQ) with pivot length 5, bearish selection mode maximum distance 4, and stop loss 2: many trades detected with very asymmetric risk/reward.
The behavior of the trades is also manipulated from the settings panel.
The maximum and minimum distance parameters specify the number of bars a trade must be away from a swing area.
The Take Profit and Stop Loss parameters are applied to the long-term volatility to obtain their respective price levels.
🔹 Overlapping Trades
Same chart as before, but with overlapping trades: messy, right?
By default the tool does not show overlapping trades, this allows for a cleaner chart.
In the settings panel traders can enable overlapping mode, in which case the tool will show all available trades.
Traders must be aware that the chart can be very crowded.
🔶 SETTINGS
🔹 Swings
Pivot Length: How many bars are used to confirm a swing point. The larger this parameter is, the larger and fewer swing areas will be detected.
Selection Mode: Swing area detection mode, detect only bullish swings, only bearish swings, or both.
Threshold: Swing area comparator. This threshold is multiplied by a measure of volatility (average true range over the last 200 bars), for a new swing area to be detected it must have an average level that is sufficiently distant from the average level of any untouched swing area, this parameter controls that distance.
🔹 Trades
Maximum distance: Maximum distance allowed between a swing area and a trade.
Minimum distance: Minimum distance allowed between a swing area and a trade.
Take profit: The size of the take profit - this threshold is multiplied by a measure of volatility (the average true range over the last 200 bars).
Stop loss: The size of the stop-loss: this threshold is multiplied by a measure of volatility (the average true range over the last 200 bars).
Indicator
