| |
 |
Views:
1849 |
| Added: December 30, 2007 |
| |
| |
|
| This formula has not been rated yet |
|
|
| |
email this link
|
| |
| |
| Tags:
MetaStock, indicator
|
| |
 |
Interpretations of the Siroc indicator, with trigger & automatic over-bought/sold signals.
Code:
Siroc IV by Jose Silva
{ Siroc II v2.0 }
{ System1: trigger crossovers }
{ System2: auto over-bought/sold crossovers }
{ ©Copyright 2002-2004 Jose Silva }
{ http://www.metastocktools.com }
prd1:=Input("first period",2,252,21);
prd2:=Input("second period",2,252,10);
prd3:=Input("crossover periods",2,252,5);
x:=Input("use Open=1 High=2 Low=3 Close=4 MP=5 P=6",1,6,5);
plot:=Input("[1]Siroc, [2]System1, [3]System3",1,3,1);
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,MP(),If(x=6,P,C)))));
y:=Mov(x,prd1,E);
z:=Mov((x-y)/Ref(y,-prd1),prd2,E);
Siroc:=100
*Mov(If(z>Ref(z,-1),z-Ref(z,-1),0),prd3,E)
/(Mov(If(z>Ref(z,-1),z-Ref(z,-1),0),prd3,E)
+Mov(If(z
+.000001);
SirocAvg:=Cum(Siroc)/Cum(Siroc>-1);
{ Automatic peak/trough historical boundaries }
pk:=Ref(Siroc,-1)>Ref(Siroc,-2)
AND Ref(Siroc,-1)>Siroc
AND Ref(Siroc,-1)>SirocAvg;
pkVal:=ValueWhen(1,pk,Ref(Siroc,-1));
oBought:=Cum(pkVal)/Cum(pkVal>-1);
tr:=Ref(Siroc,-1)
AND Ref(Siroc,-1)
AND Ref(Siroc,-1)
trVal:=ValueWhen(1,tr,Ref(Siroc,-1));
oSold:=Cum(trVal)/Cum(trVal>-1);
{ System signals }
dTrigger:=Mov(Siroc,prd3,E);
System1:=
Cross(Siroc,dTrigger)-Cross(dTrigger,Siroc);
System2:=
Cross(Siroc,oSold)-Cross(Siroc,oBought);
signals:=If(plot=2,System1,System2);
If(plot=1,oBought,0);
If(plot=1,oSold,0);
If(plot=1,dTrigger,0);
If(plot=1,Siroc,signals)
Author: Jose Silva
Source: http://www.metastocktools.com
all formulas for MetaStock
all formulas
|