A=zig(2,5);
fxdd=A>REF(A,1) AND REF(A,2)>REF(A,1);
gDDZ=IF(fxdd,REF(LOW,1),0);
支撑位:=IF(gddz=0,REF(LOW,BArslAST(fxdd)+1),REF(LOW,1));
zcw:=IF(支撑位=REF(支撑位,1),支撑位,DRAWNULL);
B=ZIG(1,5);
fxgd=B<REF(B,1) AND REF(B,2)<REF(B,1);
ggdz=IF(fxgd,REF(HIGH,1),0);
压力位:=IF(ggdz=0,REF(HIGH,BARSLAST(fxgd)+1),REF(HIGH,1));
ylw:=IF(压力位=REF(压力位,1),压力位,DRAWNULL);
scmd1:=BARSLAST((支撑位>REF(支撑位,1)OR 支撑位<REF(支撑位,1)) AND CLOSE>支撑位);
scmd2:=BARSLAST(压力位>REF(压力位,1)OR 压力位<REF(压力位,1));
IF(scmd1<scmd2)
mmsj:LOW-zcw;
ELSE
mmsj:HIGH-ylw;
IF((支撑位>REF(支撑位,1)OR 支撑位<REF(支撑位,1)) AND CLOSE>支撑位)
{
DRAWTEXT(1,-0.2,'介入'),colorred;
VERLINE(1,1),colorred;
}
IF(压力位>REF(压力位,1)OR 压力位<REF(压力位,1))
{
DRAWTEXT(1,0.2,'止盈'),coloryellow;
VERLINE(1,1),coloryellow;
}
IF(mmsj<0 AND REF(mmsj,2)>0 AND scmd2>2)
{
DRAWTEXT(1,0.2,'止损'),coloryellow;
VERLINE(1,1),coloryellow;
}