abdel01s

Member
Please for every body, if it is possible i want a formula for RSI 21day based on ;

(H + L +2*C)/4 and not just for the close price.

johnnypareek

Well-Known Member
Well,

Check this

HTML:
``````//Plot(RSI(),"RSI Normal",4,1);
C=(H+L+(C*2))/4;
Plot(RSI(),"RSI Modifies",5,1);``````

KelvinHand

Well-Known Member
Well,

Check this

HTML:
``````//Plot(RSI(),"RSI Normal",4,1);
C=(H+L+(C*2))/4;
Plot(RSI(),"RSI Modifies",5,1);``````
Another way:
P=(H+L+(C*2))/4;
Plot(RSIa(P,14),"RSI Modified 2",5,1);

abdel01s

Member
first thanks a lot you for your help;

it's became like that;

_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
P=(H+L+(C*2))/4;
periods = Param( "Periods", 21, 1, 200, 1 );
Plot( RSIa(P,21), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );

_SECTION_END();

it's correct like that?
thanks a tone.

KelvinHand

Well-Known Member
first thanks a lot you for your help;

it's became like that;

_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
P=(H+L+(C*2))/4;
periods = Param( "Periods", 21, 1, 200, 1 );
Plot( RSIa(P,21), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );

_SECTION_END();

it's correct like that?
thanks a tone.
Make it more pro:

switch(ParamList("Price", "O,H,L,C,MP,TP,WP", 6))
{
case "O": P=O; break;
case "H": P=H; break;
case "L": P=H; break;
case "MP": P=(H+L)/2; break;
case "TP": P=(H+L+C)/3; break;
case "WP": P=(H+L+2*C)/4; break;
default: P=C; break;

}

Change 21 in RSI to periods