通达信两峰三峰箱体主图
N1:=10;
N2:=60;
N3:=10;
A1:=REFX(HHV(H,N1),N1-1);{N1为峰的宽度}{N2为箱体宽度}
A2:=IF(H=HHV(H,N1)&&H=A1,H,DRAWNULL);
高点:=IF(A2=REF(A2,1),DRAWNULL,A2);
F1:=FINDHIGH(高点,0,N2,1);
F2:=FINDHIGH(高点,0,N2,2);
AVGH:=(H+C+O+L)/4;
平均:=(F1+F2+AVGH)/3;
方差:=POW(F1-平均,2)+POW(F2-平均,2)+POW(AVGH-平均,2);
标准差:=SQRT(方差);
B1:=标准差<=(N3/100);
C1:=COUNT(B1>0 AND REF(B1,1)=0,0);
C2:=CONST(C1)-C1;
P1:=BARSLAST(C2=0 AND REF(C2,1)>=1);
P2:=CONST(P1);
L1:=CONST(REF(AVGH,P1));
LL1:IF(H>L1,DRAWNULL,L1),DOTLINE;
L2:IF(CURRBARSCOUNT<=(N2+P2) AND CURRBARSCOUNT>=P2,L1,DRAWNULL)COLORYELLOW,DOTLINE;
LOW1:=IF(ISLASTBAR,FINDLOW(L,P2,N2,1),DRAWNULL);
L3:IF(CURRBARSCOUNT<=(N2+P2) AND CURRBARSCOUNT>=P2,CONST(LOW1),DRAWNULL)COLORYELLOW,DOTLINE;
STICKLINE(CURRBARSCOUNT=P2 OR CURRBARSCOUNT=(P2+N2),L2,L3,0.000001,0)COLORYELLOW;
F3:=FINDHIGH(高点,0,N2,3);
B平均:=(F1+F2+F3+AVGH)/4;
BFC:=POW(F1-平均,2)+POW(F2-平均,2)+POW(F3-B平均,2)+POW(AVGH-平均,2);
{股票指标网}
BBZC:=SQRT(BFC);
BB1:=BBZC<=(N3/70);
BC1:=COUNT(BB1>0 AND REF(BB1,1)=0,0);
BC2:=CONST(BC1)-BC1;
BP1:=BARSLAST(BC2=0 AND REF(BC2,1)>=1);
BP2:=CONST(BP1);
BL1:=CONST(REF(AVGH,BP1));
BBL1:IF(H>BL1,DRAWNULL,BL1),DOTLINE;
BL2:IF(CURRBARSCOUNT<=(N2+BP2) AND CURRBARSCOUNT>=BP2,BL1,DRAWNULL)COLORYELLOW,DOTLINE;
BLOW1:=IF(ISLASTBAR,FINDLOW(L,BP2,N2,1),DRAWNULL);
BL3:IF(CURRBARSCOUNT<=(N2+BP2) AND CURRBARSCOUNT>=BP2,CONST(BLOW1),DRAWNULL)COLORYELLOW,DOTLINE;
STICKLINE(CURRBARSCOUNT=BP2 OR CURRBARSCOUNT=(BP2+N2),BL2,BL3,0.000001,0)COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N1赋值:10
N2赋值:60
N3赋值:10
A1赋值:REFX(N1日内H最高值,N1-1)
{N1为峰的宽度}{N2为箱体宽度}
A2:=IF(H=N1日内H最高值&&H=A1,H,DRAWNULL)
高点赋值:IF(A2=1日前的A2,DRAWNULL,A2)
F1赋值:FIND最高价(高点,0,N2,1)
F2赋值:FIND最高价(高点,0,N2,2)
AVGH赋值:(H+C+O+L)/4
平均赋值:(F1+F2+AVGH)/3
方差赋值:POW(F1-平均,2)+POW(F2-平均,2)+POW(AVGH-平均,2)
标准差赋值:SQRT(方差)
B1赋值:标准差<=(N3/100)
C1赋值:COUNT(B1>0 AND 1日前的B1=0,0)
C2赋值:CONST(C1)-C1
P1赋值:上次C2=0 AND 1日前的C2>=1距今天数
P2赋值:CONST(P1)
L1赋值:CONST(P1日前的AVGH)
如果H>L1返回DRAWNULL否则返回L1
输出
L2:IF( 到最后交易的周期<=(N2+P2) AND 到最后交易的周期>=P2,L1,DRAWNULL)画黄色,DOTLINE
LOW1赋值:IF(ISLASTBAR,FIND最低价(L,P2,N2,1),DRAWNULL)
输出
L3:IF( 到最后交易的周期<=(N2+P2) AND 到最后交易的周期>=P2,CONST(最低价1),DRAWNULL)画黄色,DOTLINE
STICKLINE( 到最后交易的周期=P2 OR 到最后交易的周期=(P2+N2),L2,L3,0.000001,0)画黄色
F3赋值:FIND最高价(高点,0,N2,3)
B平均赋值:(F1+F2+F3+AVGH)/4
BFC赋值:POW(F1-平均,2)+POW(F2-平均,2)+POW(F3-B平均,2)+POW(AVGH-平均,2)
{股票指标网}
BBZC赋值:SQRT(BFC)
BB1赋值:BBZC<=(N3/70)
BC1赋值:COUNT(BB1>0 AND 1日前的BB1=0,0)
BC2赋值:CONST(BC1)-BC1
BP1赋值:上次BC2=0 AND 1日前的BC2>=1距今天数
BP2赋值:CONST(BP1)
BL1赋值:CONST(BP1日前的AVGH)
如果H>BL1返回DRAWNULL否则返回BL1
输出
BL2:IF( 到最后交易的周期<=(N2+BP2) AND 到最后交易的周期>=BP2,BL1,DRAWNULL)画黄色,DOTLINE
BLOW1赋值:IF(ISLASTBAR,FIND最低价(L,BP2,N2,1),DRAWNULL)
输出
BL3:IF( 到最后交易的周期<=(N2+BP2) AND 到最后交易的周期>=BP2,CONST(B最低价1),DRAWNULL)画黄色,DOTLINE
STICKLINE( 到最后交易的周期=BP2 OR 到最后交易的周期=(BP2+N2),BL2,BL3,0.000001,0)画黄色