Zero-Lag ATR Trend [BackQuant]Zero-Lag ATR Trend
Overview
Zero-Lag ATR Trend is a volatility-adaptive trend-following overlay designed to identify directional market regimes with minimal delay while preserving structural clarity. The indicator combines a zero-lag moving average framework with a zero-lag volatility model to produce a trailing trend line that reacts quickly to meaningful price changes without becoming unstable or overly sensitive.
Unlike conventional ATR-based trend tools that rely on lagging averages and delayed volatility estimates, this indicator applies zero-lag logic to both the trend centerline and the volatility calculation. The result is a trend structure that aligns more closely with real-time price action while still maintaining the discipline required for trend continuation trading.
Core design philosophy
The core idea behind Zero-Lag ATR Trend is simple:
Reduce signal delay without sacrificing trend integrity.
Adapt dynamically to changing volatility regimes.
Provide a single, clean structure that defines trend direction, continuation, and invalidation.
Instead of stacking multiple indicators, the script builds a complete trend framework from two tightly integrated components: a zero-lag trend spine and a zero-lag ATR trailing mechanism.
Zero-lag trend spine
The trend spine is constructed using a zero-lag moving average (ZLMA). This is achieved by applying a corrective step to a traditional moving average, effectively compensating for smoothing delay.
Conceptually, the process works as follows:
A base moving average is calculated from the selected price source.
That moving average is then passed through a zero-lag correction.
The correction pulls the line closer to current price without introducing noise.
This produces a trend line that reacts faster than standard EMA, SMA, or HMA signals, particularly during early trend acceleration phases. Multiple moving-average types can be used inside the zero-lag framework, allowing traders to fine-tune responsiveness based on asset behavior and timeframe.
Zero-lag volatility model
Volatility is measured using True Range, but instead of applying classic ATR smoothing, the indicator uses a zero-lag smoothing pass on the True Range itself.
This approach offers several advantages:
Volatility expands more quickly during impulse moves.
Volatility contracts faster during consolidations.
Band width adjusts in near real-time to changing conditions.
The smoothed zero-lag ATR is multiplied by a user-defined factor to create adaptive upper and lower boundaries around the trend spine. These boundaries define how much counter-movement price is allowed before the trend structure is invalidated.
Volatility-aware trailing structure
The trailing output is the defining feature of the indicator. It behaves as a one-directional trailing structure:
In bullish conditions, the trailing line can only move upward.
In bearish conditions, the trailing line can only move downward.
Minor pullbacks inside the volatility envelope do not flip the trend.
This logic prevents the indicator from reacting to shallow retracements and focuses instead on structural trend changes. Because the trailing behavior is volatility-scaled, the indicator remains stable during high volatility while still responding promptly during regime shifts.
Trend flips and regime transitions
Trend direction is determined by changes in the trailing structure itself rather than raw price crosses. A trend flip occurs only when price movement is strong enough, relative to current volatility, to force the trailing line to reverse direction.
This means:
Bullish flips represent genuine transitions into upward regimes.
Bearish flips represent genuine transitions into downward regimes.
Sideways noise is largely filtered out.
As a result, the indicator is well suited for identifying medium-to-long trend phases rather than short-term oscillations.
Visual structure and chart clarity
The visual design is intentionally minimal and functional:
The main trailing line is color-coded by trend direction.
An optional ribbon or cloud reinforces directional bias.
Optional candle coloring aligns price bars with the active trend.
These elements allow traders to assess trend state instantly without interpreting multiple signals or overlays.
How to use for trend following
Trend bias
Maintain a bullish bias while price holds above the trailing line.
Maintain a bearish bias while price holds below the trailing line.
Entries
Trend flips can be used as initial directional entries.
Pullbacks toward the trailing line often act as continuation opportunities.
Momentum confirmation can be layered on top for additional confluence.
Trend management
The trailing line naturally functions as a dynamic stop reference.
As long as price respects the trailing structure, the trend remains valid.
A flip in direction signals a full regime transition rather than a minor correction.
Why zero-lag matters for trend trading
Traditional trend indicators often react late, especially during fast expansions, resulting in delayed entries and early exits. By reducing lag in both the trend calculation and the volatility model, Zero-Lag ATR Trend aims to capture a larger portion of directional moves while maintaining consistency and discipline.
This makes it particularly effective for momentum-based trend following, breakout continuation strategies, and traders who prioritize staying aligned with dominant market structure rather than predicting reversals.
Summary
Zero-Lag ATR Trend is a complete trend-following framework built around responsiveness, adaptability, and clarity. Its zero-lag architecture allows it to respond earlier to meaningful price changes, while its volatility-aware trailing logic ensures that trends are only invalidated when structure truly breaks. The result is a clean, intuitive tool that supports disciplined trend participation across assets and timeframes.
Rango Verdadero Medio (ATR)
Volatility Trend Score [BackQuant]Volatility Trend Score
Overview
Volatility Trend Score is a trend-strength and regime-evaluation indicator built to measure directional persistence, not just direction. Most trend tools answer “up or down” using slope, crossovers, or a single condition. This indicator answers a more useful question for real trading: “How consistently is trend structure holding up once volatility is accounted for?”
It does this by building a volatility-scaled trailing structure (ATR-based) and then scoring how that structure evolves over a configurable lookback range. The output is a continuous score that rises when trend is persistent and decays when price action becomes noisy, mean-reverting, or unstable.
What it is measuring (the real goal)
This indicator is not trying to predict reversals. It is trying to quantify whether the market is behaving like a trend market or a chop market. It focuses on:
Persistence: does structure keep pushing in one direction bar after bar?
Stability: are pullbacks being absorbed without breaking the trailing structure?
Regime: is the market trending strongly enough to justify directional bias?
If you already have entries from other systems, this becomes a high-quality trend filter and trade management layer.
Core idea
At its foundation, the indicator combines two parts:
A volatility-adjusted trailing level derived from ATR and a user-defined factor.
A rolling persistence score that compares the current trail to prior trail values over a configurable loop window.
The trailing structure adapts to volatility and enforces one-sided movement, while the scoring logic converts that behavior into a numeric measure of trend quality.
Inputs and what they actually control
Average True Range Period (calc_p)
Defines the ATR window used to estimate volatility. A higher value smooths the volatility estimate and makes the trailing structure less reactive.
Factor (atr_factor)
Scales the ATR band size. Higher values widen the trailing band, filtering more noise, reducing flip frequency, and generally producing slower but more stable regimes.
For Loop Start/End (start/end)
Defines the comparison window used to build the score. It effectively sets how many historical trail values the current trail is compared against.
Shorter ranges produce a faster, more responsive score.
Longer ranges produce a slower, more “confidence-based” score that only climbs when trend persistence is sustained.
Long/Short Thresholds (thresL/thresS)
Convert a continuous score into regime thresholds.
Long threshold is a “trend quality requirement” for bullish bias.
Short threshold is used as a deterioration / breakdown trigger via crossunder logic.
Volatility-adjusted trailing structure
The trailing line is built from ATR bands around price:
up = close + ATR * factor
dn = close - ATR * factor
Then a trailing value is maintained with one-sided ratcheting behavior:
If dn rises above the previous trail, the trail steps up (ratchets upward).
If up drops below the previous trail, the trail steps down (ratchets downward).
This “ratchet” behavior is important. It prevents the trail from oscillating with small countertrend moves, forcing the trail to represent meaningful structure rather than micro-noise. On-chart, this trail often behaves like dynamic support/resistance in trends.
Why the trail is a better base than raw price
Price itself is noisy, and volatility changes the meaning of “big move” vs “small move.” By anchoring structure to ATR:
A move is interpreted relative to current volatility, not in absolute points.
High-volatility chop is less likely to be misread as a trend.
Trend structure is normalized across assets and timeframes more reliably.
This is why the score remains usable even when switching from low-vol assets to high-vol crypto pairs.
Trend scoring logic
The score is built by repeatedly comparing the current trailing value to trailing values from prior bars across a loop window:
If current trail > trail , add +1
If current trail < trail , add -1
This is a persistence test, not a momentum calculation. In a strong trend, the trail should generally keep stepping in the trend direction, so current values will be greater than many past values (bullish) or lower than many past values (bearish). In chop, the trail fails to progress meaningfully, so the score compresses, oscillates, or bleeds out.
How to interpret the score
Think of the score as a “trend conviction meter”:
High positive values: bullish persistence, structure is advancing consistently.
Low positive values: bullish bias may exist, but trend quality is weak or unstable.
Near zero: indecision, range behavior, or frequent structure challenges.
Negative values: bearish dominance or sustained deterioration in structure.
The speed of score change matters too:
Fast expansion suggests a fresh regime gaining traction.
Slow grind suggests mature trend continuation.
Rapid compression often signals consolidation, exhaustion, or a transition phase.
Signals and regime transitions
This script uses two different styles of conditions (important detail):
Long condition: score > long threshold (state-based, persistent while true).
Short condition: crossunder(score, short threshold) (event-based trigger).
That means:
Long bias can remain active as long as score stays above the long threshold.
Short regime flips are triggered at the moment the score breaks down through the short threshold.
On the chart, long/short shapes are only plotted when the regime flips (first bar of the change), not on every bar, using:
Long shape when signal becomes 1 and previous signal was -1
Short shape when signal becomes -1 and previous signal was 1
This keeps signals clean and avoids spam, making it usable for alerts and regime tagging.
Visual presentation
The indicator is designed to work both as a panel oscillator and as an on-chart overlay:
Score plot (oscillator): color reflects active regime state.
Optional trail on price: volatility-scaled structure line on chart.
Optional threshold reference lines: clear regime boundaries.
Optional candle coloring: makes regime obvious without reading the panel.
Optional background shading: useful for quick scanning and backtesting visually.
You can use only the score, only the trail, or both together depending on your workflow.
Practical use cases
1) Trend filter for systems
Use the score as a regime gate:
Allow long entries only when score is above the long threshold.
Avoid longs when score compresses toward zero or loses the threshold.
Treat the short threshold break as “trend is no longer healthy.”
This often improves system expectancy by reducing exposure during low-conviction conditions.
2) Trend quality grading
Instead of treating all uptrends as equal:
Higher score = higher persistence, better continuation odds.
Score plateau = trend losing pressure, continuation becomes less reliable.
Score decay while price rises = trend is getting weaker under the hood.
This is useful for position sizing or deciding whether to add to winners.
3) Trade management and exits
Two complementary tools exist here:
Trail line can act as a dynamic stop reference or structure invalidation level.
Score behavior can be used to scale out when persistence fades (before a full flip).
Many traders use the trail for “hard structure” and the score for “soft deterioration.”
4) Breakout confirmation vs fakeouts
A breakout that immediately fails to build score is often low quality.
Healthy breakouts usually come with score expansion as structure advances.
Fakeouts often revert quickly, score fails to climb, and regime stays unstable.
Tuning guidelines
These are general behaviors you can expect when adjusting settings:
Higher ATR period and factor: slower regimes, fewer flips, cleaner structure.
Lower ATR period and factor: faster reaction, more sensitivity, more noise risk.
Longer loop range: score becomes more “confidence-based,” slower to change.
Shorter loop range: score becomes more “tactical,” faster but more jittery.
A good way to tune is to pick the trail behavior first (ATR period and factor), then tune the score window (loop) to match how quickly you want “trend conviction” to build.
Market behavior focus
Volatility Trend Score is most valuable in markets where volatility shifts frequently and fake trends are common, especially crypto. It is designed to:
Stay out of low-quality chop where most indicators whipsaw.
Quantify when volatility is being expressed directionally (constructive trend).
Provide a clean regime framework for filtering, alignment, and management.
Summary
Volatility Trend Score converts volatility-adjusted structure into a quantified measure of trend persistence. By combining an ATR-based trailing mechanism with a rolling comparison score, it provides a more reliable read on trend quality than single-condition indicators. It is best used as a regime filter, a trend strength gauge, and a trade management layer, helping you stay aligned with strong directional phases while avoiding low-conviction envir
Purra Buy Sell Signalsindicator.lk's purra buy sell is a precision-tuned indicator designed specifically for XAU/USD (Gold) 5-minute scalping. It combines a smoothed trend-filter (based on a multi-stage EMA cascade with adaptive smoothing) and an ATR-based trailing stop logic to generate high-confidence Buy and Sell signals directly on the price chart.
Ideal for short-term traders seeking clean, responsive entries with minimal lag, this tool helps you:
Catch early trend reversals
Avoid choppy false signals
Execute fast scalps during active gold sessions (London & Asian overlap)
Built with risk-aware logic and visual clarity in mind—green labels = long opportunities, red labels = short setups. Fully compatible with alerts for automated trade execution.
Optimized for XAUUSD on the 5-minute timeframe. Works best during high-liquidity hours.
🛠️ How to Use (for Gold 5-Minute Scalping)
Apply to Chart: Add the indicator to XAU/USD (Gold) on the 5-minute timeframe.
Signal Interpretation:
Green "Buy" label below bar: Strong bullish momentum—consider long entry.
Red "Sell" label above bar: Strong bearish momentum—consider short entry.
Confirmation Tips:
Trade only when the background ribbon or trend line (if enabled) aligns with the signal direction (green = uptrend, red = downtrend).
Avoid signals during major news events or low volatility (e.g., late NY session).
For higher accuracy, combine with price action (e.g., rejection candles, break of micro structure).
Risk Management:
Use tight stop-losses just beyond recent swing points.
Target 1:1 or 1:2 risk-reward; gold moves fast on 5M!
Alerts: Enable TradingView alerts on “Purra Long” / “Purra Short” conditions for real-time notifications.
Lakshmi - Low Volatility Range Breakout (LVRB)⚡️ Overview
The Low Volatility Range Breakout (LVRB) indicator is designed to identify consolidation phases characterized by suppressed volatility and generate actionable signals when price breaks out of these ranges. The underlying premise is rooted in the market principle that periods of low volatility often precede significant directional moves—volatility contraction leads to expansion.
Important Note on Optimization: The default parameter settings of this indicator have been specifically optimized for BTCUSDT on the 2-hour (2H) timeframe. While the indicator can be applied to other instruments and timeframes, users are encouraged to adjust the parameters accordingly to suit different trading conditions and asset characteristics.
This indicator automates the detection of "quiet" accumulation/distribution zones and provides clear visual cues and alerts when a breakout occurs.
⚡️ How to Use
1. Add the indicator to your chart. Default settings are optimized for BTCUSDT 2H.
2. Wait for a gray box to appear—this indicates a qualified low-volatility range is forming.
3. Monitor for breakout signals:
• LONG (green triangle below bar): Price broke above the range. Consider entering a long position.
• SHORT (red triangle above bar): Price broke below the range. Consider entering a short position.
4. Set alerts using "LVRB LONG" or "LVRB SHORT" to receive notifications on confirmed breakouts.
5. Adjust parameters as needed for different instruments or timeframes.
Tip: Combine with volume analysis or trend filters for higher-probability setups.
⚡️ How It Works
1. Low Volatility Bar Detection
A bar is classified as "low volatility" when it meets the following criteria:
• True Range (TR) is at or below the average TR (Simple Moving Average) multiplied by a user-defined threshold.
• (Optional) Candle Body is at or below the average body size multiplied by a separate threshold.
This dual-filter approach helps isolate bars that exhibit genuine compression in both range and directional commitment.
2. Range Box Formation
When consecutive low-volatility bars are detected, the indicator begins constructing a consolidation box:
• The box expands to encompass the high and low of qualifying bars.
• A minimum number of bars and a minimum fraction of low-volatility bars are required for the box to become "qualified" (active).
• A configurable tolerance allows for a limited number of consecutive non-low-vol bars within the sequence, accommodating minor noise without invalidating the range.
• If the box height exceeds a maximum threshold (defined as a multiple of the base ATR at sequence start), the range is invalidated.
3. Breakout Detection
Once a qualified range is established, the indicator monitors for breakouts:
• Wick Mode: Requires both a wick pierce beyond the range boundary AND a close outside the range.
• Close Mode: Requires only a close beyond the range boundary.
• (Optional) Breakout Body Filter: The breakout candle's body must exceed a multiple of the average body size at range formation.
• (Optional) Candle Direction Filter: Bullish breakouts require a green candle; bearish breakouts require a red candle.
Signals are displayed in real-time and confirmed upon bar close.
⚡️ Inputs & Parameters
• Volatility Window: Lookback period for calculating average TR and average body size.
• TR Multiplier: A bar's TR must be ≤ avgTR × this value to qualify as low-vol.
• Body Multiplier: A bar's body must be ≤ avgBody × this value (if body filter is enabled).
• Use Body Filter: Toggle the body size filter on/off.
• Min Bars in Box: Minimum number of bars required for a range to become qualified.
• Min Low-Vol Fraction: Minimum proportion of bars in the sequence that must be low-vol.
• Allowed Consecutive Non-Low-Vol Bars: Tolerance for consecutive bars that do not meet low-vol criteria.
• Max Box Height: Maximum allowed range height as a multiple of the base ATR.
• Breakout Mode: Choose between "Wick" (pierce + close) or "Close" (close only).
• Breakout Body Multiplier: Require breakout candle body ≥ avgBody × this value (1.0 = OFF).
• Require Candle Direction: Enforce green candle for LONG, red candle for SHORT.
⚡️ Visual Features
• Consolidation Boxes: Displayed in neutral (gray) color during formation. Upon a confirmed breakout, the box is colored green for bullish breakouts or red for bearish breakouts.
• Breakout Signals:
• LONG: Green upward triangle displayed below the price bar with "LONG" label.
• SHORT: Red downward triangle displayed above the price bar with "SHORT" label.
• Range Levels: Optional horizontal plots for the active range's high and low.
• Invalidated Boxes: Optionally retained in neutral (gray) color or deleted from the chart.
• Full Customization: Colors, transparency, and border width are all adjustable.
⚡️ Alerts
Two alert conditions are available:
• LVRB LONG: Triggered on a confirmed bullish breakout (bar close).
• LVRB SHORT: Triggered on a confirmed bearish breakout (bar close).
⚡️ Use Cases
• Breakout Trading: Enter positions when price escapes a well-defined low-volatility range.
• Volatility Expansion Plays: Anticipate increased volatility following periods of compression.
• Filtering Choppy Markets: Avoid trading during extended consolidation; wait for confirmed breakouts.
• Multi-Timeframe Analysis: Use on higher timeframes to identify major consolidation zones.
⚡️ Notes
• Best used in conjunction with volume analysis, trend context, or support/resistance levels for confirmation.
• Performance varies across instruments and timeframes; backtesting and parameter optimization are recommended.
⚡️ Credits
Developed by Lakshmi. Inspired by volatility contraction principles and range breakout methodologies.
⚡️ Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a guarantee of profits. Trading financial instruments involves substantial risk, and you may lose more than your initial investment. Past performance, whether indicated by backtesting or historical analysis, does not guarantee future results. The use of this indicator does not ensure or promise any profits or protection against losses. Users are solely responsible for their own trading decisions and should conduct their own research and/or consult with a qualified financial advisor before making any investment decisions. By using this indicator, you acknowledge and accept that you bear full responsibility for any trading outcomes.
ATR Table (Top Right) - Multi Rangejust your friendly atr table to multiple ranges and for the sense of what is brewing
ATR Units + % (Watermark)A clean and simple indicator for displaying ATR (Average True Range) volatility directly on the chart, without any lines, panels, or visual clutter.
The indicator shows:
ATR in price units (how much the asset moves in absolute terms)
ATR as a percentage (%) of the current price
The values are displayed as a text watermark on the chart, allowing you to quickly see the volatility level at a glance without interfering with price analysis.
Customization Options:
Set ATR length
Choose text size
Choose text color
Control transparency (for a true watermark look)
Choose full chart position:
Vertical: Top / Middle / Bottom
Horizontal: Left / Center / Right
Disclaimer
This indicator is provided for educational and informational purposes only.
It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument.
The ATR values shown (both units and percentage) reflect historical price volatility only and do not predict future market behavior.
All trading decisions are the sole responsibility of the user.
Trading involves risk. Always use proper risk management, and consult a licensed financial professional if needed before making trading decisions.
Pro Minimalist ATR (Black)The script I provided is a tool that automatically calculates and displays volatility "zones" around the average price. Here is the plain English explanation of what it is doing and why:
1. The Anchor: 20 DMA (The "Fair Value")
The script starts by calculating the 20-Day Moving Average (20 DMA).
What it represents: Think of this as the "fair price" or the "center of gravity" for the market over the last month.
In the script: It looks at the closing price of the last 20 candles, adds them up, and divides by 20. This is your baseline.
2. The Ruler: ATR (The "Volatility")
Next, it measures the Average True Range (ATR) over the last 14 days.
What it represents: This measures the "energy" or "noise" of the market. If candles are huge, the ATR is high. If candles are tiny, the ATR is low.
Why we use it: Using a fixed number (like $50) doesn't work because stocks move differently. ATR adapts to the current market mood.
3. The Zones: +1, +2, -1, -2
The script then takes that "center" (20 DMA) and adds/subtracts the "ruler" (ATR) to create four distinct levels:
+1 ATR: This is the "Upper Normal" limit. Price hanging here is bullish but normal.
+2 ATR: This is the "Extreme" limit. Statistically, price rarely stays above this line for long without snapping back. This is often an overbought signal.
-1 ATR: This is the "Lower Normal" limit.
-2 ATR: This is the "Extreme" discount. If price hits this, it is statistically stretched far below its average.
4. The Visuals: "Clean" Labeling
Finally, the script focuses on presentation:
No Lines: It specifically avoids drawing lines all over your history to keep your chart clean.
Dynamic Labels: It creates text labels only on the very last bar (the current moment). It constantly deletes the old label and draws a new one as the price moves, so it looks like the text is "floating" next to the current price.
Axis Marking: It forces marks onto the right-hand price scale (display=display.price_scale) so you can see the exact price levels (e.g., 154.20) without having to guess.
Dynamic ATR-based Renko Overlay - Non repaintingDaily ATR-Based Renko Overlay
Overview
This Pine Script v5 indicator creates a dynamic Renko overlay on your time-based charts (optimized for 1-minute timeframes), using the previous period's ATR from a user-specified higher timeframe (default: 1-hour) to determine brick sizes. Unlike traditional Renko charts, this is an overlay that draws Renko bricks directly on top of your existing candles, allowing you to combine the noise-filtering power of Renko with the full features of time-based charts.
It's designed for traders who want Renko's trend-clarity benefits without switching chart types, especially useful for intraday trading in volatile markets like forex, stocks, or crypto.
Key Features
- Adaptive Brick Sizing: Brick size is calculated as a percentage (default 40%) of the previous period's ATR (Average True Range, default length 14) from the selected higher timeframe (default: 1-hour). This makes bricks volatility-adjusted—larger in high-vol periods to reduce noise, smaller in low-vol for more detail.
- Periodic Recalculation: Resets brick size at the start of each new period based on the user-specified reset timeframe (default: daily), using the prior period's ATR from the chosen timeframe. This ensures relevance without unwanted disruptions.
- Traditional Renko Logic: Uses 1-box reversal (a full brick against the trend to reverse). Bricks form based on closing prices, ignoring time and minor fluctuations.
- Visual Style: Stepped lines with green (up) and red (down) fills for a box-like appearance. Semi-transparent for easy overlay on candles.
- Customizable Inputs:
- ATR Length: Adjust the ATR period (default: 14).
- Percentage of ATR: Fine-tune brick sensitivity (default: 0.4 or 40%; range 0-1).
- ATR Timeframe: Specify the timeframe for ATR calculation (default: "60" for 1-hour; enter as a string like "240" for 4-hour, "D" for daily, etc.).
- Reset Timeframe: Specify the period for recalculating the brick size (default: "D" for daily; enter as a string like "W" for weekly, "M" for monthly, etc.).
How It Works
1. Fetches ATR from the user-specified timeframe via `request.security` for higher-timeframe volatility data.
2. On new periods based on the reset timeframe (or first load), sets brick size to `percent * ATR_HTF`.
3. Tracks Renko "close" and "previous close" to calculate bricks:
- Upward moves add green bricks in multiples of the size.
- Downward moves add red bricks.
- Reversals require a full brick against the direction.
4. Plots and fills create the overlay, updating on each 1-min bar close.
Add it to a 1-minute chart for best results—bricks will adapt periodically while you retain full candle visibility.
Why This Indicator is Helpful
TradingView's native Renko charts are powerful but come with limitations that can frustrate serious traders:
- No Bar Replay: Native Renko doesn't support TradingView's bar replay feature, making it hard to simulate historical trading sessions.
- Inaccurate/Repainting Strategy Testing: Strategies on native Renko can repaint or lack precision due to the non-time-based nature, leading to unreliable backtests.
- Limited Data History: Fast Renko timeframes (e.g., small bricks) often load very little historical data, restricting long-term analysis.
This overlay solves these by building Renko on a time-based chart:
- Full Bar Replay Support: Replay sessions as usual on your 1-min chart—the Renko follows along.
- Accurate, Non-Repainting Testing: Test strategies on the underlying time chart without repainting issues, as Renko is derived from closes.
- Unlimited Data Depth: Access TradingView's full historical data for 1-min charts (up to years of bars), not limited by Renko's data constraints.
- Hybrid Analysis: Overlay Renko on candles to spot trends while using volume, indicators (e.g., RSI, MAs), or drawing tools that don't work well on native Renko.
It's a game-changer for trend-following, breakout strategies, or filtering noise in short-term trades. No more switching charts—get the best of both worlds!
Usage Tips
- Best on 1-min charts for intraday precision, but experiment with others.
- Tune the percentage lower (e.g., 0.3) for more bricks/sensitivity, higher (e.g., 0.5) for fewer/false-signal reduction.
- Adjust the ATR timeframe to match your strategy—e.g., "240" for longer-term volatility or "15" for shorter.
- Customize the reset timeframe for different recalculation frequencies—e.g., "W" for weekly resets to capture broader market shifts, or "240" for every 4 hours.
- Combine with alerts: right now I am experimenting with 90 period EMA and the Renko brick pullbacks to find some EDGE
If you find this useful, give it a thumbs up or share your tweaks in the comments. Feedback welcome—happy trading! 🚀
Daily ATR (Shown on All Timeframes)Daily ATR (Shown on All Timeframes) displays the Daily timeframe ATR on any chart you’re viewing, so you always know the current day’s average range without switching timeframes.
True Daily ATR (not chart ATR): The script pulls ATR from the Daily chart using request.security() and shows that value on every timeframe.
On-chart table (top-right): A clean 2-row table shows:
The label: Daily ATR (Length)
The ATR value, with an optional ATR-as-% of price readout.
Custom display controls:
ATR Length input (default 14)
Toggle to show ATR % of current price
Toggle to show/hide the table
Choose table text color
Choose table text size (Tiny → Huge)
Data Window output: The Daily ATR value is also plotted invisibly so it appears in TradingView’s Data Window for quick reference.
This is useful for gauging daily volatility, setting risk/position sizing, and comparing intraday movement to the stock’s typical daily range.
Daily ATR (Shown on All Timeframes)Daily ATR (Shown on All Timeframes) displays the Daily timeframe ATR on any chart you’re viewing, so you always know the current day’s average range without switching timeframes.
True Daily ATR (not chart ATR): The script pulls ATR from the Daily chart using request.security() and shows that value on every timeframe.
On-chart table (top-right): A clean 2-row table shows:
The label: Daily ATR (Length)
The ATR value, with an optional ATR-as-% of price readout.
Custom display controls:
ATR Length input (default 14)
Toggle to show ATR % of current price
Toggle to show/hide the table
Choose table text color
Choose table text size (Tiny → Huge)
Data Window output: The Daily ATR value is also plotted invisibly so it appears in TradingView’s Data Window for quick reference.
This is useful for gauging daily volatility, setting risk/position sizing, and comparing intraday movement to the stock’s typical daily range.
STOP_TRADING_MODE📘 Release Notes
STOP_TRADING_MODE — Stable Release
Version: 1.0.0
Status: Stable / Production-ready
⸻
🎯 Purpose
This indicator is designed to identify market regimes, not to generate constant trade signals.
Its primary goal is to protect the trader from low-quality environments and highlight rare, high-quality interaction points with equilibrium.
⸻
🧠 Core Concepts
• STOP Mode — identifies impulsive, dangerous, or one-sided market conditions
• Equilibrium (MID / EQ) — represents the auction balance, not a trend level
• MAGNET vs SPRING — distinguishes range behavior from trend behavior
• EQ_HOLD — highlights valid reactions at equilibrium only in a range-friendly environment
⸻
✅ What’s Included
🔴 STOP Mode (Background Only)
• Red background marks:
• volatility spikes (ATR expansion)
• impulsive candles
• one-directional movement
• No entry signals
• Used strictly as a risk-environment filter
🟨 MID (Equilibrium Line)
• Calculated as SMA of HL2
• Acts as:
• Magnet in ranging markets
• Spring in trending markets
• Not a trade trigger by itself
🔁 MAGNET / SPRING Regime Detection
• Based on:
• frequency of MID crossings
• time spent near equilibrium
• market “trendiness” ratio
• Regime labels appear only when the regime changes
• Prevents constant label repainting or noise
🟢 EQ_HOLD Signal (Rare by Design)
• Triggered only when:
• STOP mode is OFF
• MID behaves as MAGNET
• price reacts cleanly at equilibrium
• Designed for micro-scaling / position management, not aggressive entries
• Low frequency = high informational value
⸻
🚫 What Was Removed (By Design)
• No STOP / STOP_OFF labels on chart (alerts only)
• No constant signal spam
• No reliance on trend prediction
• No “buy/sell” prompts
⸻
🎛 UI & Usability Improvements
• Clean, minimal visual layout
• Color logic aligned with meaning:
• 🔴 Risk / danger
• 🟨 Balance / structure
• 🟢 Action-permitted condition
• Optional toggles for regime and EQ_HOLD labels
⸻
🧪 Known Behavior (Not Bugs)
• MID crossing does not immediately change regime
• STOP may activate after entry — this signals risk management mode, not exit
• EQ_HOLD appears infrequently by intention
⸻
🧩 Intended Usage
• Best suited for:
• range-aware traders
• scale-in / scale-out strategies
• discretionary decision support
• Not intended for:
• high-frequency trading
• signal-following automation
• prediction-based entries
⸻
🧠 Design Philosophy
“Silence is a feature.”
If the indicator does nothing —
the market likely offers nothing worth doing.
Volume-Weighted Hybrid Channel [Capitalize Labs]Volume-Weighted Hybrid Channel (VWHC) is a channel-only indicator designed to visualise mean and volatility structure using a blended framework. It combines a configurable mean engine (SuperSmoother, EMA, SMA, or RMA) with an anchored VWAP component, then builds a four-level band ladder around a hybrid mean using a hybrid width that blends a range engine (ATR or true range variants) with anchored, volume-weighted standard deviation. The result is a smooth, adaptive channel intended to help us contextualise price location and volatility expansion or contraction relative to the hybrid mean.
The indicator supports Weekly or Session anchoring for the VWAP and sigma components, and includes optional transition smoothing after anchor resets to reduce visual stepping. Band levels are user-defined (with automatic ordering enforcement), and optional gradient fills can be enabled for clearer zone recognition. An optional Band Occupancy Table is included to show how frequently price closes inside each zone, either over a rolling lookback or since the most recent anchor reset. This table is informational only and does not generate signals.
This script is an indicator, not a strategy. It does not place trades, generate alerts, or provide entry or exit instructions. Outputs depend on chart symbol, timeframe, and data quality, including volume availability. The channel is designed to be non-repainting in the sense that it uses confirmed bar data and does not use forward-looking logic; however, like all indicators, the current bar can update until it closes.
Risk Warning
This material is educational research only and does not constitute financial advice, investment recommendation, or a solicitation to buy or sell any instrument. Foreign exchange and CFDs are complex, leveraged products that carry a high risk of rapid losses; leverage amplifies both gains and losses, and you should not trade with funds you cannot afford to lose. Market conditions can change without notice, and news or illiquidity may cause gaps and slippage; stop-loss orders are not guaranteed.
The analysis presented does not take into account your objectives, financial situation, or risk tolerance. Before acting, assess suitability in light of your circumstances and consider seeking advice from a licensed professional. Past performance and back-tested or hypothetical scenarios are not reliable indicators of future results, and no outcome or level mentioned here is assured. You are solely responsible for all trading decisions, including position sizing and risk management. No external links, promotions, or contact details are provided, in line with TradingView House Rules.
Disclaimer
Use of this indicator is at our own discretion and risk. It is a visual analysis tool and should be validated through independent testing and a documented trading plan before being used in live decision-making.
The BLUE Red Candle Swing w AlertsThe script is for high probability swing entries based on a extremely strong bearish candles which typically come right before a green push up.
When a bearish candle has a higher than average ATR, it is a sign that there could be a large reversal coming next.
Use this indicator to help you set the stop loss and take profit based on the range of the highlighted Red candle.
*So if the ATR of this candle is $3.00 then set a $3.00 stop loss and take profit.
There is also a sc
Rules for the ATR RED/Blue Impulse candle
*Use the 50% line or midline of the candle to help refine your entries
*Use the range of the Blue candle as your stop loss range and for your 1st take profit target!
*Add more positions if there is a clear trend after the candle
ATR Volatility Impulse Candles (Bull & Bear)This indicator highlights unusually strong momentum candles using ATR as a volatility filter. Treyding Stocks was the inspiration behind this powerful swing indicator!
A candle is marked only when its body is larger than the Average True Range, meaning price moved farther than normal for that timeframe. This filters out noise and focuses attention on candles that often matter most.
Lime green candles represent strong bullish impulse. They occur when price closes above the open and the candle body is larger than ATR. These candles often show aggressive buying, late-stage momentum, or exhaustion before a reversal.
Blue candles represent strong bearish impulse. They occur when price closes below the open and the candle body is larger than ATR. These candles often signal aggressive selling, liquidation, stop runs, or breakdown confirmation.
The indicator includes alerts for both bullish and bearish impulse candles, allowing traders to monitor multiple charts without watching them constantly.
Traders commonly use this tool to identify momentum exhaustion, reversal zones, and high-impact candles near VWAP, key moving averages, or important price levels. It works on any timeframe, does not repaint, and is designed to keep the chart clean while highlighting only the most meaningful price moves.
The Red (Blue) candle is very useful for swings especially on the Daily chart
*When the Blue (RED) candle appears, mark the high/low, and enter when the next candle breaks /closes above it.
Dip Buy/Sell Signals (Vix Fix + MA Deviation + TRMAD) [DotGain]Dip Buy/Sell Signals (Vix Fix + MA Deviation + TRMAD)
This indicator combines three proven market stress and mean-reversion components to identify potential buy and sell opportunities during extended market conditions.
────────────────────
📌 Included Components
1️⃣ Volatility-Based Stress Filter (Vix Fix)
Detects short-term market panic using relative price movement.
Signals are generated only during periods of elevated volatility or market stress.
2️⃣ Moving Average Deviation (MA Deviation)
Identifies overbought and oversold conditions based on the percentage deviation from a selected moving average.
Supported MA types:
• EMA
• SMA
• RMA
• VWMA
• WMA
• TEMA
3️⃣ TRMAD (True Range Mean Absolute Deviation)
Measures the distance of price from its mean relative to current volatility.
Useful for filtering extreme price moves and reducing false signals.
────────────────────
📈 Trading Signals
Buy Signal:
• Elevated market volatility
• Price significantly below the moving average
• TRMAD below the defined threshold
Sell Signal:
• Elevated market volatility
• Price significantly above the moving average
• TRMAD above the defined threshold
Signals are visualized directly on the chart:
• Buy: green label below the candle
• Sell: red label above the candle
────────────────────
⚙️ Settings & Customization
All components are fully adjustable:
• Lookback periods
• Moving average types and lengths
• Volatility and threshold levels
This makes the indicator suitable for:
• Intraday trading
• Swing trading
• Crypto, Forex, indices, and equities
────────────────────
Disclaimer
This "Dip Buy/Sell Signals (Vix Fix + MA Deviation + TRMAD)" (DipSig) indicator is provided for informational and educational purposes only. It does not, and should not be construed as, financial, investment, or trading advice.
The signals generated by this tool (both "Buy" and "Sell") are the result of a specific set of algorithmic conditions. They are not a direct recommendation to buy or sell any asset. All trading and investing in financial markets involves substantial risk of loss. You can lose all of your invested capital.
Past performance is not indicative of future results. The signals generated may produce false or losing trades. The creator (© DotGain) assumes no liability for any financial losses or damages you may incur as a result of using this indicator.
You are solely responsible for your own trading and investment decisions. Always conduct your own research (DYOR) and consider your personal risk tolerance before making any trades.
Kalman Exponential SuperTrendThe Kalman Exponential SuperTrend is a new, smoother & superior version of the famous "SuperTrend". Using Kalman smoothing, a concept from the EMA (Exponential Moving Average), this script leverages the best out of each and combines it into a single indicator.
How does it work?
First, we need to calculate the Kalman smoothed source. This is a kind of complex calculation, so you need to study it if you want to know how it works precisely. It smooths the source of the SuperTrend, which helps us smooth the SuperTrend.
Then, we calculate "a" where:
n = user defined ATR length
a = 2/(n+1)
Now we calculate the ATR over "n" period. Classical calculation, nothing changed here.
Now we calculate the SuperTrend using the Kalman smoothed source & ATR where:
kalman = kalman smoothed source
ATR = Average True Range
m = Factor chosen by user.
Upper Band = kalman + ATR * m
Lower Band = kalman - ATR * m
Now we just smooth it a bit further using the "a" and a concept from the EMA.
u1 = Upper Band a bar ago
l1 = Lower Band a bar ago
u = Upper Band
l = Lower Band
Upper = u1 * (1-a) + u * a
Lower = l1 * (1-a) + u * a
When the classical (not Kalman) source crosses above the Upper, it indicates an uptrend. When it crosses below the Lower, it indicates a downtrend.
Methodology & Concepts
When I took a look at the classical SuperTrend => It was just far too slow, and if I made it faster it was noisy as hell. So I decided I would try to make up for it.
I tried the gaussian, bilateral filter, but then I tried kalman and that worked the best, so I added it. Now it was still too noisy and unconsistent, so I revisited my knowledge of concepts and picked the one from the EMA, and it kinda solved it.
In the core of the indicator, all it does is combine them in a really simple way, but if you go more deeply you see how it fits the puzzlé really well.
It is not about trying out random things´=> but about seeking what it is missing and trying to lessen its bad side.
That is the entire point of this indicator => Offer a unique approach to the SuperTrend type, that lessen the bad sides of it.
I also added different plotting types, this is so everyone can find their favorite
Enjoy Gs!
Thanks @BackQuant for making a open source Kalman code <3
Adaptive MA SuperTrend 3.0The Adaptive MA SuperTrend 3.0 is a 3rd Generation of the SuperTrend indicator focused on improving accuracy while maintaining high speeds to capture ANY trend the market has to offer and allow investors/traders from beginner to advanced and beyond to gain a unique insight on what is happening with the markets.
How does it work?
The indicator uses a Moving Average as a base for the SuperTrend and adapts it to market environments.
It uses averages to find if short-term, medium-term or long-term have the highest avg. volume/ATR/Standard Deviation. Whichever period has the highest avg. is the length that will be used for the moving average.
Then it smooths it slightly to give a smoother result to finish the job.
That leaves us with high speed & accurate signals that adapt to any environment.
Enjoy!
Adaptive MA SuperTrend 2.0The Adaptive MA SuperTrend 2.0 is a new cutting edge SuperTrend that adapts to the environment and provides users with fast, smooth signals that can enhance the strategies of any user.
How does it work?
This indicator combines the classic ATR with Moving Average of users choice, and filters the data. It uses a condition, that flips the Moving Average between the past and current value, adapting and trying to enhance the accuracy of the indicator
Adaptive MA SuperTrendAdaptive MA SuperTrend is a new trend following tool designed for more responsive & smoother signal production from the classical SuperTrend indicator.
It works by picking two Moving Averages, that are swapped in their function between being used for the upper base or the lower base, based on the circumstances.
Then it applies either SD or ATR (based on the users preference) to the bases.
This provides smooth, fast trend signals that users can use to enhance their trading/investing strategies.
Enjoy!
Breakout LevelsBreakout Levels - User Guide
Overview
The Breakout Levels indicator automatically detects and displays significant breakout candles across multiple timeframes. A breakout occurs when price makes a strong, decisive move - identified by candles with unusually large bodies relative to average volatility.
These breakout levels often act as future support/resistance zones, making them valuable reference points for trading decisions.
What is a Breakout?
A breakout is detected when a candle's body size (the distance between open and close) is significantly larger than normal. By default, the script looks for candles that are 2x the ATR (Average True Range) or larger.
Example:
If the 14-period ATR is $5, a candle with a $10+ body would qualify as a breakout
These represent strong, committed moves by the market
The script marks the high of bullish breakouts and the low of bearish breakouts
Settings Guide
Timeframes
Toggle which timeframes to monitor for breakouts:
Show Daily Breakouts - Green/Red levels from daily chart breakouts
Show 4H Breakouts - 4-hour timeframe breakouts
Show 1H Breakouts - 1-hour timeframe breakouts
Show 15M Breakouts - 15-minute timeframe breakouts
Tip: When running on a 15-minute chart, you can see breakouts from all higher timeframes simultaneously.
Lookback (How Far Back to Display)
Controls how many bars back to show levels for each timeframe:
TimeframeDefaultWhat it Means15M50 bars~12.5 hours of breakout history1H200 bars~8 days of breakout history4H250 bars~42 days of breakout historyDaily300 bars~300 days (nearly 1 year)
Why adjust this?
Increase to see more historical levels (may clutter chart)
Decrease to focus only on recent breakouts
Older levels are still stored, just not displayed
Detection Settings
Breakout Candle Size (x ATR)
Default: 2.0
Range: 1.0 to 5.0
What it does: Multiplier for what qualifies as a "big" candle
SettingSensitivityUse Case1.0-1.5Very sensitiveCatches more breakouts, but may include false moves2.0Balanced (default)Good mix of quality and quantity3.0-5.0Very selectiveOnly the most explosive moves
Recommendation: Start with 2.0 and adjust based on your market and trading style.
Visual Settings
Bullish Breakout Color
Default: Green with 60% transparency
Marks levels where price broke upward strongly
Bearish Breakout Color
Default: Red with 60% transparency
Marks levels where price broke downward strongly
Show Labels
Toggle labels on/off
Labels display: BO
Example: "4H BO 150.25"
Turn OFF for cleaner charts when you just want the lines
How to Use This Indicator
1. Identify Key Breakout Zones
Breakout levels often become magnets where price returns later:
Former resistance (where price broke up) becomes future support
Former support (where price broke down) becomes future resistance
2. Look for Confluence
When multiple timeframe breakouts cluster near the same price:
15M + 1H + 4H breakouts all near $150 = strong level
More confluence = more significant level
3. Watch for Retests
After a breakout, price often returns to test that level:
Bullish breakout retest from above = potential long entry
Bearish breakout retest from below = potential short entry
4. Combine with Other Analysis
Use breakout levels alongside:
Your own support/resistance analysis
Volume profiles
Fibonacci levels
Candlestick patterns at these levels
Practical Examples
Example 1: Clean Breakout and Retest
Daily candle closes up with a huge body (2.5x ATR)
Green line drawn at the high of that candle
Price pulls back 3 days later and bounces exactly off that green line
Trade opportunity: Long entry at the retest with stop below
Example 2: Failed Breakout
4H bearish breakout draws a red line at the low
Price immediately reverses back above the level
Signal: The breakout was false - consider this a stop hunt zone
Example 3: Multi-Timeframe Confluence
Daily breakout at $100
4H breakout at $100.50
1H breakout at $99.80
Strong cluster zone: $99.80-$100.50 becomes a major decision point
Best Practices
DO:
✅ Start with default settings (2.0x ATR, default lookbacks)
✅ Use on a 15-minute chart to see all timeframes
✅ Look for price reactions at these levels before trading
✅ Combine with volume - breakouts with high volume are more reliable
✅ Turn off labels when chart gets too busy
DON'T:
❌ Treat every line as guaranteed support/resistance
❌ Set breakout multiplier too low (<1.5) - creates noise
❌ Ignore the context - check what's happening in the broader market
❌ Trade blindly at these levels without confirmation
Troubleshooting
"Too many lines on my chart"
Reduce the lookback settings
Turn off some timeframes (maybe just show Daily + 4H)
Increase the breakout multiplier to 2.5 or 3.0
"Not showing any levels"
Lower the breakout multiplier to 1.5
Increase lookback settings
Check that at least one timeframe toggle is ON
Verify the market had actual volatility during the period
"Labels are cluttering the chart"
Turn off "Show Labels" in settings
Lines will remain, labels disappear
Technical Notes
ATR Period: 14 (industry standard, not adjustable in this version)
Max Lines: 500 (Pine Script limitation)
Duplicate Filter: Levels within 0.3% of ATR are considered duplicates and filtered
Chart Type: Works on any chart timeframe, optimized for 15-minute
Asset Type: Works on stocks, forex, crypto, futures
Summary
The Breakout Levels indicator gives you a systematic way to identify where strong, committed market moves occurred. These levels often act as future decision points. Use them as reference zones to watch for price reactions, not as automatic trade signals.
Quick Start:
Add indicator to a 15-minute chart
Leave default settings (2.0x ATR)
Watch how price interacts with the levels over the next few days
Adjust sensitivity based on your observations
Happy trading! 📈
Hamazaki-Style Scalping SystemOverview: hmzk-Style Scalping System
This system is designed to identify high-probability entries in the 1-minute time frame while strictly filtering out low-efficiency market noise. It focuses on the concept of "Gensen" (Strict Selection)—only trading when volatility and trend alignment provide a clear statistical edge.
1. Visual Filtering (Background Colors)
The system uses background colors to provide instant environmental awareness:
Green Zone (High Probability):
Condition: ATR is above the 1.5-pip threshold and the price is diverging from the Kernel line.
Meaning: High volatility and momentum are present. This is the optimal "War Zone" for scalping.
Gray Zone (Avoidance):
Condition: Price is overlapping with the Kernel line.
Meaning: A "sideways" or "ranging" market. hmzk labels this as the "Death Point" where traders lose money due to spreads and lack of direction.
2. Technical Components
Calix Kernel Regression (h=21, r=34, x_0=55):
Serves as the primary trend filter. When the line is horizontal and price is tangled with it, stay out.
When the line slants and price moves away ("Gator opening"), follow the trend.
ATR Break-Out (1.5 Pips Threshold):
Ensures there is enough "meat" in the move to cover spreads and generate profit.
Fractal Arrows (▲/▼):
Indicates potential turning points or breakout levels. These are most effective when they appear in a Green Zone.
3. Execution & Discipline
The 40-Trade Rule: Limit yourself to roughly 40 high-quality trades per day to avoid overtrading and maintain focus.
0.4-Second Stop Loss: If the price action does not immediately follow your hypothesis, exit within a fraction of a second to minimize "expenses" (losses).
Pattern Over Instinct: Only enter when your predefined "form" or "pattern" appears. hmzk teaches that "waiting is the ultimate skill".
Market Context: Prioritize trades during high-liquidity windows like the London/NY open or specific time transitions (e.g., the 24:00 winter time shift).
Supertrend BUY Only - Optimized for Gold M15 TimeframeOverview
The Supertrend BUY Only - Production Optimized is a high-performance trend-following indicator specifically tuned for XAUUSD (Gold) on the 15-minute timeframe. Unlike standard Supertrend scripts, this version focuses exclusively on bullish cycles to align with long-term upward bias and uses parameters discovered through deep data analysis of over 20,000 bars of historical market data.
Key Features
Data-Optimized Parameters: Defaults are set to ATR Period 7 and Multiplier 2.1, which backtesting has shown to provide a superior balance between sensitivity and noise reduction for Gold.
Production-Ready Alerts: Includes built-in alertcondition triggers for both BUY (Trend Flip) and STOP BUY (Trend Exit), complete with dynamic messages that include price and interval.
Trailing Support Band: Uses a trailing logic that locks in support levels during upward moves, preventing the band from dropping until the trend officially reverses.
Clean Visuals: Focuses on chart clarity by only plotting the support line during active uptrends and utilizing clean shape labels for entries and exits.
How to Use
Entry (BUY): When the Supertrend line flips from Red to Green and a "BUY" label appears. This indicates bullish momentum has overcome recent volatility.
Exit (STOP BUY): When the price closes below the Green support line. The indicator will plot a red "X" and clear the green background.
Setting Alerts: * Click the Alerts icon in TradingView.
Select this indicator under "Condition."
Choose "BUY Signal" for entries and "STOP BUY / EXIT" for managing your trade or taking profit.
Technical Details
The script allows users to toggle between the TradingView (RMA) ATR calculation and the Standard (SMA) method. For production and live trading, the RMA method is recommended as it provides a smoother response to volatility spikes common in the Gold market.
Adaptive Gaussian AFR# Adaptive Gaussian AFR (Average Filtering Range)
The **Adaptive Gaussian AFR** is a sophisticated trend-following overlay designed to provide a "cleaner" perspective on market structure. It synthesizes advanced signal processing with volatility-adjusted trailing logic to create a perpetual trend indicator that filters noise while maintaining extreme responsiveness during momentum breakouts.
## How It Works
This indicator combines three distinct mathematical principles to analyze and visualize price action:
### 1. 4-Pole Gaussian Smoothing
Standard moving averages often suffer from a trade-off between smoothness and lag. By employing a **4-pole Gaussian filter**, the indicator applies a bell-curve weighting to price data. This results in a curve that is mathematically smoother than an EMA but reacts more sharply to significant price shocks.
### 2. Adaptive Volatility Scaling
Unlike static indicators, this script utilizes a **Volatility Ratio** (comparing short-term ATR to long-term ATR).
- **Expansion:** When volatility spikes, the Gaussian filter automatically shortens its lookback to "catch" the breakout.
- **Contraction:** When the market consolidates, it lengthens the lookback to prevent "whipsaws" and false signals.
### 3. AFR (Average Filtering Range) Logic
The "step-ladder" behavior is driven by the AFR logic. It calculates volatility-based boundaries (using an ATR factor). The trend line only moves higher if the price exceeds the current floor, and only moves lower if the price breaks the ceiling, creating a "perpetual" support and resistance level.
## Visual Interface & Branding
The script features a high-visibility sentiment map using a custom brand color scheme:
- **Bullish State (Blue - rgb(45, 162, 252)):** Triggered when price is trading above the Adaptive Gaussian mean and the AFR floor.
- **Bearish State (Purple - rgb(113, 59, 249)):** Triggered when price breaks below the mean and the AFR ceiling.
- **Brand Candles:** Price bars are automatically colored to match the trend state for immediate visual confirmation.
## Why This is Unique
Most trend followers are "fixed"—they perform well in trending markets but fail in sideways chop. The uniqueness of the **Adaptive Gaussian AFR** lies in its ability to "breathe." Because the Gaussian engine is adaptive, it attempts to solve the "lag vs. noise" problem by becoming more rigid when the market is indecisive and more fluid when a trend is confirmed.
## Great inventions require great Care
**This is not a standalone trading system.** While the Adaptive Gaussian AFR provides a highly refined view of the trend, it should be used in conjunction with other analysis tools.
- **Lag:** Like all indicators based on historical data, the filter is inherently lagging and cannot predict future price movements.
- **No Standalone Use:** Do not use this as your sole reason for entering or exiting a trade. It is best used as a **Trend Filter** or a **Volatility-Adjusted Entry/Exit Strategy in confluence with other tools**.
- **Context Matters:** It does not account for fundamental news, higher-timeframe resistance, or volume profiles.
Enjoy!






















