您的位置:查股网 > 查股公式 > 通达信MACD金主图公式、源码[查股公式]
股票行情消息查询:

通达信MACD金主图公式、源码[查股公式]

2022/9/13 10:33:50

通达信MACD金主图公式、源码

macd变色趋势加黄金分割。。实用、简单、一看就会用!

源码

{MACD-金}
DIF1:=WMA(CLOSE,5);
 DIF2:=WMA(CLOSE,13);
 MACD:WMA((3*DIF1-2*DIF2),2),COLORFF9900,DOTLINE,LINETHICK2;
 IF(MACD>REF(MACD,1),MACD,DRAWNULL),COLORYELLOW,LINETHICK2;
 BC1E:=IF(L=LLV(L,8*20),L,DRAWNULL);
 BC2E:=CONST(BARSLAST(BC1E=L))+1;
 E:=CONST(IF(BC2E=1,L,REF(L,BC2E-1)));
 DIFFK:=DIF1-DIF2;
 DEAK:=WMA(DIFFK,8);
 MACDK:=2*(DIFFK-DEAK);
 STICKLINE(MACDK>0 AND MACDK>REF(MACDK,1),E+MACDK,E,2,0),COLOR0000FF;
 STICKLINE(MACDK>0 AND MACDK<REF(MACDK,1),E+MACDK,E,2,0),COLORFF9900;
 STICKLINE(MACDK<0,E+MACDK,E,2,0),COLORFF9900;
 {高抛.低吸}
SJ:=WMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,2);
 ZJ:=WMA(0.667*REF(SJ,1)+0.333*SJ,2);
 DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,L-0.05,'←低吸'),COLOR00FF99,LINETHICK2;
 DRAWTEXT(CROSS(ZJ,SJ) AND SJ>70,H+0.05,'←高抛'),COLOR0044FF,LINETHICK2;
 TC1:=IF(H=HHV(H,8*14),H,DRAWNULL);
 TC2:=CONST(BARSLAST(TC1=H))+1;
 UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1)));
 BC1:=IF(L=LLV(L,8*20),L,DRAWNULL);
 BC2:=CONST(BARSLAST(BC1=L))+1;
 LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1)));
 LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;{低点定位}
HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;{高点定位};
STICKLINE(LP,L*0.992,L,13,0),COLORFF00FF;
 STICKLINE(HP,H,H*1.005,13,0),COLOR00FF00;
 X1:IF(CURRBARSCOUNT<=MAX(BC2,TC2),UPPER,DRAWNULL),COLOR89615F;
 X2:IF(CURRBARSCOUNT<=MAX(BC2,TC2),LOWER,DRAWNULL),COLOR89615F;
 X3:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.146,LOWER+(UPPER-LOWER)*0.146),DRAWNULL),COLOR89615F;
 X4:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.191,LOWER+(UPPER-LOWER)*0.191),DRAWNULL),COLOR89615F;
 X5:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.236,LOWER+(UPPER-LOWER)*0.236),DRAWNULL),COLOR89615F;
 X6:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.382,LOWER+(UPPER-LOWER)*0.382),DRAWNULL),COLOR89615F;
 X7:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.5,LOWER+(UPPER-LOWER)*0.5),DRAWNULL),COLOR89615F;
 X8:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.618,LOWER+(UPPER-LOWER)*0.618),DRAWNULL),COLOR89615F;
 X9:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.764,LOWER+(UPPER-LOWER)*0.764),DRAWNULL),COLOR89615F;
 X10:IF(CURRBARSCOUNT<=MAX(BC2,TC2),IF(BC2>TC2,UPPER-(UPPER-LOWER)*0.809,LOWER+(UPPER-LOWER)*0.809),DRAWNULL),COLOR89615F;
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X1,'UPPER');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X2,'LOWER');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X3,'0.146');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X4,'0.191');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X5,'0.236');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X6,'0.382');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X7,'0.5');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X8,'0.618');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X9,'0.764');
 DRAWTEXT(CURRBARSCOUNT=MIN(BC2,TC2)+8,X10,'0.809');
 STICKLINE(CLOSE>= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED;
 STICKLINE(CLOSE>= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR000066;
 STICKLINE(CLOSE>= REF(CLOSE,1) ,OPEN,CLOSE,2.6,0 ),COLOR000099;
 STICKLINE(CLOSE>= REF(CLOSE,1) ,OPEN,CLOSE,2,0 ),COLOR0000CC;
 STICKLINE(CLOSE>= REF(CLOSE,1) ,OPEN,CLOSE,1.2,0 ),COLOR0000FF;
 STICKLINE(CLOSE>= REF(CLOSE,1) ,OPEN,CLOSE,0.4,0 ),COLORCC66FF;
 STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;
 STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLORCC0000;
 STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.6,0 ),COLORFF4400;
 STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2,0 ),COLORFF8800;
 STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,1.2,0 ),COLORFFCC00;

相关文章列表
天天查股公式列表

股票公式分类

天天查股:股票行情消息 实时DDX在线 资金流向 千股千评 业绩报告 十大股东 最新消息 超赢数据 大小非解禁 停牌复牌 股票分红查询 股票评级报告
广告客服:315126368   843010021
天天查股网免费查股,本站内容与数据仅供参考,不构成投资建议,据此操作,风险自担,股市有风险,投资需谨慎。 沪ICP备15043930号-29