您现在的位置:程序化交易>> 股票公式>> 同花顺>> 同花顺公式>>正文内容

同花顺MACD多周期副图指标公式[同花顺公式]

相关标签: 变色macd源码 、 macd顶底背离指标源码 、 macd二次金叉指标源码 、 通达信macd实战源码 、 macd在0轴附近源码 、 量价macd源码 、 缠论macd指标源码 、 macd指标源码 、 文华变色macd源码 、

 

同花顺MACD多周期副图指标公式

VERTLINE(HOUR=15),POINTDOT,color4900;
重心:=(CLOSE+0.618*ref(CLOSE,1)+0.382*ref(CLOSE,2)+0.236*ref(CLOSE,3)+0.146*ref(CLOSE,4))/2.382;
GAO:=HHV(CLOSE,60)-LLV(CLOSE,60);
RSI:=(SMA(MAX(重心-ref(重心,1),0),5,1))/(SMA(ABS(重心-ref(重心,1)),5,1));
指导线:=重心+GAO*(RSI-0.5);
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=1*(DIFF-DEA);//程序化交易 www.cxh99.com //
FILLRGN(MACD>0,MACD,0),color80;
FILLRGN(MACD>0 AND MACD<ref(MACD,1),MACD,0),color6900;
FILLRGN(MACD<0,MACD,0),color5900;
STICKLINE(MACD>=0 AND DIFF<ref(DIFF,1),0,MACD,3,0),LINETHICK2,color6900;
DRAWICON(DIFF>ref(DIFF,1),DIFF,10),ALIGN4;
DRAWICON(DIFF<ref(DIFF,1),DIFF,11),ALIGN5;
DIFF60:"MACD选股用.DIFF#min60",LINETHICK0;
DEA60:="MACD选股用.DEA#min60";
DIFF15:"MACD选股用.DIFF#min30",LINETHICK0;
DEA15:="MACD选股用.DEA#min15";
总股【亿】:FINANCE(1)/10000,LINETHICK0,colorFF00;
流通【亿】:CAPITAL/1000000,LINETHICK0,colorFFFF00;
收益:FINANCE(33),LINETHICK0,colorFFFFFF;
市盈率:DYNAINFO(39),LINETHICK0;
0,colorFF00;
PARTLINE(指导线>ref(指导线,1),0),LINETHICK3,colorFF;
PARTLINE(DIFF<=ref(DIFF,1),DIFF),LINEDOT,LINETHICK1,colorFF00;
PARTLINE(DIFF>ref(DIFF,1) AND DIFF>0,DIFF),LINETHICK3,colorFF;
PARTLINE(DIFF>ref(DIFF,1) AND DIFF<0,DIFF),LINETHICK3,colorFF;
PARTLINE(DIFF60>ref(DIFF60,1),DIFF*1.15),LINETHICK1,colorFFFF;
PARTLINE(DIFF60<ref(DIFF60,1),DIFF*1.15),LINETHICK2,colorFF0000;
PARTLINE(DIFF15>ref(DIFF15,1),DIFF*0.75),LINETHICK1,colorFF00FF;
PARTLINE(DIFF15<ref(DIFF15,1),DIFF*0.75),LINETHICK2,colorFFA800; //文章来至程序化交易网 cxh99.com//

 

 

 

 

=====================================

 

源码解析:

VERTLINE(小时=15),POINTDOT,COLOR4900
重心赋值:(收盘价+0.618*昨收+0.382*2日前的收盘价+0.236*3日前的收盘价+0.146*4日前的收盘价)/2.382
GAO赋值:60日内收盘价的最高值-60日内收盘价的最低值
RSI赋值:(重心-昨日重心和0的较大值的5日[1日权重]移动平均)/(重心-昨日重心的绝对值的5日[1日权重]移动平均)
指导线赋值:重心+GAO*(RSI-0.5)
DIFF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均
DEA赋值:DIFF的9日指数移动平均
MACD赋值:1*(DIFF-DEA)
//程序化交易 WWW.CXH99.COM //FILLRGN(MACD>0,MACD,0),COLOR80
FILLRGN(MACD>0 AND MACD<昨日MACD,MACD,0),COLOR6900
FILLRGN(MACD<0,MACD,0),COLOR5900
当满足条件MACD>=0ANDDIFF<昨日DIFF时,在0和MACD位置之间画柱状线,宽度为3,0不为0则画空心柱.,线宽为2,COLOR6900
当满足条件DIFF>昨日DIFF时,在DIFF位置画10号图标,ALIGN4
当满足条件DIFF<昨日DIFF时,在DIFF位置画11号图标,ALIGN5
输出DIFF60:"MACD选股用.DIFF[取60分钟数据]",线宽为0
DEA60赋值:"MACD选股用.DEA[取60分钟数据]"
输出DIFF15:"MACD选股用.DIFF[取30分钟数据]",线宽为0
DEA15赋值:"MACD选股用.DEA[取15分钟数据]"
输出总股【亿】:总股本(股)/10000,线宽为0,COLORFF00
输出流通【亿】:当前流通股本(手)/1000000,线宽为0,COLORFFFF00
输出收益:每股收益(全年折?线宽为0,COLORFFFFFF
输出市盈率:市盈率(动),线宽为0
0,COLORFF00
PARTLINE(指导线>昨日指导线,0),线宽为3,COLORFF
PARTLINE(DIFF<=昨日DIFF,DIFF),LINEDOT,线宽为1,COLORFF00
PARTLINE(DIFF>昨日DIFF AND DIFF>0,DIFF),线宽为3,COLORFF
PARTLINE(DIFF>昨日DIFF AND DIFF<0,DIFF),线宽为3,COLORFF
PARTLINE(DIFF60>昨日DIFF60,DIFF*1.15),线宽为1,COLORFFFF
PARTLINE(DIFF60<昨日DIFF60,DIFF*1.15),线宽为2,COLORFF0000
PARTLINE(DIFF15>昨日DIFF15,DIFF*0.75),线宽为1,COLORFF00FF
PARTLINE(DIFF15<昨日DIFF15,DIFF*0.75),线宽为2,COLORFFA800
 //文章来至程序化交易网 CXH99.COM//
 

 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容