通达信副图指标简介:
彩带筹码副图指标通过计算多个指数移动平均(EMA)指标来捕捉市场趋势和潜在的交易信号。代码中包括了底部吸筹指标、MACD(移动平均收敛发散指标)及其变种,旨在通过不同时间周期的EMA差值来揭示市场的动向。
指标效果图:
指标公式源码及源码注释:
底部吸筹:(EMA(CLOSE,30)-EMA(CLOSE,90))*0.55;{计算底部吸筹指标}
VAR1:(EMA(底部吸筹,26));{底部吸筹指标的26日指数移动平均}
MACD周:=(底部吸筹-VAR1)*2, COLORSTICK;{计算MACD周指标}
DRAWBAND(VAR1,RGB(135,255,35),底部吸筹,RGB(240,160,0));{绘制VAR1和底部吸筹的带状图}
DRAWTEXT(CURRBARSCOUNT=1,底部吸筹,''),COLORRED;{在图表上标注底部吸筹}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);{计算DIFF指标}
DEA:=EMA(DIFF,9);{计算DEA指标}
DRAWBAND(DIFF,RGB(255,80,120),DEA,RGB(21,138,255));{绘制DIFF和DEA的带状图}
DRAWTEXT(CURRBARSCOUNT=1,DIFF,''),COLOR00FFFF;{在图表上标注DIFF}
XA_1:=EMA(CLOSE,12/2)-EMA(CLOSE,26/2);{计算XA_1指标}
XA_2:=EMA(XA_1,9/2);{计算XA_2指标WWW.GUKOUDAI.COM}
DRAWBAND(XA_1,RGB(120,20,255),XA_2,RGB(80,255,20));{绘制XA_1和XA_2的带状图}
DRAWTEXT(CURRBARSCOUNT=1,XA_1,''),COLORFF00FF;{在图表上标注XA_1}
XA_3:=(EMA(CLOSE,12/4)-EMA(CLOSE,26/4)),COLORGREEN,LINETHICK2;{计算XA_3指标}
XA_6:=(EMA(XA_3,9/4)),COLORMAGENTA,LINETHICK2;{计算XA_6指标}
DRAWBAND(XA_3,RGB(220,50,50),XA_6,RGB(50,120,50));{绘制XA_3和XA_6的带状图}
DRAWTEXT(CURRBARSCOUNT=1,XA_3,''),COLORGREEN;{在图表上标注XA_3}
0,COLORWHITE,DOTLINE;{绘制白色点线}
MACD:(DIFF-DEA)*2,COLORSTICK;{计算MACD指标}
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,1),COLORRED;{当MACD上升且大于0时,绘制红色柱状图}
STICKLINE(MACD< REF(MACD,1) AND MACD>0,0,MACD,1,1),COLOR4080FF;{当MACD下降且大于0时,绘制蓝色柱状图}
STICKLINE(MACD>REF(MACD,1) AND MACD< 0,0,MACD,1,1),COLORYELLOW;{当MACD上升且小于0时,绘制黄色柱状图}
STICKLINE(MACD< REF(MACD,1) AND MACD< 0,0,MACD,1,1),COLORLIGREEN;{当MACD下降且小于0时,绘制浅绿色柱状图}