Trend and Volatility Cloud

Trend and Volatility Cloud

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.

What is the Expanded Cloud?

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:

  • Uptrend: the lower cloud (between minExp and lower) is filled.
  • Downtrend: the upper cloud (between upper and maxExp) is filled.

This structure provides at-a-glance regime identification, adaptive support/resistance, and practical anchor levels for risk management.

How it works

  1. Rolling Channel
    The base channel is computed over lengthInput periods on a chosen source:

    • upper = HIGHEST[length](source)
    • lower = LOWEST[length](source)
  2. Expanded Bounds (adaptive lines)
    Two stateful series evolve with the channel:

    • 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%).

  3. Trend Detection (regime flips)
    • Flip to bullish (trend = 1) when minExp detaches from lower after having been aligned with it.
    • Flip to bearish (trend = -1) when maxExp detaches from upper after previous alignment.
    • Otherwise, the last regime persists.
  4. Visual Logic (cloud + lines)
    • In uptrends: the lower cloud is shaded; the Expanded Upper line is emphasized.
    • In downtrends: the upper cloud is shaded; the Expanded Lower line is emphasized.

Inputs & configuration

  • lengthInput (default: 20)
    Lookback for the Highest/Lowest channel.

    • Shorter ⇒ more responsive channel, tighter clouds, more flips.
    • Longer ⇒ smoother channel, wider clouds, fewer flips.
  • reactivityInput (default: 50, range 0–100)
    Converts to reactivity = reactivityInput / 100. Controls how strongly the expanded bounds respond to opposing channel moves.

    • Higher ⇒ more sensitive/elastic expanded lines, closer to price.
    • Lower ⇒ steadier/forgiving expanded lines, better for trends with noise.
  • source (default: close)
    Reference price for the channel. Alternatives like medianprice or typicalprice can smooth the channel if desired.
  • alpha (default: 100, range 0–255)
    Cloud transparency control.

    • Governs the fill opacity of the active cloud (0 transparent → 100 fully opaque within the indicator’s scale).
    • The plotted expanded line uses a scaled opacity min(255, alpha*2) to keep it readable against the cloud.

Tip: Start with length = 20reactivity = 40–60alpha = 60–100. Increase reactivity if you want earlier cues; decrease it if you want sturdier levels.

How to read the cloud

  • Bullish regime (trend = 1)
    Price typically respects the lower cloud as dynamic support. Continuations often occur on rebounds within or above this zone. A decisive break below the lower cloud warns of weakening momentum or a potential regime change.
  • Bearish regime (trend = -1)
    Price often respects the upper cloud as dynamic resistance. Continuations often occur on pullbacks into/under this zone. A strong break above the upper cloud warns of bearish fatigue or a possible flip.
  • Transitions (flips)
    The flip condition is designed to confirm that the expanded bound has stopped hugging the channel boundary and started to “lead” in the opposite direction — a robust signal that regime may have changed.

Trading playbook (practical use-cases)

The following are usage ideas, not trade advice. Always validate on your markets/timeframes.

  1. Trend Filter (directional bias)
    • Take longs only when the regime is bullish and price is above or rebounding from the lower cloud.
    • Take shorts only when the regime is bearish and price is below or rejecting the upper cloud.
  2. Continuation Entries (buy dips / sell rallies)
    • Bullish: look for pullbacks that hold within or just above the lower cloud, then re-acceleration.
    • Bearish: look for rallies that stall within or just below the upper cloud, then roll over.
  3. Breakout/Invalidation Logic
    • Bullish: an impulsive close below the lower cloud = momentum deterioration; consider trims or protective actions.
    • Bearish: an impulsive close above the upper cloud = bearish invalidation risk.
  4. Stops & Trailing
    • In bullish regimes, a practical trailing stop can be set a few ticks below minExp.
    • In bearish regimes, trail a few ticks above maxExp.
    • Tighten/loosen distance by instrument volatility.

Tips, limitations & good practices

  • Sideways markets: Clouds may alternate frequently. Use a secondary filter (e.g., higher-timeframe regime agreement or a simple range filter) to avoid overtrading.
  • Parameter sensitivity: reactivityInput changes character materially. Forward-test multiple presets; don’t assume one-size-fits-all.
  • Context over signals: Treat flips as context first, signals second. Add your entry trigger of choice (momentum kick, pattern break, etc.).
  • Display hygiene: The indicator already uses fill + line emphasis. Keep overlapping tools minimal to maintain readability.
  • Performance: Lightweight; scales well even on lower timeframes.

ProBuilder Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or
Related users ' posts
Nicolas
7 years ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...
joobeng Sorry, I solved the problem. I have add the CBL indicator using the spanner icon on the pric...
Nicolas Adjust the price settings for the Y Axis to use the price only.
XXXXVII Hello Your indicator is interesting. However, I can't see the orange line. Do you have ...
Vonasi Discussion on this indicator/filter can be found here: https://www.prorealcode.com/topic/121...
Domenec Claro Juanjo de todas maneras en deinversoratrader.com tienes estsos osciladores evolucionad...
Dron Hola Domenec, en la descripción hablas del indicador velas de colores, no lo encuentro en la...
Domenec Hola Dron mira en el blog deinversoratrader.com en formacion indicadores ahi hay varios grat...
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
ullle73 nicolas, can you somehome make this to be in the background of the price chart?
jonpt88 none did that yet right?
Nicolas You can ask for a code modification on forums, please open a new topic with your request.
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
bolsatrilera
8 years ago
Rainbow Oscillator
Rainbow Oscillator
1
Indicators
Maxime Baudin Interesting, thanks! Combine this indicator with the bollinger bands there is enough to make...
supertiti Bonsoir à tous For those who like me want to calibrate this indicator on a scale of 0 to ...
verdi55 You can find me at www.FXautomate.com Ahh. So i got it ? 4 different supertrends without th...
juanj What? This has nothing to do with the website. The site is simply a service to help people ...
Nicolas Advertising is allowed,as long as people are helping others and if provided services are abo...
jebus89 Big thanks for sharing this :) Seems to work as expected, good stuff.
xpe74 Top visually, and very efficient. I would like to integrate it as a value in a small algo i...
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Genotik Thank you for your important contribution this week which is much appreciated! Happy New Yea...
Vonasi No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to y...
DarioMazza Hi Vonasi, i have a question for you, the comand "pricetype" where did you found it in the ...
Vonasi PriceType is just a variable that I use. The value decides what type of price is used in the...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Nicolas
8 years ago
Trinity Impulse
Trinity Impulse
5
Indicators
ribou ah d'accord merci beaucoup
domenico nlevel1 non modifica la curva al variare del suo valore
tiger_man_no1 Very nice ; what is the best period input date for DAILY CHART ?
Nicolas
8 years ago
Genotik Merci !
WarningTrading Comment peut on la comparer ? comme ceci ? cela ne me donne plus le message d'erreur manque...
sally31120 Bonjour, je n'arrive pas à créer ce screener close > supertrend extended2[1] la réponse...
Nicolas voir ce sujet pour un screener basé sur Supertrend Extended: https://www.prorealcode.com/top...

Top