【大智慧】KDJ頂?shù)图Y(jié)號(hào)指標(biāo)公式
攻城獅 2015.11.08 04:02
DRAWGBKlast(c>0,strip(RGB(0,0,60),RGB(0,0,0),0));
80,DOTLINE;20,DOTLINE;
J9:EMA(“KDJ.J”(9,3,3),5) ,COLOR0000FF,LINETHICK2;
J18:EMA(“KDJ.J”(18,3,3),5) ,COLOR00FFFF,DOTLINE;
J27:EMA(“KDJ.J”(27,3,3),5) ,COLOR00FF00,DOTLINE;
J36:EMA(“KDJ.J”(36,3,3),5) ,COLOR0077FF,DOTLINE;
J45:EMA(“KDJ.J”(45,3,3),5) ,COLOR00FFCC,LINETHICK2;
A級(jí)頂:=J9>80 AND J18>80 AND J27>80 AND J36>80 AND J45>80;
B級(jí)頂:=(J9>80 OR J18>80) AND (J27>80 OR J36>80 OR J45>80);
A級(jí)低:=J9<5 AND J18<5 AND J27<5 AND J36<5 AND J45<5;
B級(jí)低:=J9<10 AND J18<20 AND (J27<10 OR J36<10 OR J45<10);
IF(A級(jí)頂,90,100),COLOR0077FF,LINETHICK3,LAYER2;
IF(B級(jí)頂 ,80,100),COLOR00FF00,LINETHICK2,LAYER0;
IF(A級(jí)低,10,0),COLOR00FF00,LINETHICK2,LAYER0;
IF(B級(jí)低,20,0),COLORFF9900,LINETHICK2,LAYER2;
FILLRGN(IF(A級(jí)頂,90,100),90),ColorFF2200,LAYER5;;
FILLRGN(IF(B級(jí)頂,80,100),80),ColorFF9900,LAYER6;;
FILLRGN(100,80),Color000000,LAYER7;;
FILLRGN(10,20,10<20,RGB(0,40,60)),LAYER7;
FILLRGN(0,10,0<10,RGB(0,60,0)),LAYER7;
選股A:A級(jí)低,LINETHICK0;
{低部}
DIBU:= “KDJ.K”(9,3,3)<15 AND "KDJ.D"(9,3,3)<15 AND "KDJ.K"(18,3,3)<15 AND "KDJ.D"(18,3,3)<15
AND “KDJ.K”(27,3,3)<20 AND "KDJ.D"(27,3,3)<20 AND "KDJ.D"(36,3,3)<20 AND "KDJ.D"(54,3,3)<20;
STICKLINE(DIBU=1,30,20,1,0),COLORff00ff,LAYER5;
STICKLINE(DIBU=1,20,10,2,0),COLORYELLOW,LAYER5;
STICKLINE(DIBU=1,10,0,8,0),COLORff8000,LINETHICK2,LAYER5;
選股B:DIBU,LINETHICK0;
{大盤KDJ}
DRSV:=(INDEXC-LLV(INDEXL,27))/(HHV(INDEXH,27)-LLV(INDEXL,27))*100;
DK:=SMA(DRSV,3,1);
DD:=SMA(DK,3,1);
DJ:EMA((3*DK-2*DD),5),COLOR00FFFF;
PARTLINE(DJ,(DJ>REF(DJ,1))-1,rgb(0,255,0),1,rgb(255,0,0) ),POINTDOT,LINETHICK6,LAYER1;
{MACD}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),LINETHICK0;
DEA:=EMA(DIF,9);
VAR1:=HHV(DEA,53);
VAR2:=LLV(DEA,55);
VAR3:=DEA-(DIF-DEA);
UP:=IF(DIF>VAR1 AND DEA=VAR1,MAX(LLV(VAR1,10),VAR3),VAR1);
DN:=IF(DIFPARTLINE(105,DIF>UP,RGB(255,0,0)),LINETHICK5,LAYER4;
PARTLINE(104,DIF>UP,RGB(255,120,0)),LINETHICK5,LAYER5;
PARTLINE(103,DIF>UP,RGB(255,200,0)),LINETHICK5,LAYER6;
PARTLINE(-3,DIFPARTLINE(-4,DIF {KDJ周金叉死叉}
周K:”KDJ.K#WEEK”(9,2,5),COLOR0000FF,LINETHICK0,LAYER3;
周D:”KDJ.D#WEEK”(9,2,5),COLOR00FF00,LINETHICK0;
DRAWTEXT(CROSS(周K,周D),30,’J周金叉’),ALIGN1,color00FFFF,LINETHICK1;
DRAWTEXT(CROSS(周D,周K),70,’J周死叉’),ALIGN1,COLOR0077FF,LINETHICK1;
KDB:=BARSLAST(REF(CROSS(周K,周D),1));
KDDB:=REF(WMA(C,5),KDB+1)>WMA(C,5) AND REF(周K,KDB+1)<周K AND CROSS(周K,周D);
K底背:=IF(FILTER(KDDB>0,5),1,0);
DRAWTEXT(K底背=1,15,’J周底背’),COLOR00FFFF,LINETHICK1;
KDD:=BARSLAST(REF(CROSS(周D,周K),1));
K頂背:=REF(WMA(C,5),KDD+1)周K AND CROSS(周D,周K);
DRAWTEXT(FILTER(K頂背>0,5),80,’J周頂背’),COLOR0077FF,LINETHICK1;
{頂?shù)妆畴x}
{1.MACD}
A1:=BARSLAST(REF(CROSS(“MACD.DIFF”,”MACD.DEA”),1));
B1:=REF(C,A1+1)>C AND REF(“MACD.DIFF”,A1+1)<"MACD.DIFF" AND CROSS("MACD.DIFF","MACD.DEA");
DRAWTEXT(B1>0,-2,’M底背’),COLOR00FFFF,LINETHICK1;{MACD底背離};
C1:=BARSLAST(REF(CROSS(“MACD.DEA”,”MACD.DIFf”),1));
D1:=REF(C,C1+1)“MACD.DIFf” AND CROSS(“MACD.DEA”,”MACD.DIFf”);
DRAWTEXT(D1>0,105,’M頂背’),COLOR00FF00,LINETHICK1;{MACD頂背離};
{2.KDJ}
A2:=BARSLAST(REF(CROSS(“KDJ.K”,”KDJ.D”),1));
B2:=REF(C,A2+1)>C AND REF(“KDJ.K”,A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2,5,’J9底背’),COLOR00FFFF,LINETHICK1;{KDJ底背離};
C2:=BARSLAST(REF(CROSS(“KDJ.D”,”KDJ.K”),1));
D2:=REF(C,C2+1)“KDJ.K” AND CROSS(“KDJ.D”,”KDJ.K”);
DRAWTEXT(D2>0,80,’J9頂背’),COLOR0077FF,LINETHICK1;{KDJ頂背離};
{3.RSI}
A3:=BARSLAST(REF(CROSS(“RSI.RSI1″,”RSI.RSI2”),1));
B3:=REF(C,A3+1)>C AND REF(“RSI.RSI1”,A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,24,’R底背’),COLOR00FFFF,LINETHICK1;{RSI底背離}
C3:=BARSLAST(REF(CROSS(“RSI.RSI2″,”RSI.RSI1”),1));
D3:=REF(C,C3+1)“RSI.RSI1” AND CROSS(“RSI.RSI2″,”RSI.RSI1”);
DRAWTEXT(D3>0,95,’R頂背’),COLOR0077FF,LINETHICK1;{RSI頂背離};
申明:本文為作者投稿或轉(zhuǎn)載,在概念股網(wǎng) http://www.guangshenggb.com/ 上發(fā)表,為其獨(dú)立觀點(diǎn)。不代表本網(wǎng)立場(chǎng),不代表本網(wǎng)贊同其觀點(diǎn),亦不對(duì)其真實(shí)性負(fù)責(zé),投資決策請(qǐng)建立在獨(dú)立思考之上。