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
Globalmarkets79 Thank you Vonasi for the answer. I have an other question. When i tried to run the indicator...
Vonasi Lines is either 0 or 1 to turn on or off the drawing of them. Once again if you download and...
Globalmarkets79 Thank you Vonasi, this indicator is very helpful!!!
Nicolas
6 years ago
Bateson Merci pour la réponse Nicolas. C'est bien ce que j'ai fait mais ça ne fonctionne toujours pa...
Enzo Paliotti Veramente ottimo, era quello che cercavo, si potrebbe modificare inserendo come variazione a...
Nicolas Perché no, chiedetelo con una descrizione dettagliata nel forum degli indicatori, per favore!
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
jiddan78 how to convert to afl amibroker ?
Nicolas We do not supply free coding assistance for AFL Amibroker on the website. You can ask for pa...
Ngomsi @ Vonasi, how to use timeframe , 13 minutes ,21 minutes, 34 minutes,et 55 minutes with this...
manchokcity can we have it in mql4 platform? or how or which platform do we use it?
camporan I don't use MetaTrader so I won't be able to do the translation myself. Sorry!
Alexander9 This can for amibroker ? . Thanks
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
Bard I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
bartekz Hi @Nicolas, Really impressed by your work. I am trying to replicate the Wave-PM indicator t...
Nicolas You don't have to replicate it, download the file and import it into your platform.
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
juanj
7 years ago
juanj I have actually completely redesigned this indicator with loads of improvements, so will res...
juanj @Holy Grail, glad you like it. Would you perhaps mind sharing your results here: https://www...
CaptainCaveman I am reluctant to say this buy I was a member of Dr Elder trading group for a while . The fa...
micquan The design is too complex and the performance is low.
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
Bard Problems with Safari latest s/ware and this site and links and adding code. Let me add the...
grimweasel47 Ok thanks Nicolas - could this be adapted to take into account MFI and then have price, volu...
Nicolas I don't understand what you mean exactly, would be better to open a topic about this idea wi...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
jissey Bonjour Bolsatrilera,j'essaie de vous contacter pour le cm rsi ;je le trouve interessant, m...
jissey J'essaie de vous contacter pour l'indicateur"cm rsi"....
Nicolas
7 years ago
BSTrend
v10.3
BSTrend
10
Indicators
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
Rohit82189 bstrend repaints
Nicolas No, it doesn't repaint.
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
juanj Something appears to be wrong with this formula as graphing t shows t to almost never be wit...

Top