MACD金叉次数标注,及逐次选股,源码分享 用综合选股,可以做到下面的选股 零上第一次金叉选股
零上第二次金叉选股
零上第三次金叉选股
零下第一次金叉选股
零下第二次金叉选股
零下第三次金叉选股
{MACD金叉}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORBROWN;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORLIRED;
DIF升:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK1;
JCCOUNT1:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
零下金叉:CROSS(DIF,DEA) AND DIF<0.0 AND COUNT(JCCOUNT1=1,21)=1,NODRAW,COLORGREEN;
STICKLINE(零下金叉,0,DEA,0.0,0),COLORGREEN;
DRAWTEXT(零下金叉,DEA/2,' 零下一'),COLORGREEN;
零下二次:CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT1=2,21)=1,NODRAW,COLORGREEN;
STICKLINE(零下二次,0,DEA,0.0,0),,COLORGREEN;
DRAWTEXT(零下二次,DEA/2,' 零下二'),COLORGREEN;
零下三次:CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT1=3,21)=1,NODRAW,COLORGREEN;
STICKLINE(零下三次,0,DEA,0.0,0),COLORGREEN;
DRAWTEXT(零下三次,DEA/2,' 零下三'),COLORGREEN;
零下四次:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT1=4,21)=1,NODRAW,COLORGREEN;
STICKLINE(零下四次,0,DEA,0.0,0),,COLORGREEN;
DRAWTEXT(零下四次,DEA/2,' 零下四'),COLORGREEN;
零下五次:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT1=5,21)=1,NODRAW,COLORGREEN;
STICKLINE(零下五次,0,DEA,0.0,0),COLORGREEN;
DRAWTEXT(零下五次,DEA/2,' 零下五'),COLORGREEN;
JCCOUNT2:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA<=0));
零上金叉:CROSS(DIF,DEA) AND DIF>0.0 AND COUNT(JCCOUNT2=1,21)=1,NODRAW,COLORMAGENTA;
STICKLINE(零上金叉,0,DEA,0.0,0),COLORMAGENTA;
DRAWTEXT(零上金叉,DEA/2,'零上一 '),COLORMAGENTA;
零上二次:CROSS(DIF,DEA) AND DEA>0 AND COUNT(JCCOUNT2=2,21)=1,NODRAW,,COLORMAGENTA;
STICKLINE(零上二次,0,DEA,0.0,0),COLORMAGENTA;
DRAWTEXT(零上二次,DEA/2,' 零上二'),COLORMAGENTA;
零上三次:CROSS(DIF,DEA) AND DEA>0 AND COUNT(JCCOUNT2=3,21)=1,NODRAW,COLORMAGENTA;
STICKLINE(零上三次,0,DEA,0.0,0),COLORMAGENTA;
DRAWTEXT(零上三次,DEA/2,' 零上三'),COLORMAGENTA;
零上四次:=CROSS(DIF,DEA) AND DEA>0 AND COUNT(JCCOUNT2=4,21)=1,NODRAW,COLORMAGENTA;
STICKLINE(零上四次,0,DEA,0.0,0),COLORMAGENTA;
DRAWTEXT(零上四次,DEA/2,' 零上四'),COLORMAGENTA;
零上五次:=CROSS(DIF,DEA) AND DEA>0 AND COUNT(JCCOUNT2=5,21)=1,NODRAW,COLORMAGENTA;
STICKLINE(零上五次,0,DEA,0.0,0),COLORMAGENTA;
DRAWTEXT(零上五次,DEA/2,' 零上五'),COLORMAGENTA;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA) AND DEA<0;
STICKLINE(底背离,0,0.03,3,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,DEA,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;
DRAWTEXT(顶背离,DEA,' 顶背离'),COLORGREEN;
DRAWTEXT(零下金叉 AND 零下二次 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;
{分析家公式网 WWW.fxjgsw.com 整理}
{费数}
JC:=CROSS(DIF,DEA),NODRAW;
TJ:=SUMBARS(JC,1),NODRAW;
SC:=CROSS(DEA,DIF),NODRAW;
TS:=SUMBARS(SC,1),NODRAW;
F:=0.1;{分析家公式网 整理}
DRAWTEXT(JC,-F,'1'),COLORMAGENTA;
DRAWTEXT(TJ=3 AND MACD>0,-F,'3'),COLORMAGENTA;
DRAWTEXT(TJ=5 AND MACD>0,-F,'5'),COLORMAGENTA;
DRAWTEXT(TJ=8 AND MACD>0,-F,'8'),COLORMAGENTA;
DRAWTEXT(TJ=13 AND MACD>0,-F,'13'),COLORMAGENTA;
DRAWTEXT(TJ=21 AND MACD>0,-F,'21'),COLORMAGENTA;
DRAWTEXT(TJ=34 AND MACD>0,-F,'34'),COLORMAGENTA;
DRAWTEXT(TJ=55 AND MACD>0,-F,'55'),COLORMAGENTA;
DRAWTEXT(SC,F,'1'),COLORGREEN;
DRAWTEXT(TS=3 AND MACD<0,F,'3'),COLORGREEN;
DRAWTEXT(TS=5 AND MACD<0,F,'5'),COLORGREEN;
DRAWTEXT(TS=8 AND MACD<0,F,'8'),COLORGREEN;
DRAWTEXT(TS=13 AND MACD<0,F,'13'),COLORGREEN;
DRAWTEXT(TS=21 AND MACD<0,F,'21'),COLORGREEN;
DRAWTEXT(TS=34 AND MACD<0,F,'34'),COLORGREEN;
DRAWTEXT(TS=55 AND MACD<0,F,'55'),COLORGREEN;
|
评论内容只代表网友观点,与本站立场无关!
本网提供的公式文件说明:
* alg格式飞狐股票公式,可以用飞狐交易师或者交易师软件导入;
* fnc格式大智慧新一代公式指标,可以用大智慧股票软件使用,少部分可以用分析家股票软件引入使用;
* exp格式大智慧经典版股票公式,仅可以用大智慧经典版股票软件引入使用;
* tni和tnc格式通达信股票公式,仅可以用通达信新引入使用,例如可以用通达信股票软件引入使用;
* tne,tn6格式通达信公式,可以用通达信公式编辑器5.0版导入,推荐通达信金融终端版本;
* hxf格式同花顺股票公式,仅可以用同花顺股票软件引入使用。
以上的各种软件都可以在本网股票软件栏目找到!
* 关于股票公式时间限制,如果在引入大智慧公式,交易师公式或者飞狐公式的时候,发现公式名称栏是空白的,这时候调整电脑时间到1997年,又能出现公式名称,并且能正常显示,可能是公式使用期限已过。
* 关于还原公式源码如果你忘记了自己编写的大智慧公式,通达信公式,同花顺公式,操盘手公式,飞狐公式,博易大师公式,金字塔公式,文华公式和交易师公式等等公式的密码,本网可帮恢复源码,有.偿.服.务无意勿扰,点击在线咨询联系我。
* 关于股票公式源码编辑
本网提供的源码,一般都可以编辑成公式,如果不明白公式的编辑,在本页右侧教程录像可参考,或者找公式教程资料学习,请搜索:教程
* 如果您发现软件内容或者链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含源码均是由网上搜集,若侵犯了你的版权利益,请联系通知我们!