通达信【机构分时】跟上机构的步伐分时副图用法详解
VAR1:=V*C/100;
VAR2:=SUM((IF(((VAR1/8>20) AND (CLOSE>(REF(CLOSE,1)))),VAR1,0)),0);
VAR3:=SUM((IF(((VAR1/8>20) AND (CLOSE<(REF(CLOSE,1)))),VAR1,0)),0);
VAR4:=SUM((IF(((VAR1/8<20) AND (CLOSE>(REF(CLOSE,1)))),VAR1,0)),0);
VAR5:=SUM((IF(((VAR1/8<20) AND (CLOSE<(REF(CLOSE,1)))),VAR1,0)),0);
VAR6:=((VAR2+VAR3)+VAR4)+VAR5;
机构买:(VAR2),LINETHICK6,COLORRED;
机构卖:(VAR3),LINETHICK6,COLORFFFF55;
VAR7:=机构买-机构卖;
VAR8:=((100*VAR2)/VAR6>50);
VAR9:=((100*VAR2)/VAR6-(100*VAR3)/VAR6)>18 AND (100*VAR2)/VAR6-(100*VAR5)/VAR6>18;
VAR10:=STRCAT(STRCAT('机构买',CON2STR((100*VAR2)/VAR6,0)),'%');
VAR11:=STRCAT(STRCAT('机构卖',CON2STR((100*VAR3)/VAR6,0)),'%');
VAR18:=STRCAT(STRCAT('散户买',CON2STR((100*VAR4)/VAR6,0)),'%');
VAR19:=STRCAT(STRCAT('散户卖',CON2STR((100*VAR5)/VAR6,0)),'%');
散户买:(VAR4),COLOR5555FF;
散户卖:(VAR5),COLOR55FF55;
STICKLINE(VAR8,机构买*1.02,机构买*1.1,1,0),COLORYELLOW;
STICKLINE(VAR9,机构买*1.1,机构买*1.2,1,0),COLORFF00FF;
DRAWTEXT(ISLASTBAR=1,机构买*0.95,'●机构买'),LINETHICK2,COLORRED;
DRAWTEXT(ISLASTBAR=1,机构卖*0.95,'○机构卖'),LINETHICK2,COLORFFFF55;
DRAWTEXT(VAR7>0 AND REF(VAR7,1)<=0,机构买*1.02,'●机买'),COLORRED;
DRAWTEXT(VAR7<0 AND REF(VAR7,1)>=0,机构买*0.98,'○机卖'),COLORFFFF55;
DRAWTEXT_FIX(1,0,0.02,0,VAR10),COLORRED;
DRAWTEXT_FIX(1,0,0.13,0,VAR11),COLORFFFF55;
DRAWTEXT_FIX(1,0,0.24,0,VAR18),COLOR5555FF;
DRAWTEXT_FIX(1,0,0.35,0,VAR19),COLOR55FF55;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR1赋值:V*C/100
VAR2赋值:SUM((IF(((VAR1/8>20) AND (收盘价>(1日前的收盘价))),VAR1,0)),0)
VAR3赋值:SUM((IF(((VAR1/8>20) AND (收盘价<(1日前的收盘价))),VAR1,0)),0)
VAR4赋值:SUM((IF(((VAR1/8<20) AND (收盘价>(1日前的收盘价))),VAR1,0)),0)
VAR5赋值:SUM((IF(((VAR1/8<20) AND (收盘价<(1日前的收盘价))),VAR1,0)),0)
VAR6赋值:((VAR2+VAR3)+VAR4)+VAR5
输出机构买:(VAR2),LINETHICK6,画红色
输出机构卖:(VAR3),LINETHICK6,COLORFFFF55
VAR7赋值:机构买-机构卖
VAR8赋值:((100*VAR2)/VAR6>50)
VAR9赋值:((100*VAR2)/VAR6-(100*VAR3)/VAR6)>18 AND (100*VAR2)/VAR6-(100*VAR5)/VAR6>18
VAR10:=STRCAT(STRCAT('机构买',CON2STR((100*VAR2)/VAR6,0)),'%')
VAR11:=STRCAT(STRCAT('机构卖',CON2STR((100*VAR3)/VAR6,0)),'%')
VAR18:=STRCAT(STRCAT('散户买',CON2STR((100*VAR4)/VAR6,0)),'%')
VAR19:=STRCAT(STRCAT('散户卖',CON2STR((100*VAR5)/VAR6,0)),'%')
输出散户买:(VAR4),COLOR5555FF
输出散户卖:(VAR5),COLOR55FF55
当满足条件VAR8时,在机构买*1.02和机构买*1.1之间画柱状线
当满足条件VAR9时,在机构买*1.1和机构买*1.2之间画柱状线
当满足条件ISLASTBAR=1时,在机构买*0.95和'●机构买'位置书写文字
当满足条件ISLASTBAR=1时,在机构卖*0.95和'○机构卖'位置书写文字
DRAWTEXT(VAR7>0 AND 1日前的VAR7<=0,机构买*1.02,'●机买'),画红色
DRAWTEXT(VAR7<0 AND 1日前的VAR7>=0,机构买*0.98,'○机卖'),COLORFFFF55
当满足条件1时,在横轴0纵轴0.02位置书写文字
当满足条件1时,在横轴0纵轴0.13位置书写文字
当满足条件1时,在横轴0纵轴0.24位置书写文字
当满足条件1时,在横轴0纵轴0.35位置书写文字