网友求助:
老师给编个 KD取值(8 3 3)发生金叉二天内
MACD取值(8 17 9)DIFF与DEA 也发生 金叉,但要在0轴线上的金叉的 组合预警选股公式。
对公式编写一窍不通啊
解答如下:
DIFF :=EMA(CLOSE,8) - EMA(CLOSE,17),;
DEA :=EMA(DIFF,9);
MACD :=2*(DIFF-DEA);
RSV:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
TT:=BARSLAST(CROSS(K,D));
XG:IF(TT<=2,SUM(CROSS(DIFF,DEA) AND DIFF>0 AND DEA>0,TT)=1,0);