一、通达信CCI顶底背离划线指标公式
N:=14;
M:=210;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
TYP15:=(HHV(HIGH,15)+LLV(LOW,15)+CLOSE)/3;
CCI15:(TYP15-MA(TYP15,M))/(0.015*AVEDEV(TYP15,M)),COLORRED;
AA:=REF(CCI,3)=HHV(CCI,2*3+1);
BB:=BACKSET(AA,3+1);
CC:=FILTER(BB,3) AND CCI=HHV(CCI,3+1);
A1:=BARSLAST(REF(CC,1));
顶背离:=REF(CLOSE,A1+1)<CLOSE AND REF(CCI,A1+1)>CCI AND CC;
DRAWLINE(CC,CCI,FILTER(顶背离>0,5),CCI,0),COLOR004000,LINETHICK3;
AA2:=REF(CCI,3)=LLV(CCI,2*3+1);
BB2:=BACKSET(AA2,3+1);
CC2:=FILTER(BB2,3) AND CCI=LLV(CCI,3+1);
AA2A:=BARSLAST(REF(CC2,1));
底背离:=REF(C,AA2A+1)>CLOSE AND REF(CCI,AA2A+1);
DRAWLINE(CC2,CCI,FILTER(底背离>0,5),CCI,0),COLORRED,LINETHICK3;
DRAWLINE(CC2,CCI,FILTER(底背离>0,5),CCI,0),COLORRED,LINETHICK3;
二、通达信分时买卖量变指标公式
N:=60;
K1:=IF(CLOSE>=REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW+CLOSE-REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW);
K2:=IF(CLOSE<=REF(CLOSE,1),OPEN-LOW+HIGH-CLOSE+REF(CLOSE,1)-CLOSE,OPEN-LOW+HIGH-CLOSE);
DT:=VOL*K1/(K1+K2);
KT:=VOL-DT;
买量:SUM(DT,N),COLORRED;
卖量:SUM(KT,N),COLORCYAN;