Rank: Member
Groups: Registered, Registered Users Joined: 4/15/2009(UTC) Posts: 14
|
now I come up with something like below after several days of hardworking:
{Input}
A1:=18;
A2:=18;
{Section}
B1:=C>Mov(c,a1,e);
B2:=Min(Min(Mov(C,3,E),Mov(C,5,E)),Min(Min(Mov(C,8,E),Mov(C,10,E)),Min(Mov(C,12,E),Mov(C,15,E)))) > Mov(C,100,E);
C1:=C<Mov(c,a2,e);
C2:=Max(Max(Mov(C,3,E),Mov(C,5,E)),Max(Max(Mov(C,8,E),Mov(C,10,E)),Max(Mov(C,12,E),Mov(C,15,E)))) < Mov(C,100,E);
Var1:=If(Ref(ROC(DayOfWeek(),1,$)=0,1) AND
b1 AND b2,1,If(Ref(ROC(DayOfWeek(),1,$)=0,1) AND
c1 AND c2,-1,0) );
EL:=var1=1;
CL:=cross(mov(c,45,e),L);
ES:=var1=-1;
CS:= cross(H,mov(c,45,e));
State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV))));
Buy:=State=1 AND Ref(State,-1)<1;
Buyprice:=valuewhen(1,buy=1,c);
now the problem is I can only capture the buy entry price but once I add it into my "CL:=" (as i also want to exit whenever price is below 100 points of the buy entry price),
it does not work what I expect.
Where is the error?
Can someone kindly give me a hand ?
|