通达信虚拟涨幅价格主图指标公式
通达信屠龙工具指标公式
通达信虚拟涨幅价格主图指标公式:
XK:=30;
显示:=0;
{虚拟涨幅价格}
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(MIN(C,O),BARSNEXT(T1=0));
DRAWICON(MIN(C,O)=XL,L,1);
ZTKX:=IF(ISLASTBAR,REF(XL,T)*(1+XK/100),DRAWNULL),NODRAW;
STICKLINE(ISLASTBAR,ZTKX,MAX(OPEN,CLOSE),0,-1),COLORLIGRAY;
ZF:=(CONST(ZTKX)/REF(XL,T)-1)*100;{涨幅}
JG:=REF(XL,T)*(1+XK/100);
DRAWTEXT(CURRBARSCOUNT=4,JG,VARCAT(VARCAT('价格:',VAR2STR(CONST(ZTKX),2)),'元')),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=10,JG,VARCAT(VARCAT('涨幅:',VAR2STR(ZF,2)),'%')),COLORYELLOW;
{停复牌}
复牌:=DAY-IF(WEEKOFYEAR=REF(WEEKOFYEAR,1),1,3)>REF(DAY,1) OR WEEKOFYEAR-1>REF(WEEKOFYEAR,1);
停牌:=REFX(复牌,1);
DRAWTEXT(停牌,L*0.99,'停'),COLORWHITE;
DRAWTEXT(复牌,L*0.99,'复'),COLORWHITE;
{均线}
NOTEXTM5:IF(显示=1,MA(C,5),DRAWNULL),COLORWHITE;
NOTEXTM10:IF(显示=1,MA(C,10),DRAWNULL),COLORYELLOW;
NOTEXTM20:IF(显示=1,MA(C,20),DRAWNULL),COLORMAGENTA;
NOTEXTM60:IF(显示=1,MA(C,60),DRAWNULL),COLORGREEN;
{ene};
NOTEXT上:IF(显示=2,(1+11/100)*MA(CLOSE,9),DRAWNULL),COLORWHITE;
NOTEXT下:IF(显示=2,(1-9/100)*MA(CLOSE,9),DRAWNULL),COLORYELLOW;
NOTEXT中:IF(显示=2,(NOTEXT上+NOTEXT下)/2,DRAWNULL),COLORMAGENTA;
{expma}
NOTEXTEXP1:IF(显示=3,EMA(CLOSE,12),DRAWNULL),COLORWHITE;
NOTEXTEXP2:IF(显示=3,EMA(CLOSE,50),DRAWNULL),COLORYELLOW;
通达信转折线指标公式