通达信区间窄幅波动主图指标 划线找寻洗盘后突破 江哥小工具 有未来
N:=100;
M:=30;
B:=2;
{公开版}
{以600058\000004为例}
{区间波动}
ZH:=HHV(H,N),COLORRED;
ZL:=LLV(L,N),COLORGREEN;
ZF:=(ZH/ZL-1)*100;
XG:=ZF<=M;
{常规用法}
DWB:=FILTERX(XG,BARSLASTCOUNT(XG)),COLORGREEN;
T2:=BACKSET(DWB,N);
{扩展用法,取XG的第一个信号,向左延伸N天,形成区间}
DWA:=BARSSINCEN(XG,100)=0,COLORYELLOW;{这里的100,是N的常数版}
T1:=BACKSET(DWA,N);
{高级用法,利用BOLL的正态分布,确定系数B,寻找K线最密集的上下区间,略}
{常规用法的绘图}
DRAWGBK_DIV(T2,RGB(50,200,50),RGB(0,0,0),2,1);
RDWB:=BARSNEXT(DWB);
PRICEB:=REFX(HHV(H,N),RDWB);
ZFB:=REFX(ZF,RDWB);
DRAWTEXT(CROSS(T2,0.5),PRICEB,VARCAT(VAR2STR(RDWB+1,0),VARCAT('天,K线振幅%',VAR2STR(ZFB,0)))),COLORGREEN,DRAWABOVE;
{扩展用法的绘图}
DRAWGBK_DIV(T1,RGB(255,255,0),RGB(0,0,0),2,1);
RDWA:=BARSNEXT(DWA);
PRICEA:=REFX(HHV(H,N),RDWA);
ZFA:=REFX(ZF,RDWA);
DRAWTEXT(CROSS(T1,0.5),PRICEA,VARCAT(VAR2STR(RDWA+1,0),VARCAT('天,K线振幅%',VAR2STR(ZFA,0)))),COLORYELLOW,DRAWABOVE;
DRAWKLINE(H,O,L,C);
未来函数检测结果如下:
该公式包含未来函数:BACKSET
该公式包含未来函数:BARSNEXT
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:100
M赋值:30
B赋值:2
{公开版}
{以600058\000004为例}
{区间波动}
ZH赋值:N日内H最高值,画红色
ZL赋值:N日内L最低值,COLORGREEN
ZF赋值:(ZH/ZL-1)*100
XG赋值:ZF<=M
{常规用法}
DWB赋值:FILTERX(XG,BARSLASTCOUNT(XG)),COLORGREEN
T2赋值:BACKSET(DWB,N)
{扩展用法,取XG的第一个信号,向左延伸N天,形成区间}
DWA:=BARSSINCEN(XG,100)=0,画黄色
{这里的100,是N的常数版}
T1:=BACKSET(DWA,N)
{高级用法,利用BOLL的正态分布,确定系数B,寻找K线最密集的上下区间,略}
{常规用法的绘图}
DRAWGBK_DIV(T2,RGB(50,200,50),RGB(0,0,0),2,1)
RDWB赋值:BARSNEXT(DWB)
PRICEB赋值:REFX(N日内H最高值,RDWB)
ZFB赋值:REFX(ZF,RDWB)
DRAWTEXT(T2上穿0.5,PRICEB,VARCAT(VAR2STR(RDWB+1,0),VARCAT('天,K线振幅%',VAR2STR(ZFB,0)))),COLORGREEN,DRAWABOVE
{扩展用法的绘图}
DRAWGBK_DIV(T1,RGB(255,255,0),RGB(0,0,0),2,1)
RDWA赋值:BARSNEXT(DWA)
PRICEA赋值:REFX(N日内H最高值,RDWA)
ZFA:=REFX(ZF,RDWA)
DRAWTEXT(T1上穿0.5,PRICEA,VARCAT(VAR2STR(RDWA+1,0),VARCAT('天,K线振幅%',VAR2STR(ZFA,0)))),画黄色,DRAWABOVE
DRAWKLINE(H,O,L,C)