您现在的位置:程序化交易>> 股票公式>> 通达信>> 通达信公式>>正文内容

优化MACD主图指标公式(通达信公式 主图指标公式 公式、源码 测试图)没未来函数[通达信公式]

相关标签:

 

优化MACD主图,没未来函数优化MACD用法自己体会
{MACD主图}ZIF:=EMA(C,12)-EMA(C,26);ZEA:=EMA(ZIF,9);ZBC:=2*(ZIF-ZEA);ZJS:=1.25*ZIF-0.25*ZEA;ZXH:=(ZJS*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORWHITE;ZPH:=(ZIF*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORYELLOW;ZQS:=(ZEA*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORCYAN;ZNX:=(ZXH+ZQS)/2,COLORMAGENTA;信号:ZXH,COLORFFFFFF,LINETHICK1;平滑:ZPH,COLOR00FFFF,LINETHICK1;牛熊:ZNX,COLORFF00FF,COLORGREEN,LINETHICK2;IF(牛熊>=REF(牛熊,1),牛熊,DRAWNULL),COLOREE00EE,LINETHICK2;趋势:ZQS,COLORFFFF00,LINETHICK1;DRAWKLINE(H,O,L,C);M3A:=MA(CLOSE,3);M13:=MA(CLOSE,13);M34:=MA(CLOSE,34);{生命线:SMA(C,21,1),COLORGREEN,LINETHICK1;}{魔鬼线:MA(CLOSE,321),LINETHICK2,COLORWHITE;}AAAAA:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));BBBBB:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);分水岭:=IF(MA(CLOSE,17)<BBBBB,BBBBB,MA(CLOSE,17)),COLORYELLOW,LINETHICK2;操作线:=分水岭-(EMA(C,6)-分水岭),COLORF0F000,LINETHICK1;STICKLINE(M3A>=M13 AND M34>=REF(M34,1) ,H ,L ,0 ,0 ),COLORRED;{STICKLINE(M3A>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3 ,0 ),COLORRED;STICKLINE(M3A>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3 ,1 ),COLORRED;}STICKLINE(M3A<M13 AND M34>=REF(M34,1) ,H ,L ,0 ,0 ),COLORFFBB00;STICKLINE(M3A<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3 ,0 ),COLORFFBB00;STICKLINE(M3A<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3 ,1 ),COLORFFBB00;STICKLINE(M3A<M13 AND M34<REF(M34,1) ,H ,L ,0 ,0 ),COLORFF0000;STICKLINE(M3A<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3 ,0 ),COLORFF0000;STICKLINE(M3A<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3 ,1 ),COLORFF0000;STICKLINE(M3A>=M13 AND M34<REF(M34,1) ,H ,L ,0 ,0 ),COLORFF00FF;STICKLINE(M3A>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3 ,0 ),COLORFF00FF;STICKLINE(M3A>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3 ,1 ),COLORFF00FF;X00:=(C+H+L)/3;X01:=IFF(CURRBARSCOUNT>1,XMA(X00,3),0.740524*X00+0.35541*REF(X00,1)-0.0316004*REF(X00,2)-0.0374119*REF(X00,3)-0.0218805*REF(X00,4)-0.00386503*REF(X00,5)-0.00102704*REF(X00,6)-0.000131447*REF(X00,7)-0.0000169351*REF(X00,8));X02:=IFF(CURRBARSCOUNT>1,XMA(X01,3),0.740524*X01+0.35541*REF(X01,1)-0.0316004*REF(X01,2)-0.0374119*REF(X01,3)-0.0218805*REF(X01,4)-0.00386503*REF(X01,5)-0.00102704*REF(X01,6)-0.000131447*REF(X01,7)-0.0000169351*REF(X01,8));X03:=IFF(CURRBARSCOUNT>1,XMA(X02,3),0.740524*X02+0.35541*REF(X02,1)-0.0316004*REF(X02,2)-0.0374119*REF(X02,3)-0.0218805*REF(X02,4)-0.00386503*REF(X02,5)-0.00102704*REF(X02,6)-0.000131447*REF(X02,7)-0.0000169351*REF(X02,8));X04:=IFF(CURRBARSCOUNT>1,XMA(X03,3),0.740524*X03+0.35541*REF(X03,1)-0.0316004*REF(X03,2)-0.0374119*REF(X03,3)-0.0218805*REF(X03,4)-0.00386503*REF(X03,5)-0.00102704*REF(X03,6)-0.000131447*REF(X03,7)-0.0000169351*REF(X03,8));X05:=IFF(CURRBARSCOUNT>1,XMA(X04,3),0.740524*X04+0.35541*REF(X04,1)-0.0316004*REF(X04,2)-0.0374119*REF(X04,3)-0.0218805*REF(X04,4)-0.00386503*REF(X04,5)-0.00102704*REF(X04,6)-0.000131447*REF(X04,7)-0.0000169351*REF(X04,8));X06:=IFF(CURRBARSCOUNT>1,XMA(X05,3),0.740524*X05+0.35541*REF(X05,1)-0.0316004*REF(X05,2)-0.0374119*REF(X05,3)-0.0218805*REF(X05,4)-0.00386503*REF(X05,5)-0.00102704*REF(X05,6)-0.000131447*REF(X05,7)-0.0000169351*REF(X05,8));X07:=IFF(CURRBARSCOUNT>1,XMA(X06,3),0.740524*X06+0.35541*REF(X06,1)-0.0316004*REF(X06,2)-0.0374119*REF(X06,3)-0.0218805*REF(X06,4)-0.00386503*REF(X06,5)-0.00102704*REF(X06,6)-0.000131447*REF(X06,7)-0.0000169351*REF(X06,8));X08:=IFF(CURRBARSCOUNT>1,XMA(X07,3),0.740524*X07+0.35541*REF(X07,1)-0.0316004*REF(X07,2)-0.0374119*REF(X07,3)-0.0218805*REF(X07,4)-0.00386503*REF(X07,5)-0.00102704*REF(X07,6)-0.000131447*REF(X07,7)-0.0000169351*REF(X07,8));X09:=IFF(CURRBARSCOUNT>1,XMA(X08,3),0.740524*X08+0.35541*REF(X08,1)-0.0316004*REF(X08,2)-0.0374119*REF(X08,3)-0.0218805*REF(X08,4)-0.00386503*REF(X08,5)-0.00102704*REF(X08,6)-0.000131447*REF(X08,7)-0.0000169351*REF(X08,8));X10:=IFF(CURRBARSCOUNT>1,XMA(X09,3),0.740524*X09+0.35541*REF(X09,1)-0.0316004*REF(X09,2)-0.0374119*REF(X09,3)-0.0218805*REF(X09,4)-0.00386503*REF(X09,5)-0.00102704*REF(X09,6)-0.000131447*REF(X09,7)-0.0000169351*REF(X09,8));X11:=IFF(CURRBARSCOUNT>1,XMA(X10,3),0.740524*X10+0.35541*REF(X10,1)-0.0316004*REF(X10,2)-0.0374119*REF(X10,3)-0.0218805*REF(X10,4)-0.00386503*REF(X10,5)-0.00102704*REF(X10,6)-0.000131447*REF(X10,7)-0.0000169351*REF(X10,8));X12:=IFF(CURRBARSCOUNT>1,XMA(X11,3),0.740524*X11+0.35541*REF(X11,1)-0.0316004*REF(X11,2)-0.0374119*REF(X11,3)-0.0218805*REF(X11,4)-0.00386503*REF(X11,5)-0.00102704*REF(X11,6)-0.000131447*REF(X11,7)-0.0000169351*REF(X11,8));X13:=IFF(CURRBARSCOUNT>1,XMA(X12,3),0.740524*X12+0.35541*REF(X12,1)-0.0316004*REF(X12,2)-0.0374119*REF(X12,3)-0.0218805*REF(X12,4)-0.00386503*REF(X12,5)-0.00102704*REF(X12,6)-0.000131447*REF(X12,7)-0.0000169351*REF(X12,8));X14:=IFF(CURRBARSCOUNT>1,XMA(X13,3),0.740524*X13+0.35541*REF(X13,1)-0.0316004*REF(X13,2)-0.0374119*REF(X13,3)-0.0218805*REF(X13,4)-0.00386503*REF(X13,5)-0.00102704*REF(X13,6)-0.000131447*REF(X13,7)-0.0000169351*REF(X13,8));X15:=IFF(CURRBARSCOUNT>1,XMA(X14,3),0.740524*X14+0.35541*REF(X14,1)-0.0316004*REF(X14,2)-0.0374119*REF(X14,3)-0.0218805*REF(X14,4)-0.00386503*REF(X14,5)-0.00102704*REF(X14,6)-0.000131447*REF(X14,7)-0.0000169351*REF(X14,8));X16:=IFF(CURRBARSCOUNT>1,XMA(X15,3),0.740524*X15+0.35541*REF(X15,1)-0.0316004*REF(X15,2)-0.0374119*REF(X15,3)-0.0218805*REF(X15,4)-0.00386503*REF(X15,5)-0.00102704*REF(X15,6)-0.000131447*REF(X15,7)-0.0000169351*REF(X15,8));X17:=IFF(CURRBARSCOUNT>1,XMA(X16,3),0.740524*X16+0.35541*REF(X16,1)-0.0316004*REF(X16,2)-0.0374119*REF(X16,3)-0.0218805*REF(X16,4)-0.00386503*REF(X16,5)-0.00102704*REF(X16,6)-0.000131447*REF(X16,7)-0.0000169351*REF(X16,8));X18:=IFF(CURRBARSCOUNT>1,XMA(X17,3),0.740524*X17+0.35541*REF(X17,1)-0.0316004*REF(X17,2)-0.0374119*REF(X17,3)-0.0218805*REF(X17,4)-0.00386503*REF(X17,5)-0.00102704*REF(X17,6)-0.000131447*REF(X17,7)-0.0000169351*REF(X17,8));X19:=IFF(CURRBARSCOUNT>1,XMA(X18,3),0.740524*X18+0.35541*REF(X18,1)-0.0316004*REF(X18,2)-0.0374119*REF(X18,3)-0.0218805*REF(X18,4)-0.00386503*REF(X18,5)-0.00102704*REF(X18,6)-0.000131447*REF(X18,7)-0.0000169351*REF(X18,8));X20:=IFF(CURRBARSCOUNT>1,XMA(X19,3),0.740524*X19+0.35541*REF(X19,1)-0.0316004*REF(X19,2)-0.0374119*REF(X19,3)-0.0218805*REF(X19,4)-0.00386503*REF(X19,5)-0.00102704*REF(X19,6)-0.000131447*REF(X19,7)-0.0000169351*REF(X19,8));X21:=IFF(CURRBARSCOUNT>1,XMA(X20,3),0.740524*X20+0.35541*REF(X20,1)-0.0316004*REF(X20,2)-0.0374119*REF(X20,3)-0.0218805*REF(X20,4)-0.00386503*REF(X20,5)-0.00102704*REF(X20,6)-0.000131447*REF(X20,7)-0.0000169351*REF(X20,8));X22:=IFF(CURRBARSCOUNT>1,XMA(X21,3),0.740524*X21+0.35541*REF(X21,1)-0.0316004*REF(X21,2)-0.0374119*REF(X21,3)-0.0218805*REF(X21,4)-0.00386503*REF(X21,5)-0.00102704*REF(X21,6)-0.000131447*REF(X21,7)-0.0000169351*REF(X21,8));X23:=IFF(CURRBARSCOUNT>1,XMA(X22,3),0.740524*X22+0.35541*REF(X22,1)-0.0316004*REF(X22,2)-0.0374119*REF(X22,3)-0.0218805*REF(X22,4)-0.00386503*REF(X22,5)-0.00102704*REF(X22,6)-0.000131447*REF(X22,7)-0.0000169351*REF(X22,8));X24:=IFF(CURRBARSCOUNT>1,XMA(X23,3),0.740524*X23+0.35541*REF(X23,1)-0.0316004*REF(X23,2)-0.0374119*REF(X23,3)-0.0218805*REF(X23,4)-0.00386503*REF(X23,5)-0.00102704*REF(X23,6)-0.000131447*REF(X23,7)-0.0000169351*REF(X23,8)

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


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

相关文章

    没有相关内容