通达信主力买卖量副图指标 源码
PJ:=(H+L+C)/3;
V1:=IF(H=L,1,H-MAX(O,C));
V2:=IF(H=L,1,MAX(C,O)-PJ);
V3:=IF(H=L,1,MIN(O,C)-L);
V4:=IF(H=L,1,PJ-MIN(C,O));
V5:=VOL/IF(H=L,4,H-L);
V6:=(V1*V5)+(V2*V5);
V7:=(V3*V5)+(V4*V5);
WP1:=DYNAINFO(23);
NP1:=DYNAINFO(22);
WP2:=IF(ISLASTBAR,V7*240/FROMOPEN,V7);
NP2:=IF(ISLASTBAR,V6*240/FROMOPEN,V6);
主买:IF(ISLASTBAR AND PERIOD=5,WP1,WP2),COLORRED,NODRAW;
主卖:IF(ISLASTBAR AND PERIOD=5,NP1,NP2),COLORGREEN,NODRAW;
净量:ABS(主买-主卖),NODRAW;
主买1:=BUYVOL,COLORLIRED,NODRAW;
主卖1:=-SELLVOL,COLORLIBLUE,NODRAW;
总净买:BUYVOL-SELLVOL,COLORMAGENTA,NODRAW;
A01:=(VOL/CLOSE)/3;
A02:=SUM((IF(((A01>60) AND C< 15 AND (CLOSE>(REF(CLOSE,1)))),A01,0)),1);
A03:=SUM((IF(((A01>20) AND C>15 AND (CLOSE>(REF(CLOSE,1)))),A01,0)),1);
主力买:(A02+A03),NODRAW,COLORRED;
A04:=SUM((IF(((A01>60) AND C< 15 AND (CLOSE< (REF(CLOSE,1)))),A01,0)),1);
A05:=SUM((IF(((A01>20) AND C>15 AND (CLOSE< (REF(CLOSE,1)))),A01,0)),1);
主力卖:(A04+A05),NODRAW,;
主力净买:IF(FINANCE(7)< 5000000000,(主力买-主力卖)/10,0),COLORYELLOW,NODRAW;
占盘比:主力净买/FINANCE(7)*1000000,NODRAW;
成交量:=VOL,VOLSTICK;
STICKLINE(主力买,主力买,0,2.5,0),COLORRED;
STICKLINE(主力卖,-主力卖,0,2.5,0),COLORGREEN;
STICKLINE(主力净买,主力净买,0,2,0),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
PJ赋值:(H+L+C)/3
V1赋值:IF(H=L,1,H-O和C较大值)
V2赋值:IF(H=L,1,C和O较大值-PJ)
V3赋值:IF(H=L,1,O和C的较小值-L)
V4赋值:IF(H=L,1,PJ-C和O的较小值)
如果H=L返回4否则返回H-L
V6赋值:(V1*V5)+(V2*V5)
V7赋值:(V3*V5)+(V4*V5)
WP1赋值:DYNAINFO(23)
NP1赋值:DYNAINFO(22)
如果ISLASTBAR返回V7*240/FROM开盘价否则返回V7
如果ISLASTBAR返回V6*240/FROM开盘价否则返回V6
如果ISLASTBAR AND PERIOD=5返回WP1否则返回WP2
如果ISLASTBAR AND PERIOD=5返回NP1否则返回NP2
输出净量:主买-主卖的绝对值,NODRAW
主买1:=BUY成交量,COLORLIRED,NODRAW
主卖1:=-SELL成交量,COLORLIBLUE,NODRAW
输出总净买:BUY成交量-SELL成交量,画洋红色,NODRAW
A01赋值:(成交量/收盘价)/3
A02赋值:SUM((IF(((A01>60) AND C< 15 AND (收盘价>(1日前的收盘价))),A01,0)),1)
A03赋值:SUM((IF(((A01>20) AND C>15 AND (收盘价>(1日前的收盘价))),A01,0)),1)
输出主力买:(A02+A03),NODRAW,画红色
A04赋值:SUM((IF(((A01>60) AND C< 15 AND (收盘价< (1日前的收盘价))),A01,0)),1)
A05赋值:SUM((IF(((A01>20) AND C>15 AND (收盘价< (1日前的收盘价))),A01,0)),1)
输出主力卖:(A04+A05),NODRAW,
输出主力净买:IF(FINANCE(7)< 5000000000,(主力买-主力卖)/10,0),画黄色,NODRAW
输出占盘比:主力净买/FINANCE(7)*1000000,NODRAW
成交量赋值:成交量,成交量STICK
当满足条件主力买时,在主力买和0之间画柱状线
当满足条件主力卖时,在-主力卖和0之间画柱状线
当满足条件主力净买时,在主力净买和0之间画柱状线