Expanded Cloud (by LuxAlgo) wraps a classic Highest/Lowest channel with two “adaptive” bounds that expand/contract based on recent range dynamics. It highlights the active trend regime (bullish/bearish), paints a context cloud, and plots the relevant expanded boundary so you can filter trades, trail stops, and time continuations or regime flips with less noise.
The Expanded Cloud is a dynamic envelope built on top of a rolling Highest/Lowest channel. Two internally computed lines — Expanded Upper (maxExp) and Expanded Lower (minExp) — react to changes in the channel with a configurable reactivity. The indicator shades the relevant side of price according to trend regime:
minExp and lower) is filled.upper and maxExp) is filled.This structure provides at-a-glance regime identification, adaptive support/resistance, and practical anchor levels for risk management.
lengthInput periods on a chosen source:
upper = HIGHEST[length](source)lower = LOWEST[length](source)maxExp reacts to rises in upper and is dampened by falls in lower scaled by reactivity.minExp reacts to falls in lower and is dampened by rises in upper scaled by reactivity.Intuition: as the channel stretches in one direction, the corresponding expanded bound follows, while opposing moves are partially absorbed according to reactivity (0–100%).
trend = 1) when minExp detaches from lower after having been aligned with it.trend = -1) when maxExp detaches from upper after previous alignment.lengthInput (default: 20)reactivityInput (default: 50, range 0–100)reactivity = reactivityInput / 100. Controls how strongly the expanded bounds respond to opposing channel moves.
source (default: close)medianprice or typicalprice can smooth the channel if desired.alpha (default: 100, range 0–255)min(255, alpha*2) to keep it readable against the cloud.Tip: Start with
length = 20,reactivity = 40–60,alpha = 60–100. Increasereactivityif you want earlier cues; decrease it if you want sturdier levels.
trend = 1)trend = -1)The following are usage ideas, not trade advice. Always validate on your markets/timeframes.
minExp.maxExp.reactivityInput changes character materially. Forward-test multiple presets; don’t assume one-size-fits-all.//---------------------------------------------------//
//PRC_Expanded Cloud by LuxAlgo
//version = 0
//24.09.2025
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//---------------------------------------------------//
// ----------- Parámetros configurables -------------//
//---------------------------------------------------//
lengthInput = 20 // Periodo de cálculo (Highest/Lowest)
reactivityInput = 50 // Porcentaje de expansión (0-100)
alpha = 100 // Transparencia de la nube
source = customclose // Precio de referencia
// Convertir reactividad a factor
reactivity = reactivityInput / 100
//---------------------------------------------------//
// ---------- Cálculo de máximos y mínimos ----------//
//---------------------------------------------------//
upper = HIGHEST[lengthInput](source)
lower = LOWEST[lengthInput](source)
//---------------------------------------------------//
// ---------------- Cálculo de la nube --------------//
//---------------------------------------------------//
// ----- Inicialización de variables dinámicas
ONCE maxExp = source
ONCE minExp = source
ONCE trend = 0
if barindex>lengthInput then
// ----- Actualización de expansión
maxExp = MAX(source, maxExp[1] + (upper - upper[1]) - (MAX(lower[1] - lower, 0) * reactivity))
minExp = MIN(source, minExp[1] + (lower - lower[1]) + (MAX(upper - upper[1], 0) * reactivity))
// ----- Detección de tendencia
IF minExp <> lower AND minExp[1] = lower[1] THEN
trend = 1 // alcista
ELSIF maxExp <> upper AND maxExp[1] = upper[1] THEN
trend = -1 // bajista
ELSE
trend = trend[1]
ENDIF
endif
//---------------------------------------------------//
// ------------------ Pintar nube -------------------//
//---------------------------------------------------//
IF trend = 1 THEN
rup=100
gup=255
bup=100
rlw=100
glw=200
blw=100
alphaup=alpha
alphalw=0
ELSIF trend = -1 THEN
rup=255
gup=100
bup=100
rlw=200
glw=100
blw=100
alphaup=0
alphalw=alpha
ENDIF
COLORBETWEEN(upper, maxExp, rup,gup,bup,alphalw)
COLORBETWEEN(minExp, lower, rlw,glw,blw,alphaup)
//---------------------------------------------------//
RETURN maxExp COLOURED(255,100,100,min(255,alphaup*2)) AS "Expanded Upper" style(point), minExp COLOURED(100,255,100,min(255,alphalw*2)) AS "Expanded Lower" style(point)