DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA),LINETHICK0;
A1:=DIFF<0 AND DEA<0;
A2:=A1>REF(A1,1);
A3:=BArslAst(A2);
A4:=COUNT(DEA>0 AND DIFF>0,A3)=0;
A5:=CROSS(DIFF,DEA);{金叉}
A6:=BARSLAST(A5);
A7:=REF(A6,A6+1)+A6;
A8:=(DIFF+DEA)/2;
A9:=(HIGH+LOW)/2;
A10:=A5 AND A7<A3 AND A4 AND A8>REF(A8,A7) AND A9<REF(A9,A7) AND macd>0;
金叉介入:A10;
九毛八公式解读
DIFF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均 DEA赋值:DIFF的9日指数移动平均 MACD赋值:2*(DIFF-DEA),线宽为0 A1赋值:DIFF<0 AND DEA<0 A2赋值:A1>1日前的A1 A3赋值:上次A2距今天数 A4赋值:统计A3日中满足DEA>0ANDDIFF>0的天数=0 A5赋值:DIFF上穿DEA A6赋值:上次A5距今天数 A7赋值:A6+1日前的A6+A6 A8赋值:(DIFF+DEA)/2 A9赋值:(最高价+最低价)/2 A10赋值:A5 AND A7A7日前的A8 AND A90 输出金叉介入:A10