Aurora Expanded Trend Cloud [Pineify]Aurora Expanded Trend Cloud
This indicator uses a Donchian Channel breakout to define trend direction and then projects an asymmetric "cloud" zone above or below price — a visual region where the market is expected to find support (in uptrends) or resistance (in downtrends). What makes it different from a plain Donchian system is the one-directional trailing cloud boundary: once the floor starts rising (or the ceiling falling), it never reverses, creating a ratcheting effect that tightens as a trend matures without whipping back on normal pullbacks.
Key Features
Trend direction determined by Donchian Channel breakouts — clean, objective, no oscillator subjectivity
Cloud width scales with the current channel width, so the zone automatically widens during high-volatility periods and compresses when price is ranging
One-way trailing boundary: the cloud floor only moves up in bull trends; the cloud ceiling only moves down in bear trends — reducing false exits during healthy retracements
Trend-start circles mark the exact bar where each breakout first confirmed, providing a clear visual reference for entry timing
Trend state exposed in the Data Window for use in external scripts or Pine Strategy bridges
How It Works
The calculation pipeline has three stages:
Channel Construction — Each bar, the indicator computes the N-bar highest high (upper band) and lowest low (lower band). The difference is the channel width, which serves as a volatility proxy.
Expansion Offset — An expansion percentage (default 50 %) is applied to the channel width to derive an offset. For example, on a bar where the channel spans 10 points, a 50 % setting produces a 5-point offset. This offset is added to the lower band (bullish cloud floor) or subtracted from the upper band (bearish cloud ceiling).
One-Directional Trail — Rather than placing the cloud boundary exactly at the shifted band each bar, the indicator uses math.max (bullish) or math.min (bearish) against the prior trail value. Once the floor is at level X, it will not drop below X even if the Donchian lower band temporarily dips — the level "locks in" and can only continue advancing. On a trend flip, the trail resets from the new band anchor.
How the Components Work Together
The Donchian breakout sets the trend but is inherently reactive — it waits for price to close beyond the N-bar extreme, so the first signal can be a bar or two late on fast moves. The cloud's one-way trail compensates for this by providing a persistent, non-retreating reference level throughout the trend. Because the floor never pulls back, it acts as a natural trailing stop zone: if price closes below the green cloud boundary, the bullish structure has likely deteriorated beyond normal noise. The two mechanisms are complementary — breakout for entry, one-directional trail for management.
The expansion percentage links cloud width to current volatility. On a stock moving 1 % a day in a tight channel, the cloud stays narrow. During a high-momentum phase where the channel widens, the cloud expands proportionally, giving the trade more room to breathe. This avoids one of the common frustrations with fixed-offset trailing stops: premature exits during volatile but sustained trends.
Trading Ideas and Insights
When a green circle appears and the cloud floor begins to form below price, it may signal an early-stage uptrend. Consider entries on the first close above the upper band with the cloud floor as an initial stop reference.
As a trend matures, the cloud floor rises and tightens. A close back into the cloud zone — especially with a wick that tags the floor — may indicate a pause rather than a reversal. A close below the cloud often warrants reassessment.
Compression of the Donchian Channel ahead of a circle signal (upper and lower bands converging) can suggest accumulated energy before a breakout. These setups may produce cleaner follow-through than breakouts from already-wide channels.
On higher timeframes the cloud acts as a broad trend filter. If price is above the green cloud on the daily, consider filtering intraday long setups only from that direction.
Past behavior does not guarantee future results. The indicator has no predictive capability — it identifies conditions based on historical price structure. Always combine with independent confirmation and proper risk management.
Limitations to Be Aware Of
The Donchian breakout condition requires a close beyond the N-bar extreme. On fast-moving bars, the entry signal appears one bar after the actual breakout, which can result in a worse fill price.
The one-way trail means the cloud boundary never retreats during a trend, but it also means it can diverge significantly from current price during extended moves. In those situations, the cloud is no longer a tight stop reference — it reflects the starting anchor of the trend, not current structure.
In choppy, range-bound conditions, the indicator will produce frequent trend flips (circles in rapid alternation). No trend-following tool performs well in this regime; watch the channel width as a rough proxy for regime type.
How to Use
Add the indicator to any chart and timeframe. It works on overlay mode, drawing directly on price.
A green cloud below price confirms a bullish trend. A red cloud above price confirms a bearish trend. The solid-colored boundary line is the active trailing level.
Colored circles mark trend start bars. Green below price = trend flipped bullish. Red above price = trend flipped bearish.
Use the Trend Length input to adjust sensitivity. Shorter values (10–15) react faster and suit shorter timeframes or momentum styles. Longer values (30–50) filter more noise and suit swing or position trading.
Adjust the Expansion % to control how far the cloud boundary sits from the Donchian band. Higher values give more room and widen the cloud; lower values keep the trail tight to price.
Customization
Trend Length (default: 20) — Lookback window for the Donchian Channel. Larger values require a more sustained breakout to flip the trend and produce fewer, higher-conviction signals. Smaller values increase responsiveness at the cost of more noise.
Expansion % (default: 50) — How wide the cloud is expressed as a fraction of the channel width. At 100 %, the cloud spans the full channel. At 0 %, the cloud collapses to a line at the channel boundary. Values between 30 %–70 % work well for most setups.
Conclusion
Aurora Expanded Trend Cloud combines a Donchian breakout system with a volatility-adaptive, one-directional trailing zone to give both a clear trend signal and a persistent visual reference level throughout the move. It is best suited for traders who want an objective, rule-based trend overlay without manual line-drawing — particularly on trending assets and timeframes where Donchian systems historically perform best.
Indicator

Breakout Evidence Board [TradeDots]Breakout Evidence Board
Summary
This indicator detects Donchian-style breakouts (a close beyond the highest close or lowest close over a user-configured lookback) and scores each breakout from 0 to 100 across seven independent factors of supporting evidence. The output is a composite "Evidence Score" with a tier label of Strong, Valid, Mixed, or Weak. It is intended as a quality filter for continuation entries — traders use it to separate breakouts that occur in supportive context from breakouts that occur on thin volume, late extension, or counter-trend conditions.
What is original here
Breakout detection from prior-bar Donchian extremes is standard and is already present in many public scripts. The contribution of this script is the seven-factor evidence panel applied at the moment of the breakout. The factors quantify the breakout's pre-conditions (compression), the breakout's immediate character (volume, ATR expansion, close location), its position relative to mean (VWAP distance), and its alignment with higher-timeframe context. The combination — and the transparency of each factor's contribution to the final score — is what differentiates this script. Each factor weight is exposed as an input so the model can be inspected, tuned, or partially disabled.
How it works
Breakout detection uses the highest close and lowest close over the prior donchian_len bars, indexed by so the breakout level is the previous bar's extreme rather than the current bar's own extreme. A bullish breakout is registered when the current close exceeds the prior-bar highest close; the bearish case is symmetric. To avoid re-firing on every bar that remains above the prior high, only the first breakout (a transition from "not broken" to "broken") is treated as a signal. Optionally, a "Require Compression Before Breakout" filter rejects breakouts that do not follow a mature Bollinger Bandwidth compression — useful in choppy markets. Signal evaluation is gated by barstate.isconfirmed.
When a breakout is detected, the following seven factors are computed.
1. Compression score. The Bollinger Bandwidth at the prior bar, expressed as a percentile rank over the configured lookback. The score is inverted: tight pre-break (low BBW percentile) yields a high score, while a breakout from already-expanded volatility yields a low score.
2. ATR expansion score. The current bar's ATR percentile rank. High ATR percentile means the breakout is moving with thrust, not just drifting across the level.
3. Volume score. The current bar's volume percentile rank.
4. Close-location score. Where the close sits within the bar's high-low range. For a bullish breakout the score rewards a close near the bar's high; for a bearish breakout, a close near the bar's low. A weak close (in the middle of the range or against direction) indicates indecision.
5. VWAP distance score. The absolute distance from an anchored VWAP, expressed in ATR units. A breakout that is already extended from VWAP scores lower than a breakout that occurs near the mean. The anchor is user-selectable: Session, Week, or Month.
6. HTF alignment score. A higher-timeframe trend reference is fetched and the breakout direction is compared against the HTF trend. Aligned breakouts score full credit; neutral HTF scores half; counter-HTF scores zero.
7. Compression-to-expansion confirmation. A binary factor that earns full credit only when the prior bar was in a mature compression and the current bar shows clear expansion (ATR percentile above a threshold). This captures the classic "coil release" pattern.
The composite is the weighted average of all seven factors. Tier mapping:
Strong : score 80 or higher
Valid : score 60 to 79
Mixed : score 30 to 59
Weak : below 30
Repainting and data integrity
Signal generation and labels are gated by barstate.isconfirmed. Donchian extremes are indexed by so they refer to the prior bar's high or low, not the current bar's own value. The higher-timeframe trend reference is fetched with request.security() using a prior-bar source together with barmerge.lookahead_on — the standard non-repainting idiom that returns the last confirmed HTF bar's value. This pattern does not access future data.
How to read the chart
The Donchian rails (prior-bar highest and lowest closes) are plotted as thin green and red lines so the breakout level is visible.
A small triangle marks the breakout bar (below for bullish, above for bearish).
A directional tier label is placed on the breakout bar, color-graded from red at low scores to green at high scores. Text shows the tier and numeric composite score.
An "Evidence Board" dashboard panel displays each of the seven factors as a row, with gradient cells reflecting that factor's contribution, plus the composite score and tier.
All sub-scores are also output as hidden plots for use in the Data Window and alert messages.
Inputs
Inputs are grouped into five sections.
Core Settings : Donchian lookback, Bollinger Band length and standard-deviation multiplier, percentile-rank lookback, ATR length.
Filters : HTF trend reference, VWAP anchor (Session / Week / Month), optional "Require Compression Before Breakout" toggle.
Score Tuning : a 0 to 1 weight for each of the seven factors.
Visual Settings : panel position, panel size, label cap, marker toggles.
Any Alert() function call conditions : per-alert boolean toggles.
Alerts
Four alert conditions are provided: Strong Bull Breakout (bullish breakout with score at or above 80), Strong Bear Breakout, Any Breakout with Score ≥ 70, and Any Breakout with Score ≥ 80. Each alert is declared via alertcondition() for the native TradingView alert UI and is fired programmatically through alert() when the corresponding input toggle is enabled. Programmatic alerts use alert.freq_once_per_bar_close. Alert message templates include {{ticker}}, {{interval}}, and {{close}} placeholders.
How to use this script
This is a continuation filter, not a complete system.
Look for a chart setup where a breakout would be your trade thesis (range break, base break, retest of a prior high, etc.).
Wait for a breakout marker.
Read the Evidence Board panel. A Strong or Valid score with HTF aligned is the highest-conviction case.
A Weak score on a Donchian breakout usually indicates either thin volume, no prior compression, or counter-trend pressure — useful as a "skip this one" signal.
The script does not place orders or define stops; sizing and exits remain the user's responsibility.
Limitations and honest caveats
The composite is a heuristic evidence weighting, not a probability. A Strong tier does not imply a specific success rate.
Fast news-driven breakouts may print with little prior compression and may receive lower scores than they deserve. The "Require Compression" filter is therefore off by default; users who want it strict can enable it.
The anchored VWAP uses a fixed anchor choice (Session, Week, or Month). It does not support multiple simultaneous VWAPs or user-defined anchor points.
Donchian breakouts on the current chart timeframe may not align with breakouts a user perceives at higher timeframes; consider the HTF alignment factor as a coarse check, not as multi-timeframe structure analysis.
The script does not include any backtesting, position sizing, or order management logic.
Disclaimer
This script is published for informational and educational purposes. It is not investment advice and is not a recommendation to buy or sell any instrument. Past appearance of any pattern, including high-quality breakouts, does not guarantee future behaviour. Users are solely responsible for their own trading decisions and risk management.
Indicator

Donchian Ribbon [UAlgo]Donchian Ribbon is a chart-overlay Donchian Channel ribbon that visualizes multiple lookback lengths at the same time. Instead of plotting a single Donchian Channel, the script builds a fixed stack of channels that increase in length and blends them into a clean, layered ribbon above and below price using progressive fills.
The goal is to make market structure and regime easier to read without clutter:
- When the ribbon expands and stays orderly (fast boundaries leading, slow boundaries following), it often reflects sustained range expansion and more directional flow.
- When the ribbon compresses and bands overlap frequently, it typically reflects consolidation, rotational behavior, and reduced clarity.
- The slowest channel provides the structural “outer frame” of the market’s recent range, while shorter channels react first and show how quickly the range is shifting.
This indicator is designed as a context tool. It does not attempt to “predict” direction by itself, but it gives a high-quality visual map of evolving highs/lows across multiple sensitivities so you can align entries, risk, and expectations with the current regime.
🔹 Features
1) Multi-Length Donchian Stack (Ribbon Engine)
The script constructs several Donchian Channels from a Base Length and a Step Length. Each band represents a different sensitivity level:
- Fast bands respond quickly to recent highs and lows.
- Slow bands respond more conservatively and define broader containment.
By stacking these lengths together, you can see short-term responsiveness and higher-level structure simultaneously.
2) Two-Sided Ribbon (Upper and Lower Envelopes)
The indicator visualizes both sides of the Donchian framework:
- Upper ribbon is built from stacked Donchian highs (highest highs per length).
- Lower ribbon is built from stacked Donchian lows (lowest lows per length).
This keeps interpretation intuitive: price pressing into the upper ribbon suggests pressure toward recent highs, while leaning into the lower ribbon suggests pressure toward recent lows.
3) Gradient Depth via Layered Fills (Clean Charts)
Instead of drawing many lines, the script fills the space between consecutive bands. Transparency is gradually adjusted from the fast band to the slow band, producing a smooth depth effect that stays readable even on busy charts.
Intermediate plots are intentionally hidden so the ribbon remains the main visual output.
4) Regime Readability (Expansion vs Compression)
Because each band has a different lookback length, the ribbon naturally communicates volatility and state:
- Expansion: spacing between fast and slow bands increases, commonly seen in stronger directional phases.
- Compression: spacing collapses and bands cluster, commonly seen in ranges, pauses, or choppy rotation.
This helps you quickly decide whether to treat price action as breakout-oriented, trend-continuation, or mean-reverting.
5) Trend Baseline Reference (Slow Midpoint)
A baseline is plotted using the midpoint of the slowest channel. This provides a stable reference that helps you judge whether price is operating in the upper or lower half of the broader range structure.
🔹 Calculations
1) Donchian High, Low, and Midpoint Per Band
Each Donchian band is computed from its own length:
- High = highest high over the lookback length
- Low = lowest low over the lookback length
- Mid = average of High and Low
id.high := ta.highest(id.length)
id.low := ta.lowest(id.length)
id.mid := math.avg(id.high, id.low)
2) Length Sequencing (Base Length + Step Length)
The indicator creates a fixed number of bands. Lengths are built as:
- Band 1: base_length
- Band 2: base_length + step_length
- Band 3: base_length + 2 * step_length
- ...
- Final band: base_length + (ribbon_count - 1) * step_length
This yields a consistent progression from fast to slow sensitivity.
int len = base_length + (i * step_length)
channels.push(DonchianChannel.new(len))
3) Iterative Updates with Arrays and Methods
All bands are stored in an array and updated every bar using a unified method call. This ensures every band follows identical rules and makes the logic scalable and maintainable.
for dc in channels
dc.update()
4) Upper Ribbon Construction (Layered Fills Between Highs)
The upper ribbon is created by filling between consecutive Donchian highs. Each layer uses the same upper tone with progressively stronger visibility toward the slow band.
fill(p_fast_high, p_mid1_high, color.new(col_upper, 90), "Ribbon Upper 1")
fill(p_mid1_high, p_mid2_high, color.new(col_upper, 80), "Ribbon Upper 2")
fill(p_mid2_high, p_mid3_high, color.new(col_upper, 70), "Ribbon Upper 3")
fill(p_mid3_high, p_slow_high, color.new(col_upper, 60), "Ribbon Upper 4")
5) Lower Ribbon Construction (Layered Fills Between Lows)
The lower ribbon is created by filling between consecutive Donchian lows with the lower tone, again using progressive transparency.
fill(p_fast_low, p_mid1_low, color.new(col_lower, 90), "Ribbon Lower 1")
fill(p_mid1_low, p_mid2_low, color.new(col_lower, 80), "Ribbon Lower 2")
fill(p_mid2_low, p_mid3_low, color.new(col_lower, 70), "Ribbon Lower 3")
fill(p_mid3_low, p_slow_low, color.new(col_lower, 60), "Ribbon Lower 4")
6) Trend Baseline (Slow Midpoint)
The baseline is the midpoint of the slowest Donchian band, plotted as a stable center reference for the broadest range framework.
plot(dc_slow.mid, "Trend Baseline",
color = color.from_gradient(0.5, 0, 1, col_lower, col_upper),
linewidth = 2)
7) Visualization Choice (Hidden Internals, Visible Structure)
To keep charts clean, most intermediate plots are hidden and the ribbon fills do the heavy lifting visually, while the slow boundaries remain visible as the outer frame.
p_fast_high = plot(dc_fast.high, "Fast High", color = color.new(col_upper, 80), display = display.none)
p_fast_low = plot(dc_fast.low, "Fast Low", color = color.new(col_lower, 80), display = display.none)
p_slow_high = plot(dc_slow.high, "Slow High", color = color.new(col_upper, 50))
p_slow_low = plot(dc_slow.low, "Slow Low", color = color.new(col_lower, 50))
Indicator

Adaptive Channel Breakout [MarkitTick]💡 This script is a trend-following system designed to identify high-probability breakout opportunities while rigorously filtering out market noise. By synthesizing volatility (ATR), trend strength (ADX), and price extremes (Donchian logic), this indicator attempts to solve the classic problem of false breakouts in ranging markets. It features a regime-detection engine that dynamically adjusts the visual feedback and signal generation based on whether the market is trending or consolidating.
✨ Originality and Utility
Most breakout indicators rely solely on price crossing a fixed threshold (like a 20-day High). However, these systems often fail in "choppy" markets where price seeks liquidity above highs before reversing. This script innovates by:
Volatility-Adjusted Bounds: It does not simply track the Highest High or Lowest Low. Instead, it retracts the channel bounds by a multiple of the Average True Range (ATR). This creates a "tightened" breakout requirement—price must not only make a new high but do so with enough momentum to overcome the volatility threshold. Regime Filtering: Integrated ADX/DMI logic categorizes the market into Bull, Bear, or Range. Signals are filtered to align with the dominant regime (e.g., no Longs are permitted if the internal structure is Bearish). Logarithmic Scaling: A unique feature allowing calculations to be performed on Logarithmic price data, making it highly suitable for parabolic assets like Crypto or small-cap stocks where linear percentage moves vary drastically. Time-Based Exits: Recognizes that "stale" trades—those that do not perform immediately—often turn into losses, and provides visual cues to exit if momentum stalls.
🔬 Methodology and Concepts
The core logic operates on a three-stage pipeline:
1. Market Regime Classification The script utilizes the Directional Movement Index (DMI) and Average Directional Index (ADX) to determine the state of the market. Trending: Defined as ADX > Threshold (default 25). Range: Defined as ADX < Threshold. Direction: Determined by the relationship between DI+ and DI-.
2. Adaptive Channel Construction The channels are calculated using a modified Donchian/ATR hybrid approach: Upper Band: Highest High (N) minus (ATR × Multiplier) . Lower Band: Lowest Low (N) plus (ATR × Multiplier) . Note: By subtracting ATR from the High, the Upper Band acts as a trailing resistance level that gets closer to price as volatility decreases, allowing for earlier entries during volatility squeezes.
3. Signal Generation & Filtering Long Signal: Price crosses over the Upper Band, provided the market is in a Bull or Range regime. Short Signal: Price crosses under the Lower Band, provided the market is in a Bear or Range regime. Stale Exit: If a signal is generated but price fails to reverse or progress significantly within a user-defined bar limit (default 10), a "Time Exit" warning is triggered.
🎨 Visual Guide
The indicator is designed for immediate visual interpretation through color-coding and dashboard analytics.
● Channel Bands Upper Line: Represents the dynamic resistance/breakout level. Lower Line: Represents the dynamic support/breakout level. Color Logic: Gray: Indicates the opposing side of the trend (e.g., Upper band is gray during a downtrend). Green: Active Upper Band during a Bullish phase. Red: Active Lower Band during a Bearish phase.
● Background Fills (Market Regime) The space between the channels is filled to indicate the current market state: Green Fill: Bullish Trend (ADX High, DI+ > DI-). Red Fill: Bearish Trend (ADX High, DI- > DI+). Yellow Fill: Range/Accumulation (ADX Low). Breakouts from Yellow zones are often the most explosive.
● Signal Shapes Green Triangle (Below Bar): Valid Long Breakout Signal. Red Triangle (Above Bar): Valid Short Breakout Signal. Orange "X" (Below Bar): Time Exit/Stale Trade. Indicates the trade has not progressed after N bars.
● Dashboard (Top Right) A table displaying real-time metrics: Market Regime: Explicitly states TREND (Bull/Bear) or RANGE. Volatility: Displays the current ATR value. ADX Strength: Shows the ADX value, highlighting it in white if it is above the trending threshold.
📖 How to Use
For Trend Following Wait for the background color to transition from Yellow (Range) to Green (Bull) or Red (Bear). This signifies a volatility expansion from a consolidation period. Enter on the corresponding Triangle signal.
For Risk Management Stop Loss: The script calculates suggested Stop Losses (SL) based on the opposite channel band. Stale Exits: If you see an Orange "X" appear after entering a trade, consider closing the position or tightening stops, as the momentum impulse has faded.
For Crypto/Parabolic Assets Enable the "Use Logarithmic Scale" setting in the inputs. This normalizes the volatility calculations, preventing the bands from becoming too wide during exponential price increases.
⚙️ Inputs and Settings
Adaptive Parameters Lookback Length (20): The period for High/Low and ATR calculations. ATR Multiplier (3.2): Determines the width of the channel. Higher values reduce false signals but delay entry. (3.2 is tuned for outlier detection). Use Logarithmic Scale: Toggles math.log() calculations for High, Low, and Close.
Filters & Exits ADX Threshold (25): The level at which the market is considered "Trending." Time Exit (Bars) (10): The number of bars allowed for a trade to "work" before being flagged as stale.
UI / Dashboard Show Analytics Dashboard: Toggles the on-screen information table. Size: Adjusts the text size of the dashboard (Tiny, Small, Normal).
🔍 Deconstruction of the Underlying Scientific and Academic Framework
1. Outlier Detection Theory The script uses an ATR Multiplier of 3.2. In normal statistical distributions, 3 standard deviations cover 99.7% of data points. While financial markets are leptokurtic (fat-tailed), a multiplier of 3.2 on the ATR effectively acts as an outlier filter. A breach of this band signifies a price movement that is statistically significant relative to recent noise, suggesting a structural shift in supply/demand rather than random variance.
2. Heteroscedasticity Handling By including a Logarithmic option, the script addresses heteroscedasticity—the phenomenon where the variability of a variable is unequal across the range of values. In simpler terms, a $100 move in Bitcoin at $1,000 is different from a $100 move at $60,000. Using log-returns (math.log) ensures the channel width remains proportionally relevant regardless of the asset's absolute price level.
3. Trend Efficiency (ADX) The integration of J. Welles Wilder’s ADX serves as a filter for "Trend Efficiency." Breakout systems suffer drawdown in mean-reverting markets. By mathematically requiring ADX > 25, the model attempts to trade only when the autocorrelation of price changes is positive (trending behavior), thereby increasing the expectancy of the breakout signal.
⚠️ 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. I 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. Indicator

Indicator

Donchian Predictive Channel (Zeiierman)█ Overview
Donchian Predictive Channel (Zeiierman) extends the classic Donchian framework into a predictive structure. It does not just track where the range has been; it projects where the Donchian mid, high, and low boundaries are statistically likely to move based on recent directional bias and volatility regime.
By quantifying the linear drift of the Donchian midline and the expansion or compression rate of the Donchian range, the indicator generates a forward propagation cone that reflects the prevailing trend and volatility state. This produces a cleaner, more analytically grounded projection of future price corridors, and it remains fully aligned with the signal precision of the underlying Donchian logic.
█ How It Works
⚪ Donchian Core
The script first computes a standard Donchian Channel over a configurable Length:
Upper Band (dcHi) – highest high over the lookback.
Lower Band (dcLo) – lowest low over the lookback.
Midline (dcMd) – simple midpoint of upper and lower: (dcHi + dcLo)/ 2.
f_getDonchian(length) =>
hi = ta.highest(high, length)
lo = ta.lowest(low, length)
md = (hi + lo) * 0.5
= f_getDonchian(lenDC)
⚪ Slope Estimation & Range Dynamics
To turn the Donchian Channel into a predictive model, the script measures how both the midline and the range are changing over time:
Midline Slope (mSl) – derived from a 1-bar difference in linear regression of the midline.
Range Slope (rSl) – derived from a 1-bar difference in linear regression of the Donchian range (dcHi − dcLo).
This pair describes both directional drift (uptrend vs. downtrend) and range expansion/compression (volatility regime).
f_getSlopes(midLine, rngVal, length) =>
mSl = ta.linreg(midLine, length, 0) - ta.linreg(midLine, length, 1)
rSl = ta.linreg(rngVal, length, 0) - ta.linreg(rngVal, length, 1)
⚪ Forward Projection Engine
At the last bar, the indicator constructs a set of forward points for the mid, upper, and lower projections over Forecast Bars:
The midline is projected linearly using the midline slope per bar.
The range is adjusted using the range slope per bar, creating either a widening cone (expansion) or a tightening cone (compression).
Upper and lower projections are then anchored around the projected midline, with logic that keeps the structure consistent and prevents pathological flips when slope changes sign.
f_generatePoints(hi0, md0, lo0, steps, midSlp, rngSlp) =>
upPts = array.new()
mdPts = array.new()
dnPts = array.new()
fillPts = array.new()
hi_vals = array.new_float()
md_vals = array.new_float()
lo_vals = array.new_float()
curHiLocal = hi0
curLoLocal = lo0
curMidLocal = md0
segBars = math.floor(steps / 3)
segBars := segBars < 1 ? 1 : segBars
for b = 0 to steps
mdProj = md0 + midSlp * b
prevRange = curHiLocal - curLoLocal
rngProj = prevRange + rngSlp * b
hiTemp = 0.0
loTemp = 0.0
if midSlp >= 0
hiTemp := math.max(curHiLocal, mdProj + rngProj * 0.5)
loTemp := math.max(curLoLocal, mdProj - rngProj * 0.5)
else
hiTemp := math.min(curHiLocal, mdProj + rngProj * 0.5)
loTemp := math.min(curLoLocal, mdProj - rngProj * 0.5)
hiProj = hiTemp < mdProj ? curHiLocal : hiTemp
loProj = loTemp > mdProj ? curLoLocal : loTemp
if b % segBars == 0
curHiLocal := hiProj
curLoLocal := loProj
curMidLocal := mdProj
array.push(hi_vals, curHiLocal)
array.push(md_vals, curMidLocal)
array.push(lo_vals, curLoLocal)
array.push(upPts, chart.point.from_index(bar_index + b, curHiLocal))
array.push(mdPts, chart.point.from_index(bar_index + b, curMidLocal))
array.push(dnPts, chart.point.from_index(bar_index + b, curLoLocal))
ptSet.new(upPts, mdPts, dnPts)
⚪ Rejection Signals
The script also tracks failed Donchian breakouts and marks them as potential reversal/reversion cues:
Signal Down: Triggered when price makes an attempt above the upper Donchian band but then pulls back inside and closes above the midline, provided enough bars have passed since the last signal.
Signal Up: Triggered when price makes an attempt below the lower Donchian band but then snaps back inside and closes below the midline, also requiring sufficient spacing from the previous signal.
// Base signal conditions (unfiltered)
bearCond = high < dcHi and high >= dcHi and close > dcMd and bar_index - lastMarker >= lenDC
bullCond = low > dcLo and low <= dcLo and close < dcMd and bar_index - lastMarker >= lenDC
// Apply MA filter if enabled
if signalfilter
bearCond := bearCond and close < ma // Bearish only below MA
bullCond := bullCond and close > ma // Bullish only above MA
signalUp := false
signalDn := false
if bearCond
lastMarker := bar_index
signalDn := true
if bullCond
lastMarker := bar_index
signalUp := true
█ How to Use
The Donchian Predictive Channel is designed to outline possible future price trajectories. Treat it as a directional guide, not a fixed prediction tool.
⚪ Map Future Support & Resistance
Use the projected upper and lower paths as dynamic future reference levels:
Projected upper band ≈ is likely a resistance corridor if the current trend and volatility persist.
Projected lower band ≈ likely support corridor or expected downside range.
⚪ Trend Path & Volatility Cone
Because the projection is driven by midline and range slopes, the channel behaves like a trend + volatility cone:
Steep positive midline slope + expanding range → accelerating, high-volatility trend.
Flat midline + compressing range → coiling/contracting regime ahead of potential expansion.
This helps you distinguish between a gentle drift and an aggressive move that likely needs more risk buffer.
⚪ Reversion & Rejection Signals
The Donchian-based signals are especially useful for mean-reversion and fade-style trades.
A Signal Down near the upper band can mark a failed breakout and a potential rotation back toward the midline or the lower projected band.
A Signal Up near the lower band can flag a failed breakdown and a potential snap-back up the channel.
When Filter Signals is enabled, these signals are only generated when they align with the chart’s directional bias as defined by the moving average. Bullish signals are allowed only when the price is above the MA, and bearish signals only when the price is below it.
This reduces noise and helps ensure that reversions occur in harmony with the prevailing trend environment.
█ Settings
Length – Donchian lookback length. Higher values produce a smoother channel with fewer but more stable signals. Lower values make the channel more reactive and increase sensitivity at the cost of more noise.
Forecast Bars – Number of bars used for projecting the Donchian channel forward.
Higher values create a broader, longer-term projection. Lower values focus on short-horizon price path scenarios.
Filter Signals – Enables directional filtering of Donchian signals using the selected moving average. When ON, bullish signals only trigger when the price is above the MA, and bearish signals only trigger when the price is below it. This helps reduce noise and aligns reversions with the broader trend context.
Moving Average Type – The type of moving average used for signal filtering and optional plotting.
Choose between SMA, EMA, WMA, or HMA depending on desired responsiveness. Faster averages (EMA, HMA) react quickly, while slower ones (SMA, WMA) smooth out short-term noise.
Moving Average Length – Lookback length of the moving average. Higher values create a slower, more stable trend filter. Lower values track price more tightly and can flip the directional bias more frequently.
-----------------
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.
Indicator

Period Range AnalyzerThis indicator analyzes a specific periodic range, which can start from a fixed date or a defined lookback period. It draws percentage levels and colored zones between the highest and lowest price. It also displays a detailed information table, which shows the price's position within the range in "Trend" mode, and the relative strength of currency pairs in "Forex" mode. The current price position is also indicated by a label with a percentage value and the name of the corresponding zone.
User Guide
Calculation Method
This setting determines how the indicator defines the range used for the calculation.
Lookback Period: In this mode, the indicator uses the last N candles (the number can be specified in the "Lookback Period (bars)" field). The range (the highest and lowest price) is "floating," meaning it is recalculated with each new candle based on the last N candles.
Date Based: In this mode, the calculation starts from a fixed date and time you select. The indicator finds the opening price of the start date and continuously tracks the highest and lowest price from that point on. This mode is ideal for measuring performance from a specific event (e.g., start of a week/month/year, news).
Data Handling Note: If you select a date in "Date Based" mode for which no data is available on the current timeframe (e.g., switching to a very low timeframe), the indicator will automatically use the earliest available candle as the starting point. All calculations (Open, Max, Min, Range, Percentage, Change, Trend) are based on this actual start date.
Start Date & Time
This setting is only active in "Date Based" mode.
Here you can specify the fixed starting point for the calculation.
The specified time is in the Exchange timezone.
Important limitation: Due to TradingView platform limits, visual elements (levels, zones) are only drawn for a maximum of 250 candles back. If the set date is older than this, the calculation still applies to the entire period (from the set date), but the drawing only covers the last 250 candles. The table always displays accurate data for the entire period.
When switching to a higher timeframe, the range may restart from a slightly later bar due to TradingView's bar alignment. For best accuracy, set your timeframe first, then select the start date.
Table Mode
This setting controls what data the information table displays.
Trend: This is the default mode, which works on any symbol (stock, index, crypto, etc.). It displays information related to the trend and the range.
Forex: This is a special mode used to measure the strength of currency and crypto pairs. It only works on symbols with exactly 6 characters (e.g., "EURUSD", "BTCUSD"). It treats the first 3 characters as the base currency (e.g., EUR) and the last 3 as the quote currency (e.g., USD). If the symbol does not have 6 characters, the table will automatically display in "Trend" mode.
Trend
This trend determination operates based on the formation order of the high and low within the analyzed range:
Its switch is located in the “Table Additional Rows” menu.
Bullish: Indicated if the low was formed before the high (on different candles). Or if they formed on the same candle, it was a bullish candle.
Bearish: Indicated if the high was formed before the low (on different candles). Or if they formed on the same candle, it was a bearish candle.
Neutral: Indicated if the high and low formed on the same candle, and it was a "doji" candle (close = open).
Upper & Lower Threshold
These settings (Upper Threshold (%) and Lower Threshold (%) in the "Label Coloring" section) primarily determine the state (Bullish/Bearish/Neutral) of the top row of the table.
The logic is not based on the percentage change of the price movement, but on the current price's position within the range, where the bottom of the range is 0% and the top is 100%.
Upper Threshold (%): The percentage level (e.g., 60.0) above which the indicator considers the price position "Bullish" (or "Strong").
Lower Threshold (%): The percentage level (e.g., 40.0) below which the indicator considers the price position "Bearish" (or "Weak").
If the price is between the two (e.g., between 40% and 60%), the signal is Neutral.
Secondary function: These thresholds also control the color of the label next to the price, provided the "Dynamic Label Coloring" option is enabled.
Indicator

Indicator

VWAP Price ChannelVWAP Price Channel cuts the crust off of a traditional price channel (Donchian Channel) by anchoring VWAPs at the highs and lows. By doing this, the flat levels, characteristic of traditional Donchian Channels, are no more!
Author's Note: This indicator is formed with no inherent use, and serves solely as a thought experiment.
> Concept
I would be hesitant to call this a "predictive" indicator, however the behavior of it would suggest it could be considered at least partially predictive
Essentially, the Anchored VWAPs creates something from otherwise nothing.
While the DC upper or lower values are staying flat, the VWAPs improvise based on price and volume to project a level that may be a better representation of where future highs or lows may settle.
Visually, this looks like we have cut off the corners of the Donchian Channel.
Note: Notice how we are calculating values before the corners are realized.
> Implementation
While this is only a concept indicator, The specific application I've gone with for this, is a sort of supertrend-ish display (A Trend Flipping Trailing Stop Loss).
The script uses basic logic to create a trend direction, and then displays the Anchored VWAPs as a form of trailing stop loss.
While "In Trend", the script fills in the area between the VWAP and Price in the direction of trend.
When new highs or lows are made while in trend, the opposite VWAP will start to generate at the new highs or lows. These happen on every new high or low, so they are not indicating the trend shift, but could be interpreted as breakout levels for the current trend direction in order for continuation.
Note: All values are drawn live, but when using higher timeframes, there is a natural calculation discrepancy when using live data vs. historical.
> Technicals
In this script, I'm simply detecting new highs or lows from the DC and using those as the anchor frequency on the built-in VWAP function.
So each time a new high or low is made based on DC, the VWAP function re-anchors to the high or low of the candle.
Past that, I have implemented some logic in order to account for a common occurrence I faced during development.
Frequently, the price would outpace the anchored VWAP, so we would end up with the VWAP being further from price than the actual DC upper or lower.
Due to this, what I have ended up with was a third value which, rather than switching between raw VWAP values and DC values, it adjusts the value based on the change in the VWAP value.
This can be simply thought of as a "Start + Change" type of setup.
By doing this, I can use the change values from the actual anchored VWAP, and under normal conditions, this will also be the true VWAP value.
However, situationally, I am able to update the start value which we're applying the VWAP change to.
In other words, when these situations happen, the VWAP change is added to the new (closer to price) DC value.
The specific trend logic being used is nothing fancy at all, we are simply checking if a new high or low is created and setting the trend in that direction.
This is in line with some traditional DC Strategies.
To those who made it here,
Just remember:
The chart may be ugly, but it's the fastest analysis of the data you can get.
Nicer displays often come at the hidden cost of latency.
You have to shoot your shot to make it.
Choose 2: Fast, Clean, Useful
Enjoy! Indicator

Indicator

Expanded Cloud [LuxAlgo]The Expanded Cloud tool allows traders to identify and follow trends accurately. It is based on the well-known Donchian Channels, but with enhanced features.
It features a trailing cloud that expands with the price and a trading stats dashboard.
🔶 USAGE
The tool is super easy to use. Traders can identify bigger or smaller trends just by adjusting the length from the settings panel.
Trend identification is based on Donchian Channels. An uptrend is indicated when the cloud is located below the price, while a downtrend is indicated when the cloud is above it.
Dots signal the start of a new trend, and the width of the clouds identifies the strength of the price expansion. The wider the cloud, the bigger the move.
The expanded cloud, due to its visual, can also act as a trailing stop.
🔹 Trend Identification
As we can see in the chart above, different length values identify different trends on the same BTC daily chart. Larger values identify larger trends.
🔹 Cloud Expansion
From the settings panel, traders can adjust how the clouds expand based on the Expansion % parameter. It accepts values from 0 to 100, which controls how much of the expansion is taken into account. Higher values will make the cloud expand and get closer to the price faster.
When the cloud moves opposite to the direction of the indicated trend (e.g: the cloud decreases while being below the price), it is often indicative of the end of a retracement, and we can expect the price to move with the indicated trend.
The chart above shows the effect of different Expansion % values.
🔹 Dashboard
The trading statistics dashboard informs traders of key metrics derived from the tool. The following are notable:
PNL: Theoretical profit or loss from all trends identified by the tool in the right scale units.
EXPECT.: Expected value of each trade. It is derived from win rate and risk-to-reward metrics.
AVG: 1st TOUCH: The average number of bars from the beginning of a new trend until the price touches the cloud for the first time.
🔶 SETTINGS
Length: Length for trend detection
Expansion %: Percentage of price expansion for cloud formation
Source: Source of the data
🔹 Dashboard
Show Dashboard: Enable/disable the statistics dashboard
Location: Dashboard location
Size: Dashboard size
Indicator

HiLo EMA Custom bandsHILo Ema custom bands
This advanced technical indicator is a powerful variation of "HiLo Ema squeeze bands" that combines the best elements of Donchian channels and EMAs. It's specially designed to identify price squeezes before significant market moves while providing dynamic support/resistance levels and predictive price targets.
Indicator Concept:
The indicator initializes EMAs at each new high or low - the upper EMA tracks highs while the lower EMA tracks lows. It draws maximum of 6 custom bands based on percentage, fixed value or Atr
Upper EM bands are drawn below uper ema, Lower EMA bands are drawn above lower ema
Customizable Options:
Ema length: 200 default
Calculation type: Ema (Default), HILO
Calculation type: Percent,Fixed Value, ATR
Band Value: Percent/Value/ATR multiple This is value to use for calculation type
Band Selection: Both,Upper,Lower
Key Features:
You can choose to draw either of one or both, the latter can be overwhelming initially but as you get used to it, it becomes a powerful tool.
When both bands are selected, upper and lower bands provide provides dual references and intersections
This creates a more trend-responsive alternative to traditional Donchian channels with clearly defined zones for trade planning.
If you select percaentage, note that the calulation is based FROM the respective EMA bands. So bands from lower EMA band will appear narrower compared to the those drawn from upper EMA band
Price targets or reversals:
Look of alignment of lines and price. The current level of one order could align with that of previous level of a different order because often markets move in steps
Settings Guide:
Recommended Settings:
Ema length: 200
Use one of the bands (not both) if using large length of say 1000
Calculation type: EMA
HILO will draw donchian like bands, this is useful if you only want flat price levels. In a rising market use upper and vise versa
Calculation type:
percentage for indices : 5, for symbols 10 or higher based on symbol volatility
Fixed value: about 10% of symbol value converted to value
Atr: 2 ideally
Perfect for swing traders and position traders looking for a more sophisticated volatility-based overlay that adapts to changing market conditions and provides predictive reversal levels.
Note: This indicator works well across multiple timeframes but is especially effective on H4, Daily and Weekly charts for trend trading. Indicator

Indicator

Indicator

Donchian Breakout Strategy📈 Donchian Breakout Strategy (Inspired by Way of the Turtle)
This strategy is a modern adaptation of the legendary Turtle Trading system as taught in Way of the Turtle by Curtis Faith — re-engineered for the crypto market’s volatility, 24/7 nature, and frequent fakeouts.
⸻
🐢 Original Inspiration
The original Turtle system, created by Richard Dennis and William Eckhardt, used:
• Breakouts of Donchian Channels (20-day for entry, 10-day for exit)
• Volatility-based position sizing using ATR (N)
• Simple rules, big trend exposure, and pyramiding to grow winners
It was built for futures and commodities, trading daily bars, assuming stable trading hours and regulated markets.
⸻
🚀 What’s Different in This Strategy?
✅ Optimized for Crypto
• Adapts to constant volatility and price manipulation common in crypto
• Adds commission modeling for realistic results (0.045% default)
✅ Improved Entry Filtering
• Uses EMA filter to align with trend direction
• Adds RSI momentum check to avoid early or weak breakouts
• Optional volatility and volume filters to reduce false signals
✅ Smarter Exits
• ATR-based volatility stop loss, not just Donchian reversal
• Avoids pyramiding to reduce risk from sudden reversals
✅ Backtest-Friendly
• Default backtest window starts from 2025-01-01
• Fully configurable: long/short toggle, filter control, stop loss multiplier
⸻
🧪 Use Case
• Best on trending coins with strong directional moves
• Avoids chop via filters, preserving capital
• Can be tuned for aggressive or conservative setups with just a few tweaks Strategy

Indicator

Breakaway Fair Value Gaps [LuxAlgo]The Breakaway Fair Value Gap (FVG) is a typical FVG located at a point where the price is breaking new Highs or Lows.
🔶 USAGE
In the screenshot above, the price range is visualized by Donchian Channels.
In theory, the Breakaway FVGs should generally be a good indication of market participation, showing favor in the FVG's breaking direction. This is a combination of buyers or sellers pushing markets quickly while already at the highest high or lowest low in recent history.
While this described reasoning seems conventional, looking into it inversely seems to reveal a more effective use of these formations.
When the price is pushed to the extremities of the current range, the price is already potentially off balance and over-extended. Then an FVG is created, extending the price further out of balance.
With this in consideration, After identifying a Breakaway FVG, we could logically look for a reversion to re-balance the gap.
However, it would be illogical to believe that the FVG will immediately mitigate after formation. Because of this, the dashboard display for this indicator shows the analysis for the mitigation likelihood and timeliness.
In the example above, the information in the dashboard would read as follows (Bearish example):
Out of 949 Bearish Breakaway FVGs, 80.19% are shown to be mitigated within 60 bars, with the average mitigation time being 13 bars.
The other 19.81% are not mitigated within 60 bars. This could mean the FVG was mitigated after 60 bars, or it was never mitigated.
The unmitigated FVGs within the analysis window will extend their mitigation level to the current bar. We can see the number of bars since the formation is represented to the right of the live mitigation level.
Utilizing the current distance readout helps to better judge the likelihood of a level being mitigated.
Additionally, when considering these mitigation levels as targets, an additional indicator or analysis can be used to identify specific entries, which would further aid in a system's reliability.
🔶 SETTINGS
Trend Length: Sets the (DC) Trend length to use for Identifying Breakaway FVGs.
Show Mitigation Levels: Optionally hide mitigation levels if you would prefer only to see the Breakaway FVGs.
Maximum Duration: Sets the analysis duration for FVGs, Past this length in bars, the FVG is counted as "Un-Mitigated".
Show Dashboard: Optionally hide the dashboard.
Use Median Duration: Display the Median of the Bar Length data set rather than the Average.
Indicator

Curved Price Channels (Zeiierman)█ Overview
The Curved Price Channels (Zeiierman) is designed to plot dynamic channels around price movements, much like the traditional Donchian Channels, but with a key difference: the channels are curved instead of straight. This curvature allows the channels to adapt more fluidly to price action, providing a smoother representation of the highest high and lowest low levels.
Just like Donchian Channels, the Curved Price Channels help identify potential breakout points and areas of trend reversal. However, the curvature offers a more refined approach to visualizing price boundaries, making it potentially more effective in capturing price trends and reversals in markets that exhibit significant volatility or price swings.
The included trend strength calculation further enhances the indicator by offering insight into the strength of the current trend.
█ How It Works
The Curved Price Channels are calculated based on the asset's average true range (ATR), scaled by the chosen length and multiplier settings. This adaptive size allows the channels to expand and contract based on recent market volatility. The central trendline is calculated as the average of the upper and lower curved bands, providing a smoothed representation of the overall price trend.
Key Calculations:
Adaptive Size: The ATR is used to dynamically adjust the width of the channels, making them responsive to changes in market volatility.
Upper and Lower Bands: The upper band is calculated by taking the maximum close value and adjusting it downward by a factor proportional to the ATR and the multiplier. Similarly, the lower band is calculated by adjusting the minimum close value upward.
Trendline: The trendline is the average of the upper and lower bands, representing the central tendency of the price action.
Trend Strength
The Trend Strength feature in the Curved Price Channels is a powerful feature designed to help traders gauge the strength of the current trend. It calculates the strength of a trend by analyzing the relationship between the price's position within the curved channels and the overall range of the channels themselves.
Range Calculation:
The indicator first determines the distance between the upper and lower curved channels, known as the range. This range represents the overall volatility of the price within the given period.
Range = Upper Band - Lower Band
Relative Position:
The next step involves calculating the relative position of the closing price within this range. This value indicates where the current price sits in relation to the overall range.
RelativePosition = (Close - Trendline) / Range
Normalization:
To assess the trend strength over time, the current range is normalized against the maximum and minimum ranges observed over a specified look-back period.
NormalizedRange = (Range - Min Range) / (Max Range - Min Range)
Trend Strength Calculation:
The final Trend Strength is calculated by multiplying the relative position by the normalized range and then scaling it to a percentage.
TrendStrength = Relative Position * Normalized Range * 100
This approach ensures that the Trend Strength not only reflects the direction of the trend but also its intensity, providing a more comprehensive view of market conditions.
█ Comparison with Donchian Channels
Curved Price Channels offer several advantages over Donchian Channels, particularly in their ability to adapt to changing market conditions.
⚪ Adaptability vs. Fixed Structure
Donchian Channels: Use a fixed period to plot straight lines based on the highest high and lowest low. This can be limiting because the channels do not adjust to volatility; they remain the same width regardless of how much or how little the price is moving.
Curved Price Channels: Adapt dynamically to market conditions using the Average True Range (ATR) as a measure of volatility. The channels expand and contract based on recent price movements, providing a more accurate reflection of the market's current state. This adaptability allows traders to capture both large trends and smaller fluctuations more effectively.
⚪ Sensitivity to Market Movements
Donchian Channels: Are less sensitive to recent price action because they rely on a fixed look-back period. This can result in late signals during fast-moving markets, as the channels may not adjust quickly enough to capture new trends.
Curved Price Channels: Respond more quickly to changes in market volatility, making them more sensitive to recent price action. The multiplier setting further allows traders to adjust the channel's sensitivity, making it possible to capture smaller price movements during periods of low volatility or filter out noise during high volatility.
⚪ Enhanced Trend Strength Analysis
Donchian Channels: Do not provide direct insight into the strength of a trend. Traders must rely on additional indicators or their judgment to gauge whether a trend is strong or weak.
Curved Price Channels: Includes a built-in trend strength calculation that takes into account the distance between the upper and lower channels relative to the trendline. A broader range between the channels typically indicates a stronger trend, while a narrower range suggests a weaker trend. This feature helps traders not only identify the direction of the trend but also assess its potential longevity and strength.
⚪ Dynamic Support and Resistance
Donchian Channels: Offer static support and resistance levels that may not accurately reflect changing market dynamics. These levels can quickly become outdated in volatile markets.
Curved Price Channels: Offer dynamic support and resistance levels that adjust in real-time, providing more relevant and actionable trading signals. As the channels curve to reflect price movements, they can help identify areas where the price is likely to encounter support or resistance, making them more useful in volatile or trending markets.
█ How to Use
Traders can use the Curved Price Channels in similar ways to Donchian Channels but with the added benefits of the adaptive, curved structure:
Breakout Identification:
Just like Donchian Channels, when the price breaks above the upper curved band, it may signal the start of a bullish trend, while a break below the lower curved band could indicate a bearish trend. The curved nature of the channels helps in capturing these breakouts more precisely by adjusting to recent volatility.
Volatility:
The width of the price channels in the Curved Price Channels indicator serves as a clear indicator of current market volatility. A wider channel indicates that the market is experiencing higher volatility, as prices are fluctuating more dramatically within the period. Conversely, a narrower channel suggests that the market is in a lower volatility state, with price movements being more subdued.
Typically, higher volatility is observed during negative trends, where market uncertainty or fear drives larger price swings. In contrast, lower volatility is often associated with positive trends, where prices tend to move more steadily and predictably. The adaptive nature of the Curved Price Channels reflects these volatility conditions in real time, allowing traders to assess the market environment quickly and adjust their strategies accordingly.
Support and Resistance:
The trend line act as dynamic support and resistance levels. Due to it's adaptive nature, this level is more reflective of the current market environment than the fixed level of Donchian Channels.
Trend Direction and Strength:
The trend direction and strength are highlighted by the trendline and the directional candle within the Curved Price Channels indicator. If the price is above the trendline, it indicates a positive trend, while a price below the trendline signals a negative trend. This directional bias is visually represented by the color of the directional candle, making it easy for traders to quickly identify the current market trend.
In addition to the trendline, the indicator also displays Max and Min values. These represent the highest and lowest trend strength values within the lookback period, providing a reference point for understanding the current trend strength relative to historical levels.
Max Value: Indicates the highest recorded trend strength during the lookback period. If the Max value is greater than the Min value, it suggests that the market has generally experienced more positive (bullish) conditions during this time frame.
Min Value: Represents the lowest recorded trend strength within the same period. If the Min value is greater than the Max value, it indicates that the market has been predominantly negative (bearish) over the lookback period.
By assessing these Max and Min values, traders gain an immediate understanding of the underlying trend. If the current trend strength is close to the Max value, it indicates a strong bullish trend. Conversely, if the trend strength is near the Min value, it suggests a strong bearish trend.
█ Settings
Trend Length: Defines the number of bars used to calculate the core trendline and adaptive size. A length of 200 will create a smooth, long-term trendline that reacts slowly to price changes, while a length of 20 will create a more responsive trendline that tracks short-term movements.
Multiplier: Adjusts the width of the curved price channels. A higher value tightens the channels, making them more sensitive to price movements, while a lower value widens the channels. A multiplier of 10 will create tighter channels that are more sensitive to minor price fluctuations, which is useful in low-volatility markets. A multiplier of 2 will create wider channels that capture larger trends and are better suited for high-volatility markets.
Trend Strength Length: Defines the period over which the maximum and minimum ranges are calculated to normalize the trend strength. A length of 200 will smooth out the trend strength readings, providing a stable indication of trend health, whereas a length of 50 will make the readings more reactive to recent price changes.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. 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.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Indicator

Double Donchian Channels [CrossTrade]Dual Channel System
The indicator incorporates two Donchian Channels - the Inner Channel and the Outer Channel. These channels are adjustable, allowing users to define their lengths according to their trading strategy.
Inner Channel: With a default length of 100 periods, the Inner Channel provides a closer view of market trends and potential support and resistance areas. It includes an upper, lower, and middle line (average of the upper and lower), offering detailed insights into shorter-term price movements.
Outer Channel: Set with a default length of 300 periods, the Outer Channel offers a broader perspective, ideal for identifying long-term trends and stronger levels of support and resistance.
Dynamic Color Coding: The middle lines of both channels change color based on the relationship between the previous close and the channel's basis. This feature provides an immediate visual cue regarding market sentiment.
Touching Bars Highlighting: The indicator highlights bars that touch the upper or lower bands of either channel. This is particularly useful for identifying potential reversals or continuation patterns.
Pullback Identification: By differentiating between bars that touch the Inner Channel only and those that touch the Outer Channel, the indicator helps in identifying pullbacks within a broader trend.
Customizable Alert System: Users can set up alerts for specific conditions - a bar touching the bottom band of the Inner Channel (green), the bottom band of the Outer Channel (blue), the upper band of the Inner Channel (red), and the upper band of the Outer Channel (orange). These alerts assist in timely decision-making and can be tailored to individual trading styles.
The indicator is a versatile tool designed to adapt to various trading styles and timeframes. Its features make it suitable for trend analysis, identifying potential reversal points, and understanding market volatility. Indicator

Indicator

Indicator

Indicator

Donchian Quest Research// =================================
Trend following strategy.
// =================================
Strategy uses two channels. One channel - for opening trades. Second channel - for closing.
Channel is similar to Donchian channel, but uses Close prices (not High/Low). That helps don't react to wicks of volatile candles (“stop hunting”). In most cases openings occur earlier than in Donchian channel. Closings occur only for real breakout.
// =================================
Strategy waits for beginning of trend - when price breakout of channel. Default length of both channels = 50 candles.
Conditions of trading:
- Open Long: If last Close = max Close for 50 closes.
- Close Long: If last Close = min Close for 50 closes.
- Open Short: If last Close = min Close for 50 closes.
- Close Short: If last Close = max Close for 50 closes.
// =================================
Color of lines:
- black - channel for opening trade.
- red - channel for closing trade.
- yellow - entry price.
- fuchsia - stoploss and breakeven.
- vertical green - go Long.
- vertical red - go Short.
- vertical gray - close in end, don't trade anymore.
// =================================
Order size calculated with ATR and volatility.
You can't trade 1 contract in BTC and 1 contract in XRP - for example. They have different price and volatility, so 1 contract BTC not equal 1 contract XRP.
Script uses universal calculation for every market. It is based on:
- Risk - USD sum you ready to loss in one trade. It calculated as percent of Equity.
- ATR indicator - measurement of volatility.
With default setting your stoploss = 0.5 percent of equity:
- If initial capital is 1000 USD and used parameter "Permit stop" - loss will be 5 USD (0.5 % of equity).
- If your Equity rises to 2000 USD and used parameter "Permit stop"- loss will be 10 USD (0.5 % of Equity).
// =================================
This Risk works only if you enable “Permit stop” parameter in Settings.
If this parameter disabled - strategy works as reversal strategy:
⁃ If close Long - channel border works as stoploss and momentarily go Short.
⁃ If close Short - channel border works as stoploss and momentarily go Long.
Channel borders changed dynamically. So sometime your loss will be greater than ‘Risk %’. Sometime - less than ‘Risk %’.
If this parameter enabled - maximum loss always equal to 'Risk %'. This parameter also include breakeven: if profit % = Risk %, then move stoploss to entry price.
// =================================
Like all trend following strategies - it works only in trend conditions. If no trend - slowly bleeding. There is no special additional indicator to filter trend/notrend. You need to trade every signal of strategy.
Strategy gives many losses:
⁃ 30 % of trades will close with profit.
⁃ 70 % of trades will close with loss.
⁃ But profit from 30% will be much greater than loss from 70 %.
Your task - patiently wait for it and don't use risky setting for position sizing.
// =================================
Recommended timeframe - Daily.
// =================================
Trend can vary in lengths. Selecting length of channels determine which trend you will be hunting:
⁃ 20/10 - from several days to several weeks.
⁃ 20/20 or 50/20 - from several weeks to several months.
⁃ 50/50 or 100/50 or 100/100 - from several months to several years.
// =================================
Inputs (Settings):
- Length: length of channel for trade opening/closing. You can choose 20/10, 20/20, 50/20, 50/50, 100/50, 100/100. Default value: 50/50.
- Permit Long / Permit short: Longs are most profitable for this strategy. You can disable Shorts and enable Longs only. Default value: permit all directions.
- Risk % of Equity: for position sizing used Equity percent. Don't use values greater than 5 % - it's risky. Default value: 0.5%.
⁃ ATR multiplier: this multiplier moves stoploss up or down. Big multiplier = small size of order, small profit, stoploss far from entry, low chance of stoploss. Small multiplier = big size of order, big profit, stop near entry, high chance of stoploss. Default value: 2.
- ATR length: number of candles to calculate ATR indicator. It used for order size and stoploss. Default value: 20.
- Close in end - to close active trade in the end (and don't trade anymore) or leave it open. You can see difference in Strategy Tester. Default value: don’t close.
- Permit stop: use stop or go reversal. Default value: without stop, reversal strategy.
// =================================
Properties (Settings):
- Initial capital - 1000 USD.
- Script don't uses 'Order size' - you need to change 'Risk %' in Inputs instead.
- Script don't uses 'Pyramiding'.
- 'Commission' 0.055 % and 'Slippage' 0 - this parameters are for crypto exchanges with perpetual contracts (for example Bybit). If use on other markets - set it accordingly to your exchange parameters.
// =================================
Big dataset used for chart - 'BITCOIN ALL TIME HISTORY INDEX'. It gives enough trades to understand logic of script. It have several good trends.
// ================================= Strategy
