通达信周日KDJ指标公式

通达信峰谷趋势主图指标公式

通达信周日KDJ指标公式:

ZQ:=CURRBARSCOUNT<55;{设置日macd显示周期数为最后90天}

P:=61;{设定从倒数第150根k线开始显示周MacD}

Q:=50;{设定周周MACD显示周期数为40周}

P1:=135;{设定从倒数第135根K线开始显示月MACD}

Q1:=20;{设定月MACD显示周期数为20个月}

ZK:=kdj.K#WEEK;

ZD:=kdJ.D#WEEK;

ZJ:=KDJ.J#WEEK;

YK:=KDJ.K#MONTH;

YD:=KDJ.D#MONTH;

YJ:=KDJ.J#MONTH;

ZQZ:=TOTALBARSCOUNT;

ZQ1:=BARSCOUNT(C);

KX1:=ZQZ-ZQ1;{周K线显示开始位置按倒数K线数计算}

N1:=KX1;{周K线显示开始位置}

K6:=AA.DT1#WEEK;{周K线周期}

K7:=K6>REF(K6,1);{周K线更后}

K8:=SUM(K7,0);{当前周K线位置}

K9:=CONst(K8)-K8;

ZH:=ISLASTBAR;

SU:=IF(ZH,0,SUMBARS(K7,N1-K9)-1);

Z1:=REF(ZK,SU);Z2:=REF(ZD,SU);Z3:=REF(ZJ,SU);

Z11:=REFX(Z1,P);Z22:=REFX(Z2,P);Z33:=REFX(Z3,P);

W2:=KX1<P+Q;

周K:IF(W2,Z11,DRAWNULL),COLORWHITE;

周D:IF(W2,Z22,DRAWNULL),COLORYELLOW,LINETHICK1;

周J:IF(W2,Z33,DRAWNULL),COLORMAGENTA;

KK6:=AA.DT1#MONTH;

KK7:=KK6>REF(KK6,1);

KK8:=SUM(KK7,0);

KK9:=CONST(KK8)-KK8;

SU1:=IF(ZH,0,SUMBARS(KK7,KX1-KK9)-1);

Y1:=REF(YK,SU1);Y2:=REF(YD,SU1);Y3:=REF(YJ,SU1);

Y11:=REFX(Y1,P1);Y22:=REFX(Y2,P1);Y33:=REFX(Y3,P1);

W22:=KX1<P1+Q1;

K:IF(ZQ,KDJ.K,DRAWNULL),COLORWHITE;

D:IF(ZQ,KDJ.D,DRAWNULL),COLORYELLOW,LINETHICK1;

J:IF(ZQ,KDJ.J,DRAWNULL),COLORMAGENTA;

DRAWTEXT(KX1=P+Q-2,KDJ.K,'周');

通达信生擒黑马指标公式