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

Notification

Icon
Error

Options
Go to last post Go to first unread
rls  
#1 Posted : Thursday, November 24, 2005 10:20:15 PM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

I am looking for a basic formula to plot RSI without wilders smothing Is there a formula that would allow me to do this in Meta Stock? Any help would be greatly appreciated RLS
mstt  
#2 Posted : Thursday, November 24, 2005 11:22:04 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)
RLS This is the underlying formula for RSI(). Just change it to suit. {RSI Indicator} A:=Input("Periods",2,99,10); B:=C; {target array} U:=Wilders(If(B>Ref(B,-1),B-Ref(B,-1),0),A); D:=Wilders(If(B<Ref(B,-1),Ref(B,-1)-B,0),A); 100-(100/(1+(U/D))); Roy MetaStock Tips & Tools
rls  
#3 Posted : Friday, November 25, 2005 1:47:09 AM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

Mstt Thank you for the fast reply, but the formula you posted still includes Wilders smooting What I am looking for is the formula for Standard RSI (not including Wilders smoothing) Is there a way the formula you posted can be re-written to remove the Wilders smoothing function I am not that great with formulas so I am not sure how to go about removing the wilders smoothing and still get the formula to work rls
mstt  
#4 Posted : Friday, November 25, 2005 2:12:23 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)
RLS I assumed how to remove Wilders Smoothing would be obvious so I didn't mention it. Try this version. You could simply have set the "periods" parameter to 1 for the same effect (A:=1;). {RSI Indicator} A:=Input("Periods",2,99,10); B:=C; {target array} U:=If(B>Ref(B,-1),B-Ref(B,-1),0); D:=If(B<Ref(B,-1),Ref(B,-1)-B,0); 100-(100/(1+(U/D))); Roy MetaStock Tips & Tools
rls  
#5 Posted : Friday, November 25, 2005 2:44:52 AM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

MStt Once again thank you for the prompt reply I guess I should have worded my last post better. I tried the formula the way you have it revised but was getting a devide by zero error and thought I just didn't know what I was doing. However I must still be missing something I copied and pasted your revised formula and I am still getting the "Division by zero" error rls
Patrick  
#6 Posted : Friday, November 25, 2005 2:54:59 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Replace the last line of code by: [code:1:9bc136e9bb]100-(100/(1+(U/Max(D,.00001))));[/code:1:9bc136e9bb] Patrick :mrgreen:
rls  
#7 Posted : Friday, November 25, 2005 3:25:39 AM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

Patrick your code on the last line took care of the division by zero error, but now the indicator is displaying a just a flat line. Here is how I have it written. {RSI Indicator} A:=Input("Periods",2,99,10); B:=C; {target array} U:=If(B>Ref(B,-1),B-Ref(B,-1),0)=10; D:=If(B<Ref(B,-1),Ref(B,-1)-B,0)=10; 100-(100/(1+(U/Max(D,.00001)))); rls
Patrick  
#8 Posted : Friday, November 25, 2005 3:44:56 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
:eek: Make sure you plot the indicator in its own window ... I don't see why you would get a flat line. Patrick :mrgreen:
rls  
#9 Posted : Friday, November 25, 2005 4:09:10 AM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

Its in its own window More information While trying to figure this out I changed the the "10" at the end of the If statements to "0" and got a fast binary wave, but any other value gives a flat line. Somehow its not seeing the number of periods correclty {RSI Indicator} A:=Input("Periods",2,99,10); B:=C; {target array} U:=If(B>Ref(B,-1),B-Ref(B,-1),0)=0; D:=If(B<Ref(B,-1),Ref(B,-1)-B,0)=0; 100-(100/(1+(U/Max(D,.00001)))); rls
rls  
#10 Posted : Monday, November 28, 2005 2:36:32 AM(UTC)
rls

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/24/2005(UTC)
Posts: 10

Finally got it figured out Here is the correct "working" version of my formula for "Standard RSI" (Wilders smothing removed) To get the number of periods to work the "Wilders" function had to be replaced with the "Sum" function as shown here. I Can't beleive I was not seeing the fact that I still needed a function to call the number of periods, but like I said I am not that good with the formulas. Try this as a custom indicator and compare it to the the RSI built into Meta Stock using the same number of periods and you will see the difference, especially where crosses below 30 and above 70 are concerned. {RSI Indicator} A:=Input("Periods",2,99,14); B:=C; {target array} U:=Sum(If(B>Ref(B,-1),B-Ref(B,-1),0),A); D:=Sum(If(B<Ref(B,-1),Ref(B,-1)-B,0),A); 100-(100/(1+(U/Max(D,.00001)))); mstt Thank You for your help in getting me the underlying formula Patrick Thank you for help with the Division by zero error RLS
mstt  
#11 Posted : Monday, November 28, 2005 3:05:00 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)
RLS You've just takes some whorthwhile steps towards improving your formula language skills. Keep up the good work. Roy MetaStock Tips & Tools
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.