优化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) |
评论内容只代表网友观点,与本站立场无关!
本网提供的公式文件说明:
* alg格式飞狐股票公式,可以用飞狐交易师或者交易师软件导入;
* fnc格式大智慧新一代公式指标,可以用大智慧股票软件使用,少部分可以用分析家股票软件引入使用;
* exp格式大智慧经典版股票公式,仅可以用大智慧经典版股票软件引入使用;
* tni和tnc格式通达信股票公式,仅可以用通达信新引入使用,例如可以用通达信股票软件引入使用;
* tne,tn6格式通达信公式,可以用通达信公式编辑器5.0版导入,推荐通达信金融终端版本;
* hxf格式同花顺股票公式,仅可以用同花顺股票软件引入使用。
以上的各种软件都可以在本网股票软件栏目找到!
* 关于股票公式时间限制,如果在引入大智慧公式,交易师公式或者飞狐公式的时候,发现公式名称栏是空白的,这时候调整电脑时间到1997年,又能出现公式名称,并且能正常显示,可能是公式使用期限已过。
* 关于还原公式源码如果你忘记了自己编写的大智慧公式,通达信公式,同花顺公式,操盘手公式,飞狐公式,博易大师公式,金字塔公式,文华公式和交易师公式等等公式的密码,本网可帮恢复源码,有.偿.服.务无意勿扰,点击在线咨询联系我。
* 关于股票公式源码编辑
本网提供的源码,一般都可以编辑成公式,如果不明白公式的编辑,在本页右侧教程录像可参考,或者找公式教程资料学习,请搜索:教程
* 如果您发现软件内容或者链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含源码均是由网上搜集,若侵犯了你的版权利益,请联系通知我们!