Here is the code for the famous Traders Dynamic Index aka the “TDI”.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
//parameters // lengthRSI = 13 // lengthband = 34 // lengthrsipl = 2 // lengthtradesl = 7 r = rsi[lengthrsi](close) ma = average[lengthband](r) offs = (1.6185 * std[lengthband](r)) up = ma+offs dn = ma-offs mid = (up+dn)/2 mab = average[lengthrsipl](r) mbb = average[lengthtradesl](r) lineup = 68 linemid = 50 linedown = 32 RETURN lineup as "line up", linemid as "line mid", linedown as "line down", up coloured(0,238,238) as "up", dn coloured(0,238,238) as "dn", mid coloured(255,165,0) as "mid", mab coloured(0,255,0), mbb coloured(255,0,0) |
Share this
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 :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
many thanks, very helpful
Hi Nicolas.Is there an updated code for this – I copy and pasted your code exactly how it is shown and it was coming up with syntax errors.I’m not at the computer right now to show you – but with your experience would you have any idea what these errors are?Apologies – I have no previous experience with programming indicators so it might be something very obviously and silly.
I think it might be something to deal with the parameters which are commented between line 1 to 5. Just remove the double dash. Or you can also download the ITF file and import it directly into your platform, much easier 🙂
Nicolas – you sir, are an absolute gentleman. Thank you for getting back to me so quick.I see you have also written a code to back test (I think) the simple trading system regarding the TDI (First found on Forex Factory).Not sure what your own results of that was, but it seems to me (won’t have your experience) that it is a more manual system as there are certain criteria that need to be considered that an automatic system couldn’t programme? (I obviously could be entirely wrong on that).Anyway, thanks again, this will allow me to manually back test some results taking into consideration the general trend, whether or not the price is above the 5ema, any major S/R zones to consider etc. Then collating that info and seeing what criteria is important and what may not be in positive results via excel (The caveman way lol).Thanks.
Hi Nicolas,is there any way to change the colour of the green line (TDI 1)?
many thanks
Just change the R,G,B code of the mab variable in the return instruction (last line)
Thank you Nicolas.
Hi Nicolas,me again..Is it possible to add in the indicator box the angle of the TDI and the TDI2 as the angles of the lines are quite important.It would be much appreciated but if you are too busy i will also understand…many thanks Adrian
Please open a new topic in the probuilder forum with a complete description of you want to be added to the TDI indicator, thanks in advance. (pictures would be of great help!).
HI, I wonder how to change the mid line color depending on its growing or declining evolution. I have not managed to do it myself …sorry
Bonjour à tous,
Post tardif, mais on débute tous un jour, et moi je découvre Prorealcode.
A propos de jolis code de “Traders Dynamic Index TDI”, on peut obtenir exactement la même chose (je dis bien exactement) avec un RSI 13 auquel on ajoute :
– 2 Moyennes mobiles simple de 2 et 7 périodes (pour cet exemple)
– des Bandes de Bollinger de période 34 et d’écart type 1.6185 (Les BB contiennent déjà la bande du milieu)
Je dis simplement ça pour expliquer que tous les signaux sont basés sur des calculs qui se croisent souvent et qu’on peut les retrouver par des chemins différents.
Ça me paraît inintéressant pour mieux les comprendre
Tradivement 😉
Oui en effet, le TDI c’est un RSI lissé avec des écarts types sur sa moyenne.