MA7: MA(C,7);
MA16 : MA(CLOSE,16);
FS:= MA16 + 2*STD(CLOSE,16);
FS1:= MA16 - 2*STD(CLOSE,16);
SJ:=BARSLAST(DATE<>REF(DATE,1) OR BARPOS=1)+1;
SJE:=SJ>=0 AND TIME<=230000 ;
JS:=TIME>=233000;
TJ1:=MA7>MA16 AND C>MA7;
TJ2:=MA7<MA16 AND C<MA7;
CL:=SJE AND C>FS;
CL2:=SJE AND C<FS1;
TJ3:=IF(SJ=1,0,IF(CL,1,IF(CL2,-1,REF(TJ3,1))));
TJ6:=IF(SJ=1,0,IF(REF(TJ6,1)<>1 AND (SJE AND (CL OR (TJ1 AND TJ6=-1))),1,IF(REF(TJ6,1)<>-1 AND (SJE AND (CL2 OR (TJ2 AND TJ3=1))),-1,IF(JS,0,REF(TJ6,1)))));
DRAWICON(REF(TJ6,1)<>1 AND TJ6=1,L,4);
DRAWICON(REF(TJ6,1)<>-1 AND TJ6=-1,H,5);
DRAWTEXT(REF(TJ6,1)=0 AND TJ6=1,L,' 开多');
DRAWTEXT(REF(TJ6,1)=0 AND TJ6=-1,H,' 开空');
DRAWTEXT(REF(TJ6,1)=-1 AND TJ6=1,L,' 平空开多');
DRAWTEXT(REF(TJ6,1)=1 AND TJ6=-1,H,' 平多开空');
DRAWTEXT(REF(TJ6,1)<>0 AND TJ6=0,L,' 收盘平仓');
STICKLINE(TJ6>0,H,MAX(O,C),0,1),COLORRED;
STICKLINE(TJ6>0,MIN(O,C),L,0,1),COLORRED;
STICKLINE(TJ6>0,O,C,4,1),COLORRED;
STICKLINE(TJ6<0,H,L,0,0),COLORGREEN;
STICKLINE(TJ6<0,O,C,4,0),COLORGREEN;
STICKLINE(TJ6=0,H,L,0,0),COLORYELLOW;