520量化编程
标题:
通达信公式编写第108课——MACD于均线配合抓行情启动点
[打印本页]
作者:
520量化编程
时间:
2024-10-8 14:33
标题:
通达信公式编写第108课——MACD于均线配合抓行情启动点
[mine_video type="m3u8" vid="第01集$https://video.520lhjy.com/sv/3e93aa94-1926abf036c/3e93aa94-1926abf036c.mp4" score="0" scoretp="1" tvurl=""][/mine_video]
源码文件下载导入即可:[attach]4649[/attach]
源码代码:
MA60:=MA(C,60);
MA5:=MA(C,5);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
均线金叉位置:=BARSLAST(CROSS(MA5,MA60));
DEA金叉距离:=BARSLAST(CROSS(DEA,0));
XH1:=C>MA60
AND COUNT(C<MA60,均线金叉位置)<=2
AND COUNT(C<MA60,均线金叉位置)>=1
AND C>MA5
AND MACD>REF(MACD,1)
AND REF(MACD,1)<REF(MACD,2)
AND DEA金叉距离<均线金叉位置
AND COUNT(DEA>0 AND DIF>0,DEA金叉距离)=DEA金叉距离
AND 均线金叉位置>=1
AND COUNT(CROSS(DEA,0),均线金叉位置)=1
;
XH:XH1
AND COUNT(XH1,DEA金叉距离)=1;
复制代码
欢迎光临 520量化编程 (https://520lhjy.com/)
Powered by Discuz! X3.4