灾后自救之三主图 通达信 贴图
HH:=IF(BETWEEN(DATE,1150601,1150630),H,-999);
T:=HHVBARS(HH,0);
TT:=BARSLAST(L=LLV(L,T+1));
T1:=BARSLAST(CURRBARSCOUNT=CONST(TT)+1);
XL:=REFX(L,BARSNEXT(T1=0));
亏损:(REF(C,TT+1)-REF(C,T))/REF(C,T)*100 NODRAW;
ZF:=(C-REF(C,T+1))/REF(C,T+1)*100;
JJ:=AMOUNT/VOL/100;
VH:=BARSLAST(VOL=HHV(VOL,TT+1));
强支撑:DRAWLINE(CURRBARSCOUNT=CONST(VH)+1,REF(JJ,VH),ISLASTBAR,REF(JJ,VH),0),COLORWHITE;
回本:ZF COLORMAGENTA,NODRAW;
高位价:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,HH,ISLASTBAR,REF(HH,T),0),COLORYELLOW;
NOTEXT1:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,(HH-XL)*0.382+XL,ISLASTBAR,REF((HH-XL)*0.382+XL,T),0),DOTLINE,COLORGREEN;
NOTEXT2:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,(HH-XL)*0.618+XL,ISLASTBAR,REF((HH-XL)*0.618+XL,T),0),DOTLINE,COLORLIMAGENTA;
低位价:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,XL,ISLASTBAR,REF(L,T1),0),COLORRED;
DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,NOTEXT1*1.04,VARCAT(VARCAT('第一阻力:',VAR2STR(NOTEXT1,2)),'元')),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,NOTEXT2*1.04,VARCAT(VARCAT('第二阻力:',VAR2STR(NOTEXT2,2)),'元')),COLORLIMAGENTA;
涨幅:(C-REF(C,TT+1))/REF(C,TT+1)*100 NODRAW;
STICKLINE(T1=0,C,O,2,0),COLORYELLOW;
STICKLINE(T1=0,H,L,0,0),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:BARSNEXT
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
HH赋值:IF(BETWEEN(DATE,1150601,1150630),H,-999)
T赋值:HHVBARS(HH,0)
TT赋值:上次L=T+1日内L最低值距今天数
T1:=上次CURRBARSCOUNT=CONST(TT距今天数+1)
XL赋值:REFX(L,BARSNEXT(T1=0))
输出亏损:(TT+1日前的C-T日前的C)/T日前的C*100 NODRAW
ZF赋值:(C-T+1日前的C)/T+1日前的C*100
JJ赋值:AMOUNT/成交量/100
VH赋值:上次成交量=TT+1日内成交量最高值距今天数
输出强支撑:DRAWLINE(CURRBARSCOUNT=CONST(VH)+1,VH日前的JJ,ISLASTBAR,VH日前的JJ,0),COLORWHITE
输出回本:ZF COLORMAGENTA,NODRAW
输出高位价:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,HH,ISLASTBAR,T日前的HH,0),画黄色
NOTEXT1:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,(HH-XL)*0.382+XL,ISLASTBAR,REF((HH-XL)*0.382+XL,T),0),DOTLINE,画绿色
NOTEXT2:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,(HH-XL)*0.618+XL,ISLASTBAR,REF((HH-XL)*0.618+XL,T),0),DOTLINE,COLORLIMAGENTA
输出低位价:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,XL,ISLASTBAR,T1日前的L,0),画红色
DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,NOTEXT1*1.04,VARCAT(VARCAT('第一阻力:',VAR2STR(NOTEXT1,2)),'元')),画绿色
DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,NOTEXT2*1.04,VARCAT(VARCAT('第二阻力:',VAR2STR(NOTEXT2,2)),'元')),COLORLIMAGENTA
输出涨幅:(C-TT+1日前的C)/TT+1日前的C*100 NODRAW
当满足条件T1=0时,在C和O之间画柱状线
当满足条件T1=0时,在H和L之间画柱状线