N:=23; M:=7;
TH:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,0),N);
TL:=SUM(IF(CLOSE<REF(CLOSE,1),VOL,0),N);
TQ:=SUM(IF(CLOSE=REF(CLOSE,1),VOL,0),N);
VAR0:=100*(TH*2+TQ)/(TL*2+TQ),COLOR0000FF,LINETHICK2;
VAR1:=MA(VAR0,M),COLOR00FFFF,LINETHICK2;
{DRAWBAND(VAR0,RGB(255,0,0),VAR1,RGB(0,0,220));}
W:=CROSS(VAR0,VAR1);
WL1:=VAR1<100;
WL2:=VAR1<150 AND VAR1>REF(VAR1,1);
WLT1:=W AND WL1;
WLT2:=W AND WL2;
TJ1:=FILTER(WLT1,5);
TJ2:=FILTER(WLT2,8);
全仓:IF(TJ1,4,0),COLORFFFF99,LINETHICK2;
九毛八公式解读
N赋值:23 M赋值:7 TH赋值:如果收盘价>1日前的收盘价,返回成交量(手),否则返回0的N日累和 TL赋值:如果收盘价<1日前的收盘价,返回成交量(手),否则返回0的N日累和 TQ赋值:如果收盘价=1日前的收盘价,返回成交量(手),否则返回0的N日累和 VAR0赋值:100*(TH*2+TQ)/(TL*2+TQ),COLOR0000FF,线宽为2 VAR1赋值:VAR0的M日简单移动平均,COLOR00FFFF,线宽为2 W赋值:VAR0上穿VAR1 WL1赋值:VAR1<100 WL2赋值:VAR1<150 AND VAR1>1日前的VAR1 WLT1赋值:W AND WL1 WLT2赋值:W AND WL2 TJ1赋值:WLT1的5日过滤 TJ2赋值:WLT2的8日过滤 输出全仓:如果TJ1,返回4,否则返回0,COLORFFFF99,线宽为2