前期高点通达信公式 副图 源码附图
N:=60;
HXA1:=REF(HIGH,N)=HHV(HIGH,2*N+1);
HXB1:=FILTER(HXA1,N);
HXC1:=BACKSET(HXB1,N+1);
HXD1:=FILTER(HXC1,N);
HXA2:=REF(LOW,N)=LLV(LOW,2*N+1);
HXB2:=FILTER(HXA2,N);
HXC2:=BACKSET(HXB2,N+1);
HXD2:=FILTER(HXC2,N);
HXE1:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2;
HXE2:=(HIGH+LOW)/2;{}
HXH1:=(HXD1 AND NOT(HXD2 AND HXE1>=HXE2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXH2:=HXD1 AND NOT(HXD2 AND HXE1>=HXE2);
HXL1:=HXD2 AND NOT(HXD1 AND HXE1=HXE2);
HXX1:=REF(BARSLAST(HXH1),1)+1;
HXF1:=BACKSET(HXH1 AND COUNT(HXL1,HXX1)>0,LLVBARS(IF(HXL1,LOW,10000),HXX1));
HXG1:=HXF1>REF(HXF1,1);
HXI1:=BACKSET(HXG1,2);
HXLD:=HXI1>REF(HXI1,1);
HXL2:=HXLD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXX2:=REF(BARSLAST(HXL2),1)+1;
HXF2:=BACKSET(HXL2 AND COUNT(HXH2,HXX2)>0,HHVBARS(IF(HXH2,HIGH,0),HXX2));
HXG2:=HXF2>REF(HXF2,1);
HXI2:=BACKSET(HXG2,2);
HXHD:=HXI2>REF(HXI2,1);
UU2:=BACKSET(BARSTATUS=2,BARSLAST(HXHD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HXHD),1)+2);
XX2:=WW2>REF(WW2,1);
WW3:=BACKSET(XX2,REF(BARSLAST(HXHD),2)+30);
XX3:=WW3>REF(WW3,1);
WW4:=BACKSET(XX3,REF(BARSLAST(HXHD),3)+50);
XX4:=WW4>REF(WW4,1);
前一高:REF(H,BARSLAST(VV2)),COLORBLUE,DOTLINE;
前二高:REF(H,BARSLAST(XX2)),COLORff00ff,DOTLINE;
前三高:REF(H,BARSLAST(XX3)),COLOR00ffff,DOTLINE;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:60
HXA1赋值:N日前的最高价=2*N+1日内最高价最高值
HXB1赋值:HXA1的N过滤
HXC1赋值:BACKSET(HXB1,N+1)
HXD1赋值:HXC1的N过滤
HXA2赋值:N日前的最低价=2*N+1日内最低价最低值
HXB2赋值:HXA2的N过滤
HXC2赋值:BACKSET(HXB2,N+1)
HXD2赋值:HXC2的N过滤
HXE1赋值:(REF(2*N日内最低价最低值,1)+REF(2*N日内最高价最高值,1))/2
HXE2赋值:(最高价+最低价)/2
{}
HXH1赋值:(HXD1 AND NOT(HXD2 AND HXE1>=HXE2)) OR BARSTATUS=2 OR 收盘价的有效数据周期数=1
HXH2赋值:HXD1 AND NOT(HXD2 AND HXE1>=HXE2)
HXL1赋值:HXD2 AND NOT(HXD1 AND HXE1=HXE2)
HXX1赋值:REF(上次HXH1距今天数,1)+1
如果HXL1返回最低价否则返回10000
HXG1赋值:HXF1>1日前的HXF1
HXI1赋值:BACKSET(HXG1,2)
HXLD赋值:HXI1>1日前的HXI1
HXL2赋值:HXLD OR BARSTATUS=2 OR 收盘价的有效数据周期数=1
HXX2赋值:REF(上次HXL2距今天数,1)+1
如果HXH2返回最高价否则返回0
HXG2赋值:HXF2>1日前的HXF2
HXI2赋值:BACKSET(HXG2,2)
HXHD赋值:HXI2>1日前的HXI2
UU2赋值:BACKSET(BARSTATUS=2,上次HXHD距今天数+1)
VV2赋值:UU2>1日前的UU2
WW2赋值:BACKSET(VV2,REF(上次HXHD距今天数,1)+2)
XX2赋值:WW2>1日前的WW2
WW3赋值:BACKSET(XX2,REF(上次HXHD距今天数,2)+30)
XX3赋值:WW3>1日前的WW3
WW4赋值:BACKSET(XX3,REF(上次HXHD距今天数,3)+50)
XX4赋值:WW4>1日前的WW4
输出前一高:REF(H,上次VV2距今天数), 画蓝色,DOTLINE
输出
前二高:REF(H,上次XX2距今天数),COLORFF00FF,DOTLINE
输出
前三高:REF(H,上次XX3距今天数),COLOR00FFFF,DOTLINE