前段时间小新将自用的macd选股公式源码登出,迎来了许多拍砖,哈哈。。。
很多同学短信给小新,要求将小新自用的macd源码放出,为庆祝国庆小新现将
源码发放,以满足部分同学的要求。其实该指标也不是什么“神马”,只是小新自
用的一个指标,该指标只不过有顶底背离提示和几次金叉提示罢了,金叉提示最
多可显示九次,当然你要显示n次也行,小新觉得没必要,九次后再有金叉就视
为第一次了,图形小新也略作修改,显得美观一些。总之一句话,就是很实用!好,
废话少说,现将源码奉上:
diff:ema(close,12)-ema(close,26);
dea:ema(diff,9);
macd:2*(diff-dea),colorstick;
stickline(macd<ref(macd,1) and macd>0,0,macd,0,0),colorgreen;
stickline(macd>ref(macd,1) and macd<0,0,macd,0,0),colormagenta;
jccount:=count(cross(diff,dea),barslast(dea>=0));
金叉:=cross(diff,dea) and dea<0 and count(jccount=1,21)=1;
stickline(金叉,0,0.1,5,0),color0000ff;
drawtext(金叉,-0.095,'金叉'),color0000ff;
二金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;
stickline(二金叉,0,0.15,5,0),colorlired;
drawtext(二金叉,0.23,'二次金叉'),colorlired;
三金叉:=cross(diff,dea) and dea<0 and count(jccount=3,28)=1;
stickline(三金叉,0,0.2,5,0),colorligreen;
drawtext(三金叉,0.28,'三次金叉'),colorligreen;
四金叉:=cross(diff,dea) and dea<0 and count(jccount=4,28)=1;
stickline(四金叉,0,0.25,5,0),colorcyan;
drawtext(四金叉,0.33,'四次金叉'),colorcyan;
五金叉:=cross(diff,dea) and dea<0 and count(jccount=5,33)=1;
stickline(五金叉,0,0.3,5,0),colorblue;
drawtext(五金叉,0.37,'五次金叉'),colorblue;
六金叉:=cross(diff,dea) and dea<0 and count(jccount=6,33)=1;
stickline(六金叉,0,0.35,5,0),coloryellow;
drawtext(六金叉,0.0.7,'黄金底'),coloryellow;
drawtext(六金叉,0.42,'六次金叉'),coloryellow;
七金叉:=cross(diff,dea) and dea<0 and count(jccount=7,33)=1;
stickline(七金叉,0,0.4,5,0),colorwhite;
drawtext(七金叉,0.0.88,'白金底'),colorwhite;
drawtext(七金叉,0.47,'七次金叉'),colorwhite;
八金叉:=cross(diff,dea) and dea<0 and count(jccount=8,33)=1;
stickline(八金叉,0,0.5,5,0),colormagenta;
drawtext(八金叉,0.0.8,'钻石底'),colormagenta;
drawtext(八金叉,0.57,'八次金叉'),colormagenta;
九金叉:=cross(diff,dea) and dea<0 and count(jccount=9,33)=1;
stickline(九金叉,0,0.55,5,0),colorred;
drawtext(九金叉,0.0.8,'金钻底'),colorred;
drawtext(九金叉,0.6,'九次金叉'),colorred;
a1:=barslast(ref(cross(diff,dea),1));
底背离:=(ref(l,a1+1)>l or ref(c,a1+1)>c) and (l,diff)>ref((l,diff),a1+1) and cross(diff,dea);
stickline(底背离,0,-0.1,5,0),colorred;
drawtext(底背离,dea,'底背离')colorred;
drawline(a1=0,dea,底背离,dea,0),color0000ff,linethick3;
a2:=barslast(ref(cross(dea,diff),1));
顶背离:=(ref(c,a2+1)<c or ref(h,a2+1)<h) and ref((h,diff),a2+1)>(h,diff) and cross(dea,diff);
drawline(a2=0,dea,顶背离,dea,0),colorgreen,linethick3;
stickline(顶背离,0,0.1,5,0),colorgreen;
drawtext(顶背离,dea,'顶背离')colorgreen;
drawtext(cross(diff,dea) and 二金叉 and 底背离,0.3,'三全底'),color0000ff;
if(diff>dea,diff,drawnull),colorwhite,linethick2;
if(dea>ref(dea,1) and diff>dea,dea,drawnull),coloryellow,linethick2;
参数还是原券商的参数,原汁原味,小新觉得还是原券商的好,毕竟前辈们
已经用了几十年。其实,小新觉得该版本也没什么特别之处,反觉得小新19
日更新的“底背离金叉选股源码”才是“精华”,
该选股源码蕴含底背离和n次金叉(1次以上)才选出的股票,将选出的股票
配合今天发的的附图源码来看盘,应该说是不错的选择。该选股源码是小新
经过数夜的大胆设想和构思,小心求证的出来的,当然,近段时间大盘行情
不佳,任何神马都是浮云!若是牛市行情应能选出不错的股票或牛股来!大
家若觉得好,请多多顶一下,欢迎拍砖!顺祝大家国庆节快乐!
【好公式网提示:公式虽然用了未来,但是这确实是好公式,不懂未来函数用法的和惧怕未来函数的人勿下】
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文国庆奉献2—MACD神马版TDX附图指标下载 通达信附图源码仅供学习研究。