短中顶:=(XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5+((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;
短中底:=(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14))/4-((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;
中顶:=(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4*2.03-(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4,LINETHICK2,COLORRED;中底:=(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4*1.97-(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4,LINETHICK2,COLORRED;
长顶:=(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3*2.08-(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3,LINETHICK2,COLORYELLOW;长底:=(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3*1.92-(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3,LINETHICK2,COLORYELLOW;
波段顶:=(XMA(XMA(H,120),120)-XMA(XMA(L,120),120))*4+XMA(XMA(H,120),120);
波段底:=XMA(XMA(L,120),120)-(XMA(XMA(H,120),120)-XMA(XMA(L,120),120))*4;
AF长:=EMA((CLOSE+HIGH+LOW)/3,18);
BF长:=REF(AF长,1);
AF中:=EMA((CLOSE+HIGH+LOW)/3,10);
BF中:=REF(AF中,1);
AF5:=EMA((CLOSE+HIGH+LOW)/3,6);
BF5:=REF(AF5,1);AF3:=EMA((CLOSE+HIGH+LOW)/3,3);
BF3:=REF(AF3,1);
买入定位:=AF长>BF长 OR AF中>BF中 OR AF5>BF5 OR AF3>BF3;
卖出定位:=AF长
加仓定位1:=卖出定位=1 AND 中中顶>中顶;
加仓定位2:=顶底定位=1 AND H>中中顶 AND H>中顶;
中中中>=EMA中中中 AND CROSS(AF中,BF中) AND 短中底<中中底;