Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 4/7/2019(UTC) Posts: 5 Location: Calgary
|
Friends,
I am new to writing formulas in MetaStock - I would like to create something that I can run on an exploration that will indicate me a value that is crossing through -.5 or +.5.
The formula is as follows (to plot the indicator):
plot:= RSI(5);
ph:=LastValue(Highest(plot));
pl:=LastValue(Lowest(plot));
pf:=10/(ph-pl);
v1:= ((plot-pl)*pf)-5;
v2:= Mov(v1,9,W); .5;
-.5;
(Exp(2*v2)-1)/(Exp(2*v2)+1)
Also, please see https://www.metastock.co...er/resources/tasc/?id=60 for a detailed explanation.
Thank you!
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: CalgaryCoolCat Friends,
I am new to writing formulas in MetaStock - I would like to create something that I can run on an exploration that will indicate me a value that is crossing through -.5 or +.5.
The formula is as follows (to plot the indicator):
plot:= RSI(5);
ph:=LastValue(Highest(plot));
pl:=LastValue(Lowest(plot));
pf:=10/(ph-pl);
v1:= ((plot-pl)*pf)-5;
v2:= Mov(v1,9,W); .5;
-.5;
(Exp(2*v2)-1)/(Exp(2*v2)+1)
Also, please see https://www.metastock.co...er/resources/tasc/?id=60 for a detailed explanation.
Thank you!
Hi, This would not take much modification, and it would also depend on how you wanted the information to display in your exploration report. You could modify as follows:
Column A: Above+.5 Code:plot:= RSI(5);
ph:=LastValue(Highest(plot));
pl:=LastValue(Lowest(plot));
pf:=10/(ph-pl);
v1:=((plot-pl)*pf)-5;
v2:=Mov(v1,9,W);
fin:=(Exp(2*v2)-1)/(Exp(2*v2)+1);
Cross(fin,.5);
Column B: Below-.5 Code:plot:= RSI(5);
ph:=LastValue(Highest(plot));
pl:=LastValue(Lowest(plot));
pf:=10/(ph-pl);
v1:=((plot-pl)*pf)-5;
v2:=Mov(v1,9,W);
fin:=(Exp(2*v2)-1)/(Exp(2*v2)+1);
Cross(-.5,fin);
Filter:
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 4/7/2019(UTC) Posts: 5 Location: Calgary
|
Hello, I will try that. Thank you for your help, I really appreciate it.
|
|
|
|
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.