WARNING_DISABLE:4;
WARNING_DISABLE:2;
LASTBAR:=ISLASTBAR;CODE:=STKLABEL;
Nvirhold:=STKINDI(CODE,'tmtwo.virhold',0,6,0);
Rvirhold:=REF(Nvirhold,1);
Realhold:=STKINDI(CODE,'tmtwo.ssR',0,6,0);
BJ:=STKINDI(CODE,'tmtwo.BJ',0,6,0);
bkcon:=((Nvirhold>Rvirhold and Nvirhold>0 and Realhold>0) or BJ= 2 or BJ= 3) and LASTBAR;
skcon:=((Nvirhold<Rvirhold and Nvirhold<0 and Realhold>0) or BJ=-2 or BJ=-3) and LASTBAR;
spcon:=((Rvirhold>0 and Nvirhold<Rvirhold) or BJ=-1 or BJ=-3) and LASTBAR; //卖平(全平)
bpcon:=((Rvirhold<0 and Nvirhold>Rvirhold) or BJ= 1 or BJ= 3) and LASTBAR; //买平(全平)
Tsell (spcon,0,MKT,0,0,'','SRX05'),ORDERQUEUE; //多平
Tsellshort(bpcon,0,MKT,0,0,'','SRX05'),ORDERQUEUE; //空平
Tbuy (bkcon and Realhold>0,Realhold,MKT,0,0,'','SRX05'),ORDERQUEUE; //多开
Tbuyshort (skcon and Realhold>0,Realhold,MKT,0,0,'','SRX05'),ORDERQUEUE;//空开