hello,
I have the following ms code:
yuzde:=Input("yuzde-% of trailing stop",0,100,2);
period:=Input("period",1,100000,3);
a1:=Mov(C,period,E);
a2:=a1-(a1*yuzde/100);
a3:=a1+(a1*yuzde/100);
b1:=If(a1<PREV,a2,Max(a2,PREV));
b2:=If(a1>PREV,a3,Min(a3,PREV));
k1:=Cross(a1,Ref(b2,-1));
k2:=Cross(Ref(b1,-1),a1);
k3:=Cum(k1+k2>-1)=1;
k4:=Cum(k1)=1;s1:=BarsSince(k3 OR k1)
< BarsSince(k3 OR k2)+k4;...
I cant understand k3 and k4. Wont they be meaningful only 1 time?k1 and k2 are
always greater than 0. After the first time slot, k3 is 1 and later on it is
0.k4 is 1 after the first time k1 is 1 and later on it is 0.
Do i miss something?
thanks in advance.