logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Ginkapo  
#1 Posted : Tuesday, May 26, 2015 8:55:52 AM(UTC)
Ginkapo

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 5/26/2015(UTC)
Posts: 1

I read an article by Vitali Apirine in the April 2015 issue of the TASC magazine, he discuss about his SRSI (Slow Relative Strength Index). I tried to google but cannot find metastock coding for this indicator.

Any smart guy/gal can program this indicator? Please share here.

MS Support  
#2 Posted : Tuesday, May 26, 2015 7:24:31 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 91 times
Was thanked: 155 time(s) in 150 post(s)
Hi, The author of the indicator appears to have created it within MetaStock (given that the images displayed in the article are MetaStock charts). He does list his contact address at the end of the article on page 30. I can PM you the contact information if you end up not being able to find it.
mstt  
#3 Posted : Thursday, May 28, 2015 9:47:59 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
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

mstt  
#4 Posted : Thursday, May 28, 2015 10:48:09 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
I don't know where the last two lines of code in v2 came from - they don't belong there. Roy
kapogin  
#5 Posted : Saturday, May 30, 2015 9:52:28 AM(UTC)
kapogin

Rank: Newbie

Groups: Registered Users, Subscribers, Unverified Users
Joined: 5/30/2015(UTC)
Posts: 1

I'm new to MetaStock forum. I registered as Ginkapo but after I log out, I realised that the forum never ask me to create a password. Hence, I cannot login again. I then reset passord but the message is "There was an error setting the password. The password has not been changed."

Now, I registered as kapogin to specially thank mstt for his kindness and help. In fact, I tried to program the slow RSI and found that SRSI spreadsheet is similar to Stockcharts.com RSI spreadsheet. I want to modify RSI(). However, I cannot peek into RSI() and wilders() as these are basic functions. I was confused by wilders() and don't know what's the purpose of this function.

I'll not be able to login again due to this strange forum - never ask to create a password and cannot reset password.

I'm using Mozilla Firefox.

mstt  
#6 Posted : Sunday, May 31, 2015 2:47:21 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi kapogin Wilders() is a slightly different form of Exponential Moving Average compared to the conventional Mov(E) function. Typically an Exponential Moving Average (EMA) starts on bar one of the nominated data array (CLOSE for example), and on each subsequent bar adds a portion (percentage) of new data while retaining a portion (remaining percentage) of old data. In the EMA formula below you’ll see that Periods is converted to Rate (Ratio), and Rate is the percentage (ratio or fraction) of NEW data to be used, whilst (1-Rate) determines the percentage (fraction or ratio) of OLD data that is to be retained and added to the percentage of new data to arrive as the EMA value for the current bar. {Exponential Moving Average} Periods:=Input("Periods",1,999,9); Rate:=2 / ( Periods +1); If(Cum(1)=1, C, C*Rate + PREV*(1-Rate)); If the Periods parameter is 9 then the ratio of new data to old is 2/10 (0.2). or in percentage terms, 20%. Therefore the amount of old data retained is 80% Adding the two values together gives 100% of the new EMA value because the relative percentages of old (PREV) and new (data array) values must always add up to 100% C*0.2 + PREV*(1-0.2); Here 20% of C for the new data component and 80% of PREV for the PREVious bar’s value adds up to (is equal to) 100% of the new EMA value. What many MetaStock users do not realize is that fragments of ALL old data are present in the current EMA value. The older the data the less influence it has on the current EMA. It’s for this reason that I suggest using 5 times as much data as the Periods parameter of any EMA or Wilders to be sure of getting a reasonably accurate EMA result. Wilders Smoothing, the Wilders() function in MetaStock, is also an Exponential Moving average. However it is seeded (or initialized) by taking the first valid value of an SMA (Simple Moving Average) as the starting point. From there it’s very similar to the EMA discussed above, the difference being that the rate or ratio is different for any given Periods parameter. For this emulation the rate or ratio of new data is 0.1111 (recurring), and the ratio of old data is 0.8888 (recurring.) {Wilders Smoothing} Periods:=Input("Periods",1,999,9); Rate:=1 / Periods; If(Cum(1)<=Periods, Mov(C,Periods,S), PREV*(1-Rate) + C*Rate); When sufficient data is loaded a 10 period Wilders() will generate a 19 period Mov(E) Here is a discrete formula for RSI (Relative Strength Index). This emulation should make it easier to create variants of the original function. You might find it helps to rename each variable so that you can recognize the role of each variable. {RSI} N:=Input("Periods",2,99,10); C1:=Ref(C,-1); U:=Mov(( C>C1 ) * ( C-C1 ), N, E ); D:=Mov(( C<C1) * ( C1-C ), N, E ); 100 - (100 / ( 1 + (U / (D + (D=0) )))); I hope this gives you some insight into at least Wilders(), Mov(E) and RSI(). Hopefully you’ll take the time to experiment with these formulas. If you do I’m sure you’ll make discoveries of your own. Roy (mstt)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.