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:CURRBARSCOUNT=CONST(ZD)+1;