所有周期都可以用的DDX 副图指标 源码介绍
所有周期都可以用的DDX 副图指标 源码
{SUPER-DDX}
INPUT: P1(60,0,100),P2(5,0,100),P3(10,0,100);
VARIABLE:DDX=0;
REFLINE:0;
DRAWGBKlast(DATE>900101,strip(RGB(0,0,180),RGB(0,20,0),0));
VAR0:=MIN(COUNT(ORDER(2),0),P1);
D1:=(BIGORDER(1) - BIGORDER(2));
D2:="DDEDATA@BIGORDER"(1,2)-"DDEDATA@BIGORDER"(2,2);
DD:=IF(ORDER(2)>0,D1,D2) * VOL/CAPITAL * 100;
T:=topview(1436,0,200);
TT:=T-REF(T,1);
DDX:IF(DATATYPE=8,DD,TT),LINETHICK0;;
STICKLINE(DDX>0 and DDX<0.5,0,DDX,7,0),color000099;
STICKLINE(DDX>=0.5 and DDX<1,0,DDX,7,0),color0000BB;
STICKLINE(DDX>=1 and DDX<2,0,DDX,7,0),color0000DD;
STICKLINE(DDX>=2,0,DDX,7,0),color0000FF;
STICKLINE(DDX>-0.5 and DDX<=0,0,DDX,7,0),COLOR009900;
STICKLINE(DDX<=-0.5 and DDX>-1,0,DDX,7,0),COLOR00BB00;
STICKLINE(DDX<=-1 and DDX>-2,0,DDX,7,0),COLOR00DD00;
STICKLINE(DDX<=-2,0,DDX,7,0),COLOR00FF00;
DDX1:EMA(DDX,VAR0)* VAR0,COLOR0000ff,LINETHICK2;
DDX2:MA(DDX1,P2),COLOR00ff00;
DDX3:MA(DDX1,P3),COLOR00ffff;
10周期飘红数:count(DDX>0,10),PRECIS0,LINETHICK0;
连续飘红数:last(DDX>0),PRECIS0,LINETHICK0;
X:=BARSLAST(DISPSTATUS=1)+1;
DRAWTEXTABS(0,5,'【单日DDX】 '+NUMTOSTRN((hhv(DDX,0)),3)+'%(单日最高)'),COLOR4477FF,LINETHICK3;
DRAWTEXTABS(0,25,'【'+X+'天累计】 '+NUMTOSTRN((hhv(SUM(DDX,X),0)),3)+'%(累计最高)'),COLOR00FF00,LINETHICK3;
DRAWTEXTABS(0,45,'【'+X+'天DDX】 '+NUMTOSTRN(SUM(DDX,X)/x,3)+'% (平均) '+NUMTOSTRN(SUM(DDX,X),3)+'% (累计) '),COLOR0000FF,LINETHICK3,LAYER0;
gd18702