通达信分时突破主图指标公式
攻击量:=((HSL*0.50+REF(HSL,1)*0.33)+(REF(HSL,2)*0.17))*SUM(C,FROMOPEN)/FROMOPEN;
攻击量A:=SUM(IF(C>REF(C,1),攻击量*V,0),FROMOPEN),COLOR0000FF,LINETHICK0;
攻击量B:=-SUM(IF(C<REF(C,1),攻击量*V,0),FROMOPEN),COLOR00FF00,LINETHICK0;
攻击流量:=攻击量A+攻击量B,COLORSTICK;
攻击比:=攻击流量/SUM(V,FROMOPEN)*100,COLORRED,LINETHICK1;
资金攻击度:=IF(攻击比>=0,(攻击比+50),100-ABS((攻击比-50)));
资金流入:=SUM(IF(C>REF(C,1),V,0),FROMOPEN),STICK,COLORRED;
资金流出:=-SUM(IF(C<REF(C,1),V,0),FROMOPEN),STICK,COLOR00FF00;
资金出入:=资金流入+资金流出,COLORSTICK;
资金比:=资金出入/SUM(V,FROMOPEN)*100,COLOR00FFFF,LINETHICK1;
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-ABS((资金比-100)/2));
DRAWTEXT_FIX(1,0.250,0.88,0,STRCAT(STRCAT('【资金流量比】',CON2STR(资金流量比,2)),'%买')),COLORCYAN;
DRAWTEXT_FIX(1,0.000,0.88,0,STRCAT(STRCAT('【资金攻击度】',CON2STR(资金攻击度,2)),' %买')),COLORCYAN;
XG:HHV(H,480),DOTLINE,COLORRED;
STICKLINE(FILTER(CROSS(C,REF(XG,1)),10) AND C>REF(XG,1),C*0.99,C,8,0),COLORGREEN;
DRAWTEXT(FILTER(CROSS(C,REF(XG,1)),10) AND C>REF(XG,1),C*0.99,'突破'),COLORYELLOW;
RQ:=DATETODAY(DATE)-DATETODAY(REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT))+1;
JY:=BARSLAST((RQ-REF(RQ,1))!=WEEKDAY-REF(WEEKDAY,1) OR TOTALBARSCOUNT-CURRBARSCOUNT=0)+1;
MA1:=REF(C,JY);{}
MA2:=REF(MA1,JY);
MA3:=REF(MA2,JY);
MA4:=REF(MA3,JY);
MA5:=REF(MA4,JY);
MA6:=REF(MA5,JY);
MA7:=REF(MA6,JY);
MA8:=REF(MA7,JY);
MA9:=REF(MA8,JY);
CK:REFDATE((C+MA1+MA2+MA3+MA4+MA5+MA6+MA7+MA8+MA9)/10,DATE),COLORAC59FF,CIRCLEDOT;
DRAWTEXT(ISLASTBAR,CK,' 参考线'),COLOR0000FF;
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))+DYNAINFO(3);
DEA:=EMA(DIF,9);
MACD1:=10*(DIF-DEA);
MACD2:=EMA(MACD1,2);
STICKLINE(MACD1>=MACD2 AND MACD1>=0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR0000B4;
STICKLINE(MACD1<MACD2 AND MACD1>0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR00B400;
STICKLINE(MACD1>=MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR5151A2;
STICKLINE(MACD1<MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR88743A;
XX:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(V*100,BARSCOUNT(CLOSE));
主力:=EXPMA(CLOSE/XX,20);大户:=EXPMA(CLOSE/XX,60);散户:=EXPMA(CLOSE/XX,120);
底:=1;1.02,NODRAW;高:=1.03;
DRAWTEXT(CROSS(主力,1.02),C*0.999,'-拉升'),COLORCYAN;
DRAWICON(CROSS(主力,1.04),C,24);
DRAWTEXT(CROSS(主力,1.04),C*0.999,'-冲涨停'),COLORLIMAGENTA;
A1:=(VOL/CLOSE)/3;
A2:=SUM((IF(((A1>40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0);
A3:=SUM((IF(((A1>40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0);
A4:=SUM((IF(((A1<40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0);
A5:=SUM((IF(((A1<40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0);
A6:=((A2+A3)+A4)+A5;
A7:=IF((BARSTATUS=2),((100*A2)/A6),0);
A8:=((IF((BARSTATUS=2),((100*A3)/A6),0)));
A9:=((IF((BARSTATUS=2),((100*A4)/A6),0)));
A10:=((IF((BARSTATUS=2),((100*A5)/A6),0)));
机构买盘:=(A2),LINETHICK2;
机构卖盘:=(A3),LINETHICK2;
散户买盘:=(A4);
散户卖盘:=(A5);
DRAWTEXT_FIX(1,0.000,1-0.05,0,STRCAT(STRCAT('【机构买盘】',CON2STR(机构买盘,2)),'万')),COLORRED;
DRAWTEXT_FIX(1,0.250,1-0.05,0,STRCAT(STRCAT('【机构卖盘】',CON2STR(机构卖盘,2)),'万')),COLOR00FF00;
DRAWTEXT_FIX(1,0.500,1-0.05,0,STRCAT(STRCAT('【散户买盘】',CON2STR(散户买盘,2)),'万')),COLORRED;
DRAWTEXT_FIX(1,0.745,1-0.05,0,STRCAT(STRCAT('【散户卖盘】',CON2STR(散户卖盘,2)),'万')),COLOR00FF00;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:=L1+P1*7/8,COLORGREEN;
支撑:=L1+P1*0.5/8,COLORMAGENTA;
DRAWTEXT(LONGCROSS(支撑,C,2),C,'买'),COLORYELLOW;
DRAWTEXT(LONGCROSS(C,阻力,2),C,'卖'),COLORGREEN;
量价:=(VOL/CLOSE)/3;
B2:=SUM((IF(((量价>0.20) AND (CLOSE>(REF(CLOSE,1)))),量价,0)),0);
B3:=SUM((IF(((量价>0.20) AND (CLOSE<(REF(CLOSE,1)))),量价,0)),0);
B6:=B2+B3;DD1:=1;比:=B2/B3;
BBB1:=STRCAT(STRCAT('买= ',CON2STR((100*B2)/B6,0)),'%');
BBB2:=STRCAT(STRCAT('卖= ',CON2STR((100*B3)/B6,0)),'%');
BBB3:=STRCAT(STRCAT('差= ',CON2STR((100*(B2-B3))/B6,0)),'%');
DRAWTEXT_FIX(DD1=1,0,0.70,0,BBB1),COLORRED;
DRAWTEXT_FIX(DD1=1,0,0.75,0,BBB2),COLORGREEN;
DRAWTEXT_FIX(DD1=1,0,0.80,0,BBB3),COLOR00FFFF;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
攻击量赋值:((HSL*0.50+1日前的HSL*0.33)+(2日前的HSL*0.17))*FROM开盘价的C日累和/FROM开盘价
攻击量A:=SUM(IF(C>1日前的C,攻击量*V,0),FROM开盘价),COLOR0000FF,LINETHICK0
攻击量B:=-SUM(IF(C<1日前的C,攻击量*V,0),FROM开盘价),COLOR00FF00,LINETHICK0
攻击流量赋值:攻击量A+攻击量B,COLORSTICK
攻击比赋值:攻击流量/FROM开盘价的V日累和*100,画红色,LINETHICK1
资金攻击度赋值:IF(攻击比>=0,(攻击比+50),100-(攻击比-50的绝对值))
资金流入赋值:SUM(IF(C>1日前的C,V,0),FROM开盘价),STICK,画红色
资金流出赋值:-SUM(IF(C<1日前的C,V,0),FROM开盘价),STICK,COLOR00FF00
资金出入赋值:资金流入+资金流出,COLORSTICK
资金比赋值:资金出入/FROM开盘价的V日累和*100,COLOR00FFFF,LINETHICK1
资金流量比赋值:IF(资金比>=0,(资金比+100)/2,100-(资金比-100的绝对值/2))
DRAWTEXT_FIX(1,0.250,0.88,0,STRCAT(STRCAT('【资金流量比】',CON2STR(资金流量比,2)),'%买')),画青色
DRAWTEXT_FIX(1,0.000,0.88,0,STRCAT(STRCAT('【资金攻击度】',CON2STR(资金攻击度,2)),' %买')),画青色
输出XG:480日内H最高值,DOTLINE,画红色
STICKLINE(FILTER(CROSS(C,1日前的XG),10) AND C>1日前的XG,C*0.99,C,8,0),画绿色
DRAWTEXT(FILTER(CROSS(C,1日前的XG),10) AND C>1日前的XG,C*0.99,'突破'),画黄色
RQ赋值:DATETODAY(DATE)-DATETODAY(TOTALBARSCOUNT- 到最后交易的周期日前的DATE)+1
JY赋值:上次(RQ-1日前的RQ距今天数!=WEEKDAY-1日前的WEEKDAY OR TOTALBARSCOUNT- 到最后交易的周期=0)+1
MA1赋值:JY日前的C
{}
MA2赋值:JY日前的MA1
MA3赋值:JY日前的MA2
MA4赋值:JY日前的MA3
MA5赋值:JY日前的MA4
MA6赋值:JY日前的MA5
MA7赋值:JY日前的MA6
MA8赋值:JY日前的MA7
MA9赋值:JY日前的MA8
输出CK:REFDATE((C+MA1+MA2+MA3+MA4+MA5+MA6+MA7+MA8+MA9)/10,DATE),COLORAC59FF,CIRCLEDOT
当满足条件ISLASTBAR时,在CK和' 参考线'位置书写文字
DIF赋值:(收盘价的12日指数移动平均-收盘价的26日指数移动平均)+DYNAINFO(3)
DEA赋值:DIF的9日指数移动平均
MACD1赋值:10*(DIF-DEA)
MACD2赋值:MACD1的2日指数移动平均
STICKLINE(MACD1>=MACD2 AND MACD1>=0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR0000B4
STICKLINE(MACD10,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR00B400
STICKLINE(MACD1>=MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,0),COLOR5151A2
STICKLINE(MACD1
XX赋值:SUM(成交额,收盘价的有效数据周期数)/SUM(V*100,收盘价的有效数据周期数)
主力赋值:收盘价/XX的20日指数移动平均
大户赋值:收盘价/XX的60日指数移动平均
散户赋值:收盘价/XX的120日指数移动平均
底赋值:1
1.02,NODRAW
高赋值:1.03
DRAWTEXT(主力上穿1.02,C*0.999,'-拉升'),画青色
DRAWICON(主力上穿1.04,C,24)
DRAWTEXT(主力上穿1.04,C*0.999,'-冲涨停'),COLORLIMAGENTA
A1赋值:(成交量/收盘价)/3
A2赋值:SUM((IF(((A1>40) AND (收盘价>(1日前的收盘价))),A1,0)),0)
A3赋值:SUM((IF(((A1>40) AND (收盘价<(1日前的收盘价))),A1,0)),0)
A4赋值:SUM((IF(((A1<40) AND (收盘价>(1日前的收盘价))),A1,0)),0)
A5赋值:SUM((IF(((A1<40) AND (收盘价<(1日前的收盘价))),A1,0)),0)
A6赋值:((A2+A3)+A4)+A5
A7赋值:IF((BARSTATUS=2),((100*A2)/A6),0)
A8赋值:((IF((BARSTATUS=2),((100*A3)/A6),0)))
A9赋值:((IF((BARSTATUS=2),((100*A4)/A6),0)))
A10:=((IF((BARSTATUS=2),((100*A5)/A6),0)))
机构买盘赋值:(A2),LINETHICK2
机构卖盘赋值:(A3),LINETHICK2
散户买盘:=(A4)
散户卖盘:=(A5)
DRAWTEXT_FIX(1,0.000,1-0.05,0,STRCAT(STRCAT('【机构买盘】',CON2STR(机构买盘,2)),'万')),画红色
DRAWTEXT_FIX(1,0.250,1-0.05,0,STRCAT(STRCAT('【机构卖盘】',CON2STR(机构卖盘,2)),'万')),COLOR00FF00
DRAWTEXT_FIX(1,0.500,1-0.05,0,STRCAT(STRCAT('【散户买盘】',CON2STR(散户买盘,2)),'万')),画红色
DRAWTEXT_FIX(1,0.745,1-0.05,0,STRCAT(STRCAT('【散户卖盘】',CON2STR(散户卖盘,2)),'万')),COLOR00FF00
H1赋值:MAX(DYNAINFO(3),DYNAINFO(5))
L1赋值:MIN(DYNAINFO(3),DYNAINFO(6))
P1赋值:H1-L1
阻力赋值:L1+P1*7/8,画绿色
支撑赋值:L1+P1*0.5/8,画洋红色
DRAWTEXT(LONGCROSS(支撑,C,2),C,'买'),画黄色
DRAWTEXT(LONGCROSS(C,阻力,2),C,'卖'),画绿色
量价赋值:(成交量/收盘价)/3
B2赋值:SUM((IF(((量价>0.20) AND (收盘价>(1日前的收盘价))),量价,0)),0)
B3赋值:SUM((IF(((量价>0.20) AND (收盘价<(1日前的收盘价))),量价,0)),0)
B6赋值:B2+B3
DD1赋值:1
比赋值:B2/B3
BBB1赋值:STRCAT(STRCAT('买= ',CON2STR((100*B2)/B6,0)),'%')
BBB2赋值:STRCAT(STRCAT('卖= ',CON2STR((100*B3)/B6,0)),'%')
BBB3赋值:STRCAT(STRCAT('差= ',CON2STR((100*(B2-B3))/B6,0)),'%')
当满足条件DD1=1时,在横轴0纵轴0.70位置书写文字
当满足条件DD1=1时,在横轴0纵轴0.75位置书写文字
当满足条件DD1=1时,在横轴0纵轴0.80位置书写文字