通达信兰色飘带主图指标
N:=5;CT:=0;
TON:=TOTALBARSCOUNT;
NN:=IF(BARSCOUNT(C)<N,BARSCOUNT(C),N);
上轨:REF(MA(H,NN),1),NODRAW;
下轨:REF(MA(L,NN),1),NODRAW;
带宽:100*(上轨/下轨-1),NODRAW;
STICKLINE(C,上轨,下轨,4,0),COLOR660000;
PA:=IF(CT=0,上轨,下轨);
BS:=FILTER(CROSS(C,PA),9);
信号:IF(BS,PA,0),NODRAW;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE),COLOR00FFFF;
BN:=BARSLAST(BS>0); 信号数:SUM(BS>0,0),NODRAW;
BJJ:=REF(PA,BN);
DRAWICON(信号>0 AND (BJJ/REF(BJJ,1)-1)*100<-N*2,LLV(L,7)*0.99,3);
DRAWICON(信号>0,LLV(L,7)*0.99,7);
P1:=HHV(H>BJJ*1.03 AND BN>0 AND BN<=3,BN+1);
短线机会%3:100*SUM(P1=1 AND REF(P1,1)=0,0)/信号数,NODRAW;
P2:=HHV(H>BJJ*1.05 AND BN>0 AND BN<=7,BN+1);
%7:100*SUM(P2=1 AND REF(P2,1)=0,0)/信号数,NODRAW;
M3:MA(C,30),LINETHICK2;
M6:MA(C,60),LINETHICK2;
M12:MA(C,125),LINETHICK2;
M25:MA(C,250),LINETHICK2;
N1:=300;{注:锁定显示区为310条K线时正常显示}
N2:=IF(TON<N1,TON,N1);
AH:=CONST(HHV(H,N2)); AL:=CONST(LLV(L,N2)); AHL:=AH-AL;
DRAWTEXT(CURRBARSCOUNT=N2,AH+AHL*0.05,IF(CT=0,'上轨★信号数','下轨★信号数')),COLOR00FFFF;
DRAWTEXT(CURRBARSCOUNT=INTPART(N2*0.85),AH+AHL*0.05,' ★短线概率 ■三天3%】'),COLOR00FFFF;
DRAWTEXT(CURRBARSCOUNT=INTPART(N2*0.63),AH+AHL*0.05,' % ■七天5%】 %★短线概率高低说明操盘相对安全性'),COLOR00FFFF;
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.9),AH+AHL*0.05, CONST(信号数)),COLOR0088FF;
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.68),AH+AHL*0.05,CONST(短线机会%3)),COLOR0088FF;
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.52),AH+AHL*0.05,CONST(%7)),COLOR0088FF;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:5
CT赋值:0
TON赋值:TOTALBARSCOUNT
NN赋值:IF(C的有效数据周期数输出
上轨:REF(H的NN日简单移动平均,1),NODRAW
输出
下轨:REF(L的NN日简单移动平均,1),NODRAW
输出
带宽:100*(上轨/下轨-1),NODRAW
当满足条件C时,在上轨和下轨之间画柱状线
如果CT=0返回上轨否则返回下轨
BS赋值:FILTER(C上穿PA,9)
如果BS返回PA否则返回0
DRAWKLINE(最高价,OPEN,最低价,收盘价),COLOR00FFFF
BN赋值:上次BS>0距今天数
输出信号数:0的BS>0日累和,NODRAW
BJJ赋值:BN日前的PA
DRAWICON(信号>0 AND (BJJ/1日前的BJJ-1)*100<-N*2,7日内L最低值*0.99,3)
DRAWICON(信号>0,7日内L最低值*0.99,7)
P1赋值:BN+1日内H>BJJ*1.03 AND BN>0 AND BN<=3最高值
输出
短线机会%3:100*0的P1=1 AND 1日前的P1=0日累和/信号数,NODRAW
P2赋值:BN+1日内H>BJJ*1.05 AND BN>0 AND BN<=7最高值
输出
%7:100*0的P2=1 AND 1日前的P2=0日累和/信号数,NODRAW
输出
M3:C的30日简单移动平均,LINETHICK2
输出
M6:C的60日简单移动平均,LINETHICK2
输出
M12:C的125日简单移动平均,LINETHICK2
输出
M25:C的250日简单移动平均,LINETHICK2
N1:=300
如果TON
AH赋值:CONST(N2日内H最高值)
AL赋值:CONST(N2日内L最低值)
AHL赋值:AH-AL
如果CT=0返回'上轨★信号数'否则返回'下轨★信号数'
DRAWTEXT(CURRBARSCOUNT=INTPART(N2*0.85),AH+AHL*0.05,' ★短线概率 ■三天3%】'),COLOR00FFFF
DRAWTEXT(CURRBARSCOUNT=INTPART(N2*0.63),AH+AHL*0.05,' % ■七天5%】 %★短线概率高低说明操盘相对安全性'),COLOR00FFFF
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.9),AH+AHL*0.05, CONST(信号数)),COLOR0088FF
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.68),AH+AHL*0.05,CONST(短线机会%3)),COLOR0088FF
DRAWNUMBER(CURRBARSCOUNT=INTPART(N2*0.52),AH+AHL*0.05,CONST(%7)),COLOR0088FF