- {MACD和KDJ二合一}
- RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
- K:SMA(RSV,3,1),PRECISION2,linethick0,colorwhite;
- D:SMA(K,3,1),PRECISION2,linethick0,coloryellow;
- J:3*K-2*D,PRECISION2,linethick0,COLORMAGENTA;
- 分开:c>0,COLORBLACK;
- DIFF:(EMA(CLOSE,12) - EMA(CLOSE,26)),linethick0,COLORCYAN;
- DEA:EMA(DIFF,9),COLORBLUE,LINETHICK0;
- MACD:2*(DIFF-DEA),linethick0,PRECISION3,COLORRED;
- a:=SYSPARAM(3)-SYSPARAM(2)+1;
- jh:=hhv(max(k,max(d,j)),a);
- jl:=llv(min(k,min(d,j)),a);
- diffh:=hhv(max(diff,max(dea,macd)),a);
- diffl:=llv(min(diff,min(dea,macd)),a);
- b1:=SYSPARAM(3)-barpos;
- hlast:=refx(max(jh,diffh),b1);
- llast:=refx(min(jl,diffl),b1);
- hl:=hlast-llast;
- jhl:=refx(jh,b1)-refx(jl,b1);
- diffhl:=refx(diffh,b1)-refx(diffl,b1);
- hl2:=hlast+llast;
- jhl2:=refx(jh,b1)+refx(jl,b1);
- diffhl2:=refx(diffh,b1)+refx(diffl,b1);
- jp:=hl/jhl;
- diffp:=hl/diffhl;
- {AAAAAAAA:1000000000000000000000000000000000000,colorblack,linethick0;}
- DIFF2:=(DIFF-diffhl2/2)*diffp+hl2/2-35;//DIFF
- PARTLINE(C,DIFF2),COLORCYAN;
- DEA2:=(DEA-diffhl2/2)*diffp+hl2/2-35;
- PARTLINE(C,DEA2),COLORBLUE;//DEA
- STICKLINE(DIFF2>DEA2,0,DIFF2-DEA2,0,0),COLORRED;//MACD
- STICKLINE(DIFF2<DEA2,0,DIFF2-DEA2,0,0),COLORCYAN;//MACD
- k2:=(k-jhl2/2)*jp+hl2/2;//k
- PARTLINE(C,k2),colorwhite;
- d2:=(d-jhl2/2)*jp+hl2/2;//d
- PARTLINE(C,d2),coloryellow;
- j2:=(j-jhl2/2)*jp+hl2/2;//j
- PARTLINE(C,j2),COLORMAGENTA;
- k3:=hl/4;
- k4:=jhl/4;
- DRAWTEXT(islastbar,hlast-k3/3,' KD'+'\n'+' J用'),coloryellow;
- STICKLINE(islastbar,hlast,llast,2,0),colorwhite;
- STICKLINE(islastbar,llast,llast,8,0),colorwhite;
- STICKLINE(islastbar,k3+llast,k3+llast,8,0),colorwhite;
- STICKLINE(islastbar,k3*2+llast,k3*2+llast,8,0),colorwhite;
- STICKLINE(islastbar,k3*3+llast,k3*3+llast,8,0),colorwhite;
- STICKLINE(islastbar,hlast,hlast,8,0),colorwhite;
- DRAWNUMBER(islastbar,llast,jl,0),shift1,colorwhite;
- DRAWNUMBER(islastbar,k3+llast,k4+jl,0),shift1,colorwhite;
- DRAWNUMBER(islastbar,k3*2+llast,k4*2+jl,0),shift1,colorwhite;
- DRAWNUMBER(islastbar,k3*3+llast,k4*3+jl,0),shift1,colorwhite;
- DRAWNUMBER(islastbar,hlast,jh,0),shift1,colorwhite;
-
|