Rank: Member
Groups: Registered, Registered Users Joined: 10/6/2005(UTC) Posts: 26
|
Patrick,
TQ for your quick reply and willingness to take a shot at this problem. Anyway, I have tried your new coding for LE and SE, but still failed in one (1) specific area. That is when LE is active (LX yet to be triggered) and SE signal was also trigger, the new coding removes both signals from the Expert system. I include the chart for easy reference and some remarks on the chart.
LONG ENTRY (LE)
LE:=C>LinearReg(C,12) AND Qstick(10)>0;
LX:=C<Ref(LLV(L,3),-1);
SE:=C<LinearReg(C,12) AND Qstick(10)<0;
SX:=C>Ref(HHV(H,3),-1);
B:= ExtFml("ForumDll.Latch",LE,LX,SE,SX);
B = 1 AND Ref(B,-1) =0
LONGEXIT (LX)
LE:=C>LinearReg(C,12) AND Qstick(10)>0;
LX:=C<Ref(LLV(L,3),-1);
SE:=C<LinearReg(C,12) AND Qstick(10)<0;
SX:=C>Ref(HHV(H,3),-1);
B:= ExtFml("ForumDll.Latch",LE,LX,SE,SX);
B = 0 AND Ref(B,-1) = 1
SHORTENTRY (SE)
LE:=C>LinearReg(C,12) AND Qstick(10)>0;
LX:=C<Ref(LLV(L,3),-1);
SE:=C<LinearReg(C,12) AND Qstick(10)<0;
SX:=C>Ref(HHV(H,3),-1);
B:= ExtFml("ForumDll.Latch",LE,LX,SE,SX);
B = -1 AND Ref(B,-1) =0
SHORTEXIT(SX)
LE:=C>LinearReg(C,12) AND Qstick(10)>0;
LX:=C<Ref(LLV(L,3),-1);
SE:=C<LinearReg(C,12) AND Qstick(10)<0;
SX:=C>Ref(HHV(H,3),-1);
B:= ExtFml("ForumDll.Latch",LE,LX,SE,SX);
B = 0 AND Ref(B,-1) = 1
This code works fine in all areas other than when the Short/Long Entry (1st position) is still active, and the opposite signal (Long/Short Entry - 2nd position) was triggered without the exit taking place to square off the 1st position. With the new coding, 1st position and 2nd position signals were not triggered at all in the Expert System.
|