DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=(DIFF-DEA)*2;
B:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背:REF(H,B+1)<H AND DIFF<REF(DIFF,B+1) AND CROSS(DEA,DIFF);
看 股吧公式 www.kan guba.com
[源码翻译]通达信公式动态翻译显示
DIFF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均
DEA赋值:DIFF的9日指数移动平均
MACD赋值:(DIFF-DEA)*2
B赋值:上次1日前的DEA上穿DIFF距今天数
输出顶背:B+1日前的最高价<最高价 AND DIFF<B+1日前的DIFF AND DEA上穿DIFF