Multi Deviation Scaled Moving Average (Multi-DSMA)

Multi Deviation Scaled Moving Average (Multi-DSMA)

1) What is the Multi-DSMA?

The Multi Deviation Scaled Moving Average (by ChartPrime) is an adaptive moving average that stacks eight Deviation-Scaled MAs (DSMAs) with progressively longer lookbacks. Each DSMA self-adjusts to current market activity via RMS scaling, then all eight are averaged into a single line. A score gauges how many fast layers are above the slowest layer, driving dynamic color/opacity and generating early/late crossover signals.

Use it when you need a trend-aware line that reacts quickly in acceleration phases but remains calm in choppy markets.

2) How it Works — The Short Version

Pipeline per bar:

  1. Super Smoother prefilter → noise reduction with low lag.

  2. RMS scaling (via exponential average) → dimensionless, volatility-aware signal.

  3. Adaptive alpha → bigger |signal| ⇒ faster DSMA; clamped to avoid overshoot.

  4. Eight DSMA layers → periods = Periods + k×step (k = 0..7).

  5. Average of 8 layers → final “Multi DSMA Avg” line.

  6. Score (0–1) → fraction of fast layers above the slowest layer.

  7. Color/Opacity from score + Signals at 0.30/0.70 crossovers.

3) Core Mechanics

3.1 Super Smoother (per layer)

Each layer takes a zero-mean input (close - close[2]) and runs it through a 2-pole Super Smoother (Ehlers-style) using period-dependent coefficients. This removes high-frequency noise without the lag typical of simple MAs.

3.2 RMS Normalization

rms = sqrt(ExponentialAverage(period)(filt^2))
Dividing the filtered signal by its RMS (scaledFilt) makes the amplitude comparable across regimes (quiet vs. volatile), so the adaption depends on structure, not raw volatility.

3.3 Adaptive DSMA

alpha = min( |scaledFilt| * 5 / period , 1 )
DSMA = alpha * close + (1 - alpha) * DSMA[1]
When structure builds (|scaled| ↑), alpha increases and the DSMA hugs price more tightly. In calm conditions, alpha shrinks and the line smooths out.

3.4 The Eight Layers & Sensitivity Inversion

  • Base period = Periods.

  • Step = max(100 - Sensitivity, 1) → higher Sensitivitysmaller step ⇒ layers are closer together ⇒ more responsiveness.

  • Layer periods: Periods, Periods+step, ..., Periods+7×step.

3.5 Multi-Layer Average

The plotted line “Multi DSMA Avg” is the simple average of the 8 DSMA values. This blend keeps the agility of fast layers while anchoring to the slower context.

3.6 Score Construction (0–1)

Compare each of the seven fast layers to the slowest (DSMA8). Each fast-above-slow adds ≈ 1/7.

  • Score ≈ 1 → strong bullish stack (broad alignment).

  • Score ≈ 0 → strong bearish stack.

  • Middle → mixed/transition.

3.7 Dynamic Color & Opacity

  • If score > 0.5: gradient fades in towards the upper color (bullish).

  • If score ≤ 0.5: gradient fades out from the down color (bearish).
    Opacity follows the same logic: conviction (stack agreement) literally shows up as a more opaque line.

3.8 Signals (Hysteresis Band)

  • Bullish signal when score crosses up 0.30early heads-up.

  • Bearish signal when score crosses down 0.70late confirmation.
    This asymmetric band reduces flip-flops by asking for more evidence before flipping bearish.

4) How to Read It on the Chart

  • Line direction: trend bias of the blended stack.

  • Color & opacity: confidence. Deeper/denser = stronger alignment.

  • Arrows:

    • ▲ at the Multi DSMA Avg when score crosses above 0.30.

    • ▼ at the Multi DSMA Avg when score crosses below 0.70.

  • On-chart panel (last bar): two vertical bars show Up% vs Down% (score×100 vs 100–score×100), updated on the most recent update.

Tip: The score panel uses anchored drawing near the bottom-right of the chart. If you customize positions, keep the anchor(bottomright, xshift, yshift) logic consistent.

5) Typical Uses

A) Trend Confirmation / Bias Filter

  • Trade only long when score > 0.5 and line slopes up; short when < 0.5 and slope down.

  • Use arrows as timing aids, not stand-alone entries.

B) Momentum Entries

  • Aggressive: act on the ▲ (0.30 cross up) if the line is already turning up and price pulls back to or slightly below the line.

  • Conservative: wait for price to reclaim the line and the score to sustain > 0.6 for several bars.

C) Exits / Risk Control

  • Partial exit when score slips below 0.7 from high levels (momentum fading).

  • Hard exit on ▼ (0.70 cross down) and line turning flat/down.

D) Multi-Timeframe

  • Use higher timeframe score as bias; execute with lower timeframe ▲/▼ around the Multi DSMA Avg.

This indicator is non-repainting (no future data; all calculations use current and past bars).

6) Inputs & Configuration

Periods (default 30)

  • Sets the base lookback.

  • Lower (e.g., 14–25): faster, more responsive, more signals.

  • Higher (e.g., 40–80): smoother trend backbone, fewer signals.

Sensitivity (default 60, range 0–100)

  • Controls step via step = max(100 - Sensitivity, 1).

  • Higher Sensitivity ⇒ smaller step ⇒ layers cluster ⇒ more agility.

  • Lower Sensitivity ⇒ larger step ⇒ wider spread ⇒ stronger “stack” requirement.

Recommended starting points:

  • Scalping: Periods 20–30, Sensitivity 70–85

  • Swing: Periods 30–50, Sensitivity 55–70

  • Position: Periods 50–80, Sensitivity 40–60

Colors (RGB triplets)

  • Upper color for bullish gradients, Down color for bearish.

  • You can soften opacity extremes by lowering the alpha scaling, but the default provides a clear conviction cue.

7) 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

Likes

avatar avatar avatar avatar avatar
Related users ' posts
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.
fazel53 How do i attach this indicator to my mt5 platform?
Nicolas You can't! All indicators here are for ProRealTime trading platform: https://www.prorealtime...
Nicolas c'est exactement ce que je fais entre les lignes 58 et 64 pour pouvoir tracer la ligne complète
Italo Fabian Nicolas, Ces matrices sont-elles des vecteurs unidimensionnels ou multidimensionnels? Depu...
Denis Bonjour Nicolas et RicLg, Merci Nicolas pour cet indicateur intéressant et merci RicLg pour...
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
Nicolas Il faut l'ajouter sur le prix avec l'icône de la clé situé en haut à gauche du graphique du ...
jerome777 merci de ta réponse
jerome777 bonjour c est bon il fonctionne parfaitement merci beaucoup
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-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...
Alessandro Furlani Hi Ian, hope you still use PRT and so you can read this post. I have tested a lot your work ...
Stockastiss Can this code be simply transferred into Backtestingcode so one doesnt need to use call ? (i...
Vonasi Sorry for the late reply. Add the code to your strategy and remove line 5 and line 39. Chang...
viktorthunss Hi! How many averages are there? Can I see the somewhere?
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
leofi https://www.prorealcode.com/topic/simple-average-with-visual-color/
leofi Go visit www.prorealcode.com/topic/simple-average-with-visual-color/ and watch 2em post
Dritan Hi,I am new on Prorealtime and coding.I downloaded the indi but I have it on a separate wind...

Top