通达信分时突破支撑压力分时主图指标 源码 附图
最新:C,COLORFFFF00,LINETHICK9;
IF(C>=REF(C,1),C,DRAWNULL),COLOR0000FF,LINETHICK9;
AA:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
BB:=BETWEEN(C/AA,C+H,C-H);
DRAWICON(ISLASTBAR AND C>REF(C,1),C,1);
DRAWICON(ISLASTBAR AND C<REF(C,1),C,2);
压力:MA(REF(HHV(C,30),1),2),DOTLINE,COLOR8080FF,LINETHICK1;
支撑:MA(REF(LLV(C,30),1),2),DOTLINE,COLORAAAA00,LINETHICK1;
HH:=CONST(HHV(C,0));
LL:=CONST(LLV(C,0));
HL:=HH-LL;
顶:HH,NODRAW;
DRAWICON(C=HH,HH,35);
DRAWICON(C=LL,LL,34);
STICKLINE(TIME2=94100 AND REF(C,BARSLAST(TIME2=94100))>=REF(C,BARSLAST(TIME2=93100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORRED;
STICKLINE(TIME2=94100 AND REF(C,BARSLAST(TIME2=94100))<REF(C,BARSLAST(TIME2=93100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORGREEN;
STICKLINE(TIME2=95100 AND REF(C,BARSLAST(TIME2=95100))>=REF(C,BARSLAST(TIME2=94100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORRED;
STICKLINE(TIME2=95100 AND REF(C,BARSLAST(TIME2=95100))<REF(C,BARSLAST(TIME2=94100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORGREEN;
STICKLINE(TIME2=100100 AND REF(C,BARSLAST(TIME2=100100))>=REF(C,BARSLAST(TIME2=95100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORRED;
STICKLINE(TIME2=100100 AND REF(C,BARSLAST(TIME2=100100))<REF(C,BARSLAST(TIME2=95100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),COLORGREEN;
SJ1:=TIME2=93100;T1:=BARSLAST(SJ1);SJ2:=TIME2=94100;
SJ4:=TIME2=95100;T2:=BARSLAST(SJ2);T4:=BARSLAST(SJ4);
H1:=IF(TIME2=94100,REF(C,T2),DRAWNULL)=C;
H2:=IF(TIME2=95100,REF(C,T4),DRAWNULL)=C;
CS2:=CONST(REF(C,T2));
CS4:=CONST(REF(C,T4));
GL2:=FILTERX(H1,T2);
GL4:=FILTERX(H2,T4);
L1:=IF(TIME2=93100,REF(C,T1),DRAWNULL)=C;
CS1:=CONST(REF(C,T1));
GL1:=FILTERX(L1,T1);
DA:=CONST(IF(REF(GL2,BARSLAST(GL2)),REF(BARSLAST(GL1),BARSLAST(GL2)),DRAWNULL));
DA1:=CONST(IF(REF(GL4,BARSLAST(GL4)),REF(BARSLAST(GL2),BARSLAST(GL4)),DRAWNULL));
A:=IF(BARSLAST(GL1)>=0 AND BARSLAST(GL1)<=DA,((CS2-CS1)/DA)*BARSLAST(GL1)+CS1,DRAWNULL);
B:=IF(BARSLAST(GL2)>=0 AND BARSLAST(GL2)<=DA1,((CS4-CS2)/DA1)*BARSLAST(GL2)+CS2,DRAWNULL);
IF(A>=REF(A,1),A,DRAWNULL)COLORLIMAGENTA,LINETHICK3;
IF(A<REF(A,1),A,DRAWNULL)COLORGREEN,LINETHICK5;
IF(B>=REF(B,1),B,DRAWNULL)COLORLIMAGENTA,LINETHICK3;
IF(B<REF(B,1),B,DRAWNULL)COLORGREEN,LINETHICK3;
XSJ1:=TIME2=95100;
XT1:=BARSLAST(XSJ1);
XSJ2:=TIME2=100100;
XT2:=BARSLAST(XSJ2);
XCS2:=CONST(REF(C,XT2));
XL1:=IF(TIME2=95100,REF(C,XT1),DRAWNULL)=C;
XH1:=IF(TIME2=100100,REF(C,XT2),DRAWNULL)=C;
XCS1:=CONST(REF(C,XT1));
XGL1:=FILTERX(XL1,XT1);
XGL2:=FILTERX(XH1,XT2);
XDA:=CONST(IF(REF(XGL2,BARSLAST(XGL2)),REF(BARSLAST(XGL1),BARSLAST(XGL2)),DRAWNULL));
XA:=IF(BARSLAST(XGL1)>=0 AND BARSLAST(XGL1)<=XDA,((XCS2-XCS1)/XDA)*BARSLAST(XGL1)+XCS1,DRAWNULL);
IF(XA>=REF(XA,1),XA,DRAWNULL)COLORLIMAGENTA,LINETHICK3;
IF(XA<REF(XA,1),XA,DRAWNULL)COLORGREEN,LINETHICK3;
时间:=TIME2=100100;
N:=BARSLAST(时间);
C1:CONST(IF(N,MAX(REF(HHV(H,0),N+1),DYNAINFO(4)),HHV(H,0))),DOTLINE,COLORRED;
C2:CONST(IF(N,MIN(REF(LLV(L,0),N+1),DYNAINFO(4)),LLV(L,0))),DOTLINE,COLORGREEN;
C3:(C1+C2)/2,DOTLINE,COLORYELLOW;
VV:=HHV(V,0);
ZF:=(C1/C2-1)*100;
DRAWTEXT(CURRBARSCOUNT=2,C1,VARCAT(VARCAT(VARCAT(VARCAT('上限:',VAR2STR(C1,2)),'元,'),VARCAT('振幅:',VAR2STR(ZF,2))),'%')),COLORRED;
DRAWTEXT(CURRBARSCOUNT=2,C3,VARCAT(VARCAT('中限:',VAR2STR(C3,2)),'元')),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=2,C2,VARCAT(VARCAT('下限:',VAR2STR(C2,2)),'元')),COLORGREEN;
DRAWTEXT(C1/C2<=1.03 AND CROSS(C,C1) AND V>=VV,C1*1.005,'★买入')COLORRED;
DRAWTEXT(C1/C2<=1.03 AND CROSS(C2,C) AND V>=VV,C2*0.998,'★卖出')COLORGREEN;
STICKLINE(C1/C2<1.03 AND CROSS(C,C1) AND V>=VV,DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,1,0),COLORRED;
攻击量:=((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;
FF:=(C-REF(C,5))/REF(C,5);
STICKLINE(FF>0,DYNAINFO(3),DYNAINFO(3)*(1+FF),0.5,0),COLORRED;
STICKLINE(FF<0,DYNAINFO(3),DYNAINFO(3)*(1+FF),0.5,0),COLORGREEN;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出最新:C,COLORFFFF00,LINETHICK9
IF(C>=1日前的C,C,DRAWNULL),COLOR0000FF,LINETHICK9
AA赋值:SUM(AMOUNT,C的有效数据周期数)/SUM(成交量*100,C的有效数据周期数)
BB赋值:BETWEEN(C/AA,C+H,C-H)
DRAWICON(ISLASTBAR AND C>1日前的C,C,1)
DRAWICON(ISLASTBAR AND C<1日前的C,C,2)
输出压力:MA(REF(30日内C最高值,1),2),DOTLINE,COLOR8080FF,LINETHICK1
输出支撑:MA(REF(30日内C最低值,1),2),DOTLINE,COLORAAAA00,LINETHICK1
HH赋值:CONST(0日内C最高值)
LL赋值:CONST(0日内C最低值)
HL赋值:HH-LL
输出顶:HH,NODRAW
当满足条件C=HH时,在HH和35之间画图标
当满足条件C=LL时,在LL和34之间画图标
STICKLINE(TIME2=94100 AND REF(C,上次TIME2=94100距今天数)>=REF(C,BARSLAST(TIME2=93100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),画红色
STICKLINE(TIME2=94100 AND REF(C,上次TIME2=94100距今天数)[
STICKLINE(TIME2=95100 AND REF(C,上次TIME2=95100距今天数)>=REF(C,BARSLAST(TIME2=94100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),画红色]
STICKLINE(TIME2=95100 AND REF(C,上次TIME2=95100距今天数)[
STICKLINE(TIME2=100100 AND REF(C,上次TIME2=100100距今天数)>=REF(C,BARSLAST(TIME2=95100)),DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,0.5,-1),画红色]
STICKLINE(TIME2=100100 AND REF(C,上次TIME2=100100距今天数)[
SJ1赋值:TIME2=93100]
T1赋值:上次SJ1距今天数
SJ2赋值:TIME2=94100
SJ4赋值:TIME2=95100
T2赋值:上次SJ2距今天数
T4赋值:上次SJ4距今天数
H1赋值:IF(TIME2=94100,T2日前的C,DRAWNULL)=C
H2赋值:IF(TIME2=95100,T4日前的C,DRAWNULL)=C
CS2赋值:CONST(T2日前的C)
CS4赋值:CONST(T4日前的C)
GL2赋值:FILTERX(H1,T2)
GL4赋值:FILTERX(H2,T4)
L1赋值:IF(TIME2=93100,T1日前的C,DRAWNULL)=C
CS1赋值:CONST(T1日前的C)
GL1赋值:FILTERX(L1,T1)
DA赋值:CONST(IF(REF(GL2,上次GL2距今天数),REF(BARSLAST(GL1),上次GL2距今天数),DRAWNULL))
DA1:=CONST(IF(REF(GL4,上次GL4距今天数),REF(BARSLAST(GL2),上次GL4距今天数),DRAWNULL))
A赋值:IF(上次GL1距今天数>=0 AND 上次GL1距今天数<=DA,((CS2-CS1)/DA)*上次GL1距今天数+CS1,DRAWNULL)
B赋值:IF(上次GL2距今天数>=0 AND 上次GL2距今天数<=DA1,((CS4-CS2)/DA1)*上次GL2距今天数+CS2,DRAWNULL)
IF(A>=1日前的A,A,DRAWNULL)COLORLIMAGENTA,LINETHICK3
IF(A<1日前的A,A,DRAWNULL)COLORGREEN,LINETHICK5
IF(B>=1日前的B,B,DRAWNULL)COLORLIMAGENTA,LINETHICK3
IF(B<1日前的B,B,DRAWNULL)COLORGREEN,LINETHICK3
XSJ1赋值:TIME2=95100
XT1赋值:上次XSJ1距今天数
XSJ2赋值:TIME2=100100
XT2赋值:上次XSJ2距今天数
XCS2赋值:CONST(XT2日前的C)
XL1赋值:IF(TIME2=95100,XT1日前的C,DRAWNULL)=C
XH1赋值:IF(TIME2=100100,XT2日前的C,DRAWNULL)=C
XCS1赋值:CONST(XT1日前的C)
XGL1赋值:FILTERX(XL1,XT1)
XGL2赋值:FILTERX(XH1,XT2)
XDA赋值:CONST(IF(REF(XGL2,上次XGL2距今天数),REF(BARSLAST(XGL1),上次XGL2距今天数),DRAWNULL))
XA赋值:IF(上次XGL1距今天数>=0 AND 上次XGL1距今天数<=XDA,((XCS2-XCS1)/XDA)*上次XGL1距今天数+XCS1,DRAWNULL)
IF(XA>=1日前的XA,XA,DRAWNULL)COLORLIMAGENTA,LINETHICK3
IF(XA<1日前的XA,XA,DRAWNULL)COLORGREEN,LINETHICK3
时间赋值:TIME2=100100
N赋值:上次时间距今天数
输出C1:CONST(IF(N,MAX(REF(0日内H最高值,N+1),DYNAINFO(4)),0日内H最高值)),DOTLINE,画红色
输出C2:CONST(IF(N,MIN(REF(0日内L最低值,N+1),DYNAINFO(4)),0日内L最低值)),DOTLINE,COLORGREEN
输出C3:(C1+C2)/2,DOTLINE,COLORYELLOW
VV赋值:0日内V最高值
ZF赋值:(C1/C2-1)*100
DRAWTEXT(CURRBARSCOUNT=2,C1,VARCAT(VARCAT(VARCAT(VARCAT('上限:',VAR2STR(C1,2)),'元,'),VARCAT('振幅:',VAR2STR(ZF,2))),'%')),画红色
DRAWTEXT(CURRBARSCOUNT=2,C3,VARCAT(VARCAT('中限:',VAR2STR(C3,2)),'元')),COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=2,C2,VARCAT(VARCAT('下限:',VAR2STR(C2,2)),'元')),COLORGREEN
DRAWTEXT(C1/C2<=1.03 AND C上穿C1 AND V>=VV,C1*1.005,'★买入')画红色
DRAWTEXT(C1/C2<=1.03 AND C2上穿C AND V>=VV,C2*0.998,'★卖出')COLORGREEN
STICKLINE(C1/C2<1.03 AND C上穿C1 AND V>=VV,DYNAINFO(3)*1.03,DYNAINFO(3)*0.97,1,0),画红色
攻击量赋值:((HSL*0.50+1日前的HSL*0.33)+(2日前的HSL*0.17))*FROMOPEN的C日累和/FROMOPEN
攻击量A赋值:SUM(IF(C>1日前的C,攻击量*V,0),FROMOPEN),COLOR0000FF,LINETHICK0
攻击量B赋值:-SUM(IF(C<1日前的C,攻击量*V,0),FROMOPEN),COLOR00FF00,LINETHICK0
攻击流量赋值:攻击量A+攻击量B,COLORSTICK
攻击比赋值:攻击流量/FROMOPEN的V日累和*100,画红色,LINETHICK1
资金攻击度赋值:IF(攻击比>=0,(攻击比+50),100-(攻击比-50的绝对值))
资金流入赋值:SUM(IF(C>1日前的C,V,0),FROMOPEN),STICK,画红色
资金流出赋值:-SUM(IF(C<1日前的C,V,0),FROMOPEN),STICK,COLOR00FF00
资金出入赋值:资金流入+资金流出,COLORSTICK
资金比赋值:资金出入/FROMOPEN的V日累和*100,COLOR00FFFF,LINETHICK1
资金流量比赋值:IF(资金比>=0,(资金比+100)/2,100-(资金比-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:480日内H最高值,DOTLINE,画红色
STICKLINE(FILTER(CROSS(C,1日前的XG),10) AND C>1日前的XG,C*0.99,C,8,0),COLORGREEN
DRAWTEXT(FILTER(CROSS(C,1日前的XG),10) AND C>1日前的XG,C*0.99,'突破'),COLORYELLOW
FF赋值:(C-5日前的C)/5日前的C
STICKLINE(FF>0,DYNAINFO(3),DYNAINFO(3)*(1+FF),0.5,0),画红色
STICKLINE(FF<0,DYNAINFO(3),DYNAINFO(3)*(1+FF),0.5,0),COLORGREEN