以下是博易大师超级KD指标公式源码和使用说明

使用说明

   超级KD指标的取值范围通常在0到100之间,数值越大表示价格走势越强劲,数值越小表示价格走势越弱势。

   当超级KD指标数值位于70以上时,意味着市场可能处于超买状态,价格可能会出现回调或调整。

   当超级KD指标数值位于30以下时,意味着市场可能处于超卖状态,价格可能会出现反弹或反转

   超级KD指标可以作为判断价格走势强弱的依据,当指标数值较高时,可以考虑卖出或观望;当指标数值较低时,可以考虑买入或观望。

   配合其他技术分析工具和交易信号,如移动平均线、支撑阻力位等,以增强交易决策的准确性和可靠性。

   注意市场的整体趋势,避免在强势市场中过早卖出或在弱势市场中过早买入。

博易大师超级KD指标公式源码:

    RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
    K:SMA(RSV,3,1),LINETHICK2,COLORWHITE;
    D:SMA(K,3,1),LINETHICK2,COLOR00DDDD;
    J:3*K-2*D,LINETHICK2,COLOR800080;
    DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),linethick0,COLOR0099FF;
    DEA:EMA(DIFF,9),linethick0,COLORD89837;
    macd:2*(DIFF-DEA),COLORFF9999,linethick0;
    YLZC:=if(close=INDEXC,(INDEXC+INDEXh+INDEXl+INDEXO)/4,AMOUNT/(vol+0.01)/100);
    阻价:=if(close=INDEXC,YLZC+INDEXC-INDEXl,YLZC+(close-low));
    支价:=if(close=INDEXC,INDEXl+INDEXC-YLZC,low+(close-YLZC));
    今压:REF(阻价,1),LINETHICK0,COLORAA11BB;
    今撑:REF(支价,1),LINETHICK0,COLOR009900;
    明压:阻价,LINETHICK0;
    明撑:支价,LINETHICK0;
    rsv1:=(hhv(h,9.8)-c)/(hhv(h,9.8)-llv(l,9.8))*101;
    kk:=sma(rsv1,3,1);
    dd:=sma(kk,3,1);
    jj:=3*kk-2*dd;
    买卖:=if(jj>=100,100,if(jj<=0,0,jj));
    明天买:if(买卖=100,0-10,0),color00cccc;
    明天卖:if(买卖=0,90,100),color00ff00;
    KX:=250;
    KH:=HHV(K,KX);
    DH:=HHV(D,KX);
    JH:=HHV(J,KX);
    KL:=LLV(K,KX);
    DL:=LLV(D,KX);
    JL:=LLV(J,KX);
    HKMAX:=MAX(KH,MAX(DH,JH));
    LKMIN:=MIN(KL,MIN(DL,JL));
    KHLB:=(HKMAX+LKMIN)/2;
    KHLC:=HKMAX-LKMIN;
    MHF:=HHV(DIFF,KX);
    MHD:=HHV(DEA,KX);
    MHM:=HHV(MACD,KX);
    MLF:=LLV(DIFF,KX);
    MLD:=LLV(DEA,KX);
    MLM:=LLV(MACD,KX);
    HMAX:=MAX(MHF,MAX(MHD,MHM));
    LMIN:=MIN(MLF,MIN(MLD,MLM));
    FHLB:=(HMAX-LMIN)/100;
    FHLC:=HMAX-LMIN;
    SH:=(0-FHLB)*(KHLC/FHLC)+KHLB;
    DIFFA:=(DIFF-FHLB)*(KHLC/FHLC)+KHLB;
    DEAA:=(DEA-FHLB)*(KHLC/FHLC)+KHLB;
    MACDA:=(macd-FHLB)*(KHLC/FHLC)+KHLB;
    CDA:=MACD<ref(MACD,1)andMACD>0;
    CDB:=MACD>=ref(MACD,1)andMACD>0;
    CDC:=MACD>ref(MACD,1)andMACD<0;
    CDD:=MACD<=ref(MACD,1)andMACD<0;
    STICKLINE(CDA,SH,macda,6,0),COLOR00AAFF;{黄色段}
    STICKLINE(CDA,SH,macda,6.6,0),COLOR0066AA;
    STICKLINE(CDA,SH,macda,4.4,0),COLOR0099DD;
    STICKLINE(CDA,SH,macda,3.3,0),COLOR00BBEE;
    STICKLINE(CDA,SH,macda,2.2,0),COLOR00DDFF;
    STICKLINE(CDA,SH,macda,1.1,0),COLOR00FFFF;
    STICKLINE(CDB,SH,macda,6,0),COLOR0000AA;{红色段}
    STICKLINE(CDB,SH,macda,6.6,0),COLOR0011BB;
    STICKLINE(CDB,SH,macda,4.4,0),COLOr0022CC;
    STICKLINE(CDB,SH,macda,3.3,0),COLOR0033DD;
    STICKLINE(CDB,SH,macda,2.2,0),COLOR0044EE;
    STICKLINE(CDB,SH,macda,1.1,0),COLOR0055FF;
    STICKLINE(CDC,SH,macda,6,0),COLORAA00BB;{向上粉红}
    STICKLINE(CDC,SH,macda,6.6,0),COLORBB1177;
    STICKLINE(CDC,SH,macda,4.4,0),COLORCC2299;
    STICKLINE(CDC,SH,macda,3.3,0),COLORDD33AA;
    STICKLINE(CDC,SH,macda,2.2,0),COLOREE44BB;
    STICKLINE(CDC,SH,macda,1.1,0),COLORFF55BB;
    STICKLINE(CDD,SH,macda,6,0),COLORFF7700;
    STICKLINE(CDD,SH,macda,6.6,0),COLORAA7711;
    STICKLINE(CDD,SH,macda,4.4,0),COLORCC9922;
    STICKLINE(CDD,SH,macda,3.3,0),COLOREEBB33;
    STICKLINE(CDD,SH,macda,2.2,0),COLORFFCC44;
    STICKLINE(CDD,SH,macda,1.1,0),COLORFFDD55;
    //PARTLINE(DIFFA,DIFF>0,RGB(255,153,153),DIFF<0,RGB(255,153,153));
    //PARTLINE(DEAA,DEA>0,RGB(65,105,225),DEA<0,RGB(65,105,225));
    DRAWTEXT(BARSTATUS=2,SH,'0'),color00aaaa;
    TYP:=(HIGH+LOW+CLOSE)/3;
    STICKLINE(diff>ref(diff,1),20,20,2,0),COLORRED;
    STICKLINE(diff<ref(diff,1),20,20,2,0),COLORGREEN;
    STICKLINE(K>=ref(K,1)ork>danddiff>ref(diff,1),80,80,2,1),COLORRED;
    STICKLINE(K<ref(K,1),80,80,2,1),COLORGREEN;
    MACD金叉:=CROSS(MACD,DIFF)ANDMACD>=(0-0.05)ANDMACD<=0.02;
    DRAWTEXT(MACD金叉,macda*0.82,'MACD金叉'),color00FFFF;
    XX:=ema(MA(LOW,3)*0.96,30);
    DIFF金叉:=if(CROSS(DIFF,DEA)ANDXX-REF(XX,1)>0ANDMACD>=REF(MACD,1)ANDDIFF<=0,1,0);
    DRAWTEXT(DIFF金叉=1,DIFFA*1.68,'DIFF金叉'),colorCDFFBB;
    低位金叉:=CROSS(DIFF,DEA)ANDDIFF<-0.1;
    DRAWTEXT(低位金叉,deaa*0.99,'低位金叉'),COLOR0099DD;
    DIFDEA:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
    二次金叉:=CROSS(DIFF,DEA)ANDDEA<0ANDCOUNT(DIFDEA=2,21)=1;
    DRAWTEXT(二次金叉,deaa*0.99-8,'二次金叉'),ColorFF00FF;
    A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
    底背离:=REF(CLOSE,A1+1)>CLOSEANDDIFF>REF(DIFF,A1+1)ANDCROSS(DIFF,DEA);
    DRAWTEXT(底背离,DEAA*0.99-16,'底背离'),Color0099FF;
    A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
    顶背离:=REF(CLOSE,A2+1)<CLOSEANDREF(DIFF,A2+1)>DIFFANDCROSS(DEA,DIFF);
    DRAWTEXT(FILTER(顶背离,5),DEAA*1.02,'顶背离'),COLORDDAAAA;
    {周金叉,死叉}
    周DIFF:="MACD.DIFF#WEEK";
    周DEA:="MACD.DEA#WEEK";
    周MACD:="MACD.MACD#WEEK";
    DIF周金叉:=CROSS(周DIFF,周DEA);
    DRAWTEXT(DIF周金叉,DEAA,'DIFF周金叉'),COLOR0099FF;
    DRAWTEXT(CROSS(周DEA,周DIFF),DEAA+4,'DIFF周死叉'),align0,COLORCDFFBB;
    MACD周金叉:=CROSS(周MACD,周DIFF)AND周MACD>=(0-0.05)AND周MACD<=0.02;
    DRAWTEXT(MACD周金叉,macda-0.03,'MACD周金叉'),color00FFFF;
    {月金叉,死叉}
    月DIFF:="MACD.DIFF#MONTH";
    月DEA:="MACD.DEA#MONTH";
    DIF月金叉:=CROSS(月DIFF,月DEA);
    DRAWTEXT(DIF月金叉,DEAA*0.98,'DIF月金叉'),COLOR00FFCC;
    DRAWTEXT(CROSS(月DEA,月DIFF),DEAA*1.02,'DIF月死叉'),align0,COLORDDDDDD;
    周K:="KDJ.K#WEEK";
    周D:="KDJ.D#WEEK";
    周J:="KDJ.J#WEEK";
    月K:="KDJ.K#MONTH";
    月D:="KDJ.D#MONTH";
    月J:="KDJ.J#MONTH";
    月金叉:=cross(月K,月D);
    周金叉:=cross(周K,周D);
    日金叉:=FILTER(cross(K,D)andK<20,4);
    drawtext(月金叉,月D-2,'★'),ALIGN0,color0022ee;
    DRAWTEXT(月金叉,月D-2,'KD月金叉'),coloryellow;
    drawtext(周金叉,周D,'★'),ALIGN2,color0022ee;
    DRAWTEXT(周金叉,周D,'KD周金叉'),colorgreen;
    DRAWICON(日金叉,K,1),align2;
    DRAWTEXT(日金叉,D-6,'低位金叉'),color00CCCC;
    DRAWTEXT(CROSS(周D,周K),周D*1.2,'KD周死叉'),COLOR00DDBB;
    DRAWTEXT(CROSS(月D,月K),月D,'KD月死叉'),COLORFFFFFF;
    KDB:=BARSLAST(ref(cross(k,d),1));
    KDDB:=ref(close,KDB+1)>closeandref(k,KDB+1)<kandcross(k,d);
    K底背:=if(FILTER(KDDB>0,5),1,0);
    DRAWTEXT(K底背=1,D*0.98,'底背离'),COLORDDDDDD;
    KDD:=BARSLAST(ref(cross(d,k),1));
    K顶背:=ref(close,KDD+1)<closeandref(k,KDD+1)>kandcross(d,k);
    DRAWTEXT(FILTER(K顶背>0,5),D+8,'顶背离'),COLORFFAA22;
    MD1:=MA(CLOSE,80)-MA(CLOSE,13)/3;
    MD2:=MA((CLOSE-MD1)/MD1,3);
    买点1:=CROSS(MD2,0)ANDLOW/REF(HIGH,1)<1.012ANDJ<75ANDJ>REF(J,1);
    ma12:=MA(CLOSE,12);
    佳点:=if(FILTER(MACD>=REF(MACD,5)ANDopen<=ref(close,1)andXX-REF(XX,1)>0ANDMACD<=0ANDma12-REF(ma12,1)>=0,3)andJ<80andJ>ref(J,1)andD>ref(D,1)and(diff>=ref(diff,1)ordea>=ref(dea,1)),1,0);
    DRAWTEXT(佳点=1,macda*0.98,'佳点'),color0099FF;
    DX0:=EMA(CLOSE,2)-EMA(OPEN,5);
    DX1:=if(CROSS(DX0,MACD)ANDLOW<=XXANDMACD<=(0-0.11)and(J<20orK<20),1,0);
    DRAWTEXT(FILTER(DX1,3),0,'短10%'),color00CC00;{短线}
    MA10:=MA(CLOSE,10);
    SS:=EMA(MA(HIGH,3)*1.05,30);
    LQS:=if(FILTER(0.7*(CROSS(DIFF,DEA)ANDCLOSE<SSANDXX-REF(XX,1)>0ANDCROSS(MACD,0)ANDMACD>=0ANDDIFF>0ANDma10-REF(ma10,1)>0ANDVOL>REF(VOL,1))>=0.7AND(CLOSE<SSANDXX-REF(XX,1)>0),5)ANDJ<80,1,0);
    DRAWTEXT(LQS=1,macda*0.98,'量价齐上'),colorCDFFDD;{量价齐上}
    最佳点:=IF(COUNT(MD2>REF(MD2,1),3)=3ANDCOUNT(MD2<0,10)=10ANDREF(MD2,3)=LLV(MD2,10)andJ<80andJ>ref(J,1),1,0);
    DRAWTEXT(最佳点=1,J,'最佳点'),colorFF00CC;
    买点2:=REF(MD2,2)=LLV(MD2,20)ANDREF(MD2,2)<0.071ANDREF(MD2,2)<REF(MD2,1)AND
    NOT(REF(LOW,1)>REF(HIGH,2)ANDLOW>REF(HIGH,1))ANDCLOSE>REF(CLOSE,1)ANDJ<75ANDJ>REF(J,1);
    DRAWTEXT(买点1or买点2,D-1,'买'),colorff00CC;
    {预涨}
    YZ:=(INTPART(SMA(RSV,3,1))+INTPART(SMA(K,3,1)))/2;
    预涨:=cross(yz,50)andj<95anddiff>ref(diff,1)andlow<ref(close,1);
    DRAWTEXT(预涨,d*0.6,'预涨'),COLORA52A2A;
    KD金叉:=cross(K,D)andJ>20andJ<80;
    选股:if(cross(macd,0)orDX1or佳点orLQSorK底背or月金叉or周金叉or日金叉or买点1or买点2or最佳点orMACD金叉orDIFF金叉or低位金叉or二次金叉or底背离orDIF周金叉orMACD周金叉orDIF月金叉orKD金叉,2,0),LINETHICK0;
    VAR1:=((CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15)))*(100);
    VAR2:=SMA(VAR1,5,1);
    K:=SMA(VAR2,3,1);
    D:=SMA(K,3,1);
    STICKLINE((K>=D),K,D,6,0),COLOR0000A8;
    STICKLINE((K>=D),K,D,5,0),COLOR0000C0;
    STICKLINE((K>=D),K,D,4,0),COLOR0000E0;
    STICKLINE((K>=D),K,D,3,0),COLOR0000F0;
    STICKLINE((K>=D),K,D,2,0),COLOR0000D0;
    STICKLINE((K>=D),K,D,1,0),COLOR8080FF;
    STICKLINE((K<=D),K,D,6,0),COLOR008800;
    STICKLINE((K<=D),K,D,5,0),COLOR009900;
    STICKLINE((K<=D),K,D,4,0),COLOR00AA00;
    STICKLINE((K<=D),K,D,3,0),COLOR00BB00;
    STICKLINE((K<=D),K,D,2,0),COLOR00CC00;
    STICKLINE((K<=D),K,D,1,0),COLOR00DD00;
    {注:上面(咖啡色)这部分可以省略,如果省略将KD线显示出来并且在KD交叉时显示上下箭头}
    顶线:80,COLOR808080;
    底线:20,COLOR808080;
    VAR1:=(CLOSE-LLV(LOW,80))/(HHV(HIGH,80)-LLV(LOW,80))*200;
    VAR2:=SMA(VAR1,3,1);
    VAR3:=SMA(VAR2,3,1);
    VAR4:=3*VAR2-2*VAR3;
    VAR5:=LLV(LOW,5);
    VAR6:=HHV(HIGH,5);
    VAR7:=EMA((CLOSE-VAR5)/(VAR6-VAR5)*100,4)*2;
    VAR8:=EMA(0.667*REF(VAR7,1)+0.333*VAR7,2);
    VAR9:=3*VAR7-2*VAR8;
    VARA:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);
    VARB:=POW(MA(LOW,5),2)+MA(LOW,5);
    VARC:=POW(MA(HIGH,5),2)+MA(HIGH,5);
    VARD:=(VARA-LLV(VARB,64))/(HHV(VARC,64)-LLV(VARB,64))*150+65-10;
    VARE:=SMA(VARD,3,1)*1.5-100;
    VARF:=SMA(VARE,3,1);
    VAR10:=3*VARE-2*VARF;
    VAR11:=(HIGH+LOW+CLOSE*2)/4;
    VAR12:=EMA(VAR11,13);
    VAR13:=STD(VAR11,13);
    VAR14:=(VAR11-VAR12)*100/VAR13;
    VAR15:=EMA(VAR14,5);
    VAR17:=EMA(VAR15,13)+200-100;
    VAR18:=EMA(VAR17,10);
    VAR19:=3*VAR17-2*VAR18;
    VAR1A:=VAR2+VAR7+VARE+VAR17;
    VAR1B:=VAR3+VAR8+VARF+VAR18;
    VAR1C:=VAR4+VAR9+VAR10+VAR19;
    VAR1D:=(HIGH+LOW+CLOSE)/3;
    VAR20:=(VAR1D-MA(VAR1D,34))/(0.015*AVEDEV(VAR1D,34));
    VAR22:=(HIGH+LOW+CLOSE+VAR1D)/4;
    VAR23:=EMA(VAR22,24);
    VAR24:=STD(VAR22,24);
    VAR25:=(VAR22-VAR23)/VAR24*100;
    VAR26:=(VAR1D-MA(VAR1D,24))/(0.015*AVEDEV(VAR1D,24));
    VAR27:=EMA(VAR25,5);
    VAR2A:=((VAR27+VAR26+VAR20)/3+165)/4;
    VAR2B:=(EMA(EMA(EMA(VAR2A,15),10),5)-25)*2;
    VAR2C:=(VAR1A+VAR1B+VAR1C*30)/32/5-15;
    VAR2D:=EMA(VAR2C,7);
    VAR2E:=(VAR2A+VAR2C)/2/1.1;
    超短:EMA(VAR2E,3),COLORRED;
    短线:EMA(超短,5),COLORWHITE;
    趋势线:EMA((VAR2B+VAR2D)/2,2),COLORYELLOW;
    DRAWICON(CROSS(趋势线,0),0,1);
    DRAWICON(CROSS(100,超短),100,2);
    DRAWTEXT(趋势线>REF(趋势线,1)ANDREF(趋势线,1)<REF(趋势线,2)ANDCOUNT(CROSS(超短,短线),3)=1AND短线<30,短线,'看底');

博易大师超级KD指标公式截图

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。