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
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
Sofitech le screener "resserrement" (le premier) correspond aux flèches rouge / vertes sur l'image ?
JC_Bywan Bonjour, non les flèches sur l'image correspondent aux croisements des ema15/ema60, 2e screener
jc_aries Thanks for the SCREENER. I have a doubt. Is it not necessary to put a time interval for the ...
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
Seabiscuit Hi! I like this indicator a lot, been using it on a 30 min timeframe and usually confirms my...
Ramahu Bonjour et merci pour cet indicateur ! je l'observe sur les actions du Nasdaq et la plupart ...
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
simmerseb Bonjour, merci beaucoup pour cet indicateur je le trouve très clair et pertinent.
IV Mcm V2 is coming
SudhirRN is this code working for on tradingview plartform?
Nicolas No. All our codes are made to be used with ProRealTime trading platform: https://www.proreal...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
oraclus Bonjour indicateur très intéressant existe t il un screener qui détecte les actions qui donn...
IV Mcm Ce n'est pas le but de cet indicateur, mais avec un peu d'entraînement vous pourriez le code...
Yantra Thank you for sharing your good work!
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...

Top