划线压力支撑通达信公式 主图 源码附图
N:=60;
HH:=HHVBARS(H,N);
LL:=LLVBARS(L,N);
XX:=CONST(HH)>CONST(LL);
SX:=CONST(HH)<CONST(LL);
G:=CONST(REF(H,HH));
D:=CONST(REF(L,LL));
D1:=D*1.0418;
D2:=(G-D1)*0.218+D1;
D3:=(G-D2)*0.382+D2;
G1:=G*0.9618;
G2:=(G1-D)*0.382+D;
G3:=(G1-D)*0.682+D;
DRAWLINE(SX AND CURRBARSCOUNT=CONST(LL)+1,L,SX AND CURRBARSCOUNT=CONST(HH)+1,H,0),COLORYELLOW,LINETHICK1;
DRAWLINE(XX AND CURRBARSCOUNT=CONST(HH)+1,H,XX AND CURRBARSCOUNT=CONST(LL)+1,L,0),COLORGREEN,LINETHICK1;
STICKLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,H,D1,0,-1),COLORLIGRAY;
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D1,SX AND ISLASTBAR,D1,0),COLORLIGRAY,DOTLINE;
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D2,SX AND ISLASTBAR,D2,0),COLORLIGRAY,DOTLINE;
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D3,SX AND ISLASTBAR,D3,0),COLORLIGRAY,DOTLINE;
STICKLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,L,G1,0,-1),COLORLIGREEN;
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G1,XX AND ISLASTBAR,G1,0),COLORLIGREEN,DOTLINE;
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G2,XX AND ISLASTBAR,G2,0),COLORLIGREEN,DOTLINE;
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G3,XX AND ISLASTBAR,G3,0),COLORLIGREEN,DOTLINE;
A:=SX AND CURRBARSCOUNT=CONST(HH)+15;
B:=SX AND CURRBARSCOUNT=CONST(HH)+3;
A1:=XX AND CURRBARSCOUNT=CONST(HH);
B1:=XX AND CURRBARSCOUNT=CONST(LL)+3;
DRAWTEXT(A,G*0.98,VARCAT(VARCAT('本轮区间振幅:',VAR2STR((G-D)/D*100,2)),'%,')),COLORYELLOW;
DRAWNUMBER(B,D1,D1),COLORYELLOW;
DRAWNUMBER(B,D2,D2),COLORYELLOW;
DRAWNUMBER(B,D3,D3),COLORYELLOW;
DRAWTEXT(A1,G*0.98,VARCAT(VARCAT('本轮区间振幅:',VAR2STR((G-D)/D*100,2)),'%,')),COLORGREEN;
DRAWNUMBER(B1,G1,G1),COLORGREEN;
DRAWNUMBER(B1,G2,G2),COLORGREEN;
DRAWNUMBER(B1,G3,G3),COLORGREEN;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:60
HH赋值:HHVBARS(H,N)
LL赋值:LLVBARS(L,N)
XX赋值:CONST(HH)>CONST(LL)
SX赋值:CONST(HH)
G赋值:CONST(HH日前的H)
D赋值:CONST(LL日前的L)
D1:=D*1.0418
D2:=(G-D1)*0.218+D1
D3:=(G-D2)*0.382+D2
G1:=G*0.9618
G2:=(G1-D)*0.382+D
G3:=(G1-D)*0.682+D
DRAWLINE(SX AND CURRBARSCOUNT=CONST(LL)+1,L,SX AND CURRBARSCOUNT=CONST(HH)+1,H,0),COLORYELLOW,LINETHICK1
DRAWLINE(XX AND CURRBARSCOUNT=CONST(HH)+1,H,XX AND CURRBARSCOUNT=CONST(LL)+1,L,0),COLORGREEN,LINETHICK1
STICKLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,H,D1,0,-1),COLORLIGRAY
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D1,SX AND ISLASTBAR,D1,0),COLORLIGRAY,DOTLINE
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D2,SX AND ISLASTBAR,D2,0),COLORLIGRAY,DOTLINE
DRAWLINE(SX AND CURRBARSCOUNT=CONST(HH)+1,D3,SX AND ISLASTBAR,D3,0),COLORLIGRAY,DOTLINE
STICKLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,L,G1,0,-1),COLORLIGREEN
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G1,XX AND ISLASTBAR,G1,0),COLORLIGREEN,DOTLINE
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G2,XX AND ISLASTBAR,G2,0),COLORLIGREEN,DOTLINE
DRAWLINE(XX AND CURRBARSCOUNT=CONST(LL)+1,G3,XX AND ISLASTBAR,G3,0),COLORLIGREEN,DOTLINE
A赋值:SX AND CURRBARSCOUNT=CONST(HH)+15
B赋值:SX AND CURRBARSCOUNT=CONST(HH)+3
A1:=XX AND CURRBARSCOUNT=CONST(HH)
B1:=XX AND CURRBARSCOUNT=CONST(LL)+3
DRAWTEXT(A,G*0.98,VARCAT(VARCAT('本轮区间振幅:',VAR2STR((G-D)/D*100,2)),'%,')),COLORYELLOW
DRAWNUMBER(B,D1,D1),COLORYELLOW
DRAWNUMBER(B,D2,D2),COLORYELLOW
DRAWNUMBER(B,D3,D3),COLORYELLOW
DRAWTEXT(A1,G*0.98,VARCAT(VARCAT('本轮区间振幅:',VAR2STR((G-D)/D*100,2)),'%,')),COLORGREEN
DRAWNUMBER(B1,G1,G1),COLORGREEN
DRAWNUMBER(B1,G2,G2),COLORGREEN
DRAWNUMBER(B1,G3,G3),COLORGREEN