Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
[color=red:35d9861f90]Warning - I did this in 5 minutes ....[/color]
Make sure to double check the results etc ....
bc:={your buy condition here};
rv:=Round((C-ValueWhen(1,bc,C))/10);
mu:=If(RV<1,0,rv);
lvl:=ValueWhen(1,bc,C);
If(bc,lvl,If(ROC(mu,1,$)>0,lvl+(10*mu),PREV));
It's not pretty but it should return the stop line, then exit signal would be :
bc:={your buy condition here};
rv:=Round((C-ValueWhen(1,bc,C))/10);
mu:=If(RV<1,0,rv);
lvl:=ValueWhen(1,bc,C);
lin:=If(bc,lvl,If(ROC(mu,1,$)>0,lvl+(10*mu),PREV));
Cross(lin,C)
Etc ...
Patrick
|