当前位置: 网站首页 > 股票软件公式 > 同花顺公式 > 文章 当前位置: 同花顺公式 > 文章

同花顺源码精选:菩提树,KDJ自用优化,CDMA与KDJ金叉

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、菩提树

STICKLINE(TROUGHBARS(3,10,1)=0 AND HIGH>LOW+0.01,108,66,6,1 ),colorgray;

STICKLINE(PEAKBARS(3,10,1)=1,-108,-66,6,0 ),coloryellow;
STICKLINE(TROUGHBARS(3,15,1)=0 AND HIGH>LOW+0.01,66,128,6,1 ),COLORF00FF0;
STICKLINE(PEAKBARS(3,15,1)=1,-66,-128,6,0 ),colorcyan;
TYP:= CLOSE;
EC1:(EMA((TYP-MA(TYP,20))/(0.015*AVEDEV(TYP,20)),13)), colorred,LINETHICK2;
EC2:(EMA((TYP-MA(TYP,52))/(0.015*AVEDEV(TYP,52)),30)), colorlicyan,LINETHICK2;
EMA610:=EMA(CLOSE,610);
LE:IF(EMA610>200,EMA610/100,EMA610),NODRAW;
DE:(C-EMA610)/C*100,NODRAW,colorcyan;
HI:100,colorgray,DOTLINE;
EC3:(EMA((TYP-MA(TYP, 9))/(0.015*AVEDEV(TYP, 9)),4 )), colorligray;
LO36:=LLV(LOW, 36);HI30:=HHV(HIGH,30);
DD:=(EMA(((CLOSE-LO36)/(HI30-LO36))*(4),4))*(25);
KK:=(((DD-LLV(DD,21))/(HHV(DD,21)-LLV(DD,21)))*(4))*(25);
STICKLINE(CROSS(KK,90) AND (DD<40),108,128,10,1),coloryellow;
STICKLINE((COUNT((DD>REF(DD,1)),1)=1) AND (REF(DD,1)<REF(REF(DD,1),1)) AND (DD<10),33,-33,2,1),COLORF00FF0;
V1:=(CLOSE-MA(CLOSE,21))/MA(CLOSE,21)*100;
V2:=(CLOSE-LLV(LOW,43))/(HHV(HIGH,43)-LLV(LOW,43))*100;
V3:=SMA(V2,2,1);
顶:=100+(-ABS(V1)),colorgray;
底:=ABS(V1),colorgray;
VR1:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;
VR2:=SMA(VR1,3,1);
VR3:=SMA(VR2,3,1);
VR4:=SMA(VR3,3,1);
VR5:=CROSS(VR3,VR4) AND VR3<20;
VR8:=CROSS(VR2,VR3) AND VR3>80 AND VR3>VR4;
VR9:=CROSS(VR4,VR3) AND VR3>80;
STICKLINE(FILTER(VR5,10)=1, 66,  128,4,1),COLORF00FF0;
STICKLINE(FILTER(VR9,5)=1, -66, -128,4,0),colorcyan;
STICKLINE(VR8,-66,-128,4,0),COLOR0099FF;
M43:=(REF(C,40)+REF(C,41)+REF(C,42)+REF(C,43))/4;
L43:IF(M43>200,M43/100,M43),NODRAW;
D43:(C-M43)/C*100,NODRAW;
STICKLINE( CROSS(CLOSE, M43) OR CROSS(M43,CLOSE) , -10,10,9,1),coloryellow;
M3:=(REF(C,1)+REF(C,2)+O)/3;
L3:IF(M3>200,M3/100,M3),NODRAW;
D3:(C-M3)/C*100,NODRAW;
LO:-100,colorgray,DOTLINE;
STICKLINE((CLOSE > EMA610*0.96) AND (CLOSE<EMA610*1.06) ,   -38,-58,9,1),colorgray;
S:=C>REF(C,4);
B:=C<REF(C,4);
S0:=S AND REF(B,1);
S1:=S0 OR ( REF(COUNT(S,9)=9,1) AND S AND REF(S0,9) ) OR ( REF(COUNT(S,18)=18,1) AND S AND REF(S0,18) ) ;
S2:=S AND REF(S1,1);
S3:=S AND REF(S2,1);
S4:=S AND REF(S3,1);
S5:=S AND REF(S4,1);
S6:=S AND REF(S5,1);
S7:=S AND REF(S6,1);
S8:=S AND REF(S7,1);
S9:=S AND REF(S8,1);
B0:=B AND REF(S,1);
B1:=B0 OR ( REF(COUNT(B,9)=9,1) AND S AND REF(B0,9) ) OR ( REF(COUNT(B,18)=18,1) AND S AND REF(B0,18) ) ;
B2:=B AND REF(B1,1);
B3:=B AND REF(B2,1);
B4:=B AND REF(B3,1);
B5:=B AND REF(B4,1);
B6:=B AND REF(B5,1);
B7:=B AND REF(B6,1);
B8:=B AND REF(B7,1);
B9:=B AND REF(B8,1);
STICKLINE(B8, 128, 108,6,1), colorgray;
STICKLINE(S8,-128,-108,6,0), coloryellow;
MV3:=MA(VOL,3);
MV7:=MA(VOL,7);
MV21:=MA(VOL,21);
STICKLINE( CROSS(MV3,MV7),  6+EC3,  13+EC3, 13,1),colorred;
STICKLINE( CROSS(MV7,MV3), -6+EC3, -13+EC3, 13,1),colorgreen;
STICKLINE( CROSS(MV3,MV21), 6+EC3,  26+EC3,  4,1),colorred;
STICKLINE( CROSS(MV21,MV3),-6+EC3, -26+EC3,  4,1),colorgreen;



2、KDJ自用优化

底部出现灰色柱关注,出现红色柱买入。

 
N:=9;
M1:=3;
M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1);
D:=SMA(K,M2,1);
J:3*K-2*D;
VAR2:=REF(LOW,1);
VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100;
VAR4:=EMA(VAR3*10,3);
VAR5:=LLV(LOW,13);
VAR6:=HHV(VAR4,13);
VAR7:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618;
VAR8:=IF(VAR7>500,500,VAR7);
STICKLINE(VAR8>-120,0,VAR8,5,1),colorgray;
STICKLINE(VAR8>1 AND J>REF(J,1) AND REF(J,1)<REF(J,2),0,VAR8,5,0),colorred;
STICKLINE(VAR8>0.1 AND VAR8<1 AND J>REF(J,1) AND REF(J,1)<REF(J,2),0,VAR8,5,0),COLOR00FFFF;
〖精品同花顺公式〗:STRLEFT('股 民 学 院 : http://www.58188.net',100),color666666;



3、CDMA与KDJ金叉

共振金叉,底部买入,顶部死叉,卖出。横盘不交易( 股 民 学 院 : http://www.58188.net )

 DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*100;

DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
IF(DIF<DEA,DIF,DRAWNULL),colorgreen;
DD:=C=HHV(C,180);
EE:=DEA< REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;
CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1;
顶背离:=(DD AND EE AND DEA< HHV(DEA,180))*DEA;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
{顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);}
DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorred,LINETHICK2;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,9,3),coloryellow;
D:SMA(K,9,3),colorwhite;
J:3*K-2*D,colormagenta;
IF(J<D,J,DRAWNULL),COLORFFEE44;
0,colorred,LINETHICK2;20,colorlimagenta;{50,colorwhite;}
80,colorblue;100,colorgreen,LINETHICK2;
DRAWTEXT(ISLASTBAR,0,'高安全区'),colorred;
DRAWTEXT(ISLASTBAR,20,'安 全 区'),colorlimagenta;
DRAWTEXT(ISLASTBAR,80,'风 险 区'),colorblue;
DRAWTEXT(ISLASTBAR,100,'高风险区'),colorgreen;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND CROSS(DIF,DEA);
A22:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A22+1)>C AND REF("KDJ.K"(9,3,3),A22+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
DRAWTEXT(B1,DEA-0.20,'▲MACD底背'),colorwhite;
DRAWTEXT(B2,D-0.20,'●KDJ底背'),COLORFF00FF;
{DJ:=CROSS(J,D) AND D<20;
DRAWTEXT(DJ,J-0.3,''),colorcyan;
MDJ:=CROSS(DIF,DEA) AND DEA<0;
DRAWTEXT(MDJ,DEA-0.3,''),colorgreen;
DRAWTEXT(CROSS(DEA,DIF),DIF+0.3,''),coloryellow;
DRAWTEXT(CROSS(D,J),J+0.3,''),colorred;}
A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);
DRAWICON(A,LOW*0.98,1);
B4:CROSS(DIF,DEA) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(B4,L-0.20,'★共振'),COLOR0099FF;
DRAWICON(CROSS(K,D),D,1);
DRAWICON(CROSS(D,K),D,2);
BA:=DEA>REF(DEA,1);
BB:=SUM(BA,5)>=4;
BC:=C<O;
BD:=SUM(BC,5)>=2;
BXG:FILTER(BB AND BD AND J>REF(J,1) AND REF(J,1)<REF(J,2),3);
STICKLINE(BXG,HHV(J,60),HHV(J,60)-20,1,0),colorred;
SS:=EMA(C,11);
LL:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,5))/4;
{短:EMA(LL,2),colorgreen,LINETHICK2;}
{长:EMA(SS,2),colormagenta,LINETHICK2;}
AA:=(C-LLV(C,10))/(HHV(C,10)-LLV(C,10));
(CROSS(AA,0.05)-1);
 

上一篇:同花顺源码精选:新神龙抄底,操盘指导线,九哥背离

下一篇:同花顺源码精选:牛股起步LY,超准超短副图,超准短线买卖