Tushar Chande’s DMI (with RSX)

Tushar Chande’s DMI (with RSX)

An indicator used in technical analysis that determines the overbought and oversold conditions of a particular asset. This indicator is very similar to the Relative Strength Index (RSI). The main difference between the two is that the RSI uses a fixed number of time periods (usually 14), while the Dynamic Momentum Index uses different time periods as volatility changes.

This indicator is interpreted in the same manner as the RSI where the readings below 30 are deemed to be oversold and more than 70 levels are deemed to be overbought. The number of time periods used in the dynamic momentum index decreases as the volatility of the underlying asset increases, making this indicator more sensitive to price changes than the RSI. This version has an additional smoothing in an RSX usage form for calculating the original RSI pitch. It has been added to make it a little more readable. The DMI Chande is less smooth than this original version and can raise more false signals. Using the RSX instead of RSI not add any lag at all, so we can say that using an RSX instead of RSI could be classified as “1% improvement” rule – which is sure it not be worse than the original Chande’s DMI.

(description found on internet). Indicator translated from Metatrader5 version by a request in forum.

Settings explanation:

_ MAStdDevMode : moving average type for smoothing the ATR value used to get the volatility of the current instrument

_ DmiLowerLimit & DmiUpperLimit : bounds for DMI periods (DMI calculated period can’t be less or more than these 2 limits)


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

  1. macbartin • 01/31/2018 #

    Bonjour, merci pour l’indicateur, j’utilise un RSI de 7 période, sur du 1 min, est’il possible de changer sa base de période ? si oui comment faire ? merci encore j’avais pas pensé que le RSI pouvait avoir du retard !

    • Nicolas • 01/31/2018 #

      Changer la base de périodes du RSI original ? Le RSI a du “retard” puisqu’il est toujours nécessaire d’évaluer le terrain (et donc de regarder le passé) pour donner l’information sur la bougie courante.

    • macbartin • 01/31/2018 #

      merci, je voulais savoir quel paramètre il faut modifier sur votre indicateur pour le modifier sur la période 7 de votre indicateur

    • Nicolas • 01/31/2018 #

      Cet indicateur est dynamique, il n’utilise pas de période fixe

  2. falco44 • 01/31/2018 #

    Bonjour Nicolas,
    Lorsque j’importe l’indicateur via l’itf et que je l’attache au graphique, il apparait ce message “Erreur dans l’indicateur : PRC_DMI of RSX (5 8 0 15 10 50 60 40) — Un parametre de type entier positif est attendu avec SUMMATION”.
    Pourrais-tu m’eclairer à ce sujet stp ?
    Je suis sur la v11 de prt.
    Merci à toi,

    • Nicolas • 01/31/2018 #

      Dans ce cas, il faut changer les lignes qui comportent l’instruction SUMMATION comme ceci: summation[max(1,RSIterm)]

  3. falco44 • 01/31/2018 #

    Bonjour Nicolas, je suis desolé mais cela ne fonctionne toujours pas …
    Merci de ton retour

  4. AG1 • 01/31/2018 #

    Hello Nicholas
    Is it possible to attach a revised code?
    I tried to change according to your instructions but the indicator is not working yet.
    Thanks in advance for your help

    • Nicolas • 01/31/2018 #

      PFA below a revised version:
      //PRC_DMI of RSX | indicator
      //Nicolas @ http://www.prorealcode.com
      //Sharing ProRealTime knowledge
      //translated from MT5 code

      // — settings
      StdDevPeriod = 5 // Period of Standard Deviation
      MAStdDevPeriod = 8 // Period of smoothing
      MAStdDevMode = 0 // Mode of smoothing MA
      DMIPeriod = 15 // Dynamic Momentum Index Period
      DmiLowerLimit = 10 // Dynamic Periods Lower Bound
      DmiUpperLimit = 50 // Dynamic Periods Upper Bound
      LevelUp = 60 // Lower level
      LevelDown = 40 // Upper level
      // — end of settings

      if barindex>DMIperiod then
      SD = STD[StdDevPeriod](customclose)
      ASD = Average[MAStdDevPeriod,MAStdDevMode](SD)

      RSIterm = max(1,ROUND(DMIPeriod / (SD/ASD)))
      RSIterm = Max(Min(RSIterm,DmiUpperLimit),DmiLowerLimit)

      //RSI calculation
      plus = summation[max(1,round(RSIterm))](customclose-customclose[1]>0)
      minus = summation[max(1,round(RSIterm))](customclose-customclose[1]per then
      beta = 0.45*(per-1)/(0.45*(per-1)+2)
      if pow=1 then
      alpha = beta
      elsif pow=2 then
      alpha = beta*beta
      elsif pow=3 then
      alpha = beta*beta*beta
      elsif pow=4 then
      alpha = beta*beta*beta*beta
      elsif pow=5 then
      alpha = beta*beta*beta*beta*beta
      alpha = beta

      tmp0 = (1-alpha)*plus + alpha*tmp0[1]
      tmp1 = (plus – tmp0[0])*(1-beta) + beta*tmp1[1]
      tmp2 = tmp0[0] + tmp1[0]
      tmp3 = (tmp2[0] – tmp4[1])*((1-alpha)*(1-alpha)) + (alpha*alpha)*tmp3[1]
      tmp4 = tmp4[1] + tmp3[0]
      avgplus = tmp4

      ftmp0 = (1-alpha)*minus + alpha*ftmp0[1]
      ftmp1 = (minus – ftmp0[0])*(1-beta) + beta*ftmp1[1]
      ftmp2 = ftmp0[0] + ftmp1[0]
      ftmp3 = (ftmp2[0] – ftmp4[1])*((1-alpha)*(1-alpha)) + (alpha*alpha)*ftmp3[1]
      ftmp4 = ftmp4[1] + ftmp3[0]
      avgminus = ftmp4


      RS = avgplus/avgminus
      DMIRSX = 100 – 100 / ( 1 + RS )

      if DMIRSX>LevelUp then
      elsif DMIRSX<LevelDown then

      return DMIRSX coloured(r,g,b) style(line,3) as "Dynamic Momentum Index", levelup coloured(100,100,100) style(dottedline) as "level up", leveldown coloured(100,100,100) style(dottedline) as "level down"

  5. AG1 • 01/31/2018 #

    Thanks Nicolas
    Still a problem in line 29
    Please take a look.
    thanks again

    • Nicolas • 01/31/2018 #

      code is modified in the above post, use that one.

    • AG1 • 01/31/2018 #

      Still a problem in line 29
      Please take a look.
      thanks again

Register or


avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
superfalcio I need to fix it a little bit before to post...
Stenozar Hi Superfalcio, can you explain, in short, the Connor's 2Rsi strategy?
superfalcio The original one is based on 1 day timeframe and for stocks/indexes. Buy setup: price >SM...
2 months ago
Violet Nicolas, you calculate iRSI, but don't use it. You show RSI in the returned values, which, a...
Nicolas Yes, that's an error. RSI instruction is set by default to 14 if you don't indicate it that'...
DELBERT Bonjour , Nicolas , je voudrais installer cet indicateur sur ma PRT , version 10.3 , mais je...
Nicolas En effet, il faut à minima une version 11. La 10.3 est tellement ancienne maintenant.. Je pe...
DELBERT Bonjour , Nicolas , merci pour ta réponse , je fais un essai et je verrais . Salutations .
Khaled Thank you Nicolas! Looks like TDI (Trader Dynamic Index). Interesting to give Exit Signal as...
Nicolas ColorBetween is an instruction added last year: https://www.prorealcode.com/documentation/co...
AntoGH Bonjour peut-on backtester cela ? Et si vous l'avez fait pourriez vous nous donner le code.....
Nicolas désolé c'est un oubli de ma part, tu peux supprimer cette ligne, elle n'est plus utile dans ...
DELBERT Bonjour , Nicolas , merci pour ta réponse , je suis en effet avec PRT 10.3 , et j'ai bidouil...
supertiti https://zupimages.net/viewer.php?id=20/50/2e3v.jpg
volanirina Bonjour Je souhaite l'avoir sur l'indicateur MT4 si possible s'il vous plait. car je l'ai fa...
Nicolas ProRealCode est un site dédié à l'utilisation de la plateforme de trading ProRealTime: https...
Nicolas Merci d'ouvrir un sujet dans le forum des screeners en respectant les règles de publication ...
Pensera Bravo Nicolas ! Tu es en quelque sorte l’inventeur de Metascore…(oups je viens de lire jusqu...
Nicolas Dans un but d'investissement pure, et non spéculatif.
DIOS Bonjour Nicolas, comment coder un indicateur de rsi de Divergence? Merci pour ta réponse
Nicolas En apprenant la programmation :) Plus sérieusement, il y a quantité d'exemples dans la libra...
DonTony Bonjour Nicolas, Très bel indicateur! Bravo!
Madrosat I Have not see a fully functioning automated strategy on your site?? Really have you???
juanj Hi Madrosat, why would it be on my site? I have developed it for my personal use and also to...
Madrosat ok I understood you are using prorealcode to hack the fish
imonix Have been trying this on demo since Monday before deciding whether to go live with it. Using...
Roberto Blázquez I'm sorry, I've tried it since November 2012 and it's bad results.
woktrade Superbe !
Vonasi An updated version with a bug fix can be found here: https://www.prorealcode.com/topic/dis...
snucke hey Vonasi is it possible you can help me get this indicator to show how much a market mo...
Vinks_o_7 Vonasi you're a beast !!! ;-)))
pableitor Amazing indicator , you are pushing PRT to the limit! But looking at the scatter its not c...
3 years ago
fifi743 Good morning, there is no mistake about the shorts c11=SMI[14,3,5](close)>-40
Zigo has to be c11=SMI[14,3,5] < -40 (indeed)
xar3 Thank you ;-) Zigo
Sapo Thank you very much. as always your indicators are extremely effective. kind regards Vonasi.
mitsu21 Hi, it looks nice. I'll try it tomorrow thank you for your share kind regards bruno
kj1988 Thank you Vonasi for sharing this indicator. Very useful as a comfirmation to the price act...
ggolfet Thanks Nicolas, I imported the itf file and solved the problem.
Hasardeur Hallo Nicolas, i tried to code the multi period heat map in combination with the Ehler’s ...
Nicolas Please open a new topic with the code in forum.
Marie-Eve Vergoz lorsque je copie les codes, le système me signale des erreurs à la ligne 12 et suivantes
Marie-Eve Vergoz sorry - tout est ok -