我也发一个 多周期KD指标,出现信号,还得筛选,源码如下:
VAR13:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
K1:SMA(VAR13,3,1),COLORFFFFFF;
D1:SMA(K1,3,1),COLORFFFFFF,LINETHICK2;
DRAWBAND(K1,RGB(245,16,10),D1,RGB(0,224,0));
VAR21:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
K2:SMA(VAR21,3,1),COLOR0000FF;
D2:SMA(K2,3,1),COLOR0000FF,LINETHICK2;
DRAWBAND(K2,RGB(255,96,225),D2,RGB(0,240,120));
VAR34:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;
K3:SMA(VAR34,3,1),COLORFF8800;
D3:SMA(K3,3,1),COLORFF8800,LINETHICK2;
DRAWBAND(K3,RGB(241,27,110),D3,RGB(58,104,206));
VAR55:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K4:SMA(VAR55,3,1),COLOR00FF00;
D4:SMA(K4,3,1),COLOR008000;
DRAWBAND(K4,RGB(187,20,201),D4,RGB(0,150,50));
买点:K1<20 AND K1>REF(K1,1) AND D1<20 AND K2<20
AND D2<20 AND K3<20 AND D3<20 AND D4<20,COLORRED,NODRAW;
STICKLINE(买点 ,100,85,2,1),COLORRED ;
TOBU:= K3>80 AND K2>80 ;
STICKLINE(TOBU=1,100,92,1,0) ,COLORGREEN;
DD:=-10;
{买了不输}
A1:=AMOUNT/VOL/1000;
B2:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
D3D:=SUM(AMOUNT,13)/A1/1000;
E4:=DMA(B2,VOL/D3D);
买了不输:=(CLOSE-E4)/E4*1000;
VARX:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
VARX1:=SMA(VARX,3,1);
VARX2:=SMA(VARX1,3,1);
VARX3:=REF(LOW,1);
VARX4:=SMA(ABS(LOW-VARX3),3,1)/SMA(MAX(LOW-VARX3,0),3,1)*100;
VARX5:=EMA(IF(CLOSE*1.2,VARX4*10,VARX4/10),3);
VARX6:=LLV(LOW,30);
VARX7:=HHV(VARX5,30);
VARX8:=IF(LLV(LOW,58),1,0);
VARX9:=(EMA(IF(LOW<=VARX6,(VARX5+VARX7*2)/2,0),3)/618*VARX8);
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26),LINETHICK2;
DEA:=EMA(DIFF,9),LINETHICK2;
MACD:=(DIFF-DEA)*2, ;
DIF55:=(EMA(CLOSE,30)-EMA(CLOSE,100));
DEA55:=(EMA(DIF55,45));
F60:=EMA(CLOSE,12/2)-EMA(CLOSE,26/2),COLORFF00FF;
A60:=EMA(F60,9/2),COLORGREEN;
F30:=(EMA(CLOSE,12/4)-EMA(CLOSE,26/4)),COLORBLUE,LINETHICK2;
A30:=(EMA(F30,9/4)),COLORWHITE;
{买了就涨}
买1:=MA(CLOSE,1);
卖1:=(LOW+HIGH+CLOSE)/3;
VARR1:=MA(卖1,5);
VARR2:=HHV(VARR1,10);
DM:=IF(HHV((买1<VARR2),5),100,85),COLORFFFF00,LINETHICK2;
MAI:=IF(HHV((买1<VARR2),10),100,90),COLORGREEN,LINETHICK2;
{DRAWBAND(100,RGB(0,250,250),DM,RGB(0,0,0));
DRAWBAND(100,RGB(240,240,0),MAI,RGB(0,0,0));}
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=(SUM(IF(((HD > 0) AND (HD > LD)),HD,0),5) );
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),5);
VARR3:=(((DMP ) * 100) / TR);
VARR4:=((DMM * 100) / TR);
XXX:=(MA(((ABS((VARR4 - VARR3)) / (VARR4 + VARR3)) * 100),3));
买卖:=LLV(VARR1,10);
DMAI:=IF(LLV((买1<买卖),5),15,0),COLORRED,LINETHICK3;
MAI2:=IF(LLV((买1<买卖),10),20,0),COLORFF00FF,LINETHICK3;
短买:IF(DMAI AND VAR55<20,10,0),COLORYELLOW,LINETHICK2,NODRAW;
STICKLINE(短买 ,100,85,2,1),COLORYELLOW ;
买:=MAI2,COLORYELLOW,LINETHICK2;
{寻宝}
RV:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
RG:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
VR44:=SMA(RV,3,1);
VR55:=SMA(VR44,3,1);
KK:=EMA(SMA(RG,3,1),2);EE:=SMA(KK,3,1);
X:=CROSS(VR44,VR55) AND VR55<30;
X1:=CROSS(VR44,VR55) AND CROSS(KK,EE);
XG1:=X OR X1;
寻宝:=C-REF(C,1);
股海:=100*EMA(EMA(寻宝,6),6)/EMA(EMA(ABS(寻宝),6),6);
捡金:=LLV(股海,2)=LLV(股海,7) AND COUNT(股海<0,2) AND CROSS(股海,MA(股海,2));
笨哥:=(C-REF(C,20))/REF(C,20)*100<0;
XG2:=(FILTER(捡金=1,5))AND("CCI">0);
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
XG3:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;
RSV1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
K11:=SMA(RSV1,5,1);
D11:=SMA(K11,5,1);
J11:=3*K11-2*D11;
AA1:=EMA(J11,5);
AA2:=REF(AA1,1);
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K22:=SMA(RSV2,3,1);
D22:=SMA(K22,3,1);
J22:=3*K22-2*D22;
BB1:=EMA(J22,5);
BB2:=REF(BB1,1);
D1D:=AA1>AA2 AND BB1>BB2;
XG4:=(D1D AND NOT(REF(D1D,1)) AND (AA1<50 OR BB1<50));
N:=5;{可调}
BB:=REF(CLOSE,N);
CC:=SMA(MAX(CLOSE-BB,0),2,1)/SMA(ABS(CLOSE-BB),2,1)*100-50;
线:=CC;
XG5:=线>REF(线,1) AND REF(线,1)<=REF(线,2) AND C/REF(C,1)>1;
宝:IF(XG1+XG2+XG3+XG4+XG5>=4,50,0),COLORWHITE,NODRAW;
STICKLINE(XG1+XG2+XG3+XG4+XG5>=4,0,70,1,1),COLORWHITE ;
不输2:IF(CROSS(买了不输,-88) AND K3>REF(K3,1),30,0),COLORFF00FF,NODRAW;
STICKLINE(CROSS(买了不输,-88) AND K3>REF(K3,1),0,40,1,0),COLORFF00FF ;
不输3:IF(CROSS(买了不输,-120),30,0),COLOR0066FF,NODRAW;
STICKLINE(CROSS(买了不输,-120),0,50,1,0),COLOR0066FF ;
F:=(EMA(CLOSE,12)-EMA(CLOSE,26))*200,COLORMAGENTA;
E:=EMA(F,9),COLORGREEN;
AMOV:=VOL*(OPEN+CLOSE)/2;
S1:=SUM(AMOV,5)/SUM(VOL,5);
S2:=SUM(AMOV,13)/SUM(VOL,13);
S3:=SUM(AMOV,34)/SUM(VOL,34);
S4:=SUM(AMOV,60)/SUM(VOL,60);
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
WR1:=EMA(100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14)),5),LINETHICK1;
B:IF(CROSS(CCI,0) AND K1>REF(K1,1) AND D1>REF(D1,1),70,0),STICK,COLORFF00FF;
{STICKLINE(CROSS(CCI,0) AND K1>REF(K1,1) AND K1<40 AND D1>REF(D1,1) ,
0,70,0,0),COLORFF00FF;}
绝点:IF(K1>K2 AND K1>REF(K1,1) AND K2>K3 AND K2>K4 AND CROSS(K1,D1) AND K1<50
AND K2>REF(K2,1) AND K3>REF(K3,1) AND K4>REF(K4,1) ,70,0),COLORYELLOW,STICK,LINETHICK2;
{红买}
VA:=(C+2*H+L)/4;
VB:=LLV(L,8);
VC:=HHV(H,8);
VD:=EMA(((VA-VB)/(VC-VB)-VC/VB)*81,5)*-1;
红线上穿买:=REVERSE(VD)+100,COLORRED;
RSV:=(((CLOSE - LLV(LOW,9)) / (HHV(HIGH,9) - LLV(LOW,9))) * 100);
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
XQ:=LLV(J,2)=LLV(J,8);
AA:=DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND XQ AND J<19,红线上穿买*0.9,'短'),COLORLIRED;
红买:IF(AA,60,0),COLORRED,LINETHICK2;
{买了就涨}
短卖:DM,COLORGREEN,LINETHICK1;
卖:MAI,COLORGREEN,LINETHICK3;