DIFF:=EMA(CLOSE,3)-EMA(CLOSE,8);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
LOWV:=LLV(LOW,9);
HIGHV:=HHV(HIGH,9);
RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,3);
K:=EMA(RSV,3);
D:=MA(K,3);
KD金叉:=K<=50 AND D<=50 AND CROSS(K,D);
N:=83;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
cci上穿:=CROSS(CCI,-100);
GZ:底背离 AND KD金叉 AND CCI上穿;
九毛八公式解读
DIFF赋值:收盘价的3日指数移动平均-收盘价的8日指数移动平均 DEA赋值:DIFF的9日指数移动平均 MACD赋值:2*(DIFF-DEA) A1赋值:上次1日前的DIFF上穿DEA距今天数 底背离赋值:A1+1日前的收盘价>收盘价 AND DIFF>A1+1日前的DIFF AND DIFF上穿DEA LOWV赋值:9日内最低价的最低值 HIGHV赋值:9日内最高价的最高值 RSV赋值:(收盘价-LOWV)/(HIGHV-LOWV)*100的3日指数移动平均 K赋值:RSV的3日指数移动平均 D赋值:K的3日简单移动平均 KD金叉赋值:K<=50 AND D<=50 AND K上穿D N赋值:83 TYP赋值:(最高价+最低价+收盘价)/3 CCI赋值:(TYP-TYP的N日简单移动平均)/(0.015*TYP的N日平均绝对偏差) CCI上穿赋值:CCI上穿-100 输出GZ:底背离 AND KD金叉 AND CCI上穿