Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
{from Darryl Guppy's site}
{http://www.guppytraders.com/Metastock%20Formulas/metastock%20formula%2017.htm}
{from Ton Maas}
Custom Relative Momentum Index (RMI) Indicator for MetaStock
Q:=Input("RSI Time Periods",1,1000,14);
M:=Input("Momentum Time Periods",1,1000,5);
B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1);
Bval:=If(B=1,C,If(B=2,O,If(B=3,H,If(B=4,L,V))));
Mom:=Bval-Ref(Bval,-M);
Z:=Wilders(If(ROC(Mom,1,$)>0,ROC(Mom,1,$),0),LastValue(Q));
Y:=Wilders(If(ROC(Mom,1,$)<0,Abs(ROC(Mom,1,$)),0),LastValue(Q));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
Mov(RMIcust,M,S)
using this indicators default here is an expert that uses the powerPivots Plus add-on
Highlights
Long
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B>0
Short
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B<0
Out
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B=0
Symbols
long entry
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B>0 AND Ref(B,-1)<=0
short entry
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B<0 AND Ref(B,-1)>=0
Long exit
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B=0 AND Ref(B,-1)>0
Short exit
Mom:=C-Ref(C,-5);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(14));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(14));
RMS:=Z/Y;
RMIcust:=100-(100/(1+RMS));
A:=Mov(RMIcust,5,S);
LE :=A>Ref(A,-1) AND A>50;
SE:=A<Ref(A,-1) AND A<50;
LX:=A<Ref(A,-1) AND A>60;
SX:=A>Ref(A,-1) AND A<40;
B:=ExtFml("PowerPivots.SysEval",LE,LX,SE,SX,"!@#$#@!");
B=0 AND Ref(B,-1)<0
|