# stochastic RSI afl same as investing.com

#### pareshbhangale

##### Member
Hi,

seen stochastic rsi (14,14,3,3) in investing.com...tried many codes from google for stochastic rsi afl but unable to find 1 which replicate same values as on investing.com stochRsi indicator.

Can someone help with it.

Regards,
Paresh

#### rajeshkanattu

##### New Member
have you managed get, i am also looking for the same?

#### pareshbhangale

##### Member
no not yet ....no member is reverting on this topic

##### Well-Known Member
Stock RSI is also known as dt oscillator, extensively use by Robert miner. Google dt oscillator you will get the AFL. But it not perfect. There is slight deviation in values from original St osc.

#### pareshbhangale

##### Member
i already tried all afl for dt oscillator .but values does not match with investing.com charts

##### Well-Known Member
Forget investing.com how come you are sure it's correct. Try to match with dynamic trader.

#### rajeshkanattu

##### New Member
@pareshbhangale

May be you can give a try with below::

-----------------------------------------------------------
_SECTION_BEGIN("StochRSI");
RSIperiods = Param( "RSIperiods", 10, 1, 100, 1 );
Stochperiods = Param( "Stochperiods", 10, 1, 100, 1 );
sep = ParamList( "Separator Interval", "Day|Week|Month|Year", 0 );
Kperiods = Param( "Kperiods", 3, 1, 50, 1 );
Dperiods = Param( "Dperiods", 3, 1, 50, 1 );
OBthreshold = Param( "OBthreshold", 80, 55, 100, 5 );
OSthreshold = Param( "OSthreshold", 20, 0, 50, 5 );

switch( sep )
{
case "Day":
dn = Day();
dn1 = inDaily;
break;

case "Week":
dw = DayOfWeek();
newWeek = dw < Ref( dw, -1 );;
newYear = Year() != Ref( Year(), -1 );
dn = weekNumber = Sum( newWeek, BarsSince( newYear ) + 1 );
dn1 = inWeekly;
break;

case "Month":
dn = Month();
dn1 = inMonthly;
break;

case "Year":
dn = Year();
dn1 = inYearly;
break;
}

separator = dn != Ref( dn, -1 );
Plot( separator, "", colorDarkBlue, styleHistogram | styleOwnScale | styleNoLabel | styleNoRescale, 0, 1, 0, -2, 5 );

TheRSI = RSI( RSIperiods );
llRSI = LLV( TheRSI, Stochperiods );
hhRSI = HHV( TheRSI, Stochperiods );

StochasticRSI = 100 * ( ( TheRSI - llRSI ) / ( hhRSI - llRSI + 0.00001 ) );

StocK_rsi = MA( StochasticRSI, Kperiods );
StocD_rsi = MA( StocK_rsi, Dperiods );

Plot( StocK_rsi, "StochK(" + Kperiods + ") of RSI(" + RSIperiods + ")", colorRed, styleLine | styleThick );
Plot( StocD_rsi, "StochD(" + Dperiods + ") of RSI(" + RSIperiods + ")", colorBlue, styleDashed | styleThick );
PlotGrid( OBthreshold, colorRed, 1 );
PlotGrid( OSthreshold, colorGreen, 1 );

_SECTION_END();

#### rajeshkanattu

##### New Member
@pareshbhangale ,

We cant match the StochRSI with investing.com untill we get the same data feed which investing.com is using.

#### pareshbhangale

##### Member
this 1 matches closely but still not perfect match..maybe your point of data might be valid but EOD data should be same on all website

#### Rudra Pujara

##### New Member
Can someone help me out with stochastic rsi crossover alert afl?
I am new