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

Notification

Icon
Error

Options
Go to last post Go to first unread
Patrick  
#1 Posted : Friday, August 19, 2005 4:39:32 PM(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)
This custom RSI will allow you to select which price data to use when you plot it. The standard RSI uses the close value as Welles Wilder did when he created the indicator. This custom indicator will allow you to use the other price fields including volume. Q:=Input("Time Periods",1,1000,14); B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1); Z:=If(B=1,Wilders(If(ROC(C,1,$)>0,ROC(C,1,$),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)>0,ROC(O,1,$),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)>0,ROC(H,1,$),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)>0,ROC(L,1,$),0),LastValue(Q)),Wilders(If(ROC(V,1,$)>0,ROC(V,1,$),0),LastValue(Q)))))); Y:=If(B=1,Wilders(If(ROC(C,1,$)<0,Abs(ROC(C,1,$)),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)<0,Abs(ROC(O,1,$)),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)<0,Abs(ROC(H,1,$)),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)<0,Abs(ROC(L,1,$)),0),LastValue(Q)),Wilders(If(ROC(V,1,$)<0,Abs(ROC(V,1,$)),0),LastValue(Q)))))); RS:=Z/Y; 100-(100/(1+RS))
pumrysh  
#2 Posted : Saturday, September 3, 2005 4:03:14 AM(UTC)
pumrysh

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/28/2004(UTC)
Posts: 110

How about another vaiation of the same theme: Q:=Input("Time Periods",1,1000,14); B:=Input("1=Close,2=Open,3=High,4=Low,5=Vol,6=Typ,7=Med",1,7,1); B:=If(B=1,C,If(B=2,O,If(B=3,H,If(B=4,L,If(B=5,V,If(B=6,Typical(),MP())))))); Z:=Wilders(If(ROC(B,1,$)>0,ROC(B,1,$),0),LastValue(Q)); Y:=Wilders(If(ROC(B,1,$)<0,Abs(ROC(B,1,$)),0),LastValue(Q)); RS:=Z/Y; 100-(100/(1+RS)) This one includes the typical and median prices. Also note the double use of the B variable where first it is used as an input device and then an output. Preston
mstt  
#3 Posted : Saturday, September 3, 2005 9:50:31 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)
I can't quite see why either formula needs to use LastValue(). The value from the Input() function is already a constant. Roy
Patrick  
#4 Posted : Saturday, September 3, 2005 4:16:57 PM(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)
I don't know either :lol: I just copied this from Equis's website before they decided to link to us for formula .... I guess we could try without it but you are correct, it does seem useless ... Patrick :mrgreen:
pumrysh  
#5 Posted : Saturday, September 3, 2005 5:35:50 PM(UTC)
pumrysh

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/28/2004(UTC)
Posts: 110

My formula was simply a version of Patrick's, so it was all his fault! :lol: Seriously, the only reason would be if the input was originally used with a variable input or maybe that was the original authors way of overcoming the notorius division fault inherent with the RSI. Roy is right though and a simple Q is all that is needed. So the formula that I posted becomes: Q:=Input("Time Periods",1,1000,14); B:=Input("1=Close,2=Open,3=High,4=Low,5=Vol,6=Typ,7=Med",1,7,1); B:=If(B=1,C,If(B=2,O,If(B=3,H,If(B=4,L,If(B=5,V,If(B=6,Typical(),MP())))))); Z:=Wilders(If(ROC(B,1,$)>0,ROC(B,1,$),0),Q); Y:=Wilders(If(ROC(B,1,$)<0,Abs(ROC(B,1,$)),0),Q); RS:=Z/Y; 100-(100/(1+RS)) {end} Preston
mstt  
#6 Posted : Saturday, September 3, 2005 10:09:57 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 Preston Forgive me for being a little pedantic. I guess we've all left redundant code in place from time to time. Isn't it strange that I can find instances of it in someone else's code much quicker than in my own. :oops: Roy
Patrick  
#7 Posted : Saturday, September 3, 2005 11:58:22 PM(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)
Quote:
My formula was simply a version of Patrick's, so it was all his fault! :lol
Here we go let's blame it on the French again :roll: :D
Quote:
Isn't it strange that I can find instances of it in someone else's code much quicker than in my own
I have the same ability, you should be proud of it :oops: :lol: Patrick :mrgreen:
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.