原老鸭头(鹏腾2009版本)指标 主图 通达信 贴图为加密。现公开源码同时加入了选股指标。修正了原公式中死叉在右出现号的错误。
选股中最后一句xg:后可加入=号;
然后再在最后加上下面语句,参数设置中N可根据需要统计最后满足条件的信号天数。
count(xg,n);
{主图}
MA5:MA(C,5),DOTLINE;
MA10:MA(C,10),DOTLINE;
死叉:=BARSLAST(CROSS(MA10,MA5));
金叉:=BARSLAST(CROSS(MA5,MA10));
ZG:=FINDHIGHBARS(H,死叉+1,5,1);
ZD:=FINDLOWBARS(L,金叉+1,5,1);
A:REF(H,BARSLAST(CURRBARSCOUNT=CONST(ZG)+1)),COLORRED;
B:REF(L,BARSLAST(CURRBARSCOUNT=CONST(ZD)+1)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=CONST(ZG)+1,H,'死叉5天前最高'),COLORYELLOW,DRAWABOVE;
DRAWTEXT(CURRBARSCOUNT=CONST(ZD)+1,L,' 金叉5天前最低'),COLORYELLOW,DRAWABOVE;
DRAWTEXT(CURRBARSCOUNT=CONST(死叉)+1,MA5,'死叉'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=CONST(金叉)+1,MA5,'金叉'),COLORRED;
DRAWICON(CONST(ZG) CONST(ZD) AND COUNT(C A,ZG)=1 AND C A AND C/B 1.2,H,1);
{选股}
MA5:=MA(C,5);
MA10:=MA(C,10);
死叉:=BARSLAST(CROSS(MA10,MA5));
金叉:=BARSLAST(CROSS(MA5,MA10));
ZG:=FINDHIGHBARS(H,死叉+1,5,1);
ZD:=FINDLOWBARS(L,金叉+1,5,1);
A:=REF(H,BARSLAST(CURRBARSCOUNT=CONST(ZG)+1));
B:=REF(L,BARSLAST(CURRBARSCOUNT=CONST(ZD)+1));
XG:CONST(ZG) CONST(ZD) AND COUNT(C A,ZG)=1 AND C A AND C/B