Dynamic Deviation Channels (RSI Trigger) [ChartPrime]Dynamic Deviation Channels (RSI Trigger)
🔶 OVERVIEW
Standard volatility channels paint static bands across your entire chart, ignoring shifting market momentum and leading to false breakouts in trending environments. The Dynamic Deviation Channels (RSI Trigger) solves this by combining ATR-based volatility bands with a dynamic Relative Strength Index filter.
Instead of showing overlapping channels on both sides simultaneously, the indicator intelligently displays upper bands only when momentum is bullish/neutral and lower bands only when momentum shifts bearish, keeping your workspace clean and focused on active market participation zones.
🔶 HOW IT WORKS
The indicator processes market structure and momentum through a multi-stage execution pipeline:
Adaptive Mid-Line Trend Matrix: Computes a configurable moving average (SMA, EMA, WMA, or RMA) to serve as the central channel baseline, dynamically coloring itself based on short-term price slopes.
ATR Volatility Multipliers: Expands outward from the central basis using multi-tiered ATR deviations to establish structured Level 1, Level 2, and Level 3 boundary channels.
RSI Directional Filtering: A smoothed RSI engine checks prevailing momentum state. When the RSI value is at or above 50, upper channel bands activate; when it drops below 50, lower channel bands engage.
Smart Signal Generation: Plots precise entry triangles when price interacts with the primary deviation bands, utilizing a built-in bar gap control to prevent signal clustering.
🔶 KEY FEATURES
Conditional Band Rendering: Automatically hides inactive channel zones based on RSI momentum thresholds, eliminating chart clutter during strong directional trends.
Multi-Tiered Deviation Zones: Features three distinct deviation multiplier levels with custom background fills to highlight volatility expansion and over-extension zones.
Glowing Mid-Line Display: A highlighted central moving average complete with a soft glow effect for immediate trend-direction recognition.
Live Deviation Labels:** Clean, real-time price labels pinned to the final bar of each active upper and lower deviation boundary for instant reference.
🔶 TRADING APPLICATIONS
Momentum-Aligned Rebounds:** When lower bands are active during a bearish-to-neutral momentum phase, look for price rejections off Deviation Level 1 or 2 to catch high-probability counter-trend bounces.
Volatility Expansion Breakouts:** Monitor price interaction with outermost Level 3 bands. A clean break past these boundaries during high-volatility regimes signals an aggressive continuation move.
Trend Filtering via Mid-Line:** Use the glowing central moving average slope and color state to determine primary bias before taking entries off individual deviation levels.
🔶 SETTINGS
Moving Average (Length / Type): Controls the lookback period and calculation method (SMA, EMA, WMA, RMA) for the central baseline channel.
RSI Filter (Length / Source): Adjusts the sensitivity and data input source used by the momentum filter engine to toggle upper and lower band visibility.
Deviation Bands (Multipliers / Display Toggles): Customizes the width spacing for all three deviation tiers and lets you toggle the visibility of the outermost channels.
🔶 CONCLUSION
The Dynamic Deviation Channels (RSI Trigger) brings clarity to volatility channel analysis. By filtering band display through real-time RSI momentum, it ensures you are only looking at the structural levels that matter most for your current market direction. Indicador

Dynamic Grid Indicator [BigBeluga]🔵 OVERVIEW
The Dynamic Grid Indicator is an advanced technical indicator created by BigBeluga to map volatility-based grid channels across price charts while simultaneously plotting a synchronized multi-level oscillator pane. Traditional envelope indicators often use static standard deviation bands that fail to adjust to shifting trend momentum or localized price congestion. In order to provide a solution to this problem, this indicator combines a Hull Moving Average (HMA) central baseline with Average True Range (ATR) multiplier steps, automatically fading channel lines and generating precise crossover signals when price interacts with structural grid borders.
The indicator aims to visualize volatility expansion, compression, and overextended momentum zones. The core element of its calculation involves measuring price distance from the central baseline scaled by volatility steps defined as:
centerLine = ta.hma(close, hmaLength)
oscValue = atrVal != 0 ? (close - centerLine) / atrVal : 0.0
where centerLine acts as the adaptive trend anchor, and oscValue normalizes deviations into standardized grid units. Higher values of numLevels and ATR multipliers allow the indicator to filter out localized market noise and isolate major overbought or oversold structural extremes.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Dynamic HMA & ATR Grid Engine
Central Baseline Momentum: Tracks trend direction and baseline elasticity using customizable Hull Moving Average lengths via ta.hma(close, hmaLength)
Volatility Multiplier Steps: Projects up to 5 multi-tiered grid levels above and below the baseline scaled dynamically by ATR volatility.
2 — Proximity Fade & Edge Label Management
Smart Proximity Hiding: Automatically hides chart grid line segments when price approaches a level within a set percentage threshold using diff <= proxDist .
Right-Edge Price Tags: Automatically renders live numerical price tags and oscillator labels on the right edge of the chart using custom label management functions.
3 — Synchronized Oscillator Pane & Position Dashboard
Multi-Level Oscillator Fill: Projects a synchronized sub-pane oscillator complete with gradient fills and crossover signal annotations.
Position Scale Dashboard: Features an interactive table displaying real-time level states and oscillator positioning across the grid.
🔵 HOW TO USE
Apart from the basic visualization of volatility channels, this tool can also act in alternative ways to support decision-making:
Identify Channel Extremes: Monitor the outer grid levels (+3 to +5 / -3 to -5) to spot overextended market conditions where price is likely to revert or consolidate.
Trade Grid Crossovers: Look for confirmed crossover signals and direction labels (▲/▼) when price breaks across key grid boundaries to catch trend continuations.
Track Momentum via Oscillator: Observe the sub-pane oscillator line and gradient fill to gauge the strength of the current move relative to the volatility baseline.
🔵 NOTES
Why this implementation is unique:
It combines an overlay price grid with a synchronized, volatility-normalized oscillator pane in a single unified script.
The proximity fade engine keeps the chart clean by automatically removing line clutter directly under active price action.
The script is fully optimized for Pine Script version 6, utilizing advanced conditional plotting, multi-timeframe safety filters, and dynamic dashboard tables.
Indicador

Zeiierman Bands (Zeiierman)█ Overview
Zeiierman Bands (Zeiierman) is an adaptive liquidity-band indicator designed to visualize price equilibrium, liquidity stress, directional pressure, and mean-reversion opportunities directly around price.
Instead of using a standard moving average with symmetrical volatility bands, the indicator builds a custom Liquidity Mean using price, volume participation, candle range, wick behavior, and liquidity interaction. The upper and lower bands then adapt independently depending on the stress developing on each side of the market.
A higher-timeframe Liquidity Tension model colors the bands:
• Bull Color = positive directional pressure
• Bear Color = negative directional pressure
• Neutral Color = insufficient directional pressure
Reclaim triangles identify situations where price reaches a liquidity extreme and then begins moving back toward equilibrium.
█ How It Works
⚪ Liquidity Mean
Volume participation is compared with candle movement to estimate liquidity acceptance. Wick behavior is then used to adjust the price being weighted into the mean.
acceptance = relativeVolume / relativeRange
The result is a liquidity-weighted equilibrium instead of a conventional moving average.
⚪ Asymmetric Liquidity Bands
Upside and downside deviation are calculated separately using normal price dispersion, wick activity, and liquidity stress.
upper = mean + deviation * upperStress
lower = mean - deviation * lowerStress
This allows one side of the bands to expand more than the other when liquidity pressure becomes uneven.
⚪ Liquidity Color
The color engine compares price with the previous completed candle from the selected higher timeframe and combines that position with Path Efficiency.
normalizedPosition = 2 * (close - htfMid) / htfRange
rawTension = normalizedPosition * pathEfficiency
Persistent positive tension creates the Bull regime, persistent negative tension creates the Bear regime, and weaker conditions remain Neutral.
⚪ Reclaim Signals
A reclaim setup becomes armed after price reaches an outer liquidity extreme. The signal appears when price then reclaims the inner band toward the Liquidity Mean.
longReclaim = armedLong and crossover(z, -reclaimLevel)
shortReclaim = armedShort and crossunder(z, reclaimLevel)
The optional OU Filter removes reclaims when the current environment does not behave sufficiently like a mean-reverting process.
When Align Reclaims With Trend is enabled, Long Reclaims are allowed only during the Bull regime and Short Reclaims only during the Bear regime.
█ How to Use
Bull-colored bands indicate positive higher-timeframe Liquidity Pressure, while Bear-colored bands indicate negative Liquidity Pressure. Neutral bands indicate that directional pressure is not strong enough to establish either regime.
⚪ Bullish Setup
If the bands are blue, look for rejection from the lower bands. These areas can act as potential bounce zones because the setup is aligned with higher-timeframe liquidity pressure.
⚪ Bearish Setup
If the bands are yellow, look for rejection from the upper bands. These areas can act as potential rejection zones because the setup is aligned with higher-timeframe liquidity pressure.
⚪ Volatility Contraction & Expansion
When the bands begin to contract, volatility is decreasing, and price is becoming more compressed. This can signal that the market is building toward a larger move.
A breakout followed by band expansion shows that volatility is increasing and price is moving out of the compressed range.
⚪ Bearish Setup
In this example, the bands contract before price breaks lower. The bands then expand as bearish momentum accelerates, confirming the volatility expansion and continuation of the move.
⚪ Bullish Setup
In this example, the bands contract as price consolidates and volatility decreases. Price then breaks higher and the bands expand as bullish momentum increases. A second contraction develops before another breakout, followed by a stronger volatility expansion and continuation of the bullish move.
█ Settings
Length: Controls the primary calculation window.
Deviation: Controls the distance of the outer bands.
Reclaim Ratio: Controls the position of the inner reclaim bands.
Use OU Filter: Enables the mean-reversion filter for reclaim signals.
OU Strictness: Controls how selective the OU filter is.
Color Timeframe: Selects the timeframe used by the Liquidity Color Engine.
Auto Color Timeframe: Automatically moves the color engine higher according to the timeframe mapping.
Path Efficiency Length: Controls how price travel efficiency is measured.
Tension Build Length: Controls how quickly directional tension strengthens.
Tension Release Length: Controls how quickly tension fades or reverses.
Maximum Tension: Caps the Liquidity Tension value.
Trend Tension Threshold: Determines when Bull or Bear coloring becomes active.
Reclaim Signals: Shows or hides reclaim signals and their reclaim alerts.
Align Reclaims With Trend: Allows Long Reclaims only in the Bull regime and Short Reclaims only in the Bear regime.
Fill Bands: Shows or hides the area between the outer bands.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicador

Coppock Curve Multi-Filter [MarkitTick]💡 A dual-momentum oscillator built on the classic Coppock Curve, extended with an optional adaptive source pre-filter, an ADX strength gate, and a full ATR-based trade-management layer with staged take-profits, on-chart price levels, and a live dashboard. The core wave is a weighted moving average of two rate-of-change readings, but everything measured downstream of that wave — signal timing, trend bias, and risk levels — can be reshaped by up to eight independent, toggleable filters, giving traders a single oscillator that can behave anywhere from "classic long-term Coppock" to a tightly gated, multi-condition entry engine.
✨ Originality and Utility
The stock Coppock Curve is a single-purpose, long-only momentum tool: sum two rate-of-change readings, smooth with a weighted moving average, and watch for crosses above zero. This script keeps that foundation intact but restructures it into a bidirectional signal engine with a stack of independent confirmation layers that the original concept never included.
The key structural change is the adaptive source stage. Rather than feeding raw closing price directly into the rate-of-change calculations, the script offers a choice of eight different smoothing methods — including a custom Kalman Filter estimator and a custom LLAMA (Linear-Lag Adaptive Moving Average) function — that first condition the price series before Coppock's ROC math is applied. This means the character of the entire curve can be tuned from responsive to heavily smoothed without altering the underlying two-ROC-plus-WMA structure that defines the Coppock method.
Layered on top of that are seven optional gating and confirmation mechanisms (ADX strength, divergence, slope acceleration, volume, higher-timeframe alignment, volatility-adjusted zero line, and signal persistence) that traders can combine in any subset. Because each filter operates independently and can be switched on or off, the same core wave can be configured for a slow trend-confirmation approach or a fast, tightly-filtered signal generator, giving the tool a much broader utility range than a standard Coppock plot.
Beyond signal generation, the script converts each qualifying cross into a full trade plan: an ATR-derived stop-loss, three R-multiple take-profit tiers, live price levels drawn on the chart, and a real-time dashboard summarizing bias, filter states, and trade levels — none of which exist in the original Coppock Curve concept or in standard TradingView implementations of it.
🔬 Methodology and Concepts
● Core Wave Construction
The engine begins with an adaptive source stage. If no adaptive filter is selected, the raw chosen source (default: close) feeds directly into the calculation. If a filter is selected, the source is pre-smoothed using one of the following:
Simple, Exponential, or RMA-based moving averages
A Double WMA (a weighted moving average applied twice in succession, producing extra lag reduction)
A Triple VWMA (three successive volume-weighted moving average passes)
A Hull Moving Average
A custom LLAMA function, which computes a simple moving average over the lookback window, then adds a linear slope term (calculated from the change in price across the window divided by the window length) scaled by half the window length — effectively projecting the average forward along its own recent trajectory
A custom Kalman Filter estimator, which maintains a running estimate and error variance, calculates a Kalman gain each bar from the ratio of predicted error to total error, and blends the new price into the estimate proportionally to that gain — placing more weight on new data when the filter's own uncertainty is high, and more weight on the existing estimate when it is low
Once the (optionally smoothed) source is established, two Rate of Change values are calculated against it — a long lookback and a short lookback, independently configurable. These two ROC values are summed and passed through a weighted moving average, producing the final Coppock Curve value. This is structurally identical to the classic Coppock formula, but with the adaptive pre-filter as an optional intermediate step.
• ADX Strength Filter
When enabled, the script calculates the Directional Movement Index (+DI, -DI, ADX) over a configurable length. A signal — whether a slope change, a cross, or a zero-line cross — is only considered valid if the ADX reading is at or above the user-defined threshold. This filters out Coppock movements that occur during weak or directionless conditions.
• Slope and Cross Detection
The script tracks whether the curve is rising or falling bar-to-bar, and separately detects two types of crosses: a cross of the curve against its own prior value (used as the primary bull/bear signal) and a cross of the curve against the zero line (used as a secondary trend-state signal). Both cross types respect the ADX filter when it is active.
• Signal Locking
A "Lock Signal" input freezes the active signal and trade levels on the most recent bar, preventing new signals from overwriting the currently displayed trade plan — useful for holding a specific setup visible while monitoring live price action.
● Trade-Level Automation
Every new bullish or bearish cross (confirmed and unlocked) triggers a full trade-plan calculation:
Entry is set to the prior bar's close
Stop-loss is placed at a configurable multiple of ATR away from entry, in the direction opposing the trade
Three take-profit levels are calculated as configurable R-multiples of the initial risk distance (the entry-to-stop distance), projected in the trade's favor
Each level's distance from entry is also expressed as a percentage for quick reference
These levels persist on the chart until a new opposing signal fires (or, if Lock Signal is active, until manually released), and are dynamically extended to the current bar so the trade plan remains visible in real time. Take-profit and stop labels update their text once price actually touches each respective level, marking it as hit along with the realized percentage move.
● Optional Confirmation Filters
Seven additional filters exist as inputs in the script but should be understood as configuration flags a trader can layer onto the core signal logic depending on their own methodology:
Divergence Filter — intended to suppress cross signals that run counter to a detected price/Coppock divergence
Slope Acceleration Filter — intended to require the curve's slope itself to be increasing, not merely positive, before validating a signal
Volume Confirmation Filter — intended to require current volume to exceed its moving average before a signal is accepted
HTF Alignment Filter — intended to require a higher-timeframe Coppock reading to agree with the signal's direction
Volatility-Adjusted Zero Line — intended to require zero-line crosses to clear a noise band derived from the indicator's own recent volatility, reducing whipsaw signals near the zero line
Signal Persistence Filter — intended to require the curve's direction to hold for a minimum number of bars before a signal is treated as valid
Traders should treat these as intended-purpose toggles per their input tooltips and confirm behavior against the ADX filter and core cross logic, which are the two filters fully wired into the signal path in this build.
🎨 Visual Guide
● Main Panel (Separate Pane)
The primary line plot shows the Coppock Curve itself. It is colored using the Bull Color when the curve is rising and the ADX filter (if active) passes, the Bear Color when falling under the same condition, and the Neutral Color otherwise.
A histogram of the same Coppock value is plotted in columns beneath the line, using a four-tier color scheme: strong bull shading when the curve is above zero and rising, weak bull shading when above zero but not rising, weak bear shading when below zero but rising, and strong bear shading when below zero and falling.
A dashed horizontal zero line marks the neutral threshold that separates bullish and bearish curve territory.
Small triangle markers appear directly on the curve at the exact bar where it crosses zero — an upward triangle in Bull Color for an upward zero-cross, and a downward triangle in Bear Color for a downward zero-cross.
● Price Chart Overlay
When candle coloring is enabled, the price candles themselves are recolored using the same four-tier histogram coloring described above, turning the price chart into a visual heatmap of underlying Coppock strength and direction.
When a new signal fires and trade levels are enabled, five horizontal lines are drawn directly on price: a solid stop-loss line, a dashed entry line, and three dashed take-profit lines with progressively increasing opacity from TP1 to TP3. Each line carries a right-aligned label showing its role and exact price.
A shaded "risk zone" fills the area between the stop-loss and entry lines, and a "reward zone" fills the area between the entry and TP3 lines, giving an immediate visual sense of the risk-to-reward geometry of the active trade plan.
Once a take-profit or stop level is touched by price, its label updates in place to show a hit confirmation along with the realized percentage gain or loss.
● Dashboard Table
A compact table (position configurable) displays, in real time: the current symbol and timeframe, the Lock Signal state, the raw Coppock value, the current bias (Bullish / Bearish / Neutral, color-coded), the individual long and short ROC readings, whether the curve is currently above or below zero, and — when trade levels are enabled — the live Entry, SL, TP1, TP2, and TP3 prices. If the ADX filter is active, its current reading is shown alongside a pass/fail color cue. If an adaptive filter is selected, its name is displayed for quick reference.
📖 How to Use
Treat a bullish cross (curve turning up) as a potential long-side signal, and a bearish cross (curve turning down) as a potential short-side signal, especially when it aligns with a zero-line cross in the same direction.
Use the zero line as a broader trend-state filter: readings above zero generally reflect positive intermediate-term momentum, while readings below zero reflect negative momentum, independent of the immediate slope.
Enable the ADX filter to restrict signals to periods of measurable trend strength, reducing signals generated during flat or choppy conditions.
Select an adaptive filter method to change the responsiveness of the underlying source feeding the Coppock calculation — faster methods like EMA or the Kalman Filter increase sensitivity, while methods like the Triple VWMA or SMA produce a smoother, slower curve.
When a signal fires, use the automatically plotted Entry, SL, and TP1–TP3 lines as a starting reference for trade structure, and adjust position sizing according to the displayed stop distance and your own risk tolerances.
Use candle heatmap coloring as a quick visual scan across the chart to spot where momentum has historically been strongest or weakest, independent of reading the oscillator pane directly.
Configure the webhook alert action strings in the Alerts group to match the payload keys expected by your automation or webhook receiver before relying on the JSON-formatted alerts for execution.
⚙️ Inputs and Settings
• Core Settings
Source — the price series the calculation is based on (default: close)
Long ROC Length — lookback for the long-term rate-of-change component
Short ROC Length — lookback for the short-term rate-of-change component
WMA Smoothing Length — window for the final weighted moving average applied to the combined ROC values
• Filters
Use ADX Filter / ADX Threshold / ADX Length — enables trend-strength gating and configures its sensitivity
Adaptive Filter / Adaptive Filter Length — selects the pre-smoothing method applied to price before the ROC/WMA math, and its lookback window
Use Divergence Filter / Divergence Pivot Lookback — configuration for suppressing signals against detected divergence
Use Slope Acceleration Filter — configuration for requiring accelerating slope before a signal
Use Volume Confirmation Filter / Volume MA Length — configuration for requiring above-average volume
Use HTF Alignment Filter / HTF Alignment Timeframe — configuration for requiring higher-timeframe agreement
Use Volatility-Adjusted Zero Line / Volatility Zero Band Multiple / Volatility Zero Band Length — configuration for a noise-adjusted zero-cross threshold
Use Signal Persistence Filter / Persistence Bars — configuration for requiring a minimum number of bars of consistent direction
• Trade Tools
Lock Signal — freezes the currently active signal and trade levels
SL ATR Multiple — sets stop-loss distance as a multiple of ATR
TP1 / TP2 / TP3 R-Multiple — sets each take-profit distance as a multiple of the initial risk
ATR Length — lookback for the Average True Range calculation used in stop placement
Show Trade Levels — toggles the on-chart lines, labels, and dashboard trade-level rows
• Visuals
Use Candle Coloring — toggles heatmap-style recoloring of price candles
Show Histogram — toggles the columned histogram beneath the main curve
Show Zero-Cross Markers — toggles the triangle markers at zero-line crosses
• Dashboard
Show Dashboard — toggles the on-chart summary table
Position — sets the table's screen position
• Alerts
Action strings for Bull Cross, Bear Cross, Zero Cross Up/Down, Close Long/Short, and TP1/TP2/TP3/SL Hit — these populate the "action" field of each JSON alert payload, allowing the alerts to be mapped directly to webhook or automation logic
• Colors
Full palette control over bull/bear/neutral coloring, histogram tiers, dashboard styling, and all trade-level line and fill colors
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Rate of Change and the Coppock Curve
The foundation of this script is Edwin Coppock's original curve, published in Barron's in 1962, which sums a long-term and a short-term Rate of Change and smooths the result with a weighted moving average. Rate of Change itself is a first-order momentum measure — the percentage difference between the current value and its value N bars ago — rooted in the broader technical-analysis principle that the velocity of price change often leads price direction itself. Coppock's original design used a WMA specifically because it weights recent data more heavily than a simple average while remaining less reactive to single-bar noise than an exponential average.
● Weighted and Hull Moving Averages
The Weighted Moving Average used both in the final smoothing stage and optionally in the adaptive pre-filter assigns linearly decreasing weights to older data points, a technique long used to balance responsiveness against noise rejection. The Hull Moving Average, developed by Alan Hull, extends this idea by combining WMAs of different lengths in a way designed to reduce lag while preserving smoothness — a documented refinement of the general weighted-average family.
● Kalman Filtering
The Kalman Filter, originally developed by Rudolf Kálmán in the context of control and estimation theory, is a recursive algorithm for estimating an unknown value from a series of noisy observations. In this implementation, the filter maintains a running estimate and an error term, computes a Kalman gain from the ratio of predicted error to total error each bar, and updates the estimate by blending new price data in proportion to that gain. This gives the estimate more responsiveness when its own uncertainty is high and more smoothness when uncertainty is low — the same estimation principle underlying Kalman's original work, applied here to a single noisy input series rather than a multi-variable state system.
● Directional Movement and Trend Strength (Wilder)
The optional ADX filter is built on J. Welles Wilder's Directional Movement System, which derives +DI and -DI from directional price movement smoothed with Wilder's own moving average technique, then compresses their divergence into the Average Directional Index (ADX) as a bounded measure of trend strength independent of direction. Using ADX as a gating condition reflects the broader academic distinction between trend-following and mean-reverting market regimes — Wilder's system was explicitly designed to help separate the two.
● Average True Range and Volatility-Based Risk Sizing
Stop-loss and take-profit distances in this script are derived from Average True Range, also introduced by Wilder, which measures volatility by accounting for gaps as well as intraperiod range. Sizing risk as a multiple of ATR — rather than a fixed point or percentage value — is a widely documented approach in position-sizing literature because it scales stop distance to the instrument's actual recent volatility rather than an arbitrary constant.
● R-Multiples and Risk-Reward Structuring
The three-tiered take-profit structure expresses reward as a multiple of initial risk (an "R-multiple"), a framework popularized in trading risk-management literature to normalize outcomes across trades of different sizes and volatility regimes, allowing performance to be evaluated in terms of risk-adjusted return rather than raw price movement.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicador

PyraTime True Trend Line (PTTL)PTTL builds a dynamic, vector-based geometric framework utilizing two extreme market pivots (A and B) and projects their mathematical structure forward in price and time. Because it processes its own internal OHLCV data array, it bypasses native TradingView history constraints, allowing historical vectors to act on live price action without breaking down.
Why This Works
Standard trend lines are notoriously subjective, often skewed by the user pulling lines to fit a narrative. PTTL removes user bias by hard-locking purely to mathematical extremes.
Furthermore, instead of relying on a generalized Volume Profile across the entire screen, PTTL isolates its Vector POC strictly within the A-B impulse leg. This explicitly traps the liquidity nodes associated only with the trend currently being analyzed, rather than mixing it with unrelated historical chop.
How This Works
The Core Buffer: The indicator continuously records high, low, close, and volume data into a 5,000-bar rolling array. This isolates the calculations from TradingView's visual history and prevents data from dropping out when zooming or scrolling.
Dynamic Geometry: In Auto mode, PTTL perpetually hunts for the most significant A and B pivots. Because this window is dynamic, historical structure migrates as stronger dominant highs/lows appear.
Harmonic Divisions: By treating the maximum price deviation from the true A-B line as a 100% boundary, the tool mathematically slices the resulting channel into exact geometric fractions (1/8, 1/3, 1/2, etc.) to highlight internal support/resistance nodes.
Time & Price Squaring (AB=CD): PTTL measures the span of the A-B impulse and demands that the Point C retracement validates within a strict time window. Once validated, it targets an identical price/time expansion (Target D), actively grading the setup as Pending, Success, or Failed based on real-time price intersection.
Settings Guide
Mode Selection: Choose between Auto (dynamically scanning) and Manual (locking Point A to a user-defined timestamp).
Manual — One-Click Anchor: Anchor Point A to a specific timestamp and price. Pivot B Search Window dictates how many bars forward the tool should scan before permanently locking Point B into place.
Auto Mode Settings: Adjust the Scan Window to define how many bars back the tool searches for major swings, and set a Minimum AB Span to ensure it doesn't anchor to microscopic, noisy swings.
Features & Visibility: Toggle overlays like the True Trend Line, Vector POC, Parallel Channel, and Reflection angle.
AB=CD Settings: Configure the time allowance for Point C to form. If Hide Failed Patterns is on, invalidated geometries clear immediately to keep the chart clean.
Projection Settings: Decide whether Time Cycles scale against the duration of the A-B leg (× AB duration) or project forward uniformly (Fixed bars).
Alert Triggers: Fire native TradingView alerts the moment price crosses the True Trend Line, the maximum-deviation Channel rail, or the isolated Vector POC. Indicador

cephxs / CISD [base]What this solves
A CISD (Change In State of Delivery) marks the moment one side loses
control: price closes back through the run of candles that made the last
push. This script finds those moments, draws the level , and removes the
level when it fails.
What makes it different
Most CISD tools mark the open of the last opposing candle and stop there.
This one tracks the whole opposing run, not just its last candle. It
records the true extreme of the move and extends the level while the run
continues. It commits only when a candle closes through the level. It also
classifies a special case — the propulsion block — where a new CISD forms
after price holds inside the zone of an earlier CISD. Propulsion blocks get
a thinner line, so you can see the difference between continuation and a
fresh reversal. The trade-off is patience: the script draws nothing as
confirmed until a close of the breaking candle... You will never get the level at the exact turn.
How it works
A swing point forms. The script walks back through the run of
same-direction candle bodies that came before it. The open of the first
candle in that run is the CISD level.
The script draws the level as a dotted line — a pending CISD. If the
opposing move continues, the script moves the pending level with it and
updates the true extreme of the run.
When a candle closes through the level, the script confirms the CISD.
The line becomes solid, and the script places a marker on that bar.
If a pending CISD gets no confirmation close within its timeout, the
script removes it. If price later crosses the swing point that created a
confirmed CISD, the script removes that CISD. A broken level does not stay
on your chart.
A propulsion block is a confirmed CISD whose reversal extreme moved into
the zone of an earlier, still-valid CISD in the same direction and held.
The script draws it with a 1px line and gives it no Fibonacci projections.
Fibonacci projections
Each confirmed CISD can project extension levels from its stretch, in the
direction of the new delivery. Two anchor modes:
Body — projects from the candle bodies of the stretch.
Wick — projects from the true peak or trough of the whole
opposing move, wicks included.
Levels -0.5 through -4.5 have individual toggles and colors. The script
always draws levels 0 and 1 as faint reference lines. The script caps
projections per direction. On charts of less than 1 hour, new projections
in one direction must form at least 2 chart-hours apart. This gap protects
a well-placed recent projection from clustered CISDs.
How to use it
Load the script on your execution timeframe with the default settings.
It works on all symbols and timeframes.
A dotted line is a pending CISD. Do not act on it. A solid line is a
confirmed change in delivery. The level often acts as support or
resistance on a retest.
A thin solid line is a propulsion block. Read it as continuation from
an earlier level, not as a fresh reversal.
If a confirmed level disappears, price broke the swing point that
created it. Treat this removal as the invalidation.
Use the Fibonacci extensions as draw-on-liquidity targets for the move
that follows confirmation.
Settings that matter
CISD Directional Bias — default Auto. When you trade one side
of a higher-timeframe bias, set it to Bullish or Bearish.
CISD Size Filter — default on, Regular. This setting removes
stretches that are small in relation to current volatility. The smallest
preset (Really small) keeps more CISDs. The largest preset (Juicy) keeps
only significant moves.
CISD Sensitivity — default Standard. This setting controls how
many bars a pending CISD waits for its confirmation close (Standard 10,
Max 20).
Show only Macro CISD? — default off. When this setting is on,
confirmation must occur in the macro windows (minutes 00-10, 24-36, 50-59
of each hour).
Filter by Purge — default off. When this setting is on, a CISD
forms only after a sweep of a nearby swing, within your bar tolerance.
Show All Historical CISD? — default off. When this setting is
on, invalidated CISDs stay on the chart as dashed lines. The maximum-count
limit no longer applies.
Calculate From — default Body. Set it to Wick to anchor
Fibonacci projections at the true extreme of the opposing move.
Limitations
Confirmation is close-based. A confirmed CISD does not repaint. But
you get it one closed candle after the turn, never at the turn.
Pending (dotted) levels are provisional by design. They move while the
opposing run extends, and they disappear on timeout. Do not trade a dotted
line as a confirmed level.
The macro time filter uses fixed New York-aligned windows. On
timeframes of more than 1 hour, the filter has little meaning.
The script has no alerts. It is a charting tool.
The script computes levels only over the most recent bars of chart
history, not the full loaded history.
Credits
CISD is a concept from the ICT (Inner Circle Trader) body of work. The
detection engine, filters, propulsion-block classification, and projection
logic are original code. I extracted them from my own larger toolkit and
published them standalone, so traders can read, audit, and reuse the code.
FAQ
Does it repaint?
Confirmed lines and markers do not repaint. Pending dotted lines update
live, and the script can remove them. This behavior is their job, not a
defect.
Why did a confirmed line disappear?
Price traded back through the swing point that created it. The level
failed, so the script removed it. If you want to keep failed levels on the
chart, enable Show All Historical CISD.
Why do some CISDs have no Fibonacci levels?
Propulsion blocks get no projections. Projections have a cap per
direction. On charts of less than 1 hour, a minimum spacing gap applies.
This is a tool for your own analysis, not trading advice. Test it
on your own instruments and timeframes before you even think about risking money on it.
Indicador

VWAP DeltaVWAP Delta is an oscillator that plots each bar's open, high, low and close as their distance from the volume-weighted average price, instead of showing price and VWAP side by side. It's built for anyone who wants to see how far, and how consistently, price is trading away from its volume-weighted average — for example to judge how stretched an intraday move already is, or how a recent push compares to the pace of previous ones — rather than only whether price sits above or below VWAP.
The delta of each bar is measured against an EMA baseline built from the delta close, and both can optionally be smoothed with a Hull moving average before that comparison. Because VWAP accumulates from the start of each session and depends on volume, it is an intraday tool and returns na on symbols or timeframes where volume data isn't available. The indicator can display this relationship as a filled area or as its own set of candles, with colors that adapt automatically to the current bias and, in candle style, to whether momentum is currently building or fading.
Calculation
VWAP Smoothing: applies a Hull moving average to the delta series before plotting, with an adjustable length.
Baseline Length: EMA length of the baseline that the delta is compared against.
Appearance
Graphic Style: visual style for the delta series: Area or Candle.
Bull / Bear Area Color: (Area style) fill color for when the delta line is above its baseline, and for when it's below.
Bull Candle Color: (Candle style) two colors for a bullish candle body — the left one while the body is expanding versus the previous bar, the right one while it's contracting.
Bear Candle Color: (Candle style) the same pair of colors for a bearish candle body.
In Area style, the delta close is plotted as a single line against its EMA baseline, and the space between them is filled — in Bull Area Color while the delta line is above the baseline, in Bear Area Color while it's below. Only the fill is visible; the delta and baseline lines themselves stay hidden. In Candle style, the fill disappears and the delta is drawn instead as its own set of candles, built from the delta's open, high, low and close relative to VWAP; when smoothing is enabled, the high and low are clamped to the smoothed open and close, so the smoothing itself can never invert a candle's body. Each candle is colored by comparing its own delta open and close: a candle whose delta close sits above its delta open takes a bull color, any other candle — including one where open and close are exactly equal — takes a bear color; within each of those two colors, the shade further distinguishes whether the current body is larger than the previous one (expanding) or smaller (contracting). A zero line marks where price and VWAP coincide.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance. Indicador

VWAP AI - Statistical Bands & Touch Stats [Dots3Red]⚓ VWAP AI - STATISTICAL BANDS & TOUCH STATS
VWAP's standard deviation bands are treated more or less as reliable support and resistance — on faith. This script checks that faith against the actual chart in front of you: every band touch is graded, every break beyond a band is graded, and the results accumulate into a running, honest record.
✨ WHY THIS MATTERS
VWAP tells you the volume-weighted average price — where the "center of gravity" of trading has actually been. The bands around it are meant to show how far price typically wanders from that center before snapping back. But "typically" varies enormously by instrument, session, and market condition, and no plain VWAP tool tells you what's actually been happening on your chart.
This script tracks it directly:
📊 +1σ | 62% rejected (n=41)
That means 41 touches of the +1σ band have been recorded on this chart, and 62% of them resulted in price genuinely rejecting back toward VWAP. Measured history, not an assumption baked into the tool.
⚙️ HOW IT WORKS
⚓ Anchoring — VWAP resets at the start of each new period. Session is the classic intraday default; Week and Month extend the same logic to longer views. Custom Bar anchors once, permanently, to a specific historical point you choose — useful for anchoring to an earnings date, a gap, or any event you want to measure from, rather than the calendar.
📏 Two-tier statistical bands — Band 1 and Band 2 are both standard-deviation multiples of VWAP, computed from a proper running variance (not an ATR approximation). Defaults are ±1σ and ±2σ, both fully adjustable.
🎯 Touch grading — when price wicks into a band without closing beyond it, that's logged as a touch. Within a configurable window, it resolves as:
• Rejection — price moved back toward VWAP by a meaningful distance
• Break — price closed convincingly through the band
• Timeout — neither happened clearly enough to call
🔄 Break-to-reversion tracking — separately, when price actually closes beyond Band 1, the script watches whether that move reverts back toward VWAP or continues away from it. This answers a different question than touch grading: not "did the band hold," but "once it didn't, did price come back anyway?"
🔒 Non-repainting — all grading happens strictly on confirmed bars.
🧭 HOW TO USE
1️⃣ Check the band stats before treating a level as reliable. "+1σ: 71% rejected (n=38)" and "+1σ: 44% rejected (n=12)" look like the same line on the chart but mean very different things about how much to lean on it.
2️⃣ Use break-reversion stats to judge a breakout beyond VWAP's range. If breaks above Band 1 have reverted back 65% of the time on this chart, that's useful context before assuming a fresh breakout will keep running.
3️⃣ Read Price vs VWAP as the simplest possible bias check. Above VWAP means the average buyer today is in profit; below means the average buyer is underwater. It's a blunt but genuinely useful read on crowd positioning.
4️⃣ Let sample sizes build before trusting the percentages. Every stat shows its N= specifically so you can judge reliability yourself — a handful of touches is not yet a pattern.
5️⃣ Match the anchor mode to what you're actually measuring. Session for pure intraday structure, Week or Month for a longer view, Custom Bar when you want to measure from one specific moment forward.
⏱️ WHICH TIMEFRAMES WORK BEST
Session-anchored VWAP is fundamentally an intraday tool — it was built for, and is most meaningful on, timeframes where a full session contains enough bars to form a real distribution: 1-minute through 1-hour is the classic and most effective range, which is exactly where VWAP sees the heaviest institutional and day-trading use.
On daily or weekly charts, a Session anchor resets so frequently relative to the bar size that it stops being meaningful — you'd see very few bars per session. For higher-timeframe or swing-style use, switch the anchor to Week, Month, or Custom Bar instead, so the accumulation window actually spans enough bars to produce a meaningful VWAP and band structure.
The touch and break statistics also need enough occurrences to mean anything — a fast-moving intraday chart will accumulate a useful sample size in days; a slow higher-timeframe anchor will take considerably longer.
🛠️ SETTINGS
⚓ Anchoring — Session / Week / Month / Custom Bar, source price
📏 Bands — Band 1 and Band 2 standard-deviation multipliers, Band 2 visibility toggle
🎯 Touch Statistics — Touch Tolerance, Rejection Distance, Reversion Distance, Outcome Window
🎨 Visualization — independent Band 1 / Band 2 touch marker toggles, Dot or Triangle marker style, marker size, VWAP and band line widths, independent fill transparency per band tier
🎨 Colors — VWAP line, Band 1 lines, Band 2 lines, upper/lower touch markers, Price Above/Below VWAP indicator, and full dashboard color control (background, border, header, row styling)
🖥️ Dashboard — show/hide, position — current VWAP value, price position, all four band stats, and both break-reversion stats in one place
📝 NOTES
Statistics accumulate from when the indicator is added to the chart and reset only when explicitly cleared by reloading. A Custom Bar anchor never resets on its own, it measures continuously from the point you chose. Band 2 statistics take meaningfully longer to build a useful sample than Band 1, simply because price reaches ±2σ far less often than ±1σ.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical rejection and reversion rates do not guarantee future performance. Indicador

Markus Channel + Dual Expansion Envelopes_V1Markus Channel + Dual Expansion Envelopes (Crossover Multiplier MA)
█ OVERVIEW
Markus Channel + Dual Expansion Envelopes is a multi-layer expansion trading system originally designed and calibrated around XAUUSD for spot traders.
Most retail brokers (Vantage, IC Markets, Pepperstone, etc.) do not provide a true order book or Level 2 data on gold. The only reliable real-time participation metric available is tick volume. This indicator was built from the ground up to extract maximum information from tick volume and turn it into a clean, adaptive expansion framework.
At its core sits an original hybrid construction — the Markus Channel — which fuses a volume-sensitive Keltner core with the statistical width of Bollinger Bands. Around this core, two adaptive outer envelopes (Orange Expansion + Blue Trigger) and a dynamic Crossover Multiplier MA are projected.
The result is a complete visual hierarchy for gold expansion / breakout trading when you only have tick volume to work with:
Core structure → First expansion → Confirmed expansion → Dynamic multiplier targets
█ HOW IT WORKS
⚪ 1. Auto MA Selection Engine (Adaptive AI)
Five classic moving averages are calculated in parallel (SMA, EMA, RMA, WMA, VWMA).
Each candidate is scored using a combined error function:
Lag Error = SMA( (MA − Source)² , length )
Jitter = SMA( (ΔMA)² , length )
Score = Lag Error + (Jitter × Penalty)
The MA with the lowest score is automatically selected. This keeps the center line optimally responsive on the highly volatile XAUUSD tick stream.
⚪ 2. Markus Channel (Original Hybrid Construction for Spot Gold)
Because no real order book is available, the entire channel is driven by tick volume:
1. Midline = Auto-selected MA of close (Base Center Length)
2. Bollinger Bands = Midline ± (StdDev × BB Multiplier)
3. Tick Volume Ratio = Volume / SMA(Volume, Vol Length)
4. Dynamic Keltner Multiplier = clamp( 3.0 + (Volume Ratio − 1) × Volume Sensitivity , 3.0 , 4.0 )
5. Keltner Bands = Midline ± (ATR × Dynamic Multiplier)
6. Band Difference = Bollinger − Keltner
7. Smoothed Difference = SMA(Band Difference, Diff MA Length)
Final Markus Bands:
Markus Upper = Keltner Upper + Smoothed Upper Difference
Markus Lower = Keltner Lower + Smoothed Lower Difference
This construction allows the channel to:
• Expand aggressively when tick volume spikes (the only real-time participation signal available on most brokers)
• Retain the statistical properties of Bollinger Bands
• Smooth the difference so the final bands remain stable even during gold’s fast moves
⚪ 3. Orange Expansion Envelope
Channel Width = Markus Upper − Markus Lower
Average Width = SMA(Channel Width, Expansion MA Length)
Volume Boost = 1 + max(0, Tick Volume Ratio − 1) × Orange Volume Boost
Orange Offset = (Average Width × 0.5 × Orange Base Multiplier) × Volume Boost
Orange Upper / Lower = Markus Bands ± Orange Offset
Optional “Breakouts Only” mode keeps the chart clean until price actually leaves the Markus channel.
⚪ 4. Blue Trigger Channel
Two memory modes designed for gold’s expansion behavior:
• Dynamic Tracking – slowly decays after the expansion ends
• Hold Peak Level – latches the extreme expansion level until a new expansion occurs
A final volatility buffer (scaled by the same tick-volume boost) is applied to create the Blue Trigger zone.
⚪ 5. Crossover Multiplier MA Engine
On every cross of the selected target (Midline / Markus / Orange / Blue):
Raw Multiplier = Dynamic Keltner Multiplier × Tick Volume Ratio
The multiplier is latched on the cross and smoothed by the Auto MA engine. Projection lines are then drawn:
Cross Upper / Lower = Midline ± (ATR × Smoothed Multiplier)
These lines act as adaptive, volume-scaled targets that expand and contract with real participation — critical when trading XAUUSD without an order book.
█ HOW TO USE (XAUUSD Spot Focus)
• Expansion Detection
Background turns green/red when price breaks a Markus band while channel width is expanding on rising tick volume.
• First Target
Orange Envelope = initial expansion objective on gold.
• High-Conviction Expansion
Blue Trigger Channel = stronger expansion zone (especially useful in Hold Peak mode during London/NY gold sessions).
• Dynamic Targets After Cross
Crossover Multiplier lines provide live support/resistance that scale with the intensity of the tick-volume surge.
• Regime Context
The HUD shows active MA type, current multiplier strength, expansion state, and bullish/bearish regime at a glance.
Built specifically for traders who trade gold spot CFDs and only have tick volume as their real-time activity metric.
█ SETTINGS
• Auto MA Selection Engine – Adaptive AI or Manual
• Markus Engine – Base length, BB multiplier, ATR length, tick-volume sensitivity, difference MA
• Orange Expansion Envelope – Base multiplier + volume boost + breakout-only mode
• Blue Trigger Channel – Buffer size + Dynamic / Hold Peak memory
• Crossover Multiplier MA – Target layer + smoothing length
• Full visual control (clouds, backgrounds, candle coloring, HUD, colors)
█ NOTES
The Markus Channel is an original hybrid construction developed and tuned on XAUUSD. It deliberately uses tick volume (the only participation data most brokers provide) instead of relying on a non-existent order book. All outer envelopes and the Crossover Multiplier engine are derived from this core structure.
Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
Not financial advice ! Indicador

Split VWAPWhat it does
Split VWAP cuts every bar horizontally at the session VWAP and draws it as two candles at the same position: one spanning the low up to VWAP, one spanning VWAP up to the high. Each partial takes the bar's open and close clamped into its own range, and a share of the bar's volume proportional to its height. Where VWAP sits at or beyond a bar's extreme, one partial collapses to zero height and the other takes the whole bar and all of its volume; the collapsed one is hidden by default.
A single candle gives you four prices and one volume total, but says nothing about how that activity was distributed relative to the session's average price. Splitting the bar at VWAP and attributing volume to each side makes that distribution visible.
How the colouring works
Each partial is coloured from two changes, both measured against the previous bar's partial on the same side of VWAP: the change in attributed volume, and the change in clamped close.
In the default mode, "Volume hue OKLCh", each change gets a channel of its own. The volume change moves the hue along a continuum — red (
#ea6c5c, hue 29) when it fell, green (
#05b28d, hue 171) when it held, blue (
#7b8efa, hue 274) when it rose. The price change moves the lightness: lighter when the close rose, darker when it fell.
All three anchors sit at an OKLCh lightness of 0.680 and hold as much chroma as their hue can carry at that lightness, capped at 0.16 so the ends do not shout over the middle. Green is the quiet one because green simply cannot hold as much. OKLCh is used rather than HSL because HSL treats lightness as a function of the hue you happen to be on, so a fixed magnitude renders brighter on some hues than others; in OKLCh, lightness, chroma and hue move independently.
Bodies are hollow when the partial's clamped close is above its clamped open, and solid otherwise. A dot marks the VWAP level itself, coloured by the same scheme applied to the whole bar.
Three further modes are included — Quadrant intensity, Bilinear blend and Polar OKLCh. These read the two changes as four corner colours instead of two channels, one per sign combination, and use magnitude to drive chroma and opacity. Every corner and anchor colour is an input.
Scaling
Every series is normalised against the dispersion of its own bar-to-bar changes: 2.5x the mean absolute change over a lookback, which is roughly two standard deviations for a well-behaved distribution but far less sensitive to the occasional volume spike.
Measuring each series against itself matters more than it sounds. A partial carries only a fraction of the bar's volume, so normalising its volume change against the whole bar's average volume compresses that axis and leaves the colour field stuck near the middle. In the other direction, half the ATR is smaller than a typical close-to-close move, so the price axis clips on a large share of bars. It also gives the VWAP-pinned partial a usable scale: when a bar closes above VWAP the lower partial's close is pinned to the cut, so its only movement is VWAP drift — small in absolute terms, but perfectly legible against its own dispersion.
The consequence worth holding on to while reading the chart: the colour says how unusual a change is for that partial, not how large it is in absolute terms.
Setup
The script paints over the chart's native candles, but Pine cannot hide the chart symbol itself. For the cleanest result, right-click the chart, open Settings -> Symbol, and uncheck Body, Borders and Wick.
Settings worth knowing
Gradient mode — the four schemes described above.
Price lightness span — how far a full-strength price change moves the lightness off the anchor, in OKLCh lightness. Default 0.16. A wider span reads more decisively but costs colour at both ends, because sRGB is widest in the middle and narrows toward black and toward white. Rather than let the channels clip, the requested chroma is fitted to whatever the lightness and hue can actually carry, so bright bars are pastel and dark bars are saturated.
Response ramp — how quickly the colour responds as a change grows. 1.0 is proportional; the default 0.6 reaches most of the response earlier, so only genuinely quiet bars stay washed out.
Price change scale / Volume change scale — the lookbacks for the two normalisers.
Transparency at no change — how far quiet bars recede. Lower it if the quiet end reads too faint.
Limitations
Volume attribution is proportional to segment height, not measured from intrabar data. It is a shape-preserving approximation, not a true intrabar volume profile.
The VWAP is session-anchored, so the split level resets at each session boundary and the first bars of a session sit close to it.
On a strongly trending session, price can run far enough from the session VWAP that one partial collapses on most bars and the display degrades toward ordinary candles. That is expected behaviour rather than a fault.
The script requires a symbol that reports volume, and raises a runtime error on symbols that report none.
Originality
This is original work. The bar splitting, the volume attribution, the per-partial normalisation, and the OKLCh colour handling — including the OKLab conversions and the chroma fitting, neither of which Pine provides — are implemented from scratch. No third-party code is reused. Indicador

Pattern Atlas : Geometric Indicator [AxeAlgo]Pattern Atlas : Geometric Indicator
A chart-native scanner for 16 classical price-structure ("geometric") chart
patterns. It tracks confirmed swing pivots as they form and, when a run of
pivots satisfies the geometry of a known pattern and its breakout condition, it
marks the pattern on the chart with an outline box, an optional construction
skeleton, a measured-move target, and a labelled pin signal. It also keeps a
live status table of every pattern it knows.
All pattern-recognition logic lives in the companion Pine library
"Pattern Atlas : Geometric ". This script is the visualization and
alerting layer on top of it, so the detection rules stay in one place that can
be maintained and audited on their own.
Patterns detected
Reversal patterns: Head & Shoulders and its Inverse; Double Top and Double
Bottom; Triple Top and Triple Bottom; Rounding Top and Rounding Bottom; Diamond
Top and Diamond Bottom; Broadening Formation; and the V-Top / V-Bottom spike.
Continuation patterns: Ascending Triangle; Descending Triangle; Symmetrical
Triangle; Rising and Falling Wedge; Bull and Bear Flag; Bull and Bear Pennant;
Rectangle; and Cup & Handle with its Inverted form.
Structural patterns: Island Reversal and Bump-and-Run Reversal.
How it works
First, a rolling list of confirmed swing highs and lows is maintained. The
"Pivot left bars" and "Pivot right bars" inputs set how many bars on each side
of a candidate must be less extreme for it to count as a pivot. Higher values
give fewer, more significant pivots and a longer confirmation lag.
Next, each pattern function inspects the recent pivot sequence for its defining
shape together with the price move that confirms it. For example, Head &
Shoulders looks for three peaks with a lower-shoulder relationship and a close
back through the neckline; an Ascending Triangle looks for a flat resistance
base with a rising support line and a close through the base.
Each match reports its direction (bullish or bearish), the exact pivots it was
built from, a text description, a strength score, and a measured-move price
target.
Strength score
The strength score runs from 0 to 100 percent and measures how decisively price
broke through the pattern's confirmation level, relative to the pattern's own
price range. A higher score means a cleaner, more committed break.
Patterns defined by a single point, such as the Spike and the Island Reversal,
have no internal range to measure against and always score a neutral 50 percent.
The "Minimum pattern strength to show" input filters marginal matches off the
chart and out of the alerts.
Measured-move targets
The target is a classical projection: the pattern's own height added to or
subtracted from the breakout point, shown as a small price label. No ray is
drawn out to it.
Targets are not shown for the Spike, the Island Reversal, or the Bump-and-Run
Reversal, because those patterns have no reliable height to project from.
Repainting
Every box, line, target, and pin is drawn only on a closed bar. Each match is
gated so it appears, and alerts, only once, on the bar it is first confirmed.
Swing pivots are only known a number of bars after they occur, equal to
"Pivot right bars". That confirmation lag is structural to pivot-based analysis,
not repainting. Nothing already drawn is moved or removed on later bars.
What you see on the chart
A box outlines the full pivot span of each match, coloured by direction.
Construction lines draw a zig-zag through the exact pivots that built the
pattern. This is off by default.
Construction points place a small circle on each of those pivots. This is also
off by default.
A target label shows the measured-move price.
A pin signal is a thin stem with a glowing gem at its tip, placed below the bar
for a bullish match and above it for a bearish one. Hovering the gem shows the
full list of matches on that bar with their strength and targets.
The scanner table lists every pattern with a live status column. When a pattern
matches on the current bar the row shows its name and strength percent; when it
does not, the row shows a dash. Hovering any row shows that pattern's
description.
Inputs
Pivot Detection controls the left bars, right bars, and the maximum number of
pivots tracked.
The Reversal, Continuation, and Structural groups each have a master enable
switch plus one checkbox per pattern, so a whole category can be turned off in
one click.
Display controls the boxes, construction lines, construction points, targets,
and pin signals; the minimum strength filter; the table on/off, position, and
text size; and the bullish and bearish colours.
Watermark switches between a Dark and a Light theme.
Alerts
There is one alert condition per pattern, plus an "Any Bullish Chart Pattern"
and an "Any Bearish Chart Pattern" condition.
There is also a single dynamic alert() call that fires once per closed bar with
the full list of patterns found on that bar, along with their strength and
targets. Add it using the "Any alert() function call" option when creating the
alert.
Every alert condition is gated to confirmed bars in the code itself, so none of
them can fire from a still-forming bar regardless of the alert frequency chosen.
Notes
Chart-pattern recognition is inherently approximate. Treat matches as structured
context rather than mechanical trade signals, and confirm them with your own
analysis.
The indicator works best on liquid instruments and on timeframes where swings
are well defined. Very low timeframes produce noisy pivots.
This is not financial advice.
Dependency: Pattern Atlas : Geometric , a Pine library.
Indicador

Indicador

Volatility Regime Tracker | NickJoanVolatility Regime Tracker | NickJoan
Core Idea
Volatility Regime Tracker measures the dispersion of price relative to its recent average and classifies the current market environment into distinct volatility states. Instead of just showing raw volatility values, the indicator uses percentile-based thresholds combined with moving average direction to identify three persistent regimes: LOW, NEUTRAL, and HIGH.
The script goes beyond simple volatility measurement by tracking how long each regime has lasted and comparing it to historical averages, giving you a statistical expectation for when the current regime might end.
The indicator can be used in two ways:
• As a volatility gauge, where you monitor the current volatility percentage and its trend.
• As a regime detection tool, where the background colors and duration table help you anticipate volatility state changes.
Calculation Logic
The indicator works through three main stages:
1. Volatility calculation
For the selected price source, the script first calculates the standard deviation over a user-defined lookback window. This absolute volatility is then normalized by the average price to produce a percentage-based measure.
• The script calculates the standard deviation of the source over the lookback period.
• It calculates the simple moving average of the source over the same period.
• It divides standard deviation by average price and multiplies by 100.
• It optionally annualizes the result using √365 for crypto daily charts.
This creates a coefficient of variation measure that shows how much price typically deviates from its recent average as a percentage.
2. Regime classification
The script then determines whether current volatility is high, low, or neutral relative to recent history.
• It calculates the percentile rank of current volatility over a regime lookback window.
• It compares this percentile to user-defined thresholds (default: 30th and 70th percentiles).
• It classifies volatility as HIGH (above upper threshold), LOW (below lower threshold), or NEUTRAL (between thresholds).
3. Dual confirmation
To reduce false signals, the script combines percentile ranking with moving average direction.
• It calculates a moving average of the volatility series.
• It checks whether current volatility is above or below this MA.
• It assigns regime states based on both percentile and MA direction.
This dual-confirmation approach produces five distinct visual states that map to three underlying regimes.
Background Color Logic
The script uses a two-layer color system to show both regime state and confidence level.
Strong signals (darker colors)
• Dark red: High percentile AND above MA (strong high volatility)
• Dark green: Low percentile AND below MA (strong low volatility)
Moderate signals (lighter colors)
• Light red: Neutral percentile but above MA (rising volatility)
• Light green: Neutral percentile but below MA (falling volatility)
Uncertain signals
• Gray: Percentile and MA direction disagree (conflicting signals)
This color structure allows you to distinguish between high-confidence regime readings and transitional or uncertain states.
Regime State Mapping
The indicator consolidates the five color states into three regime categories for duration tracking:
• LOW (0): Any green shade (dark or light) - volatility is low or falling
• NEUTRAL (1): Gray - volatility is in transition or conflicting
• HIGH (2): Any red shade (dark or light) - volatility is high or rising
This mapping ensures the duration statistics reflect the broader regime environment rather than short-term color fluctuations.
Duration Tracking Logic
The script continuously monitors regime changes and builds a historical record of how long each regime typically lasts.
Duration measurement
• When a regime change is detected, the script calculates how many bars the previous regime lasted.
• This duration is stored in an array specific to that regime type (LOW, NEUTRAL, or HIGH).
• The process repeats for each regime change, building a distribution of historical durations.
Statistical analysis
• The script calculates the average duration for each regime type from the stored history.
• It calculates the standard deviation of those durations.
• It computes confidence intervals at ±1 standard deviation (~68% confidence).
Real-time tracking
• The script counts how many bars the current regime has lasted.
• It displays this count alongside the historical average and confidence bounds.
• This allows you to see whether the current regime is typical, unusually short, or unusually long.
Duration Table Output
The table displays four rows of information for each regime type:
• Current bars in regime (if active) or "—" (if inactive)
• Historical average duration for LOW regimes
• Lower bound (average − 1 SD)
• Upper bound (average + 1 SD)
Interpretation
• If current bars < lower bound: regime is unusually short (may extend further)
• If current bars ≈ average: regime is typical (no strong expectation either way)
• If current bars > upper bound: regime is unusually long (may be nearing end)
Chart Output
The indicator displays three visual elements in a separate pane below the price chart:
Volatility line
• Shows the current annualized volatility percentage
• Plotted in blue for clear visibility
Moving average line
• Shows the smoothed volatility trend
• Plotted in gray with thicker linewidth
• Can be toggled off via input
Background color
• Shows the current volatility regime state
• Uses five color states mapped to three regimes
• Can be toggled off via input
Duration table
• Positioned at middle-right of the chart
• Shows current bars, average, and confidence intervals
• Can be toggled off via input
Inputs
The indicator has four main input groups.
CALCULATION
• Volatility Lookback (bars): defines the window used to calculate standard deviation. Default: 50.
• Annualize (√365): toggles annualization of volatility. Recommended for crypto daily charts.
• Source: selects the price series used in the calculation (default: close).
MOVING AVERAGE
• Type: chooses the MA type (SMA, EMA, WMA, RMA). Default: EMA.
• Length: sets the MA lookback period. Default: 30.
• Show Moving Average: toggles MA visibility on the chart.
VOLATILITY REGIME
• Regime Lookback (bars): defines the window used for percentile rank calculation. Default: 100.
• Low Threshold (percentile): sets the lower percentile boundary. Default: 30.
• High Threshold (percentile): sets the upper percentile boundary. Default: 70.
• Show Background Color: toggles regime coloring.
DURATION TABLE
• Show Duration Table: toggles the statistics table visibility.
• History Lookback (days): controls how many bars of history to use for average calculations. Default: 365.
Alerts
The script includes four alert conditions:
Volatility Regime Change
• Triggers on any regime transition (LOW → NEUTRAL, NEUTRAL → HIGH, etc.)
• Useful for monitoring all state changes
Low Volatility Regime
• Triggers when entering LOW regime (green background)
• Useful for breakout preparation or position size increase
Neutral Volatility Regime
• Triggers when entering NEUTRAL regime (gray background)
• Useful for identifying transition periods
High Volatility Regime
• Triggers when entering HIGH regime (red background)
• Useful for risk reduction or heightened awareness
How to Use It
This indicator is best used as a volatility filter and regime-aware positioning tool, not as a standalone entry signal.
Volatility regime filter
Use the regime colors to filter your trading approach:
• LOW regimes (green): Favor breakout strategies, increase position size
• HIGH regimes (red): Reduce position size, exercise caution (volatility can persist or reverse depending on market context)
• NEUTRAL regimes (gray): Wait for clearer signals or reduce exposure
Duration-based anticipation
Use the duration table to anticipate regime changes:
• If current bars approach upper bound: expect potential regime change soon
• If current bars are well below average: expect regime to continue
• If current bars exceed upper bound: regime is extended, watch for reversal
Trend confirmation
Use the volatility trend to confirm price action:
• Rising volatility (light red → dark red): confirms trend expansion or increased uncertainty
• Falling volatility (light green → dark green): confirms consolidation or stabilization
• Conflicting signals (gray): suggests uncertainty or transition
Practical Interpretation
Here is a simple way to read the results:
LOW regime (green)
• Price is tightly clustered around its average
• Volatility is below historical norms
• Often precedes breakout moves
• Good for trend-following entries
HIGH regime (red)
• Price is widely dispersed from its average
• Volatility is above historical norms
• Can indicate trending expansion, shock events, or panic conditions
• Reduce position size; assess whether context suggests continuation or reversion
NEUTRAL regime (gray)
• Volatility is transitioning or conflicting
• No clear regime signal
• Wait for clearer confirmation
Duration statistics
• Average: typical length of this regime type
• Lower/Upper bounds: normal range (~68% of cases)
• Current bars: where you are in the distribution
Best Use Cases
Typical uses include:
• Crypto volatility regime detection
• Position sizing based on volatility state
• Breakout vs. consolidation strategy filter
• Risk management and exposure control
• Multi-asset volatility comparison
• Regime-aware trade timing
It is especially useful when you want to objectively measure whether volatility is high or low relative to recent history, and whether the current regime is typical or extended.
Notes
The indicator is designed for daily crypto charts but works on any timeframe.
• Daily timeframe: "History Lookback (days)" represents calendar days
• Other timeframes: "History Lookback (days)" represents bars, not calendar days
The metric table is only as good as the selected lookback periods and thresholds.
• Shorter volatility lookback: more reactive but noisier
• Longer volatility lookback: smoother but may lag sudden changes
• Shorter regime lookback: faster regime detection but more whipsaws
• Longer regime lookback: more stable but slower to detect changes
• Tighter thresholds (e.g., 25/75): fewer regime changes, higher confidence
• Wider thresholds (e.g., 35/65): more regime changes, earlier detection
The Z-Score-style duration statistics are relative to the selected history window, so their meaning depends on how much data you include. Indicador

Pattern Atlas : Geometric [AxeAlgo]Pattern Atlas : Geometric Patterns
WHAT THIS LIBRARY IS
This is a Pine Script v6 library of 17 classical chart pattern detectors — Head and Shoulders, Double/Triple Tops and Bottoms, triangles, wedges, flags, and the rest of the standard technical-analysis catalog built from swing highs and lows rather than single-candle shape. Unlike candlestick patterns, which read one to a handful of fixed bars, chart patterns span a variable, often large number of bars, so this library carries one small piece of state — a rolling history of confirmed swing pivots — that every pattern function reads from. Beyond that, the same philosophy as Library #1 applies: no plotting, no alerts, and no inputs in this script by design, since a library's job is to hand other scripts a clean, reusable, well-documented API, not to draw on a chart itself (Pine doesn't allow a library to plot anything anyway). If you're looking for a ready-to-use indicator built on top of this library, see the companion "Pattern Atlas : Geometric Indicator " script, which imports every function here and turns it into on-chart signals, measured-move price targets, a live scanner table, and alerts.
Chart pattern analysis is one of the foundational tools of classical technical analysis, going back to Edwards and Magee's original work and refined since by researchers like Thomas Bulkowski, whose statistical studies of pattern behavior are the closest thing this field has to an industry-standard reference. The patterns in this library follow that standard catalog, so anyone who already knows what a Head and Shoulders top or an Ascending Triangle looks like will recognize exactly what each function is checking for.
WHY A LIBRARY INSTEAD OF ONE MONOLITHIC INDICATOR
Splitting detection logic out as an importable library means:
- Any Pine coder building their own strategy, indicator, or screener can pull in exactly the pattern checks they need without copy-pasting swing-pivot and trendline math into every new script.
- The detection logic is tested and maintained in one place. When a threshold gets refined, everything importing this library benefits from the update by bumping one version number.
- It keeps the math separate from presentation — how a pattern gets drawn, colored, or alerted on is a completely separate decision from whether the pattern is actually present, and different users want different presentations.
HOW TO IMPORT AND USE IT
Add this line near the top of your script (adjust the version number to whatever the current published version is):
import AxeAlgo/Pattern_Atlas_Geometric/1 as geo
Unlike Library #1, most of the functions here need a shared pivot history to work from. Call trackPivots() exactly once per bar, then pass its result into every detect*() function that needs it:
pivots = geo.trackPivots()
match = geo.detectDoubleTopBottom(pivots)
if match.found
label.new(bar_index, high, match.patternName)
Four functions — detectSpike(), detectFlag(), detectPennant(), and detectIslandReversal() — read directly off recent price action instead of the shared pivot history, so they're called without a pivots argument: geo.detectSpike().
trackPivots() takes three optional parameters: leftBars and rightBars (how many less-extreme bars must surround a candidate swing point before it confirms as a pivot — higher values mean fewer, more significant pivots, at the cost of a longer confirmation lag), and maxPivots (how much pivot history to retain). All three have sensible defaults.
Every detect*() function returns the same structure, called ChartPatternMatch, so the calling pattern is identical no matter which of the 17 you use. It has nine fields:
- found — true if the pattern matched at the evaluated bar, false otherwise.
- patternName — the specific name of what matched (e.g. "Ascending Triangle"), na when not found.
- direction — "bullish" or "bearish".
- pivotBars — bar_index of each pivot the match was built from, in chronological order.
- pivotPrices — price of each pivot, in the same order as pivotBars.
- breakoutLevel — the support, resistance, or neckline level price broke through to confirm the pattern.
- necklineSlope — slope (price per bar) of the breakout line, na when the pattern's breakout level isn't a sloped line.
- barIndex — the bar_index the pattern completes (breaks out) on.
- description — a full sentence naming the pattern and the actual measured price levels that triggered it — genuinely useful for a tooltip or an alert message, not just a repeat of the pattern name.
Two additional exported functions turn that raw match into something more actionable, and both work on any ChartPatternMatch regardless of which detect*() function produced it:
- patternStrength(match) — a 0-100 score for how decisively the confirmation close broke through breakoutLevel, relative to the pattern's own price range. A breakout that clears the level by a meaningful fraction of the pattern's own size scores higher than a one-tick poke through it.
- patternTarget(match) — a classical measured-move price target, projecting the pattern's own height from the breakout point. Returns na for patterns without a reliable height to project from (V-Top/V-Bottom Spike, Island Reversal, Bump-and-Run Reversal).
Every detect*() function also exposes its own set of tunable threshold parameters — how flat a "flat top" has to be, how much two shoulders can differ and still count as equal, and so on — all with sensible defaults so you don't have to touch them unless you want to tighten or loosen a specific pattern's sensitivity for a particular instrument or timeframe.
THE 17 PATTERNS
Reversal patterns (7) — signal a potential change in the prevailing trend:
- Head and Shoulders / Inverse Head and Shoulders — detectHeadAndShoulders(). Three swing extremes with the middle one more extreme than the two roughly-equal outer ones, confirmed when price breaks the neckline connecting the two points between them.
- Double Top / Double Bottom — detectDoubleTopBottom(). Two roughly equal peaks (or troughs) with a retracement between them, confirmed when price breaks back through that retracement level.
- Triple Top / Triple Bottom — detectTripleTopBottom(). The same idea as a Double Top/Bottom with a third roughly-equal touch, confirmed on the break of the support or resistance formed between the touches.
- Rounding Top / Rounding Bottom — detectRoundingTopBottom(). A gradual, curved advance-and-rollover (or decline-and-recovery) between two similar edge levels. Approximate: read from three swing pivots rather than fitting a true curve.
- Diamond Top / Diamond Bottom — detectDiamondTopBottom(). Swing range that widens and then narrows again, confirmed on a break of the resulting support or resistance. Rare and approximate: read from three pivot pairs rather than a clean diamond outline.
- Broadening Formation — detectBroadeningTopBottom(). Diverging highs and lows forming an increasingly volatile range, confirmed on a break of either edge. Approximate: read from two pivot pairs rather than a hand-fitted diverging channel.
- V-Top / V-Bottom (Spike) — detectSpike(). A single sharp extreme with no rounding — a large move into the pivot and an equally large move away from it, both measured against the recent average bar range, within a handful of bars. Self-contained, no pivots argument needed.
Continuation patterns (8) — typically resolve in the direction of the move that preceded them:
- Ascending Triangle — detectTriangleAscending(). Flat resistance with rising support, confirmed on a break above resistance.
- Descending Triangle — detectTriangleDescending(). Flat support with falling resistance, confirmed on a break below support.
- Symmetrical Triangle — detectTriangleSymmetrical(). Converging highs and rising lows, confirmed (bullish or bearish) whichever side the price actually breaks.
- Rising Wedge / Falling Wedge — detectWedge(). Both trendlines slope the same direction and converge; breaks the opposite way from the slope, since the shared-direction move was already losing momentum.
- Bull Flag / Bear Flag — detectFlag(). A strong directional move (the pole), followed by a tight, roughly parallel pullback, confirmed on a break back out in the pole's direction. Self-contained, no pivots argument needed.
- Bull Pennant / Bear Pennant — detectPennant(). The same pole-and-consolidation structure as a Flag, but the consolidation narrows and converges rather than staying parallel. Self-contained, no pivots argument needed.
- Rectangle — detectRectangle(). Price boxed between flat support and flat resistance, confirmed on a break of either edge.
- Cup and Handle / Inverted Cup and Handle — detectCupAndHandle(). A rounded recovery (or decline) back to its starting rim, then a shallow pullback (the handle), confirmed on a break through the rim.
Structural / gap-based patterns (2):
- Bullish / Bearish Island Reversal — detectIslandReversal(). A bar (or small cluster) isolated by a gap on both sides, then abandoned by a gap the other way — an abrupt reversal. Self-contained, pure gap logic, no pivots argument needed.
- Bump-and-Run Reversal — detectBumpAndRun(). A lead-in trendline, then a "bump" phase accelerating well beyond it, then a "run" breaking back through the lead-in line. Approximate: the lead-in line is read from just two pivots rather than a hand-drawn trendline.
WHAT THIS LIBRARY DELIBERATELY DOES NOT DO
No plotting, no drawing, no alertcondition() calls, and no inputs — Pine doesn't allow any of those inside a library in the first place, since a library can never be added to a chart on its own. If you want signals, price targets, a scanner table, or alerts, import this library into your own script (or use the companion "Pattern Atlas : Chart Pattern Scanner " indicator, which does exactly that) rather than expecting this script to render anything by itself.
This library also does not evaluate multi-timeframe data, volume, or broader market structure — it's swing-pivot and trendline geometry only, on purpose, so its behavior is easy to reason about and easy to reuse as one building block among several.
Four of the seventeen patterns are explicitly noted above as approximate: Rounding Top/Bottom, Diamond Top/Bottom, Broadening Formation, and Bump-and-Run Reversal are read from a small, fixed number of swing pivots rather than fitting a true curve or hand-drawn trendline to the data. They will not catch every textbook-perfect example of these shapes, and they may occasionally flag a looser approximation of one. Treat them as a starting point for further chart review, not a final word.
PART OF A LARGER SERIES
This is Library #2 in the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (Library #1, already published), classical chart/geometric patterns (this library), harmonic patterns (Fibonacci-ratio XABCD structures), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library is independent and useful on its own; together they're meant to cover technical pattern analysis without forcing unrelated detection methods into the same function.
A NOTE ON REPAINTING
trackPivots() only confirms a swing pivot once rightBars bars have passed since it happened — the same confirmation lag ta.pivothigh()/ta.pivotlow() use, just written out as plain comparisons so it works safely inside a library's exported functions. That means a pivot never moves or disappears once confirmed; it just takes rightBars bars to become known, which is a normal and unavoidable part of swing-pivot detection, not a defect in this library. On the currently-forming bar, a pattern's found status can still change tick to tick as that bar's own high, low, and close move — that's inherent to reading live price action. If you're building persisted signals, drawings, alerts, or price targets on top of these functions (rather than a live "what's happening right now" readout), gate your usage on barstate.isconfirmed so a signal only fires once the bar it describes has actually closed, exactly like the companion scanner indicator does.
DISCLAIMER
This library is a technical analysis tool for identifying classical chart pattern shapes in historical and live price data. It does not predict future price movement, and a detected pattern — including any projected price target — is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
Biblioteca

Macro Regime Dashboard█ OVERVIEW
Macro Regime Dashboard is a market-timing checklist for US equities. It evaluates five regime conditions on every daily bar: elevated volatility, a non-rising Fed policy rate, contracting margin debt, the presence of a leading sector, and earnings confirmation from bellwether stocks. It plots the count of conditions met as a stepline in a separate pane, renders a live checklist table, and marks the bars where all conditions and the enabled fail-safes align. The thesis: durable market bottoms tend to form when fear is high, the Fed is not tightening, leverage has been flushed, and a leading theme keeps delivering earnings through the panic.
█ HISTORY / BACKGROUND
The five-condition checklist and its fail-safes are the market-timing framework described by the YouTuber, Defiant Gatekeeper, who distilled it from his buy decisions around volatility spikes. The framework itself synthesizes established concepts: the VIX as a fear gauge, Federal Reserve policy as the dominant liquidity driver, margin debt as a measure of speculative leverage, sector leadership as the engine that attracts institutional capital, and earnings surprises as confirmation that the leading theme is insulated from the broader panic.
The fail-safes address the framework's known failure modes, which the author identifies from historical episodes: leading-sector fundamentals breaking down, systemic accounting fraud destroying trust in reported earnings, a credit freeze that policy easing cannot offset, and inflation high enough to remove the Fed's ability to support asset prices. Two of these are quantifiable and are implemented here as the high-yield credit spread and CPI fail-safes. The concept is his; this Pine implementation, the data-series selections, and the proxy choices are original to this script.
█ HOW IT WORKS
On each daily bar the script requests six external series and evaluates five boolean conditions plus two fail-safes.
Condition 1: Fear. The CBOE Volatility Index (CBOE:VIX) must exceed the threshold input (default 30).
Condition 2: Fed not on an upward trajectory. The effective federal funds rate (FRED:DFF) today must be at or below its value from the lookback number of trading days earlier, with a 0.01 tolerance. The table also flags when the 2-year Treasury yield (TVC:US02Y) sits below the funds rate, indicating that the bond market is pricing cuts; this flag is informational and does not gate the condition. Because the policy trajectory is partly qualitative (guidance, projections), an override input can force this condition to pass or fail.
Condition 3: Margin debt declining. The reference framework uses the monthly FINRA margin debt statistic, which TradingView does not carry. The script substitutes the Federal Reserve Z.1 series for margin accounts at brokers and dealers (FRED:BOGZ1FL663067003Q), requested at 3-month resolution. The condition passes when the latest quarterly value is below the prior quarterly value.
Condition 4: Leading sector. The script loops over eleven S&P sector ETFs plus a semiconductor ETF, computes each one's return over the lookback window, and subtracts the SPY return over the same window. The strongest relative-strength value must exceed the threshold input (default 3 percentage points over 63 days). The table names the current leader.
Condition 5: Bellwether earnings beats. For up to three user-selected bellwether symbols representing the leading theme, the script pulls reported and estimated earnings per share through the earnings request feed and marks a beat when actual is at or above estimate for the most recent report. The condition passes when a majority of the symbols with available data beat. When no earnings data exists for any bellwether, the condition passes neutrally rather than failing, so that missing history does not veto the count. An override input can force this condition either way.
Fail-safes. The ICE BofA US High Yield Option-Adjusted Spread (FRED:BAMLH0A0HYM2) must sit below its threshold (default 10 percent), and CPI year-over-year, computed from FRED:CPIAUCSL as the ratio of the monthly index to its value twelve months earlier, must sit below its threshold (default 2.5 percent). Each fail-safe passes when its data is unavailable. Two toggle inputs decide whether each fail-safe vetoes the composite signal or only displays as a warning. By default the credit fail-safe gates and the CPI fail-safe warns.
Composite. The buy state is true when all five conditions hold and every enabled gate is clear. The script plots the raw condition count (0 to 5) as a stepline, draws a dotted horizontal reference at 5, shades the pane background green while the buy state is active, and prints a green triangle on the first bar of each signal window. A table in the top right shows each condition's current value and pass state, both fail-safe readings, and a composite verdict row. Two alerts are provided: one on the first bar of a new buy signal, and one when the credit spread crosses above its threshold.
█ HOW TO USE
Apply the indicator to a broad US index such as SPX or SPY on the daily timeframe . All inputs and thresholds are calibrated to daily bars; the conditions describe the whole market, so the chart symbol only supplies the bar grid.
Read the stepline as regime pressure. A count of 3 or 4 during a selloff means the setup is forming; a touch of 5 with the background shading and a triangle means every condition and enabled gate aligned on that bar. A count of 5 without shading means a fail-safe is blocking, which is exactly the bull-trap situation the fail-safes exist to flag. The table gives the per-condition diagnosis at a glance.
Using the dashboard in tandem with the Stock Screener
The dashboard times entry and sizing. It does not select stocks. The reference framework pairs it with a fundamental selection layer keyed to the liquidity regime, and most of that layer maps directly onto TradingView's Stock Screener fields: revenue growth, EPS growth, forward price-to-earnings, and debt to EBITDA. The workflow:
Determine the liquidity quadrant. The dashboard's Fed condition covers the rate trajectory. Check the Fed balance sheet direction separately by charting FRED:WALCL: rising means expansion, falling means contraction.
Rate falling and balance sheet rising (maximum liquidity): screen for revenue growth above 50 percent and ignore valuation and leverage fields. Unprofitable hypergrowth is the target profile in this quadrant.
Mixed quadrants (one lever easing, one tightening): screen for revenue growth in the 10 to 20 percent range, a moderate forward price-to-earnings, and debt to EBITDA below roughly 3 to 5 depending on which lever is easing.
Rate rising and balance sheet falling (minimum liquidity): screen for forward price-to-earnings below 15, debt to EBITDA below 1.5, and positive earnings. Stability over growth.
When the dashboard signals, run the screener preset for the current quadrant, restricted to the leading sector the table names, to surface candidates.
The final validation step in the reference framework, a regression of price-to-earnings against expected EPS growth across roughly ten same-industry peers with an R-squared above 0.8, is not screenable and is performed outside TradingView in a spreadsheet.
█ SETTINGS
VIX threshold (default 30): level the volatility index must exceed for condition 1.
Fed rate lookback (default 63 trading days): comparison window for the funds-rate trajectory in condition 2.
Fed trajectory override (default Auto): forces condition 2 to pass or fail when guidance contradicts the rate proxy.
Sector RS lookback (default 63 days): return window for the relative-strength computation in condition 4.
RS outperformance vs SPY (default 3 percent): margin by which the leading sector must beat SPY.
Bellwether 1, 2, 3 (defaults are three large semiconductor names): symbols whose earnings reports confirm the leading theme. Change these whenever the leading theme rotates.
Earnings override (default Auto): forces condition 5 to pass or fail.
HY OAS max (default 10 percent): credit-spread ceiling for the credit fail-safe.
CPI YoY max (default 2.5 percent): inflation ceiling for the CPI fail-safe.
Credit fail-safe gates signal (default on): when on, an elevated credit spread vetoes the composite signal.
CPI fail-safe gates signal (default off): when on, elevated inflation vetoes the composite signal; when off it displays as a warning only.
█ WHAT MAKES IT ORIGINAL
The script consolidates a cross-asset macro checklist into a single gated, auditable pane: an equity volatility index, the policy rate, the Treasury 2-year, a quarterly flow-of-funds leverage series, sector ETF relative strength, per-symbol earnings surprise data, a credit spread, and a computed inflation rate. Each series exists elsewhere in isolation; the contribution here is the joint evaluation with explicit pass/fail logic, the separation of hard vetoes from soft warnings through the gate toggles, and two implementation choices that make the framework computable on TradingView at all: the Z.1 quarterly margin-account series as a proxy for the unavailable monthly FINRA margin debt statistic, and the earnings-beat condition built from the earnings request feed on user-configurable bellwethers, with missing data treated as neutral rather than as a veto.
█ NOTES / LIMITATIONS
Designed for the daily timeframe on a broad US index. Other resolutions misalign the lookbacks and the higher-timeframe requests; other symbol classes add no information because every condition is market-wide.
The margin-debt proxy is quarterly. Monthly FINRA data can show a deleveraging turn up to one quarter before the Z.1 series reflects it, so condition 3 is the slowest leg and produces a step-shaped response.
Monthly and quarterly requests update when those periods complete. Within a forming month or quarter the CPI and margin readings can change until the period closes.
Earnings history depth varies by symbol and generally thins in earlier years. On older bars condition 5 frequently passes neutrally for lack of data, and the override and bellwether inputs are static across the whole chart, so the plotted historical count is indicative rather than point-in-time. Treat the history as illustration, not as a backtest.
Economic series have distinct start dates, and all external requests ignore invalid symbols. Missing data renders as n/a in the table, fail-safes pass when their series is absent, and a sector whose ticker fails to resolve is silently skipped in the relative-strength scan.
The checklist table reflects the last bar only.
The Fed condition is a proxy for a qualitative judgment. During fast easing cycles the fixed lookback can briefly misread the trajectory, which is what the override input is for.
Indicador

Indicador

ICT Combined Venom Silver Bullet Displacement LiquidityThirteen switchable ICT modules in one overlay, built to replace several separate scripts on one chart. Nothing here predicts price — every module is a mechanical description of something that already happened.
MODULES
1-3 SESSION MODEL. Three independent instances of one CISD engine: Venom NY plus two Silver Bullet windows (10:00-11:00 and 14:00-15:00 NY, London preset included). Each builds an opening range, waits for a directional raid, locates the change-in-state-of-delivery level at the last opposing candle's open, and confirms when a candle CLOSES back through it — body close, not wick. On confirmation the order block and most recent unmitigated FVG are drawn.
4 DISPLACEMENT. Candles whose range is a standard-deviation outlier and that leave a gap behind. Confirmed bars only.
5 LIQUIDITY. Prior day/week/month, Asia and London highs and lows. A sweep requires raid AND rejection — through the level and closing back within the same candle. A close beyond is acceptance, not a sweep.
6 FIRST PRESENTED FVG. The first gap of the AM and PM sessions with its 50% (consequent encroachment). Always sourced from 1-minute data whatever the chart timeframe, and tested against the middle candle so the opening candle cannot form it. Retained across days.
7 OPENING RANGE GAP. Prior regular-session close to today's open, with 50% and quadrants.
8 PREMARKET DEALING RANGE. The 07:00-09:00 NY range graded into quadrants and octants, locked at 09:00 and carried forward. Premium and discount are measured against THIS range, not the session or daily range.
9 BODY / WICK LAW. A demand zone holds while bodies stay in its upper half, supply while they stay in the lower half. Wicks may cross the 50% freely; only a closed body is a violation. Runs against modules 6, 7 and 8. A filter, not a signal.
10 AM REGIME CLASSIFIER. Scores how likely the morning is to consolidate. READ THIS BEFORE ENABLING: it encodes a claim that is not established fact, ships with untested default thresholds as a measurement instrument, and its gate over other modules' alerts is off by default and should stay off until the calibration record earns it.
12 SUSPENSION BLOCKS. An FVG carrying a volume imbalance at BOTH ends — three stacked spans with no body trade across any of them. Read from the chart timeframe.
13 NDOG / NWOG. Settlement print to the next session's open, drawn as solid blocks and deliberately not retired when filled, because price returns to them for weeks. A settlement window that never prints yields no gap rather than one measured against a stale close.
DASHBOARD. The premarket range and which side of equilibrium price sits on, plus a calibration summary: logged sessions split by premarket classification, reporting median realised morning efficiency per group with sample sizes, flagged when thin.
FVG GEOMETRY. An FVG edge is a wick; where the neighbouring candle's body does not reach it, that space is a volume imbalance belonging to the same inefficiency. Edges widen to include it, never narrow. Extending this to the library-drawn zones in modules 1-3 is a separate switch, off by default, with a diagnostic counter so it can be verified rather than assumed.
USING IT
Switch modules off and add them back one at a time. Modules 5, 8 and 6 together are a complete framework and a reasonable place to stop. Zones mark where a reaction is plausible — they are not entries, and nothing here manages risk or sizes a position.
CREDITS
Reuses open-source work under the Mozilla Public License 2.0.
TFlab, from "ICT Venom Trading Model" and "Silver Bullet ICT Strategy": the CISD detection routine, the opening-range state machine, and the order block and FVG handling. This script also calls TFlab's libraries OrderBlockRefiner_TradingFinder, OrderBlockDrawing_TradingFinder and FVGDetectorLibrary. The engine behind modules 1-3 is substantially TFlab's work.
tradeforopp (TFO): the displacement measure in module 4.
fadizeidan, from "ICT Open Range Gap & 1st FVG": the volume-imbalance FVG geometry, sourcing the first presented gap from one minute, the middle-candle session test, and the opening range gap definition.
Original here: parameterising TFlab's engine so three overlapping windows run independently; the whole liquidity module; multi-day retention and carry rules for the first presented gap; the premarket dealing range and grid; the body/wick test; suspension blocks; NDOG/NWOG; the verified-coordinate approach to unifying FVG geometry; and the regime classifier shipped with the means of checking it. Several source defects are also fixed — the opening range absorbed the first bar of the trading window, a Bar Back Check input was overridden by a hardcoded value, four colour inputs were never referenced, box count was left at the library default, and the displacement module repainted intrabar.
The concepts themselves — fair value gaps, consequent encroachment, displacement, liquidity raids, premium and discount, the first presented gap — are ICT's (Michael J. Huddleston) and are not claimed as original.
LIMITATIONS
Intraday only; session windows cannot resolve on daily and above. Module 6 needs a minute chart and stops populating silently beyond the available one-minute history, so an empty older day may mean missing data rather than no setup. NDOG/NWOG approximate the settlement print on daily and above. Drawings are subject to TradingView's 500-object limits. Signals confirm on bar close, one bar after the move that caused them. Module 10's thresholds are untested defaults.
Published under the Mozilla Public License 2.0, consistent with the sources.
Indicador

Moving Average CandleMoving Average Candle turns up to three moving averages into full OHLC candles instead of plain lines, so you can read a moving average's shape and momentum the way you'd read a price candle. It's built for anyone who wants to see a moving average's open, high, low and close at a glance — for example to judge a moving average's momentum and turning points the way you would judge price action, or to compare several of these MA candles against each other and against the underlying price on the same chart.
Each of the up to three MA candles can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
MA Candle (present three times, MA Candle 1–3, each instance identically structured)
Length: number of bars the average is calculated over.
MA Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
Candle Style: Wick or Fill.
Bull / Bear: two colors: one for when the moving average's close is above its previous value, the other for the opposite case.
Each enabled MA candle is built from the moving averages of the bar's open, high, low and close, then colored by whether the moving average's close is rising or falling. The high and low are clamped so they never sit inside the body, which keeps the candle intact even for moving average types like HMA whose weighting can otherwise push a value outside a normal high/low range.
In Wick style, the high and low are drawn as a candle wick, just like a regular price candle. In Fill style, the wick is hidden and the high/low range is shown instead as a shaded band; the candle body stays visible in both styles.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance. Indicador

BBMA Trend & MomentumBBMA Trend & Momentum
The BBMA structure read as one running sequence rather than a handful of separate signals.
Most tools built on Bollinger Bands and moving averages draw the lines and leave the reading to
you. This one keeps a memory. It knows that momentum came first, that a reversal candle followed it, that the pullback target has already been reached, and it will not report the next step until the ones before it have happened. Each label on the chart is a position in that sequence, not an isolated condition that happened to be true.
Two of those steps are level touches rather than candle patterns, and they are treated
differently from the rest. That distinction is explained below and it matters.
THE LINES
Four families are drawn. Seven individual lines carry every rule in the script.
Bollinger Bands SMA 20 with deviation 2, giving Upper, Mid and Lower
LW MA on the HIGH weighted averages of the candle HIGH, drawn in the upper colour
LW MA on the LOW weighted averages of the candle LOW, drawn in the lower colour
EMA 50 on Close, drawn as a slower reference
The High averages sit above price and the Low averages below it, because of what they are
averaging. That is what forms the two bands the price runs between.
The seven lines every rule is written against are the three Bollinger Bands and the 5 and 10
period LW MAs on each side. Those four averages are drawn SOLID. Periods 6 to 9 are drawn DASHED, exist only to show the shape of the band, and sit on their own switch so you can take them off and see for yourself that nothing is calculated from them. Within each band the 5 sits nearer to price and the 10 further out.
The EMA 50 is drawn and nothing is measured from it either. It is there as background context for your own reading, and it can be switched off without changing a single label.
THE SEQUENCE
Upper and Lower name the band an event belongs to. Every rule below has an exact mirror on the other side, so only the Upper form is spelled out.
CSM - Candlestick Momentum
LW MA 5 High is above the Upper BB, and the candle CLOSES above LW MA 5 High.
The close is therefore beyond the outer band as well, without needing to be tested for it.
EX - Extreme
A CSM has already happened and its Extreme has not been taken yet. LW MA 5 High is still
outside the Upper BB, but a candle now CLOSES back below it. That candle must not reach down to LW MA 5 Low, LW MA 10 Low, or the Mid BB. Touching any one of the three disqualifies it. Exactly one Extreme belongs to one CSM. For another Extreme, a new CSM has to come first.
MTP - Mandatory Take Profit
After an Extreme, the first time price reaches LW MA 5 Low or LW MA 10 Low.
If a new CSM or a new MTM arrives before that touch, the MTP is cancelled and a fresh Extreme
has to form before it can be looked for again.
MLV - Market Volume Lost
After the MTP has been reached, a candle rises to the Upper BB but cannot CLOSE beyond it, and closes at or above the Mid BB. The band was tested and refused.
CSD - Candlestick Direction
A candle that opens on one side of the Mid BB and CLOSES through it, and in the same candle
closes beyond BOTH LW MA 5 and LW MA 10 on the side it broke into. An Upper CSD breaks upward through the Mid BB and both High averages; a Lower CSD breaks downward through the Mid BB and both Low averages. CSD is named by the direction it broke, not by which cycle it interrupted.
MTM - Momentum Push
After a CSM, price falls back below the Upper BB without ever CLOSING below the Mid BB, then
closes above the Upper BB again. That renewed push is the MTM candle. It is not itself a CSM,
which is what separates the two - and because it is not a CSM, it does not open the door to a
new Extreme either. It only clears whatever the previous CSM had left waiting.
RE - Re-Entry
The touch that follows CSM, MTM or CSD. An upper-band sequence looks for LW MA 5 Low or LW MA 10 Low; a lower-band sequence looks for LW MA 5 High or LW MA 10 High. Three kinds are marked separately, because they arrive from three different places:
CSM RE a pullback that was followed by a full CSM
MTM RE a pullback that was followed by an MTM push
CSD RE the pullback after a CSD
WHAT IS READ WHEN
This is the part worth being precise about.
CSM, EX, MLV, CSD and MTM are structure. They are decided on the CLOSE of a candle, and once
decided they never change.
MTP and RE are not patterns, they are level touches. A touch happens at the moment price reaches the level, not when the candle finishes, so both are read on the RUNNING candle. Waiting for the close would report the touch after the level had already been passed, which would describe something other than what happened.
When a running-candle label and a closing label land on the same bar, the running one is
removed and its text is folded into the closing label, so the two never sit on top of each other.
WHAT MAKES THIS DIFFERENT
1. It is a sequence, not a checklist.
An Extreme is not reported unless a CSM came first. An MTP is not looked for until an Extreme has been confirmed, and an MLV not until the MTP has been reached. The same candle shape means different things depending on what came before it, and the script keeps track of that.
2. A step can be cancelled, not only completed.
If momentum resumes with a new CSM or an MTM while an MTP is still waiting for its touch, that MTP is dropped. The market changed its mind, so the sequence restarts rather than reporting a target that no longer belongs to anything.
3. One Extreme per CSM.
An Extreme is the answer to a particular CSM, so it is reported once and then that CSM is spent.
Price can keep closing back inside the band for the next ten candles and none of them will be
called an Extreme. A new CSM has to arrive first. An MTM push does not substitute for one.
4. The Extreme test is deliberately narrow.
Closing back inside the band is not enough. The candle also has to stay clear of the opposite LW
MA 5 and 10 and of the Mid BB. A candle that reaches any of them has done more than fail at the edge, and it is not reported as an Extreme.
5. CSD is named by what it did.
A downward break through the Mid BB and both Low averages is a Lower CSD, wherever it happens to appear. Naming it after the cycle it interrupted would put the wrong word on the chart.
6. Touches are read as touches.
The two events that are levels rather than candle patterns are handled as levels, on the running candle, and the script says so plainly rather than pretending everything is close-based.
READING THE CHART
Each event prints a small label at the candle it belongs to. Upper-band events sit above the
candle, lower-band events below it, and where several land on the same candle they are stacked into one label instead of overlapping.
CSM momentum push beyond the outer band
MTM renewed push after a pullback
EX the reversal candle
MTP first touch of the opposite LW MA 5/10 after an Extreme
MLV the outer band tested and refused
CSD Mid BB and both same-side LW MAs broken together
CSM RE / MTM RE / CSD RE the re-entry touch, named after what preceded it
SETTINGS
Lines
- BB Period and BB Deviations for the Bollinger Bands.
- BB Shift: moves the drawn bands only. The values every rule is measured against are not
moved.
- LW MA 5 to 10 Low and LW MA 5 to 10 High: the twelve weighted average periods. Only 5 and 10 are used by any rule.
- EMA Period.
Pattern Types
- A switch for each of the seven: CSM, MTM, EX, MTP, MLV, CSD and RE.
Line Style
- Show LW MAs: the 5 and 10 period averages, the ones every rule is measured against.
- Show LW MA 6-9 Band: the four decorative periods on each side, on their own switch. Turning
them off is the quickest way to check the claim above - the chart gets simpler and not a single
label moves.
- Show or hide the Bollinger Bands and the EMA.
- Colours for the Bollinger Bands, the LW MA High band, the LW MA Low band and the EMA.
Labels
- Label Size.
ALERTS
Fourteen alert conditions, one for each event on each side:
CSM Upper / CSM Lower
MTM Upper / MTM Lower
EX Upper / EX Lower
MTP Upper / MTP Lower
MLV Upper / MLV Lower
CSD Upper / CSD Lower
Re-Entry Upper / Re-Entry Lower
The structural ones fire once per bar close. MTP and Re-Entry fire once per bar, because they are touches and are read on the running candle.
The same events are also sent through the alert function, so the "Any alert() function call"
alert type can deliver all of them through a single alert. Those messages name the exact
Re-Entry kind - CSM, MTM or CSD - which a fixed alert condition cannot.
REPAINTING
This script does not repaint.
CSM, MTM, EX, MLV and CSD are structure. They are evaluated only after a candle has fully closed and the state memory they drive is updated only on closes, so price moving inside an open candle cannot change the sequence.
MTP and Re-Entry are read on the running candle, and that deserves a straight answer rather than a disclaimer, because a label that can appear mid-candle usually can vanish mid-candle too. Here it cannot, and the reason is in the arithmetic of the level being watched.
A weighted average of the LOW gives the candle still forming a weight of one third at length 5,
and about one fifth at length 10. The running low of that candle falls three to five times faster
than the average it is being compared against. So the moment the low reaches the average, the gap between them can only keep closing. It can never reopen inside that candle. The high side is the exact mirror.
Which means:
- Once an MTP or Re-Entry label is drawn, it stays. It cannot un-touch before the candle closes.
- Reloading the chart gives the same result, because a closed candle is evaluated once using its
final low and high, and those are the most extreme values the candle ever had.
- The only thing that changes at the close is presentation: a running-candle label is folded into
the closing label for that bar so the two do not sit on top of each other. The event itself is
not re-decided.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint.
That banner appears automatically for any script that uses the built in bar state variables, no
matter how they are used, because the platform cannot check the intent behind them. For the
structural alerts, choosing "Once Per Bar Close" is still recommended.
NOTES AND LIMITATIONS
- CSD is the strong form only: the Mid BB and BOTH same-side LW MAs have to be broken by the same candle. A Mid BB break on its own is not reported.
- An Extreme always needs a CSM before it. A reversal candle appearing without that history is
not an Extreme here, whatever it looks like.
- The 6, 7, 8 and 9 period LW MAs and the EMA 50 are drawn but never measured. Changing them, or hiding them, changes the picture and nothing else.
- BB Shift is visual only. Shifting the bands does not shift the rules.
- TradingView caps a script at 500 labels and the oldest are dropped once that cap is reached, so on a long history the earliest labels leave the chart.
- Detection is purely structural. It reports where each step of the sequence occurred and nothing more. It does not rank setups by quality, measure what happened next, or produce entries, targets or stops.
HOW TO USE IT
Read the labels in order rather than one at a time. A CSM on its own says momentum arrived. The same CSM followed by an Extreme says the move ran out of room. That Extreme followed by an MTP and then an MLV says the band was tested again and refused. Each label narrows what the previous one meant.
The two bands are the working area. Price spends most of its time between the LW MA High band and the LW MA Low band, and the Re-Entry marks are where it came back to one of them after a push.
A CSD is the point where the picture changes side. It is the only event in the set that breaks
the Mid BB and both same-side averages in one candle, and everything after it belongs to the new direction.
These are reference points, not entry signals on their own. Use them alongside your own analysis, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. Indicador

Institutional Inducement Engine [algotim]Overview
Institutional Inducement Engine is a market-structure analysis tool built around a specific sequence: identify a major swing level, locate a smaller swing positioned between current price and that major level, require structural confirmation, and then monitor the confirmed level for a subsequent liquidity interaction.
The purpose of this workflow is to distinguish a potentially meaningful internal liquidity level from an ordinary minor swing. Instead of treating every internal pivot as an inducement, the script maintains a candidate state and only promotes that candidate after the required structural condition has occurred.
The resulting chart shows the relationship between external liquidity, confirmed internal inducement levels, subsequent sweeps, and the opposing external liquidity level.
Problem Statement
A conventional swing-point indicator treats major and minor pivots largely as the same type of information. This can make it difficult to distinguish a meaningful internal level from ordinary market noise.
This script uses two different structural scales:
* External swings represent the larger liquidity reference.
* Internal swings represent smaller candidate levels.
* The distance between them is optionally evaluated relative to ATR.
* A candidate can remain pending until a subsequent structure break confirms it.
This creates a sequential workflow rather than simply plotting every detected pivot.
Methodology
1. External Structure
The script detects major swing highs and lows using a configurable external pivot length.
A confirmed external high becomes the current bearish-side liquidity reference, while a confirmed external low becomes the current bullish-side liquidity reference.
Only the most recently detected external levels are maintained as the active structural references.
2. Internal Candidate Detection
A separate, shorter pivot length is used to detect internal highs and lows.
For a bullish inducement candidate, the internal low must be above the most recent external low.
For a bearish inducement candidate, the internal high must be below the most recent external high.
The separation between the internal candidate and its corresponding external level can also be filtered using ATR. With the ATR filter enabled, the minimum separation is:
Distance >= ATR x Minimum Distance Multiplier
This prevents very small differences between internal and external pivots from automatically qualifying as separate structural levels.
3. Pending Candidate State
A qualifying internal pivot is not immediately treated as a confirmed inducement.
Instead, the script stores its price and bar position as a pending candidate.
This distinction is important because the indicator is evaluating a sequence rather than a single candle or pivot:
Internal swing -> candidate -> structural confirmation -> confirmed inducement.
4. Break of Structure Confirmation
When BOS confirmation is enabled, the script looks for an internal structure point formed after the candidate.
For a bullish candidate, a subsequent internal high is tracked and a close crossing above that level confirms the bullish inducement.
For a bearish candidate, a subsequent internal low is tracked and a close crossing below that level confirms the bearish inducement.
Once confirmed, the pending candidate is transferred into the confirmed inducement state.
This prevents the initial internal pivot from being presented as a completed signal before the required structural sequence has occurred.
5. Inducement Zone
After confirmation, the inducement price is converted into a chart zone.
The zone height is derived from ATR rather than using a fixed number of ticks, allowing its visual size to scale with the instrument's current volatility.
The zone is then extended for the user-defined number of bars.
6. Liquidity Sweep Tracking
The script separately monitors the active external levels and confirmed inducement levels for price sweeps.
An external low is considered swept when price trades below that level and subsequently closes back above it.
An external high is considered swept when price trades above that level and subsequently closes back below it.
Confirmed inducement levels are also monitored. Once price trades through a confirmed inducement level, its sweep state is recorded so the same level is not repeatedly reported as a new sweep.
7. Liquidity Path Projection
After an inducement is confirmed, the script can draw a visual path from that inducement toward the opposing external liquidity reference.
For a confirmed bullish inducement, the path is drawn toward the current external high.
For a confirmed bearish inducement, the path is drawn toward the current external low.
This line is a structural visualization of the relationship between the two detected liquidity references. It is not a forecast or guarantee that price will reach the projected level.
Signal Workflow
The complete workflow is:
1. Detect a major external swing high or low.
2. Store that swing as the current external liquidity reference.
3. Detect smaller internal swings.
4. Test whether the internal swing is positioned between price structure and the corresponding external level.
5. Apply the optional ATR separation filter.
6. Store a qualifying internal swing as a pending candidate.
7. Identify a subsequent internal structure point.
8. Wait for the required break of that structure.
9. Promote the pending candidate to a confirmed inducement.
10. Draw the inducement zone.
11. Monitor the confirmed inducement and external liquidity for sweeps.
12. Optionally project the structural path toward the opposing external liquidity level.
This sequence is the central analytical framework of the indicator.
Why This Indicator Is Different
A standard pivot indicator answers a relatively simple question: "Where are the recent swing highs and lows?"
This script attempts to answer a different question: "Which smaller swing has a defined structural relationship with a larger liquidity reference, and has that relationship subsequently received structural confirmation?"
The distinction comes from the interaction of the components rather than from simply placing several indicators on the same chart.
The external and internal pivot systems operate at different structural scales. The ATR filter controls the minimum separation between those scales. The pending-state mechanism then prevents a candidate from becoming a confirmed inducement until the required structural event occurs.
After confirmation, the same state is carried forward into the sweep-tracking and opposing-liquidity visualization stages.
Consequently, the output represents a sequence of structural conditions rather than an independent collection of pivot, ATR and sweep markers.
Inputs
Structure
**External Swing Length**
Controls the pivot length used for major external swing detection.
**Internal Swing Length**
Controls the shorter pivot length used for internal candidate detection.
Filters
**Enable ATR Noise Filter**
Enables or disables volatility-adjusted separation between internal and external swings.
**ATR Length**
Controls the ATR calculation used by the distance filter and inducement-zone sizing.
**Min Distance (x ATR)**
Sets the minimum separation between the internal candidate and corresponding external level when the ATR filter is enabled.
**Require BOS Confirmation**
When enabled, an internal candidate must receive the specified structural break before becoming a confirmed inducement.
Visuals
The visual settings control whether external liquidity, inducement zones, sweep markers, path projections and liquidity targets are displayed.
**Path Projection Length** controls how far the projected structural path is drawn.
Style
Colors can be customized independently for bullish-side liquidity, bearish-side liquidity, bullish inducement zones, bearish inducement zones and projected paths.
Alerts
The script can generate alerts for:
* New bullish inducement
* New bearish inducement
* Bullish liquidity sweep
* Bearish liquidity sweep
* BOS confirmation events
These alerts correspond to state transitions in the detection workflow rather than simply alerting whenever an ordinary pivot appears.
Practical Usage
Use the external liquidity levels as the larger structural references and the inducement zones as secondary internal levels.
A typical workflow is to first identify the active external liquidity on the chart, then observe whether an appropriately separated internal swing forms. With BOS confirmation enabled, wait for the subsequent structural break before treating the candidate as confirmed.
After confirmation, monitor the inducement and external liquidity levels for subsequent sweeps.
The projected liquidity path should be interpreted as a visual representation of the detected structural relationship, not as a prediction of future price movement.
The indicator can therefore be used as a framework for studying how internal and external swing structures interact across different instruments and timeframes.
Limitations
The script uses confirmed pivot calculations. A pivot is only known after the required bars to the right have formed, so newly detected structure is inherently delayed by the selected pivot lengths.
Increasing the external or internal swing lengths will generally reduce the number of detected swings while making the structural definitions more selective. Smaller values can produce more candidates and more noise.
ATR filtering adapts the minimum separation to recent volatility, but it does not determine whether a particular market-structure interpretation is correct.
Liquidity sweeps are identified from the price relationship with detected levels. A sweep does not guarantee a reversal or continuation.
Projected liquidity paths are visual aids based on the currently detected opposing external level. They should not be interpreted as future-price forecasts.
The indicator is an analytical tool and should not be treated as a standalone trading system or a guarantee of market behavior.
Notes
The terms "liquidity", "inducement", "sweep" and "break of structure" describe the structural definitions implemented by this script. Different traders and methodologies may define these concepts differently.
For reproducibility, the most important settings are the external swing length, internal swing length, ATR separation threshold and BOS confirmation setting.
Signals and structural markings should be evaluated together with the underlying price action and the characteristics of the instrument and timeframe being analyzed. Indicador

AI Trend Strength Meter [algotim]Overview
EMA Cloud Trend Retest Signals is a trend-continuation indicator built around a state-based pullback and retest process.
The purpose of the script is to distinguish an ordinary moving-average touch from a structured retest. Instead of generating a signal simply because price crosses an EMA, the script first requires an established directional regime, then tracks a pullback into the EMA cloud and evaluates how deeply price retraces before attempting to resume the prevailing direction.
The result is a selective retest workflow rather than a standalone moving-average crossover signal.
Problem Statement
A basic EMA crossover can identify direction, but it does not describe what happens after the trend has started. Likewise, a simple moving-average touch can occur repeatedly during sideways markets and can produce many low-quality signals.
This script addresses that problem by separating trend identification from retest validation.
A trend must first establish itself for a configurable number of bars. Price must then interact with the EMA cloud. The script tracks the deepest part of that pullback and can require the depth to exceed a configurable fraction of ATR. Optional volume confirmation adds another condition at the retest candle.
This makes the signal dependent on the sequence of events rather than on one indicator crossing another.
Methodology
The trend engine uses a fast EMA and a slow EMA calculated from the selected price source.
When the fast EMA is above the slow EMA, the regime is bullish. When it is below the slow EMA, the regime is bearish.
The script also measures the percentage distance between the two EMAs:
Spread % = abs(Fast EMA - Slow EMA) / Close x 100
This value is normalized and used primarily to control the visual strength of the EMA cloud rather than to create an independent trading signal.
Trend age is tracked as the number of bars since the EMA regime last changed. A configurable minimum trend age prevents an immediate EMA flip from being treated as an established trend.
Retest Detection
Once a bullish regime is active, the script monitors for price interaction with the EMA cloud. For bearish regimes, the same process is applied in the opposite direction.
Depending on the selected setting, a retest can be recognized using either:
* A wick entering the EMA cloud.
* A candle close entering the EMA cloud.
Once the cloud is touched, a pullback state becomes active.
The script then tracks the most extreme price reached during that active pullback.
For bullish retests:
Pullback depth = Cloud top - Pullback low
For bearish retests:
Pullback depth = Pullback high - Cloud bottom
This allows the depth of the retracement to be compared with current volatility.
ATR Validation
The pullback-depth filter uses ATR as the volatility reference.
A bullish retest must satisfy:
Pullback depth >= ATR x Minimum Depth
A bearish retest uses the corresponding distance from the lower cloud boundary.
Because the threshold is expressed in ATR units, the filter adapts to the current volatility of the instrument instead of relying on a fixed price distance.
Volume Validation
When enabled, the retest candle is compared with a moving average of volume.
Volume confirmation requires:
Current volume >= Average volume x Volume multiplier
This filter is optional and can be disabled when volume data is unsuitable for the instrument.
Signal Workflow
1. Calculate the fast and slow EMAs.
2. Establish the bullish or bearish EMA regime.
3. Reset the signal lock when the EMA regime changes.
4. Count how many bars the current regime has remained active.
5. Ignore retests until the minimum trend-age requirement is satisfied.
6. Detect price interaction with the EMA cloud.
7. Activate a pullback state.
8. Track the deepest price reached during that pullback.
9. Compare pullback depth with the ATR-based minimum.
10. Optionally verify above-average volume.
11. Require price to close back through the appropriate cloud boundary.
12. Generate the retest signal.
13. Lock further signals until the EMA regime changes.
The one-signal-per-trend lock is an important part of the workflow. It prevents repeated cloud interactions during the same EMA regime from continuously producing identical signals.
Signal Strength
When enabled, the script classifies the retest using a simple three-point strength model.
One point is added when the trend has persisted for at least twice the minimum trend-age requirement.
One point is added when current volume reaches 1.5 times the average volume.
One point is added when the measured pullback depth reaches twice the configured minimum ATR depth.
A score of two or more is displayed as a stronger retest classification.
This score is a classification of the conditions present at the retest; it is not a probability or performance estimate.
Why This Indicator Is Different
A conventional EMA indicator normally answers one question: which EMA is above the other?
A basic pullback indicator may add a moving-average touch condition.
This script instead treats the retest as a sequence with persistent state:
EMA regime -> trend age -> cloud interaction -> pullback tracking -> ATR depth validation -> volume validation -> recovery through the cloud -> signal lock.
The distinction is therefore not the use of EMAs, ATR or volume individually. Those are standard analytical tools. The main contribution is the way they are used as sequential validation layers around a tracked pullback state.
The script also prevents multiple signals from the same trend regime by maintaining a signal-fired state until the EMA direction changes.
Inputs
EMA Cloud Settings
* Fast EMA Length
* Slow EMA Length
* Price Source
* EMA Line Width
* Candle coloring
* Cloud opacity and visual options
* ATR Length
Retest Settings
* Minimum Trend Age
* Wick-based or close-based cloud interaction
* Buy/Sell signal visibility
* Volume confirmation
* Volume moving-average length
* Volume multiplier
* Minimum pullback depth in ATR
* Signal-strength display
Risk and Target Settings
The script also provides configurable risk-reward reference levels where enabled, including target multipliers and a selectable stop-loss basis.
Alerts
The indicator provides alert functionality for the retest conditions according to the enabled alert settings.
Alerts should be interpreted as notifications that the defined sequence has completed, not as guarantees of future price movement.
Practical Usage
The indicator is intended primarily for trend-continuation analysis.
For bullish conditions, users can focus on periods where the fast EMA remains above the slow EMA, the trend has established for the required number of bars, and price pulls back into the EMA cloud before recovering above it.
For bearish conditions, the inverse process applies.
The ATR depth filter can be increased when shallow pullbacks generate excessive signals. The volume filter can be enabled when volume data provides useful participation information.
Signals should preferably be evaluated in the context of the broader market structure, timeframe and current volatility rather than treated as automatic entries.
Limitations
EMA-based regimes are lagging by construction and can change frequently during sideways markets.
A cloud interaction does not guarantee continuation. Ranging conditions can produce repeated pullbacks and failed retests.
ATR normalization adjusts the depth requirement to volatility but does not eliminate market noise.
Volume confirmation depends on the quality and meaning of the volume data available for the instrument.
The signal-strength score is a rule-based classification, not a statistical probability of success.
Trend age and pullback depth depend on historical bars and the selected settings, so results can vary substantially between instruments and timeframes.
Signals should be evaluated after bar close and should not be interpreted as guaranteed future price direction.
Notes
This indicator is an analytical framework for identifying structured EMA-cloud retests. It is not a trading strategy with guaranteed performance and should not be treated as financial advice.
The EMA, ATR and volume calculations used by the script are standard technical-analysis concepts. The intended distinction is the state-based workflow that combines them to qualify a single retest within an established trend regime.
Indicador

Engulfing Confirmation Signals [algotim]Overview
Engulfing Confirmation Signals is a two-stage price action indicator designed to distinguish basic engulfing candle formations from engulfing setups that receive additional confirmation from market context.
The script does not treat every bullish or bearish engulfing candle as a signal. First, an engulfing candle must satisfy structural requirements and pass a rule-based quality score using trend alignment, relative volume, and ATR expansion. A qualifying engulfing candle then creates a temporary confirmation zone based on its full high-low range.
The second stage waits for price to close beyond that range within a configurable number of bars. This separates the initial pattern from the subsequent breakout confirmation.
Problem Statement
A traditional engulfing detector can produce a large number of signals because the candlestick pattern itself only describes the relationship between the current candle and the previous candle.
This script adds a filtering and confirmation process around that pattern.
Instead of treating the engulfing candle as the final event, the indicator asks two separate questions:
1. Does the engulfing candle have sufficient structural and market-context quality?
2. After qualification, does price subsequently break the engulfing candle's range before the setup expires?
This creates a distinction between a qualified engulfing setup and a confirmed breakout.
Methodology
Stage 1: Engulfing Structure
A bullish engulfing candle must close above its open while the previous candle is bearish.
A bearish engulfing candle must close below its open while the previous candle is bullish.
When full-body engulfing is enabled, the current candle must also open and close beyond the previous candle's corresponding open and close.
The current candle body must be at least the configured multiple of the previous candle's body. The default minimum is 1.05 times the previous candle body.
The pattern is evaluated on the confirmed bar close.
### Stage 2: Quality Score
A qualifying engulfing candle receives a score from three rule-based components.
**Trend alignment - 40 points**
For bullish setups, the close is compared with the configured EMA. A close above the EMA receives the full 40 points. A close within the defined 0.2% proximity band receives 20 points.
For bearish setups, the corresponding relationship is reversed.
**Relative volume - 30 points**
Volume is compared with its simple moving average:
Volume ratio = Current volume / Average volume
The resulting value is converted into a score and capped at 30 points.
This allows the scoring engine to distinguish an engulfing candle occurring with relatively high participation from one occurring on comparatively weak volume.
**ATR expansion - 30 points**
Current ATR is compared with an average of ATR values.
ATR expansion contributes additional points when current volatility is above its ATR baseline, with the contribution capped at 30 points.
The three components are added together. An engulfing candle is accepted only when its total score reaches the user-defined minimum score.
The score is a rule-based filter and should not be interpreted as a probability or expected win rate.
Signal Workflow
Bullish workflow
1. Detect a bullish engulfing candle.
2. Verify the required body relationship with the previous candle.
3. Calculate trend, volume, and ATR components.
4. Add the components into the 0-100 quality score.
5. Ignore the setup if the score is below the minimum threshold.
6. If qualified, create a bullish confirmation zone using the engulfing candle's high and low.
7. Monitor subsequent bars for a close above the engulfing candle high.
8. Generate the confirmed bullish signal when that breakout occurs.
9. Expire the zone if the breakout does not occur within the configured waiting period.
Bearish workflow
1. Detect a bearish engulfing candle.
2. Verify the required body relationship with the previous candle.
3. Calculate trend, volume, and ATR components.
4. Add the components into the 0-100 quality score.
5. Ignore the setup if the score is below the minimum threshold.
6. If qualified, create a bearish confirmation zone using the engulfing candle's high and low.
7. Monitor subsequent bars for a close below the engulfing candle low.
8. Generate the confirmed bearish signal when that breakout occurs.
9. Expire the zone if the breakout does not occur within the configured waiting period.
Why This Indicator Is Different
A conventional engulfing indicator normally stops at identifying the candlestick pattern.
This script uses the engulfing candle as the beginning of a two-stage process.
The first stage evaluates whether the pattern has sufficient contextual support using three measurable conditions: its position relative to an EMA, current volume relative to average volume, and current ATR relative to its ATR baseline.
The second stage does not immediately convert a qualified engulfing candle into a confirmed breakout signal. Instead, the engulfing candle's range becomes a temporary state that is monitored for a subsequent closing breakout.
This distinction is the main purpose of the indicator: the initial engulfing event and the later range break are treated as separate analytical events.
Inputs
Engulfing Detection
**Min Body Size vs Prior Candle**
Controls how large the engulfing candle's body must be relative to the previous candle.
**Require Full Body Engulf**
When enabled, the current candle's open and close must fully engulf the previous candle's body.
Confirmation Engine
**Trend EMA Length**
Sets the EMA used for the trend-alignment component of the score.
**Volume Average Length**
Controls the moving-average baseline used to evaluate relative volume.
**ATR Length**
Controls the ATR calculation used by the volatility component.
**Minimum Quality Score**
Sets the minimum combined score required for an engulfing candle to create a confirmation zone.
Confirmation Zone
**Max Bars to Wait for Confirmation**
Defines how long an active engulfing zone remains valid while waiting for a breakout.
**Extend Zone Box While Active**
Controls whether the active zone visually extends as subsequent bars are processed.
Visual Style
The visual inputs control bullish and bearish colors, zone transparency, Stage 1 markers, and whether the numerical quality score is displayed.
Alerts
The script provides alerts for:
* Qualified bullish engulfing
* Qualified bearish engulfing
* Confirmed bullish breakout
* Confirmed bearish breakout
Qualified alerts identify the first stage of the process. Confirmed breakout alerts identify the second stage.
Practical Usage
The Stage 1 marker can be used to locate engulfing candles that have passed the configured contextual filters.
The Stage 2 confirmation marker can then be used to identify cases where price subsequently closes beyond the qualified engulfing candle's range.
Users can adjust the minimum score to control selectivity. Higher thresholds require stronger combined trend, volume, and volatility conditions and will generally produce fewer qualifying setups.
The confirmation window can also be adjusted depending on how long the user wants an engulfing setup to remain valid.
The indicator is intended for chart analysis and can be evaluated across different instruments and timeframes. Settings should be tested against the characteristics of the market being analyzed.
Limitations
The quality score is a rule-based classification and is not a statistical probability, accuracy percentage, or guarantee of future performance.
Engulfing patterns can fail, and a confirmed range breakout does not guarantee continued price movement.
Volume behavior varies between instruments, particularly where volume data is limited or represents different types of market activity.
EMA, volume, and ATR parameters can produce different results across instruments and timeframes.
Signals are generated from completed bar conditions, but the confirmation process can still produce false breakouts during volatile or ranging conditions.
The indicator does not provide trade management, position sizing, stop-loss, or take-profit recommendations.
Notes
The script is designed as a structured confirmation framework around engulfing price action.
Its output should be interpreted as analytical information rather than a standalone trading decision. Users should evaluate the indicator with their own market context, risk management, and trading methodology. Indicador

Optimal Trade Entry (OTE) Zone Plotter [algotim]Optimal Trade Entry (OTE) Zone Plotter locates the 62%-79% institutional retracement zone of a confirmed impulsive swing and keeps only the single most relevant zone per direction on the chart, fading it through disclosed mitigation states as price interacts with it.
Problem Statement
The Optimal Trade Entry concept, retracing into the 62%-79% region of an impulsive leg before continuation, is a well-known Fibonacci convention, but most public implementations simply plot every Fibonacci level on every swing they detect. This produces charts covered in overlapping retracement boxes, most of which come from insignificant swings that carry no real weight, and gives no visual indication of which zones are still fresh, already tested, or fully invalidated.
This indicator addresses that gap by filtering which swings are allowed to generate a zone in the first place, by showing only the current zone per direction at full strength, and by changing each zone's appearance as price actually interacts with it.
Methodology
Swing highs and lows are identified with ta.pivothigh/ta.pivotlow using a user-defined Pivot Length, so every swing referenced by the script is a confirmed pivot, evaluated only after barstate.isconfirmed is true.
Consecutive pivots of the same type extend a running swing extreme; a leg is only registered when the pivot type alternates (a low following a high, or a high following a low). Each candidate leg must then clear three disclosed checks before it is allowed to create a zone: the leg's price range must reach a minimum multiple of ATR, the swing candle's own body-to-range ratio must reach a minimum threshold, and, if the Break of Structure filter is enabled, the new swing must exceed the prior swing of the same type. Legs that fail any check produce no zone, no label, and no alert.
A qualifying leg generates one OTE zone: the shaded region between the 62% and 79% retracement of that leg, with the 70.5% level drawn as a two-layer glowing midline inside it. Only one bullish and one bearish zone are ever active at a time. When a new qualifying leg forms, the previous zone of that direction is frozen in place and, if enabled, kept as a single low-opacity historical reference rather than removed outright or left overlapping the new zone.
Each active zone tracks its own mitigation state on every confirmed bar: Fresh (untouched), Touched (price has wicked into the 62%-79% region), Mitigated (a confirmed close through the 79% boundary), or Invalidated (a confirmed close back through the leg's own origin point). State can only advance forward, and the zone's fill opacity and border color update automatically at each transition, so the chart communicates a zone's condition without any additional label or panel.
Signal Workflow
Step 1 — a confirmed swing pivot alternates direction, registering a candidate leg from the prior opposite pivot to the new one.
Step 2 — the leg is checked against the Minimum Swing Size, Body Ratio, and optional Break of Structure filters; legs that fail are discarded with no chart output.
Step 3 — a qualifying leg creates a new active OTE zone (62%-79%) with its 70.5% midline, and the previous zone of the same direction is frozen and faded.
Step 4 — the active zone's state advances from Fresh to Touched as price wicks into the zone on a confirmed bar.
Step 5 — the zone advances to Mitigated on a confirmed close through the 79% boundary, or to Invalidated on a confirmed close back through the leg's origin, at which point it is greyed out.
Step 6 — each transition and each zone entry/exit can trigger its own alert, gated by the corresponding toggle in the Alerts group.
Why This Indicator Is Different
Most public OTE/Fibonacci scripts draw a zone for every detected swing regardless of its significance, leaving multiple overlapping retracement boxes on the chart at once.
This script applies a disclosed three-part quality filter (ATR-relative swing size, swing candle body ratio, optional break-of-structure confirmation) before a swing is even allowed to generate a zone.
Only one zone per direction is ever shown at full strength; the prior zone automatically fades to a quiet historical reference the moment a new qualifying swing appears, keeping the chart focused on the current opportunity.
Zone fill opacity and border color are driven entirely by a four-state mitigation engine (Fresh/Touched/Mitigated/Invalidated) computed from confirmed price action against the zone's own boundaries, so the visual state of a zone is informative rather than purely decorative.
The 70.5% equilibrium level is rendered as a two-layer glow line rather than a plain dashed line, giving the zone's mid-point a distinct, non-generic appearance.
Inputs
Swing Detection
Pivot Length
ATR Length
OTE Quality Filter
Minimum Swing Size (x ATR)
Minimum Swing Candle Body Ratio
Require Break of Structure
OTE Zone
Show Bullish OTE Zones
Show Bearish OTE Zones
Zone Extension (bars)
Show Institutional Midline (70.5%)
Fade Previous Zone on New Swing
Visual Settings
Bullish/Bearish Zone Colour
Bullish/Bearish Midline Colour
Label Size
Alerts
Alert: New OTE Zone Created
Alert: Price Entered OTE Zone
Alert: Price Left OTE Zone
Alert: OTE Zone Mitigated
Alert: OTE Zone Invalidated
Alerts
Alerts are available for:
New Bullish/Bearish OTE Zone Created
Price Entered Bullish/Bearish OTE Zone
Price Left Bullish/Bearish OTE Zone
Bullish/Bearish OTE Zone Mitigated
Bullish/Bearish OTE Zone Invalidated
Practical Usage
Treat an active, Fresh OTE zone in the direction of the prevailing structure as a region to watch for a retracement entry, not a standalone entry signal by itself.
Use the Break of Structure filter on trending instruments to restrict zones to swings that genuinely extended structure, and disable it on ranging instruments where internal swings may still be meaningful.
Raise the Minimum Swing Size and Body Ratio filters on lower timeframes or noisy instruments to reduce the number of zones generated.
Watch the zone's fill opacity as a quick visual read of its condition: a bold zone has not been tested, a lighter fill has already been touched or mitigated, and a greyed zone has been invalidated and should generally be disregarded.
Combine the Entered/Exited alerts with your own confirmation criteria (candlestick behavior, lower-timeframe structure, etc.) rather than treating zone entry alone as a trigger.
Limitations
Swing pivots require bars to form on both sides before they confirm, so every zone is inherently placed a Pivot Length number of bars after the actual swing extreme occurred.
The quality filter reduces the number of zones shown but does not evaluate or predict the outcome of any individual retracement.
Only one active zone per direction is displayed at a time; if you want to review multiple historical zones simultaneously, enable "Fade Previous Zone on New Swing" and note that only the single most recent prior zone is retained, not a full history.
As with any retracement-based tool, results will vary across instruments, timeframes, and market regimes.
Notes
This indicator is a zone-location tool intended to highlight the current, quality-filtered Optimal Trade Entry region and its mitigation state through a disclosed, rule-based process.
All swing confirmations, zone creation, mitigation-state transitions, and invalidations are evaluated on confirmed bar closes only, so no element of the script repaints once drawn.
The output is intended to support retracement-based analysis and is not a standalone buy or sell recommendation. Indicador
