J:="KDJ.J";D:="KDJ.D";
SG:=J>REF(J,1) AND REF(J,1)[
XG:=REF(J,1)>REF(J,2) AND REF(J,1)>J;XN:=BARSLAST(XG);]
NS:=XN+REF(SN,XN)+1;NX:=SN+REF(XN,SN)+1;
NU1:=CROSS(J,D) AND REF(J,SN)>REF(J,NS) AND REF(J,SN)<50;
NU2:=CROSS(D,J) AND REF(J,XN)[50;]
买入:NU1 OR NU2;