自用的kdj监控主图。 自编kdj监控主图 j1:=(100); RSI预设:=80; RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; K:SMA(RSV,3,1),LINETHICK0,PRECIS1; D:SMA(K,3,1),LINETHICK0,PRECIS1; J:3*K-2*D,LINETHICK0,PRECIS1; RSV1:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9)); RSV2:=(RSV1-0.5)/5*EMA(C,21); RSVK:=SMA(RSV2,3,1); RSVD:=SMA(RSVK,3,1); RSVJ:=RSVK*3-RSVD*2; Kj:RSVK+EMA(C,21),COLORWHITE,LINETHICK1,PRECIS0; Dj:RSVD+EMA(C,21),COLORYELLOW,LINETHICK1; Jj:RSVJ+EMA(C,21),COLORRED; LC := REF(CLOSE,1); Aa1:=SMA(MAX(CLOSE-LC,0),6,1); Bb1:=SMA(ABS(CLOSE-LC),6,1); RSI:aa1/bb1*100,LINETHICK0,PRECIS1; TYP := (HIGH + LOW + CLOSE)/3; cci:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),LINETHICK0,PRECIS1; 买:=(cci<-80 and cci>ref(cci,1)) and (rsi<40 and rsi>ref(rsi,1)) and (j<20) and j>0; DRAWTEXT(买,L-0.01,'●买'),COLORMAGENTA; 卖:=(cci>90 and cci<ref(cci,1)) and (rsi>60 and rsi<ref(rsi,1)) and (j>80 and j<ref(j,1)); 卖21:=ref(cci,1)>100 and ref(rsi,1)>70 and ref(j,1)>90 and (cci>ref(cci,1) or rsi>ref(rsi,1) or j>ref(j,1)); 卖22:=cci>100 and j>90 and rsi>70 and (cci<ref(cci,1) or rsi<ref(rsi,1) or j<ref(j,1)); 卖2:=卖21 or 卖22; DRAWTEXT(卖,h+0.1,'●'),colorgreen; DRAWTEXT(卖2,h+0.05,'●'),Coloryellow; {j反推} j11:=j; j昨:=ref(j,1); jx:=if(j1=-50,j11,if(j1=-49,j昨,j1)); xxx:=((9/7*jx-2*ref(k,1)+12/7*ref(d,1))/100)*(HHV(HIGH,9)-LLV(LOW,9))+LLV(LOW,9); YCJ:IF(C>LC,(REF(Aa1,1)*(9-1)-REF(Bb1,1)*(9-1)*RSI预设/100)/(RSI预设/100-1)+LC,LC+REF(Bb1,1)*(9-1)-REF(Aa1,1)*(9-1)/(RSI预设/100)),LINETHICK0,PRECIS1; rYCJ:=(YCJ-ref(c,1)); rre:=(80-ref(rsi,1)); rzz:=rre/rycj; rh:=h-ref(c,1); rhh:rzz*rh+ref(rsi,1),LINETHICK0,PRECIS1; jxxx:=(xxx-ref(c,1)); jje:=(100-ref(j,1)); jzz:=jje/jxxx; jhh:jzz*rh+ref(j,1),LINETHICK0,PRECIS1; xh:=(rhh>70 and jhh>100) or (rhh>80 and jhh>90); jrhh:=xh and (j<jhh or rsi<rhh); DRAWTEXT(jrhh,h+0.1,'◆'),colorred; DRAWTEXTREL(450,30,'预设J值=100 J临界股价: '+NUMTOSTRN(xxx ,2)),LINETHICK1,Coloryellow; DRAWTEXTREL(450,90,'预设R值=80 R临界股价: '+NUMTOSTRN(YCJ ,2)),LINETHICK1,Coloryellow; DRAWTEXTABS(10,10,'图示:●=必卖'),LINETHICK1,colorgreen; DRAWTEXTABS(10,30,'图示:●=指标应卖 '),LINETHICK1,Coloryellow; DRAWTEXTABS(10,50,'图示:◆=指标超卖 '),LINETHICK1,colorred; |
