Rank:: Newbie
Groups: Registered Users, Subscribers, Unverified Users Joined: 12/14/2015(UTC) Posts: 6
Thanks: 1 times
|
Hi ,
The following self referencing function with PREV needs a revision to be converted into Valuewhen but I could not figure out how to do it. Difficulty for me is at the sell short order part. Logical OR is not yielding -1.
Please advise a solution.
Thanks in advance
BUY Order
x:=Mov(PDI(14)-MDI(14),10,S);
bset:=Cross(x,Mov(x,10,S));
el:=Cross(C,ValueWhen(1,bset,H)) AND BarsSince(bset)<5;
xl:=ADX(14)>PDI(14);
lt:=If(el,1, If(xl,0,PREV));
Cross(lt,0.5)
SELL Order
x:=Mov(PDI(14)-MDI(14),10,S);
bset:=Cross(x,Mov(x,10,S));
el:=Cross(C,ValueWhen(1,bset,H)) AND BarsSince(bset)<5;
xl:=ADX(14)>PDI(14);
lt:=If(el,1, If(xl,0,PREV));
Cross(0.5,lt)
SELL SHORT Order
x:=Mov(PDI(14)-MDI(14),10,S);
sset:=Cross(Mov(x,10,S),x);
es:=Cross(ValueWhen(1,sset,L),C) AND BarsSince(sset)<5;
xs:=ADX(14)>MDI(14);
st:=If(es,-1,If(xs,0,PREV));
Cross(-0.5,st)
BUY TO COVER ORDER
x:=Mov(PDI(14)-MDI(14),10,S);
sset:=Cross(Mov(x,10,S),x);
es:=Cross(ValueWhen(1,sset,L),C) AND BarsSince(sset)<5;
xs:=ADX(14)>MDI(14);
st:=If(es,-1,If(xs,0,PREV));
Cross(st,-0.5)
|