[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] For josè Trade Equity LE



PureBytes Links

Trading Reference Links


> Ok Roy I have seen your site but I have not found Trade Equity GVE that
> combine the long and short. Perhaps I have not understood well.

This code is not posted anywhere on the web. It has not been upgraded to the level of Trade Equity 
GV LE version 5.1.

Before it will function you must make 3 copies of GV.DLL and name them E.DLL, L.DLL and S.DLL. Once 
MetaStock has registered the new dlls you can create the new indicators. Make sure you have 
indicators called "Entry Binary" and "Exit Binary" before attempting to load. Even then you will 
still get errors - ignore them. Once all three indicators are created you should be able to open 
each one in the Indicator Builder and close again without error.  The errors when loading are caused 
because each file is linked to one of the others, and until all three are present the errors 
persist. Luckily MetaStock saves each indicator even though it thinks there is an error.

Once installed only pull down "Trade Equity GVE" onto a chart. This automatically links to the long 
and short indicators, and the third of the three produces the final long plus short on-chart plot.

Have fun with it.

Kind regards

Roy Larsen
www.metastocktips.co.nz
Free formulas and MS links


  {Trade Equity GVE} {V4.0 long & short equal}
  {2002 Roy Larsen, rlarsen@xxxxxxxxxxxxxx}
No:=Input("Enter 1=O 2=C 3=H 4=L 5=Stop",1,5,2);
Xo:=Input("Exit 1=O 2=C 3=H 4=L 5=Stop" ,1,5,2);
Nd:=Input("Entry Delay #",0,3,0);
Xd:=Input("Exit Delay #" ,0,3,0);
Cn:=Input("Entry Commission $",0,99,20);
Cx:=Input("Exit Commission $" ,0,99,20);
Cp:=5000; {* trade capital, 0 = points only *}
  {* long side formulas *}
Pp:=1; {* long position size fml *}
N:= Fml("Entry Binary"); {enter long}
Ns:=0;
X:= Fml("Exit Binary"); {close long}
Xs:=0;
  {* use 'Xs' with caution when Xo<5 *}
  {* short side formulas *}
Ps:=1 {* short position size fml *};
M:= Fml("Exit Binary"); {sell short}
Ms:=0;
Y:= Fml("Entry Binary"); {buy to cover}
Ys:=0;
  {* use 'Ys' with caution when Xo<5 *}
  {* end of user area *}
N:=N AND Alert(N=0,2);
X:=If(Xo<5,X AND Alert(X=0,2),0);
N:=If(Nd=0,N,Alert(N,Nd+1) AND Alert(N,Nd)=0);
X:=If(Xd=0,X,Alert(X,Xd+1) AND Alert(X,Xd)=0);
M:=M AND Alert(M=0,2);
Y:=If(Xo<5,Y AND Alert(Y=0,2),0);
M:=If(Nd=0,M,Alert(M,Nd+1) AND Alert(M,Nd)=0);
Y:=If(Xd=0,Y,Alert(Y,Xd+1) AND Alert(Y,Xd)=0);
I:=Cum((M+Ms+N+Ns+X+Xs+Y+Ys)>-1)=1;
I:=ExtFml("E.SetVar","I",I); I:=ExtFml("E.SetVar","N",N);
I:=ExtFml("E.SetVar","X",X); I:=ExtFml("E.SetVar","Cn",Cn);
I:=ExtFml("E.SetVar","Cp",Cp); I:=ExtFml("E.SetVar","Cx",Cx);
I:=ExtFml("E.SetVar","Nd",Nd); I:=ExtFml("E.SetVar","No",No);
I:=ExtFml("E.SetVar","Ns",Ns); I:=ExtFml("E.SetVar","Pp",Pp);
I:=ExtFml("E.SetVar","Xd",Xd); I:=ExtFml("E.SetVar","Xo",Xo);
I:=ExtFml("E.SetVar","Xs",Xs); I:=ExtFml("E.SetVar","M",M);
I:=ExtFml("E.SetVar","Y",Y); I:=ExtFml("E.SetVar","Ms",Ms);
I:=ExtFml("E.SetVar","Ps",Ps); I:=ExtFml("E.SetVar","Ys",Ys);
Fml("Trade Equity GVE Long");


  {Trade Equity GVE Long} {V4.0 Equal}
  {2002 Roy Larsen, rlarsen@xxxxxxxxxxxxxx}
Nd:=ExtFml("E.GetVar","Nd"); Xd:=ExtFml("E.GetVar","Xd");
No:=ExtFml("E.GetVar","No"); Xo:=ExtFml("E.GetVar","Xo");
Cp:=ExtFml("E.GetVar","Cp"); Cn:=ExtFml("E.GetVar","Cn");
Cx:=ExtFml("E.GetVar","Cx"); Pp:=ExtFml("E.GetVar","Pp");
N:= ExtFml("E.GetVar","N"); Ns:=ExtFml("E.GetVar","Ns");
X:= ExtFml("E.GetVar","X"); Xs:=ExtFml("E.GetVar","Xs");
I:= ExtFml("E.GetVar","I");
Pp:=If(Pp=0,1,Pp); Ns:=If(No=5,Ns,0);
Np:=If(Ns>0,Ns,If(No=1,O,If(No=3,H,If(No=4,L,C))));
Pp:=ValueWhen(1,(N+Ns)>0 OR Cum((N+Ns)>-1),Pp);
N:=If(No=5 AND Ns>0,1,If(No<5,N,0));
Xp:=If(Xs>0,Min(H,Max(L,Xs)),If(Xo=1,O,If(Xo=3,H,If(Xo=4,L,C))));
X:=If(Xs>0,1,X);
Xp:=If(Xo<5 AND No=5 AND X=0,C,Xp);
Xp:=If(Xs>0 AND N AND X,Xs,Xp);
Xp:=If(Ref(N AND X,-1),Ref(Xp,-1),Xp);
Tr:=BarsSince(I+N)<BarsSince(I+X);
Tr:=If(N+X>1 AND (Alert(Tr,2) OR (Nd+Xd<1 AND
No<>2 AND Xo>1 AND (Max(No,Xo)>4 OR No<>Xo))),1, Tr);
En:=(Tr AND Alert(Tr=0,2)) OR I;
Ex:=Tr=0 AND Alert(Tr,2); Np:=If(I AND N=0,C,Np);
Lb:=(Alert(Tr,2)) AND LastValue(Cum(1)-0)=Cum(1);
Ea:=ValueWhen(1,En,If(No=5 AND N AND X,Np,Max(O,Np)));
Ea:=If(No<5,ValueWhen(1,En,Np),Ea);
Pp:=ValueWhen(1,En,If(Pp<1,Cp*Pp,If(Pp>1, (Ea*Pp)+Cn,Cp)));
En:=Tr AND Alert(Tr=0,2);
N:=If(Ex OR Lb,If(Cp=0,Xp-Ea-Cn-Cx,(Pp-Cn)* (Xp/Ea)-Pp-If(Ex,Cx,0)),0);
No:=If(Alert(Tr,2),1+BarsSince(En OR I),0);
Xs:=If(Alert(Tr,2),If(Cp=0,Xp-Ea,(Pp-Cn)* (Xp/Ea)-Pp-If(Ex,Cx,0)),0);
Nd:=LowestSince(1,I,Xs); Ns:=HighestSince(1,I,Xs);
X:=Cum(If((Ex OR Lb) AND N> 0,No,0));
Xd:=Cum(If((Ex OR Lb) AND N<=0,No,0));
I:=ExtFml("L.SetVar","Eq",Cum(N)+If(Tr AND
Lb=0,If(Cp=0,Xp-Ea-Cn,(Pp-Cn)*(Xp/Ea)-Pp),0));
I:=ExtFml("L.SetVar","N",N); I:=ExtFml("L.SetVar","X",X);
I:=ExtFml("L.SetVar","En",En); I:=ExtFml("L.SetVar","Ex",Ex);
I:=ExtFml("L.SetVar","Lb",Lb); I:=ExtFml("L.SetVar","Nd",Nd);
I:=ExtFml("L.SetVar","Ns",Ns); I:=ExtFml("L.SetVar","Tr",Tr);
I:=ExtFml("L.SetVar","Xd",Xd); I:=ExtFml("L.SetVar","Xs",Xs);
Fml("Trade Equity GVE Short");


  {Trade Equity GVE Short} {V4.0 Equal}
  {2002 Roy Larsen, rlarsen@xxxxxxxxxxxxxx}
Nd:=ExtFml("E.GetVar","Nd"); Xd:=ExtFml("E.GetVar","Xd");
No:=ExtFml("E.GetVar","No"); Xo:=ExtFml("E.GetVar","Xo");
Cp:=ExtFml("E.GetVar","Cp"); Cn:=ExtFml("E.GetVar","Cn");
Cx:=ExtFml("E.GetVar","Cx"); Pp:=ExtFml("E.GetVar","Ps");
N:= ExtFml("E.GetVar","M"); Ns:=ExtFml("E.GetVar","Ms");
X:= ExtFml("E.GetVar","Y"); Xs:=ExtFml("E.GetVar","Ys");
I:= ExtFml("E.GetVar","I");
Pp:=If(Pp=0,1,Pp); Ns:=If(No=5,Ns,0);
Np:=If(Ns>0,Ns,If(No=1,O,If(No=3,H,If(No=4,L,C))));
Pp:=ValueWhen(1,(N+Ns)>0 OR Cum((N+Ns)>-1),Pp);
N:=If(No=5 AND Ns>0,1,If(No<5,N,0));
Xp:=If(Xs>0,Min(H,Max(L,Xs)), If(Xo=1,O,If(Xo=3,H,If(Xo=4,L,C))));
X:=If(Xs>0,1,X);
Xp:=If(Xo<5 AND No=5 AND X=0,C,Xp);
Xp:=If(Xs>0 AND N AND X,Xs,Xp);
Xp:=If(Ref(N AND X,-1),Ref(Xp,-1),Xp);
Tr:=BarsSince(I+N)<BarsSince(I+X);
Tr:=If(N+X>1 AND (Alert(Tr,2) OR (Nd+Xd<1 AND
No<>2 AND Xo>1 AND (Max(No,Xo)>4 OR No<>Xo))),1, Tr);
En:=(Tr AND Alert(Tr=0,2)) OR I;
Ex:=Tr=0 AND Alert(Tr,2); Np:=If(I AND N=0,C,Np);
Lb:=(Alert(Tr,2)) AND LastValue(Cum(1)-0)=Cum(1);
Ea:=ValueWhen(1,En,If(No=5 AND N AND X,Np,Min(O,Np)));
Ea:=If(No<5,ValueWhen(1,En,Np),Ea);
Pp:=ValueWhen(1,En,If(Pp<1,Cp*Pp,If(Pp>1, (Ea*Pp)+Cn,Cp)));
En:=Tr AND Alert(Tr=0,2);
N:=If(Ex OR Lb,If(Cp=0,Ea-Xp-Cn-Cx,(Pp-Cn)* ((Ea-Xp)/Ea)-Cn-If(Ex,Cx,0)),0);
No:=If(Alert(Tr,2),1+BarsSince(En OR I),0);
Xs:=If(Alert(Tr,2),If(Cp=0,Ea-Xp,(Pp-Cn)* ((Ea-Xp)/Ea)-Cn-If(Ex,Cx,0)),0);
Nd:=LowestSince(1,I,Xs); Ns:=HighestSince(1,I,Xs);
X:=Cum(If((Ex OR Lb) AND N> 0,No,0));
Xd:=Cum(If((Ex OR Lb) AND N<=0,No,0));
ExtFml("L.GetVar","Eq")+Cum(N)+Cp+If(Tr AND Lb=0
,If(Cp=0,Ea-Xp-Cn,(Pp-Cn)*((Ea-Xp)/Ea)-Cn),0);
I:=ExtFml("S.SetVar","N",N); I:=ExtFml("S.SetVar","X",X);
I:=ExtFml("S.SetVar","Cn",Cn); I:=ExtFml("S.SetVar","Cp",Cp);
I:=ExtFml("S.SetVar","Cx",Cx); I:=ExtFml("S.SetVar","En",En);
I:=ExtFml("S.SetVar","Ex",Ex); I:=ExtFml("S.SetVar","Lb",Lb);
I:=ExtFml("S.SetVar","Nd",Nd); I:=ExtFml("S.SetVar","Ns",Ns);
I:=ExtFml("S.SetVar","Tr",Tr); I:=ExtFml("S.SetVar","Xd",Xd);
I:=ExtFml("S.SetVar","Xs",Xs);







------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/