源码
MA5: MA(close,5);
MA10: MA(close,10);
MA60:MA(close,60);
pday1 := barslast(cross(ma5,ma60));{5日均线上穿60日均线}
pday2 := barslast(cross(ma10,ma60));{10日均线上穿60日均线,至此形成鸭颈部}
pday3 := barslast(high=hhv(high,pday2));{形成头部,要下跌}
pday4 := barslast(cross(ma10,ma5));{下跌后,5日均线和10日均线死叉}
pday5 := barslast(cross(ma5,ma10));{回落不久,5日均线和10日均线形成金叉,形成部}
a1:= pday1>pday2 and pday2>pday3 and pday3>pday4 and pday4>pday5 and pday5<5;
a2:= count(cross(ma10,ma5),pday2)=1;
aa:=if(A1 AND A2 and ma(c,5)>=ma(c,10) and ma(c,10)>ma(c,60),10,0),;
bb:=FILTER( A1 AND A2 and ma(c,5)>=ma(c,10) and ma(c,10)>ma(c,60),5);
老鸭头:if(aa and bb,1,0),color00ff00;
drawicon(aa and bb ,low,1);
drawtext(aa and bb ,low*0.98,'老鸭头'),coloryellow;