通达信副图指标简介:
换手率量价彩柱副图指标通过计算换手率、成交量、价格动量、成本分布等多个关键财务指标,为投资者提供了一个全面的市场趋势分析视角。代码集成了多种流行的技术分析工具,包括能量潮(OBV)、移动平均(MA)、移动平均收敛发散(MACD)等,旨在帮助用户捕捉市场动态,识别潜在的买卖时机。
指标效果图:
指标公式源码及源码注释:
换手:=V/CAPITAL*100;{计算换手率}
STICKLINE(换手,0,换手,2,1),COLORRED;{绘制换手率的红色柱状线}
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);{如果今日收盘价高于昨日收盘价,则VA为成交量,否则为负成交量}
OBV:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);{计算累积成交量}
MAOBV:=MA(OBV,30);{计算OBV的30日均线}
STICKLINE((OBV>REF(OBV,1) AND OBV>MAOBV),0,换手,2,1),COLORLIRED;{当OBV上升且高于其均线时,绘制红色柱状线}
STICKLINE(NOT(OBV>REF(OBV,1) AND OBV>MAOBV),0,换手,2,0),COLORCYAN;{当OBV不上升或低于其均线时,绘制青色空心柱状线}
JJ:=(HIGH+LOW+CLOSE)/3;{计算三天的平均价}
QJ0:=AMOUNT/IF(HIGH=LOW,4,HIGH-LOW);{计算每股平均成交额}
买1:=QJ0*(MIN(OPEN,CLOSE)-LOW)*2;{计算买1}
买2:=QJ0*(JJ-MIN(CLOSE,OPEN))*2;{计算买2}
卖1:=QJ0*(MAX(CLOSE,OPEN)-JJ)*2;{计算卖1}
卖2:=QJ0*(HIGH-MAX(OPEN,CLOSE))*2;{计算卖2}
DT:=((买1+买2)-(卖1+卖2))/10000*6;{计算主力动向}
STICKLINE(DT>0,0,换手*0.5,0.5,0),COLOR0000FF;{当主力动向为正时,绘制蓝色柱状线}
STICKLINE(DT< 0,0,-换手*0.4,0.5,0),COLORGREEN;{当主力动向为负时,绘制绿色柱状线}
TD1:=QJ0*(MIN(OPEN,CLOSE)-LOW);{计算TD1}
DD1:=QJ0*(JJ-MIN(CLOSE,OPEN));{计算DD1}
DD2:=QJ0*(HIGH-MAX(OPEN,CLOSE));{计算DD2}
TD2:=QJ0*(MAX(CLOSE,OPEN)-JJ);{计算TD2}
TD:=TD1-TD2;{计算TD}
DA:=DD1-DD2;{计算DA}
XD1:=1-(TD1+DD1);{计算XD1}
XD2:=1-(TD2+DD2);{计算XD2}
TZ:=V/SUM(V,60)*100;{计算TZ}
DTA:=((XD1-XD2)/10000)/TZ;{计算DTA}
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26));{计算DIF}
DEA:=EMA(DIF,9);{计算DEA}
ACB11:=MA(HHV(HIGH,485),17);{计算ACB11}
ACB21:=MA(HHV(HIGH,222),17);{计算ACB21}
ACB31:=MA(HHV(HIGH,96),17);{计算ACB31}
ACB41:=MA(LLV(LOW,485),17);{计算ACB41}
ACB51:=MA(LLV(LOW,222),17);{计算ACB51}
ACB61:=MA(LLV(LOW,96),17);{计算ACB61}
ACB71:=MA((ACB41*0.96+ACB51*0.96+ACB61*0.96+ACB11*0.558+ACB21*0.558+ACB31*0.558)/6,17);{计算ACB71}
ACB81:=MA((ACB41*1.25+ACB51*1.23+ACB61*1.2+ACB11*0.55+ACB21*0.55+ACB31*0.65)/6,17);{计算ACB81}
ACB91:=MA((ACB41*1.3+ACB51*1.3+ACB61*1.3+ACB11*0.68+ACB21*0.68+ACB31*0.68)/6,17);{计算ACB91}
ACBA:=MA((ACB71*3+ACB81*2+ACB91)/6*1.738,17);{计算ACBA}
ACBB:=ACBA;{ACBB等于ACBA}
ACBC:=LOW;{ACBC等于最低价}
ACBD:=REF(LOW,1);{ACBD等于昨日最低价}
ACBE:=SMA(ABS(ACBC-ACBD),3,1)/SMA(MAX(ACBC-ACBD,0),3,1)*100;{计算ACBE}
ACBF:=MA(IF(CLOSE*1.35<=ACBB,ACBE*10,ACBE/10),3);{计算ACBF}
ACB10:=LLV(LOW,30);{计算30日最低价}
ACB111:=HHV(ACBF,30);{计算30日ACBF最高价}
SS:=MA(IF(LOW<=ACB10,(ACBF+ACB11*2)/2,0),3);{计算SS}
STICKLINE(SS,换手,换手*0.5,0.5,0),COLORBLUE;{当SS为正时,绘制蓝色柱状线}
N:=3;{设置N为3 WWW.GUKOUDAI.COM}
M1:=10;{设置M1为10}
ACB1:=(C-EMA(C,6))/EMA(C,6)*100;{计算ACB1}
ACB2:=(C-MA(C,24))/MA(C,24)*100;{计算ACB2}
ACB3:=(C-MA(C,32))/MA(C,32)*100;{计算ACB3}
ACB4:=(ACB1+ACB2+ACB3)/3;{计算ACB4}
量价结合:MEMA(ACB4,N),COLORWHITE,LINETHICK2;{计算量价结合}
波段操作:MEMA(量价结合,3),COLORGREEN,LINETHICK2;{计算波段操作}
IF(量价结合>REF(量价结合,1),量价结合,DRAWNULL),COLORRED,LINETHICK2;{当量价结合上升时,绘制红色线}
IF(波段操作>REF(波段操作,1),波段操作,DRAWNULL),COLORFF00FF,LINETHICK2;{当波段操作上升时,绘制紫色线}
QDZ:=DT>0 AND CROSS(DIF,DEA) AND OBV>REF(OBV,1) AND OBV>MAOBV AND 量价结合>REF(量价结合,1);{计算QDZ}
DRAWICON(QDZ,DEA,9);{当QDZ为真时,在DEA位置绘制图标}