Hi Ginkapo
Here are two versions of SRSI for MetaStock. Version 1 uses PREV to exactly match the 6-period EMA of Vitale Apirine's spreadsheet. The indicator caters for the required Wilders Smoothing method that seeds or initializes the EMA of CLOSE with an SMA start value. The positive and negative displacements are smoothed by a normal Wilders() function so there's no need to use PREV for them.
Version 2 uses a standard Mov(C,E,Periods) function instead of the PREV version that delivers the hybrid EMA. For the purist, version 1 is the way to go, but for most users version 2 is probably quite close enough.
Roy
{SRSI (v1) - Slow Relative Strength Index}
{Source - Stocks & Commodities, April 2015}
{Author - Vitale Apirine}
{Coded by Roy Larsen, 2015, 28/5/15}
N:=Input("SRSI, Reference EMA Periods",2,29,6);
X:=Input("Smoothing Periods",2,29,14);
{Price EMA with SMA seeding}
R:=2/(N+1);
M:=If(Cum(1)<=N,Mov(C,N,S),PREV*(1-R)+C*R);
{Positive Difference}
PD:=(C>M)*(C-M);
{Negative Difference}
ND:=(C<m)*(m-c);
{Wilders Smoothing of PD}
PMD:=Wilders(PD,X);
{Wilders Smoothing of ND}
NMD:=Wilders(ND,X);
{Result}
SRS:=PMD/If(NMD=0,1,NMD);
If(NMD=0,100,100-(100/(1+SRS)));
{SRSI (v2) - Slow Relative Strength Index}
{Source - Stocks & Commodities, April 2015}
{Author - Vitale Apirine}
{Coded by Roy Larsen, 2015, 28/5/15}
N:=Input("SRSI, Reference EMA Periods",2,29,6);
X:=Input("Smoothing Periods",2,29,14);
{Price EMA with normal seeding}
M:=Mov(C,N,E);
{Positive Difference}
PD:=(C>M)*(C-M);
{Negative Difference}
ND:=(C<m)*(m-c);
{Wilders Smoothing of PD}
PMD:=Wilders(PD,X);
{Wilders Smoothing of ND}
NMD:=Wilders(ND,X);
{Result}
SRS:=PMD/If(NMD=0,1,NMD);
If(NMD=0,100,100-(100/(1+SRS)));
</m)*(m-c);
</m)*(m-c);
Edited by user Thursday, May 28, 2015 9:49:48 PM(UTC)
| Reason: Not specified