Page 1 of 1

How to add Lines to RSI

Posted: Thu Dec 03, 2020 2:58 pm
by rlite4
Hi Earik,
Greetings.

I want to add some additional levels to the RSI indicator beyond the overbought and oversold, such as 50 and a few more. These levels can be fixed and need not be changeable from settings. Can you point me to the easiest way to do this - i.e. is there a way to modify the script for the RSI indicator or is that programmed in?

thanks,
rlite4

Re: How to add Lines to RSI

Posted: Thu Dec 03, 2020 7:36 pm
by earik
Hi Rlite4,

Yeah, you can add plot statements to the script. So here's what the RSI indicator looks like if you open it up in the script editor:

Code: Select all

input:price(close),length(14),overbought(70),oversold(30),
    color(red),zonecolor(blue),thickness(1);

plot1=rsi(price,length);
color1=color;
plot2=oversold;
plot3=overbought;
color2,color3=zonecolor;
thickness1,thickness2,thickness3=thickness;  
Note the plot1, plot2, and plot3 lines in there. Each one of those represents one indicator line. So let's say you wanted to add 50 in there. You could do it like this:

Code: Select all

plot4 = 50;
If you want to change the color, or thickness, or style, you could do those with:

Code: Select all

color4 = red;
thickness4 = 1;
style4 = ps_dot;
Note that color4 goes with plot4. If you want more lines, just work your way up. So plot5, plot6, etc.

When you're done, you go Qscript - Build Script, and it will re-build the RSI for you. You might consider changing the name, so it doesn't get overwritten if you ever do a reinstall. Do that in QScript - Script Properties. (The QScript menu appears at the top when you have the Script Editor open.)

Let me know if that doesn't get you going.

Earik

Re: How to add Lines to RSI

Posted: Fri Dec 04, 2020 11:51 pm
by rlite4
Hi Earik,

thanks that worked great :) . I got hung up a bit because I had scaling in properties set to price instead of screen.

Regards,
rlite4