N:=11;
M:=6;
距离:=0.18;
CV:=CLOSE;
bbiboll:=(MA(CV,3)+MA(CV,6)+MA(CV,12)+MA(CV,24))/4;
UPR:=BBIBOLL+M*STD(BBIBOLL,N);
DWN:=BBIBOLL-M*STD(BBIBOLL,N);
缩口:=(UPR-DWN)/BBIBOLL<=距离;
拐头:=UPR>REF(UPR,1) AND BBIBOLL>REF(BBIBOLL,1);
XG:REF(缩口,1) AND 拐头;