Nicolas

Dynamic RSI

Category: Indicators By: Nicolas Created: January 30, 2019, 12:18 PM
January 30, 2019, 12:18 PM
Indicators
13 Comments
Dynamic RSI

The Dynamic RSI indicator is a kind of exponential RSI. The overbought and oversold levels (respectively HiLine and LoLine) are calculated according to the recent highest and lowest values of the Dynamic RSI line.

The code has been converted from the Amibroker version, as per a request in the English forum section.

 

//PRC_DynamicRSI | indicator
//30.01.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from Amibroker code

// --- settings 
DZbuy = 0.1 //Buy Zone Probability
DZsell = 0.1 //Sell Zone Probability
Period = 14 //RSI Period 
Lb = 60 //LookBack Period
// --- end of settings 

RSILine = RSI[Period](close)
jh = highest[lb](RSILine)
jl = lowest[lb](RSILine)
jc = (WeightedAverage[period](jh-jl)*0.50)+WeightedAverage[period](jl)
Hiline = jh-jc*DZbuy
Loline = jl+jc*DZsell

R =  ( 4 * RSILine + 3 * RSILine[1] + 2 * RSILine[2] + RSILine[3] ) / 10

if R > jc then 
 colr=0
 colg=255
else
 colr=255
 colg=0
endif

if R > hiline then 
 drawbarchart(hiline,r,hiline,r) coloured(colr,colg,0,150)
elsif R < loline then 
 drawbarchart(loline,r,loline,r) coloured(colr,colg,0,150)
endif

return R coloured(colr,colg,0) style(line,2), jc coloured(168,168,168) style(dottedline,2), hiline coloured(255,50,0),loline coloured(255,50,0)

 

Download
Filename: PRC_DynamicRSI.itf
Downloads: 562
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Rafyone
3 years ago
#

Bonjour Nicolas et bonne année lol J'ai une erreur qui apparait concernant drawbarchart une des expressions suivantes serait plusa pproprié ( sans proposition ) Merci de ton aide Cordialement Raphael Je commence juste à m'interressé à la programmation sur Prorealtime

Nicolas
3 years ago
#

Je pense que tu n'utilises pas le bon éditeur de code, cette instruction est compatible uniquement dans la création d'indicateur (pas dans l'éditeur de codes pour les screeners ou pour les stratégies de trading automatique).

cdc.andersson
5 years ago
#

Hello, when trying to include this wonderful Dynamic RSI on my trading system i get the error "The function "PRC_DynamicRSI" called from "(my trading system)" returns 4 values but your code needs 5". Any ideas what causes this? Regards Daniel

souf
8 years ago
#

Bonsoir Nicolas, Je te remercie d'avoir pris le temps de me répondre. J'ai essayé de supprimer les 2 lignes du programme, mais ça m'a ensuite trouvé 2 autres valeurs non utiles... (DZbuy et DZsell...)... Il y a quelque chose que je fais mal et que j'ai surement mal compris... Je vais continuer à chercher. Merci encore et bonne soirée. Soufiane

flider
8 years ago
#

Indicator in MQL4 not working?

souf
8 years ago
#

Bonjour Nicolas, J'ai tenté de créer un screener dans ProScreener, j'ai obtenu le message d'erreur ci-dessous: "Erreur de syntaxe: La variable suivante n'est pas utilisée dans le programme:hiline La variable suivante n'est pas utilisée dans le programme:loline" Voila le code que j'ai essayé d'intégrer: //PRC_DynamicRSI | indicator //30.01.2019 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //converted from Amibroker code // --- settings DZbuy = 0.1 //Buy Zone Probability DZsell = 0.1 //Sell Zone Probability Period = 14 //RSI Period Lb = 60 //LookBack Period // --- end of settings RSILine = RSI[Period](close) jh = highest[lb](RSILine) jl = lowest[lb](RSILine) jc = (WeightedAverage[period](jh-jl)*0.50)+WeightedAverage[period](jl) Hiline = jh-jc*DZbuy Loline = jl+jc*DZsell R = ( 4 * RSILine + 3 * RSILine[1] + 2 * RSILine[2] + RSILine[3] ) / 10 screener[r crosses over jc or r crosses under jc] Je vous remercie par avance pour votre précieux éclairages... Bonne fin de journée. Soufiane

Nicolas
8 years ago
#

Si ces variables ne sont pas utiles, il faut tout simplement les supprimer du programme.

Nicolas
8 years ago
#

Why do you think this code is for MT4?

luxrun
8 years ago
#

Thanks Nicolas, I did not write the request exactly; I would like to intercept the changes in the DynamicRSI line, when the color changes from red to green (rising signal) and from green to red (downward signal). The solution you indicated shows me the DynamicRSI above or below the 2 extreme bands, but in that situation the actions can stop a lot. The trend change is more interesting as a trading signal. Thanks again

souf
8 years ago
#

Hi Luxrun, I hope everything is OK for you. Did you succeed turning this indicator into screener? If so, could you please share with me the code you applied. I tried to write one but failed lamentably... Thanks in advance. Have a nice day. Soufiane

Nicolas
8 years ago
#

So it should be coded like this: screener[r crosses over jc or r crosses under jc]

luxrun
8 years ago
#

A question please: is it possible to turn the DynamicRSI into a screener that provides titles that change the color of the R line, from red to green and vice versa? I believe that the R line offers a reliable and credible indication, thanks also for this flexible indicator, Luxrun

Nicolas
8 years ago
#

delete the lines 23 to 37 and add this one at the end in ProScreener: screener[r crosses over hiline or r crosses under loline]

ProRealCode ProRealCode
Loading...