DDX作持仓线(大智慧)

N:=22;jj:=(HIGH+LOW+CLOSE)/3;qj0:=vol/IF(HIGH=LOW,4,HIGH-LOW);

qj1:=IF(CAPITAL=0,qj0*(jj-MIN(CLOSE,OPEN)),qj0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW)));

qj2:=IF(CAPITAL=0,qj0*(MIN(OPEN,CLOSE)-LOW),qj0*IF(HIGH=LOW,1,(jj-MIN(CLOSE,OPEN))));

qj3:=IF(CAPITAL=0,qj0*(HIGH-MAX(OPEN,CLOSE)),qj0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE))));

qj4:=IF(CAPITAL=0,qj0*(MAX(CLOSE,OPEN)-jj),qj0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-jj)));

DRAWTEXTREL(0,0,'主力持仓'),COLORYELLOW;

SVZL:sum(((qj1+qj2)-(qj3+qj4))/sum(VOL,60),0);

CZ:=SVZL-REF(SVZL,1);

stICKLINE(CZ<0,SVZL+CZ,SVZL,3,0),COLORFFFF00;

STICKLINE(CZ>0,SVZL,SVZL+CZ,3,0),COLORRED;

IF CZ<0 THEN

DRAWFLAGTEXT(1,SVZL+CZ,'当日主力净卖出占流通盘的'+STR(Abs(CZ))+'%');

ELSE

DRAWFLAGTEXT(1,SVZL+CZ,'当日主力净买入占流通盘的'+STR(ABS(CZ))+'%'),COLORRED;