通达信指标公式源码 变色KDJ 中线波段投资极品指标

合集下载

整合版KDJ通达信指标公式源码

整合版KDJ通达信指标公式源码

整合版KDJ通达信指标公式源码KDJ通达信指标是一种常用的股票指标,用于判断价格趋势的强弱和超买超卖状态。

该指标主要由三条线组成,分别是K线、D线和J线。

K 线和D线都是通过计算价格的快慢移动平均线得出的,而J线是由K线和D线的差值计算得出的。

以下是整合版的KDJ通达信指标的公式源码:```c//获取KDJ指标的K值float getKValue(float* close, int n, int m)float kValue = 50;float highest = getMaxValue(close, n);float lowest = getMinValue(close, n);if(highest != lowest)kValue = 100 * (close[n] - lowest) / (highest - lowest);}return simpleMA(kValue, m);//获取KDJ指标的D值float getDValue(float* close, int n, int m, int t)return simpleMA(getKValue(close, n, m), t);//获取KDJ指标的J值float getJValue(float* close, int n, int m, int t) float kValue = getKValue(close, n, m);float dValue = getDValue(close, n, m, t);return 3 * kValue - 2 * dValue;//简单移动平均线的计算函数float simpleMA(float value, int n)float ma = value;//计算n日的简单移动平均线for(int i = n; i > 0; i--)ma += value[i];}return ma / n;//获取一组数据中的最大值float getMaxValue(float* data, int n)float maxValue = data[n];for(int i = n; i > 0; i--)if(data[i] > maxValue)maxValue = data[i];}}return maxValue;//获取一组数据中的最小值float getMinValue(float* data, int n)float minValue = data[n];for(int i = n; i > 0; i--)if(data[i] < minValue)minValue = data[i];}}return minValue;```以上是整合版KDJ通达信指标的公式源码。

新版极品整合MACD划线指标公式通达信指标公式源码

新版极品整合MACD划线指标公式通达信指标公式源码

通达信新版极品整合MACD划线指标公式DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9),COLOR888888;NOTEXT5:IF(DIF>=DEA, DIF,DRAWNULL),COLORRED;NOTEXT6:IF(DIF<DEA, DIF,DRAWNULL),COLORWHITE;AT1:=BARSLAST(REF(CROSS(DIF,DEA),1));BT1:=REF(C,AT1+1)>C AND REF(DIF,AT1+1)<DIF AND CROSS(DIF,DEA); AT2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));CT1:=BARSLAST(REF(CROSS(DEA,DIF),1));DT1:=REF(C,CT1+1)<C AND REF(DIF,CT1+1)>DIF AND CROSS(DEA,DIF); MACD底背:IF(BT1>0,-0.1,0),COLORRED;MACD顶背:IF(DT1>0,0.1,0),COLOR00FF00;STICKLINE(BT1>0,0.5*DIF,0,2,0),COLORRED;STICKLINE(DT1>0,0.5*DIF,0,2,0),COLOR00FF00;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD<REF(MACD,1) AND MACD>0, 0,MACD,0,0),COLOR44FF00; STICKLINE(MACD>REF(MACD,1) AND MACD<0, 0,MACD,0,0),COLOR0066FF;M1:=13;M2:=13;A1:=REF(DIF,M1)=HHV(DIF,2*M1+1);B1:=FILTER(A1,M1);C1:=BACKSET(B1,M1+1);D1:=FILTER(C1,M1);E1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);F1:=E1>REF(E1,1);A2:=REF(DIF,M2)=LLV(DIF,2*M2+1);B2:=FILTER(A2,M2);C2:=BACKSET(B2,M2+1);D2:=FILTER(C2,M2);E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);F2:=E2>REF(E2,1);压力线:DRAWLINE(D1,DIF,F1,DIF,0),COLORFFFF00,DOTLINE;支撑线:DRAWLINE(D2,DIF,F2,DIF,0),COLOR00AAFF,DOTLINE;G3:=FILTERX(支撑线>REF(支撑线,1) && DIF>支撑线&& REF(支撑线,1)=REF(DIF,1),2); 底抬高:DRAWLINE(D2,DIF,G3,支撑线,0),COLORYELLOW,DOTLINE;{画趋势线}M:=INTPART(3*10/5);A12:=REF(DIF,M)=HHV(DIF,2*M+1);B12:=FILTER(A12,M);C12:=BACKSET(B12,M+1);D12:=FILTER(C12,M);R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1);S112:=R112>REF(R112,1);AL12:=REF(DIF,M)=LLV(DIF,2*M+1);BL12:=FILTER(AL12,M);CL12:=BACKSET(BL12,M+1);DL12:=FILTER(CL12,M);RL112:=BACKSET(ISLASTBAR,BARSLAST(DL12)+1);SL112:=RL112>REF(RL112,1);短压线:DRAWLINE(D12,DIF,S112,DIF,0),COLOR99FF00,DOTLINE;短撑线:DRAWLINE(DL12,DIF,SL112,DIF,0),COLOR0055FF,DOTLINE;VARX2:=LLV(DEA,43);VARX3:=DEA-(DIF-DEA);低点线:=IF(DIF<VARX2 AND DEA=VARX2,MIN(HHV(VARX2,10),VARX3),VARX2);VL:=REF(LOW,1);VAR12:=(SMA(ABS(LOW-VL),13,1))/(SMA(MAX(LOW-VL,0),13,1))*100;VAR14:=MA(VAR12,13);VAR15:=LLV(LOW,34);VAR18:=EMA(IF(LOW<=VAR15,VAR14,0),3);VAR110:=SMA(SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,7,1),5,1); VAR111:=SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,8,1)*15-VAR1 10*10.38;T:=FILTER(IF(VAR111<=VAR110 AND VAR18>0,VAR18*8,0),5);止跌:DRAWTEXT(T AND DIF<低点线,DIF*1.01,'止跌'),COLORYELLOW;{形态}A:=IF(CROSS(0,DEA),1,0);A11:=IF(DIF<0 AND CROSS(DIF,DEA),1,0);SS:=IF(A,SUM(A11,0),0);SSB:=HHV(SS,0);SSS:=SUM(A11,0);W底:=SSS-SSB=2 AND SSS>REF(SSS,1);DRAWTEXT(W底,DIF,'↖W底'),COLOR0080FF;MACD金叉:=CROSS(MACD,DIF) AND MACD>=(0-0.05) AND MACD<=0.02; DRAWTEXT(MACD金叉,MACD,'-MACD金叉'),COLOR00FFFF;低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; DRAWTEXT(二次金叉,0.01,'二次金叉'),COLOR5500FF;AA11:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,AA11+1)>CLOSE AND DIF>REF(DIF,AA11+1) ANDCROSS(DIF,DEA);底背:DRAWLINE(AA11=0,DIF,底背离,DIF,0),COLORYELLOW,LINETHICK2;AA22:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,AA22+1)<CLOSE AND REF(DIF,AA22+1)>DIF ANDCROSS(DEA,DIF);顶背:DRAWLINE(AA22=0,DIF,顶背离,DIF,0),COLORGREEN,LINETHICK2; DRAWTEXT(底背离,DIF*0.5,'-DIF底背'),COLOR0055FF;DRAWTEXT(顶背离,DIF*0.5,'-DIF顶背'),COLOR99FF00;{小周期}N:=3;DIF3_6.5F:=(EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2);DEA3_6.5F:=(EMA(DIF3_6.5F,3)+EMA(DIF3_6.5,2));AA:=REF(DIF3_6.5F,N)=HHV(DIF3_6.5F,2*N+1);CC:=FILTER(BB,N) AND DIF3_6.5F=HHV(DIF3_6.5F,N+1);AX1:=BARSLAST(REF(CC,1));小顶背离:=REF(CLOSE,AX1+1)<CLOSE AND REF(DIF3_6.5F,AX1+1)>DIF3_6.5F AND CC; DRAWTEXT(小顶背离,DIF3_6.5F*1.2,'-小顶背离'),COLORGREEN;DRAWICON(小顶背离>0,DIF3_6.5F*1.2,2);AAA2:=REF(DIF3_6.5F,N)=LLV(DIF3_6.5F,2*N+1);BBB2:=BACKSET(AAA2,N+1);CCC2:=FILTER(BBB2,N) AND DIF3_6.5F=LLV(DIF3_6.5F,N+1);AX2:=BARSLAST(REF(CCC2,1));小底背离:=REF(CLOSE,AX2+1)>CLOSE AND REF(DIF3_6.5F,AX2+1)<DIF3_6.5F;{画白柱线}VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);QG:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR ANDMACD>0),REF(VA1,1)+2),0.5);前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORMAGENTA;VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);VA4:=CROSS(BACKSET(CROSS(MACD,0),REF(VA3,1)+2),0.5);前低:=DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1);BD:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(C)));BDTJ:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),BARSCOUNT(C)),DRAWNULL);TSBDTJ:=BARSLAST(BDTJ);BDZH:=FILTERX(MACD<CONST(LLV(MACD,BD+1)),BARSCOUNT(C));BDTS:=BARSLAST(BDZH);本低:=IF(BD+1>=1,CONST(LLV(MACD,BD+1)),DRAWNULL);BDCL:=CROSS(COUNT(CROSS(MACD>本低/2 AND MACD<0,0.5),TSBDTJ)=1,0.5) AND TSBDTJ>=0;终点:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));UU:=(终点=1 OR 终点=2) AND MACD>0;ZZ:=FILTERX(UU,BARSCOUNT(C));本高:=DRAWLINE(ZZ,MACD,REF(ZZ,1),REF(MACD,1),1),COLORWHITE;WQG:=CROSS(COUNT(CROSS(MACD<本高/2 AND MACD>0,0.5),ZZ)=1,0.5) AND ZZ>=0;STICKLINE(MACD>前高,MACD,前高,0,0),COLORFFFFFF;STICKLINE(MACD<0 AND MACD<前低AND 前低<0,MACD,前低,0,0),COLORFFFFFF; DRAWICON(CROSS(DIF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIF),DEA,2);底:ABS((CROSS("MACD.DIF","MACD.DEA")&&"MACD.DEA"<=-0.07)*"MACD.DIF")*1.50, COLORLIMAGENTA;DRAWTEXT(ABS(底)>0,底*1.20,'底'),COLORYELLOW;。

优化KDJ通达信指标公式源码

优化KDJ通达信指标公式源码

优化KDJ通达信指标公式源码要优化KDJ指标的通达信公式源码,首先我们需要了解KDJ指标的计算原理。

KDJ指标是一种衡量市场超买超卖程度的技术指标,由三条曲线组成:K线、D线和J线。

K线代表最近一段时间内收盘价与最低价的比率,D线代表K线的简单移动平均,J线则是3倍的K线减去2倍的D线。

KDJ指标的计算公式如下:n日RSV=(Cn-Ln)/(Hn-Ln)*100Cn为最新收盘价Ln为n日内的最低价Hn为n日内的最高价K线=(2/3)*前一日K值+(1/3)*当日RSVD线=(2/3)*前一日D值+(1/3)*当日K线J线=3*当日K线-2*当日D线通过了解计算原理,我们可以针对以下方面进行代码优化:1.使用循环遍历计算RSV值:当前代码可能是使用逐个获取收盘价、最低价和最高价的方式计算RSV值,我们可以优化为使用循环遍历的方式,避免逐个获取数据带来的性能损耗。

2.优化移动平均计算:当前代码可能是使用简单的移动平均方式计算K线和D线的值,我们可以考虑使用更高效的指数加权移动平均(EMA)或其他更适合的移动平均方式。

3. 代码向量化处理:可以使用NumPy等库对数据进行向量化处理,以提高计算效率。

4.减少计算冗余:一些计算可能存在冗余,可以通过优化算法避免重复计算。

下面是一个优化过的KDJ指标计算公式的示例代码:```pythonimport numpy as npdef calculate_KDJ(closes, lows, highs, n=9):rsv_values = np.zeros(len(closes))k_values = np.zeros(len(closes))d_values = np.zeros(len(closes))j_values = np.zeros(len(closes))for i in range(n - 1, len(closes)):lowest = np.min(lows[i - n + 1:i + 1])highest = np.max(highs[i - n + 1:i + 1])rsv_values[i] = (closes[i] - lowest) / (highest - lowest) * 100k_values[n - 1] = np.mean(rsv_values[:n])d_values[n - 1] = np.mean(k_values[:n])j_values[n - 1] = 3 * k_values[n - 1] - 2 * d_values[n - 1]for i in range(n, len(closes)):k_values[i] = (2 / 3) * k_values[i - 1] + (1 / 3) *rsv_values[i]d_values[i] = (2 / 3) * d_values[i - 1] + (1 / 3) *k_values[i]j_values[i] = 3 * k_values[i] - 2 * d_values[i]return k_values, d_values, j_values```这个示例代码使用了向量化处理的方式,并在循环计算RSV值时使用Numpy库的函数进行最值计算,而不是逐个获取的方式。

通达信指标公式源码KDJ参数第3调《波段王》

通达信指标公式源码KDJ参数第3调《波段王》

KDJ参数第3调《波段王》问题1:---我们看到,有时KD线上到一半高度时,就调头向下了,好像碰到了什么阻力;问题2:---目前,J线是KD线的先导线,有指示运行方向的作用,但在问题1中我们已经意识到,KD线也只不过是更大趋势线的先导线而已;那我们就找出表示这个隐藏的阻力线\趋势线!通过再加一条更长周期的KDJ线的方法,多次调试,这条线终于被找到啦!这个“波段王”指标的线组是这样的:长趋势线:100周期下的D线黄线;波段快线:55周期下的K线粉线;波段慢线:55周期下的D线绿线;先导线:26周期下的J线灰线。

KDJ本质上是摆动指标,容易量化操作,但要回避它的弱点,还要用其它指标综合分析。

用法:1,趋势必完成。

就是先看黄线,它努力想从10到90,再从90到10,努力按此运行,其它线都为它服务2,由于更大趋势的作用,黄线有时不会运行到头,这时就要看它“走平”,走平就可能转势运行3,黄线就是趋势线,它运行方向就是趋势方向。

4,分两种情况,主图上250日线向下和向上,用法不同,向下时是抢反弹,向上是逢低加仓。

0,COLORBLUE;10,COLORBLUE,POINTDOT;80,COLORBLUE,POINTDOT;100,COLORBLUE;RSV:=(CLOSE-LLV(LOW,100))/(HHV(HIGH,100)-LLV(LOW,100))*100;K100:=SMA(RSV,5,1);D100:SMA(K100,9,1),COLORYELLOW,POINTDOT;RSV2:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;K:SMA(RSV2,5,1),COLORMAGENTA;D:SMA(K,5,1),COLOR00FF33;RSV1:=(CLOSE-LLV(LOW,26))/(HHV(HIGH,26)-LLV(LOW,26))*100;K1:=SMA(RSV1,5,1);D1:=SMA(K1,5,1);J1:3*K1-2*D1,COLOR888888;。

整合版KDJ通达信指标公式源码

整合版KDJ通达信指标公式源码

非常好用,多周期K D J 同图!STICKLINE(C>0,-20,5,4,0),COLORBLACK;F1:=ZIG(3,15);F2:=IF((F1>REF(F1,1)),100,80);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,COLORRED;MA势:=SMA(MAX(C-REF(C,1),0),8,1)/SMA(ABS(C-REF(C,1)),8,1)*100;势:=EMA(MA势,5),COLORLIRED;趋势:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1);ZZ:=趋势>REF(趋势,1);K1:=DVOL/1000000;K2:=DCLOSE;V1:=EMA(K1,5);V2:=EMA(K2,5);价异动:=K2>REF(V2,1)*1.06;量异动:=K1>REF(V1,1)*1.6&&ZZ;停牌:=DYNAINFO(17)>0;M1:=SUM(价异动,2)>0 AND 停牌;M2:=SUM(量异动,2)>0 AND REF(趋势,1)<89;鸣:(F2=100 AND C>REF(C,1) AND FILTER(M1 AND M2,3))*120,COLORRED,LINETHICK3; DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;低2:=IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL);TX:=BARSLAST(C>REF(C,1)*1.095 AND C=H);T2L:=BARSLAST(C<REF(C,1)*1.095 AND C>REF(C,1)*1.08);T3L:=BARSLAST(C<REF(C,1)*1.08 AND C>REF(C,1)*1.07);T4L:=BARSLAST(C<REF(C,1)*1.07 AND C>REF(C,1)*1.06);T5L:=BARSLAST(C<REF(C,1)*1.06 AND C>REF(C,1)*1.05);TJ1X:=COUNT(TX=0,100)=0;TJ2:=COUNT(T2L=0,100)=0;TJ3:=COUNT(T3L=0,100)=0;TJ4:=COUNT(T4L=0,100)=0;TJ5:=COUNT(T5L=0,100)=0;TJA:=C>REF(C,1)*1.05;AA:=REF(TX,1)>100 AND REF(T2L,1)>100 AND REF(T3L,1)>100 AND REF(T4L,1)>100 AND REF(T5L,1)>80 AND TJA;HHM:=HHV(MACD.MACD*100,200);LLM:=LLV(MACD.MACD*100,200);M5:=MA(C,5);M10:=MA(C,10);M20:=MA(C,20);M60:=MA(C,60);D3:=MIN(MIN(M5,M10),M20)>M60;XGT:=BARSLAST(AA AND HHM<60 AND LLM>-55);D6:=BARSSINCEN(MIN(MIN(M5,M10),M20)>M60,XGT+1);XGX:=CROSS((XGT=0 AND D3) OR D6=0,0.5);TJX:=COUNT(XGX,30)=2 AND XGX;SR11:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR21:=FILTER(SR11,10);SR31:=BACKSET(SR21,10+1);HDH:=FILTER(SR31,10);前高G:=REF(H,BARSLAST(HDH));倍量G:=VOL/REF(VOL,1)>=1.9;突破前高G:=CROSS(C,前高G);YG:= 倍量G AND 突破前高G;SJG:=BARSLAST(YG);H300:=HHVBARS(DIF,300);AL:=BOLL.UB;TQ:=BARSLAST(CROSS(AL>=REF(AL,1),0.5));E25:=EXPMA(C,25);ZF:=EVERY(RANGE(C/REF(C,1),0.97,1.05),TQ+1);ZFF:=(HHV(H,TQ+1)-LLV(L,TQ+1))/LLV(L,TQ+1)*100;TJQ:=EVERY(MAX(C,O)/AL<1.02 ,TQ+1);XL:=(ATAN((E25/REF(E25,TQ)-1)*100)*180/3.1415926);TJ1Q:=CROSS(DIF>=REF(DIF,H300),0.5) AND ZFF<17 AND ZF AND TJQ;起程:=TJ1Q AND XL>75;A1F:=REF(C,1);A3F:=(DCLOSE-A1F)/A1F*100;AA1F:=(A3F-REF(A3F,1));选股1:=CROSS(AA1F,9.8);A11F:=REF(V,1);A13F:=DVOL/A11F;AA3F:=(A13F-REF(A13F,1));选股2:=CROSS(AA3F,500);潜伏:=选股1 AND 选股2;爆发点:=(DCLOSE-REF(C,1))/REF(C,1)*100;XB:=CROSS(爆发点,20);TJ1L:=REF(CROSS(MA(C,5),C),1) AND CROSS(C,MA(C,5));TJ2L:=REF(CROSS(MA(C,10),C),1) AND CROSS(C,MA(C,10));TJ3L:=REF(CROSS(MA(C,20),C),1) AND CROSS(C,MA(C,20));TJ4L:=TJ1L OR TJ2L OR TJ3L;TJ5L:=REF(C,2)/REF(C,1)>=1.045 AND REF(C,1)<REF(O,1) AND C/REF(C,1)>1.09 AND C=H AND TJ4L;A:=(3*C+L+O+H)/6;X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8* REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+ REF(A,20))/210;中线:=EMA(X,13);KKA:=EMA(C,5);KKB:=EMA(KKA,8);KKC:=EMA(KKB,13);长线1:=EMA(KKC,50);KAAA3:=REF(C,1)<REF(中线,1) AND C>中线;KBBB3:=C/REF(C,1)>1+0.01*9;KCCC3:=中线/长线1<1+0.01*20;大牛:=KAAA3 AND KBBB3 AND KCCC3 AND TJ5L;VARAA:=LLV(LOW,5);VARBA:=HHV(HIGH,5);确:=EMA((CLOSE-VARAA)/(VARBA-VARAA)*100,4);MA500:=MA(CLOSE,500);MA250:=MA(CLOSE,250);MA120:=MA(CLOSE,120);MA30:=MA(CLOSE,33);MA60:=MA(CLOSE,55);涨停收盘:=(C-REF(C,1))*100/REF(C,1)>=4 AND H-C<0.02;HD30:=FILTER(BACKSET(FILTER(REF(H,30)=HHV(H,2*30+1),30),30+1),30);LD30:=FILTER(BACKSET(FILTER(REF(H,30)=LLV(H,2*30+1),30),30+1),30);AX30:=REF(H,BARSLAST(HD30));T300:=BARSLAST(HD30)<BARSLAST(LD30) AND NOT(HD30);顶30:=IF(T300,AX30,AX30);JZ:=(CROSS(C,顶30) AND DIF>=-0.21 AND DEA<=0.37 AND MA30>MA60 AND (CROSS(C,MA30)OR CROSS(C,MA120)OR CROSS(C,MA250)OR CROSS(C,MA500) OR LOW< MA30)) AND MA30- MA60<0.7 AND 涨停收盘AND ABS((顶30-MA30)/顶30*100)<10;信:IF(确>REF(确,1) AND DIF>DEA AND (JZ OR 大牛OR XB OR 潜伏OR 起程OR CURRBARSCOUNT=CONST(SJG)+2 OR TJX OR (CCI<=100 AND L<=低2)),120,0)STICK,LINETHICK5,COLORLIMAGENTA;卖警:=IF(PEAKBARS(3,15,1)=1,80,100),COLORGREEN;泥淖:=IF((F1> REF(F1,1)),100,80),COLORFF9900;Q_1:=C-REF(C,1);Q_2:=100*EMA(EMA(Q_1,6),6)/EMA(EMA(ABS(Q_1),6),6);Q_3:=CROSS(EMA(C,19),EMA(C,7));Q_4:=CROSS(EMA(C,7),EMA(C,19));Z1:=L=LLV(L,BARSLAST(Q_3)+1);Z2:=LLV(L,BARSLAST(Q_3)+1);Z3:=H=HHV(H,BARSLAST(Q_4)+1);Z4:=HHV(H,BARSLAST(Q_4)+1);上0:=DRAWLINE(Z1,Z2,Z3,Z4,0);Y1:=H=HHV(H,BARSLAST(Q_4)+1);Y2:=HHV(H,BARSLAST(Q_4)+1);Y3:=L=LLV(L,BARSLAST(Q_3)+1);Y4:=LLV(L,BARSLAST(Q_3)+1);下0:=DRAWLINE(Y1,Y2,Y3,Y4,0);TJ:=IF(上0<REF(上0,1) AND 下0=上0,1,0);未来空柱:=IF(REF(TJ,1)=0 AND TJ>=1,100,0);AVAR1:=(C-LLV(L,20))/(HHV(H,20)-LLV(L,20))*100;AVAR2:=(C-LLV(L,10))/(HHV(H,10)-LLV(L,10))*100;AVAR3:=(C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100;AVAR4:=DMA(SMA((AVAR1+AVAR2+AVAR3)/3,2,1),3);K0:=SMA(AVAR4,2,1),COLOR0000FF,LINETHICK2;M0:=SMA(K0,2,1),COLORFFFFFF;SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));倍量:=VOL/REF(VOL,1)>=1.9;突破前高:=CROSS(C,前高);Y:= 倍量AND 突破前高;SJ:=BARSLAST(Y);DRAWTEXT(CURRBARSCOUNT=CONST(SJ)+2,45,'过左峰'),COLORYELLOW;B:=ZIG(3,10);G:=MA(B,2);W:=CROSS(G,B);DRAWTEXT(W=1,70,'卖' ),COLOR00FF00;VARA1:=(((CLOSE - MA(CLOSE,6)) / MA(CLOSE,6)) * 100);VARA2:=(((CLOSE - MA(CLOSE,12)) / MA(CLOSE,12)) * 100);VARA3:=(((CLOSE - MA(CLOSE,24)) / MA(CLOSE,24)) * 100);VARA4:=(((VARA1 + (2 * VARA2)) + (3 * VARA3)) / 6);VARA5:=MA(VARA4,3);底部反转:=CROSS(KDJ.J,0) AND (VARA5 <= (0 - 7));DRAWTEXT(F2=100 AND 底部反转,50,'反转预警'),COLORRED;值:=(EMA(((CLOSE-LLV(LOW,14))/(HHV(HIGH,35)-LLV(LOW,56)))*(4),4))*(25),COLORG REEN,LINETHICK2;DRAWTEXT(FILTER(CROSS(值,5),10), 40,'超低'),COLORYELLOW;DIFX:=(2*EMA(CLOSE, 12)-EMA(EMA(CLOSE,12),12))-(2*EMA(CLOSE,26)-EMA(EMA(CLOSE, 26),26));DEAX:=2*EMA(DIFX, 9) - EMA(EMA(DIFX, 9),9);FF:=C=LLV(C,180);{}GG:= DEAX> REF(DEAX,1) AND REF(DEAX> REF(DEAX,1),1)=1;LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1;拐点出击:=(NOT(未来空柱=100) AND F2=100 AND LL AND GG)*DEAX;VAR1:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;VAR2:=SMA(VAR1,3,1);VAR3:=SMA(VAR2,3,1);VAR4:=SMA(VAR3,3,1);山底:=IF(CLOSE>SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORGREEN;山顶:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED; DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE;DIFF变红:=IF(DIFF>=REF(DIFF,1),DIFF,DRAWNULL),COLORLIRED;{DEA:=EMA(DIFF,9),COLORWHITE;}DEA变红:=IF(DEA>=REF(DEA,1),DEA,DRAWNULL),COLORLIMAGENTA;{MACD:=2*(DIFF-DEA),COLORSTICK;}NOTEXT上买下卖:=CLOSE-REF(CLOSE,49),COLORWHITE;NOTEXT红买绿卖:=MA(NOTEXT上买下卖,49),COLORGREEN;上买下卖:=IF(NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT上买下卖,DRAWNULL),LINETHICK2,COLORMAGENTA;红买绿卖:=IF(NOTEXT红买绿卖>=REF(NOTEXT红买绿卖,1) AND NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT红买绿卖,DRAWNULL),LINETHICK3,COLORRED;红买:=上买下卖AND 红买绿卖AND DEA变红,COLORRED,NODRAW;绿卖:=红买!=1,COLORGREEN,NODRAW;底:=SMA(VAR2,3,1),COLORGREEN;顶:=SMA(底,3,1),COLORRED;方向:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,30))/MA(CLOSE,30);方向向下:=(DMA((2*CLOSE+LOW+HIGH)/4,方向)),COLORGREEN;红灯停:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED;向下:=方向向下AND 红灯停,COLORGREEN,NODRAW;空仓基因:=绿卖AND 向下,COLORGREEN,NODRAW;B2:=BARSLAST(REF(CROSS(顶,底),1));顶背离:=空仓基因AND REF(C,B2+1)<HHV(H,3) AND REF(底,B2+1)>底AND CROSS(顶,底) AND 底>80 AND MA(C,5)>MA(C,377) AND 山顶;DRAWTEXT(顶背离=1,85,'顶背'),COLORFFFF00;DRAWTEXT(FILTER(拐点出击,30), 30,'拐点→'),COLORWHITE;多空:118,COLOR0B0BFF,LINETHICK5;红: IF(K0>M0,118,DRAWNULL),COLORFF00FF,LINETHICK5;青: IF(K0<M0,118,DRAWNULL),COLOR00FF00,LINETHICK5;STICKLINE(CROSS(90,J),88,100,1,0),COLOR00FF00;DRAWTEXT(CROSS(90,J),100,'。

通达信指标公式源码 多重共振,波段极品

通达信指标公式源码 多重共振,波段极品

DIF:(EMA(CLOSE,8)-EMA(CLOSE,20))*100;DEA:EMA(DIF,6);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 ANDCROSS(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,3,1),COLORFFFFFF;D:SMA(K,3,1),COLOR00FFFF;J:3*K-2*D,COLORFF00FF;超跌:IF(J<0,10,0),COLORFFFF00;BDDD:=LLV(J,2)=LLV(J,8);重启:IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0),COLOR00FF00; 加码:IF(CROSS(J,REF(J+0.01,1)) AND BDDD ANDBETWEEN(J,20,60),1,0),COLOR00FFFF,POINTDOT,LINETHICK0;BDGD:=HHV(J,2)=HHV(J,8) AND J>80;小心:IF(CROSS(REF(J-0.01,1),J) AND REF(BDGD,1),70,100),COLOR0000FF; DRAWTEXT(加码,J,'★'),COLOR00FFFF;IF(J<D,J,DRAWNULL),COLORFFEE44;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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("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);中:50,COLORCC9000;{中长趋势}RSV1:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;K1:=SMA(RSV1,6,1);D1:=SMA(K1,6,1);STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1) ,EMA(D1,3) ,REF(EMA(D1,3),1) ,3,0),COLORRED;STICKLINE(EMA(D1,3)<REF(EMA(D1,3),1) ,EMA(D1,3) ,REF(EMA(D1,3),1) ,3 ,0 ),COLORYELLOW;。

通达信指标公式源码MACD、KDJ、RSI三合一

通达信指标公式源码MACD、KDJ、RSI三合一

DIFF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIFF,9),COLORYELLOW;MACD:2*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1)); D3:=REF(C,C3+1)<C ANDREF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));{MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;}MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;{STICKLINE(B1>0,-0.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;}STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) ANDMACD>0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORCYAN; STICKLINE(MACD>=REF(MACD,1) ANDMACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED; NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA; VARA1:=(DVOL/C)/2,NODRAW;VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA3:=SUM(IF(VARA1>100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA4:=SUM(IF(VARA1<100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA5:=SUM(IF(VARA1<100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA6:=VARA2+VARA3+VARA4+VARA5;机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;主力差:=机买-机卖,LINETHICK2,NODRAW;强度:主力差-REF(主力差,1),NODRAW,COLORYELLOW;STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;N:=7{2,100};M:=5{2,100};VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;B:=SMA(VAR1,N,1);VAR2:=SMA(B,M,1);短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;DRAWICON(短买,0,1);。

通达信牛股变色K线主图指标公式

通达信牛股变色K线主图指标公式

通达信牛股变色K线主图指标公式股票软件源码如下:M3:MA(CLOSE,3);M13:MA(CLOSE,13);M34:MA(CLOSE,34),COLORRED,LINETHICK2;IF(M34<REF(M34,1),M34,DRAWNULL),COLORGREEN,LINETHICK2;STICKLINE(M3>=M13 AND M34>=REF(M34,1) ,H ,L ,0.4,0),COLOR0000DD;{红} STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3,1),COLOR000077; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,2.5,1),COLOR000099; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,1.9,1),COLOR0000BB; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,1.2,1),COLOR0000DD; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,0.4,1),COLOR0000FF; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3 ,0),COLOR000077; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,2.5 ,0),COLOR000099; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,1.9 ,0),COLOR0000BB; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,1.2 ,0),COLOR0000DD; STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,0.4 ,0),COLOR0000FF; STICKLINE(M3<M13 AND M34>=REF(M34,1) ,H ,L ,0.4 ,0 ),COLORFFBB00;{天兰} STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3,1 ),COLORFF3300; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,2.5,1 ),COLORFF5500; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,1.9,1 ),COLORFF7700; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,1.2,1 ),COLORFF9900; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,0.4,1 ),COLORFFBB00; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3,0 ),COLORFF1100; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,2.5,0 ),COLORFF3300; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,1.9,0 ),COLORFF5500; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,1.2,0 ),COLORFF7700; STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,0.4,0 ),COLORFF9900; STICKLINE(M3<M13 AND M34<REF(M34,1) ,H ,L ,0.4 ,0 ),COLOR00FF00;{绿} STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3, 0 ),COLOR007700; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,2.5,0 ),COLOR009900; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,1.9 ,0 ),COLOR00BB00; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,1.2 ,0 ),COLOR00DD00; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,0.4 ,0 ),COLOR00FF00; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3,1 ),COLOR006600; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,2.4,1 ),COLOR009900; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,1.8,1 ),COLOR00BB00; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,1.2 ,1 ),COLOR00DD00; STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,0.4 ,1 ),COLOR00FF00;STICKLINE(M3>=M13 AND M34<REF(M34,1) ,H ,L ,0.4 ,0 ),COLORFF66FF;{粉} STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3 ,1 ),COLOR0000BB; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,2.4 ,1 ),COLOR0000DD; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,1.8 ,1 ),COLORCC11FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,1.2 ,1 ),COLORCC44FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,0.4 ,1 ),COLORCC66FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3 ,0 ),COLOR9900FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,2.4 ,0 ),COLORFF22FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,1.8 ,0 ),COLORFF66FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,1.2 ,0 ),COLORFF99FF; STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,0.4 ,0 ),COLORFFCCFF;。

通达信KDJ完美指标公式

通达信KDJ完美指标公式

通达信KDJ完美指标公式通达信中的KDJ指标是由George C. Lane于1950年代开发的一种技术分析指标,该指标主要用于判断股票或其他金融品的超买超卖情况。

它基于随机指数的概念,通过计算最高价、最低价和收盘价之间的关系,从而为投资者提供购买和卖出的时机。

KDJ指标的计算公式如下:1.K值=(当日最高价-最低价)/(最高价-最低价)*1002.D值=K值的3日简单移动平均3.J值=3K值-2D值KDJ指标的计算过程相对简单,主要涉及到K值、D值和J值的计算,下面将重点对这三个值进行详细分析。

首先是K值的计算,K值是通过最高价和最低价之间的比例来计算的。

具体计算公式为:(当日最高价-最低价)/(最高价-最低价)*100。

K值的取值范围在0到100之间,一般来说,当K值超过80时,市场被认为是超买状态,投资者应该考虑卖出股票;而当K值低于20时,市场被认为是超卖状态,投资者应该考虑买入股票。

接下来是D值的计算,D值是K值的3日简单移动平均。

简单移动平均是指,将过去3日的K值相加后除以3,计算出来的结果即为D值。

可以说,D值是K值的平均值,它可以更好地反映股票价格的长期趋势。

当D值超过80时,市场被认为是超买状态,投资者应该考虑卖出股票;而当D值低于20时,市场被认为是超卖状态,投资者应该考虑买入股票。

最后是J值的计算,J值是通过3K值减去2D值得到的。

J值的计算公式为:3K值-2D值。

需要注意的是,J值是K值和D值的加权平均,它可以更好地判断股票价格的超买超卖情况。

当J值超过100时,市场被认为是超买状态,投资者应该考虑卖出股票;而当J值低于0时,市场被认为是超卖状态,投资者应该考虑买入股票。

总之,KDJ指标是一种较为常用的技术分析指标,通过计算最高价、最低价和收盘价之间的关系,可以帮助投资者判断股票或其他金融品的超买超卖情况。

在实际应用中,投资者可以根据K值、D值和J值的数值来制定买入和卖出的策略,从而提高投资的准确性和盈利能力。

通达信公式指标源码四色k线主图指标公式.docx

通达信公式指标源码四色k线主图指标公式.docx

通达信四色k线主图指标公式DD:=(H+L+2*C)/4;M3:EMA(DD,3);M&EMA(DD,8);M21:EMA(DD,21);M55:EMA(DD,55)Z LINETHICK2,COLOROOFFOO;TT:=BARSCOUNT(C);PT:=IF(TT<55,TT,55);上:M55+2・1*STD(C,PT),COLORRED;下:M55-2.1*STD(C Z PT),COLOROOFFOO;月涨幅:=(C-LLV(C,20))/LLV(C,20)*100;月跌幅:=(HHV(H z20)-C)/HHV(H,20)*100;DRAWTEXT(CROSS(±,M3),上,抛COLORYELLOW;DRAWTEXT(CROSS(M3,下)/下,抄 *),COLORYELLOW;HH:=MAX(MAX(MAX(M3/M8),M21),M55);LL:=MIN(MIN(MIN(M3,M8),M21),M55);SXZH:=HH/LL< = 1.03 AND M3>REF(M3,1)AND M8>REF(M8,1) AND M21>REF(M21,1) AND M55>REF(M55,1);SXZL: = HH/LL< = 1.03 AND M3<REF(M3,1)AND M8<REF(M8Z1) AND M21<REF(M21,1) AND M55<REF(M55,1); 向上:SXZH AND L<HH AND C>HH AND 月涨幅>月跌幅,NODRAW; 向下:SXZLAND H>LL AND C<LL AND 月涨幅v刀跌幅,NODRAW; DRAWICON(向上,MIN(L z LL)*0.97,l);DRAWICON(向下,MAX(H,HH)*1.03,2);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH Z9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);DIFF:= EMA(CLOSE,12)・ EMA(CLOSE,26);DEA :=EMA(DIFF,9);MACD:=2*(DIFF-DEA);做多:=IF(K>D AND MACD>0 AND V>1Z2Z O),COLORRED;做空:=IF(K V D AND MACD<0 AND V>1,-2Z O)Z COLOROOFFOO;强洗:=IF(MACD>0 AND K<D AND V>1,1,0)Z COLOR0099FF; 弱升:=IF(MACDv0 AND K>D AND V>1,-1,0),COLORFFFFOO; I”DRAWICON(CCI>185 AND H>±,H*1.02,6);DRAWICON(CCI<-185,L*0.98,5);STICKLINE(做多,L,H z0.5z O),COLORRED;STICKLINE(做多AND C>=O,C,O/3,1),COLORRED;STICKLINE(做多AND C<O,C,O z3z0),COLORRED;STICKLINE(做空z L,H,0.5z O),COLOROOFFOO;STICKLINE(做空AND C>=0,C,0,3,1),COLOROOFFOO;STICKLINE(做空AND C<0,C,O z3,0),COLOROOFFOO; STICKLINE(强洗,L,H,0.5,0),COLOR0099FF;STICKLINE(强洗AND C>=O z C z O,3,l),COLOR0099FF; STICKLINE(强洗AND C<O,C z O z3z0),COLOR0099FF; STICKLINE(弱升,L,H z0.5,0),COLORFFFF00;STICKLINE(弱升AND C>=O,C,O/3,l),COLORFFFF00; STICKLINE(弱升AND C<O,C,O,3,0),COLORFFFF00;ZDF:=(C-REF(C,1))/REF(C,1)*100;STICKU NE(ZDF>9・8QC2,0),COLORRED;STICKLINE(ZDF<-9.8,O z C z2z O)z COLORBLUE;IF(M3>M8,M3,DRAWNULL),COLORFFFFOO;IF(M8>M21,M8,DRAWNULL),COLORFFFFOO;IF(M21>M55,M21,DRAWNULL),COLORFFFFOO;IF(M55>REF(M55Z1),M55,DRAWNULL)Z COLORRED Z LINETHICK2;。

三周期KDJ通达信指标公式源码

三周期KDJ通达信指标公式源码

DIFF:EMA(CLOSE,10)-EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA),NODRAW;连续走强:EVERY(MACD>REF(MACD,1) AND MACD>0,2),NODRAW;强势回调:EVERY(MACD<REF(MACD,1) AND MACD>0,2),NODRAW;连续走弱:EVERY(MACD<REF(MACD,1) AND MACD<0,2),NODRAW;连续反弹:EVERY(MACD>REF(MACD,1) AND MACD<0,2),NODRAW;TDXSTEP198:STICKLINE(连续反弹,MACD,MACD+0.1,1,0),COLORRED;TDXSTEP199:DRAWTEXT(连续反弹,MACD+0.15,55),COLORRED;TDXSTEP200:STICKLINE(MACD>=0,MACD,0,4,1),COLORF00FF0;TDXSTEP201:STICKLINE(MACD<0,MACD,0,4,1),COLORWHITE;TDXSTEP202:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,3,0),COLOR00AAFF; TDXSTEP203:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,2.3,0),COLOR00BBFF;TDXSTEP204:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1.2,0),COLOR00CCFF;TDXSTEP205:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1.65,0),COLOR00DDFF;TDXSTEP206:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR00EEFF;TDXSTEP207:STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0.55,0),COLORYELLOW;TDXSTEP208:STICKLINE(MACD>=REF(MACD,1) AND MACD>0,0,MACD,3,0),COLOR0000AA;TDXSTEP209:STICKLINE(MACD>=REF(MACD,1) AND MACD>0,0,MACD,2.3,0),COLOR0011BB;TDXSTEP210:STICKLINE(MACD>=REF(MACD,1) AND MACD>0,0,MACD,1.2,0),COLOR0022CC;TDXSTEP211:STICKLINE(MACD>=REF(MACD,1) ANDMACD>0,0,MACD,1.65,0),COLOR0033DD;TDXSTEP212:STICKLINE(MACD>=REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR0044EE;TDXSTEP213:STICKLINE(MACD>=REF(MACD,1) AND MACD>0,0,MACD,0.55,0),COLOR0055FF;TDXSTEP214:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,3,0),COLORAA00BB;TDXSTEP215:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,2.3,0),COLORBB11BB;TDXSTEP216:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.2,0),COLORCC22BB;TDXSTEP217:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.65,0),COLORDD33BB;TDXSTEP218:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.1,0),COLOREE44BB;TDXSTEP219:STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0.55,0),COLORFF55BB;TDXSTEP220:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,3,0),COLORFFAA00;TDXSTEP221:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,2.3,0),COLORFFBB11;TDXSTEP222:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.2,0),COLORFFCC22;TDXSTEP223:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.65,0),COLORFFDD33;TDXSTEP224:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.1,0),COLORFFEE44;TDXSTEP225:STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,0.55,0),COLORFFFF55;TDXSTEP226:IF(DIFF<0,DIFF,0),COLORRED,LINETHICK2;TDXSTEP227:IF(DIFF<0,0,DIFF),COLORYELLOW,LINETHICK2;TDXSTEP228:IF(DIFF<DEA,DIFF,DEA),COLORGREEN;TDXSTEP229:IF(DIFF>DEA,DEA,DEA),COLORBLUE,LINETHICK2;买点出击:=CROSS(DIFF,DEA) AND DIFF<(-0.1);TDXSTEP230:STICKLINE(买点出击,0,(-0.1),3,0),COLORYELLOW;TDXSTEP231:DRAWTEXT(买点出击,(-0.1),56),COLORYELLOW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次出击:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; TDXSTEP232:STICKLINE(二次出击,0,(-0.1),2,0),COLORMAGENTA;TDXSTEP233:DRAWICON(二次出击,DEA*1.04,13);TDXSTEP234:DRAWTEXT(二次出击,(-0.18),57),COLORMAGENTA;AA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,AA1+1)>CLOSE AND DIFF>REF(DIFF,AA1+1) AND CROSS(DIFF,DEA);TDXSTEP235:STICKLINE(底背离,0,0.15,2,0),COLORMAGENTA;TDXSTEP236:DRAWTEXT(底背离,DEA,58),COLORRED;AA2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,AA2+1)<CLOSE AND REF(DIFF,AA2+1)>DIFF AND CROSS(DEA,DIFF);TDXSTEP237:DRAWTEXT(顶背离,DEA,59),COLORGREEN;A1:=DIFF<0 AND DEA<0;A2:=A1>REF(A1,1);A3:=BARSLAST(A2);A4:=COUNT(DEA>0 AND DIFF>0,A3)=0;A5:=CROSS(DIFF,DEA);A6:=BARSLAST(A5);A7:=REF(A6,A6+1)+A6;A8:=(DIFF+DEA)/2;A9:=(HIGH+LOW)/2;A10:=A5 AND A7<A3 AND A4 AND A8>REF(A8,A7) AND A9<REF(A9,A7) AND MACD>0; TDXSTEP238:DRAWTEXT(A10,DIFF*0.95,60),COLORYELLOW;AA3:=KD.K#WEEK(9,3,3);AA4:=KD.D#WEEK(9,3,3);TDXSTEP239:DRAWBAND(AA3/100,RGB(250,0,250),AA4/100,RGB(0,250,250));周金叉:CROSS(AA3,AA4)*0.2;月KDK:=KD.K#MONTH(4,3,3);月KDD:=KD.D#MONTH(4,3,3);月金叉:CROSS(月KDK,月KDD)*0.4,COLORWHITE,LINETHICK2;TDXSTEP240:DRAWBAND(月KDK/50,RGB(250,200,0),月KDD/50,RGB(80,150,250));。

通达信指标公式源码 变色k线主图指标

通达信指标公式源码 变色k线主图指标

DRAWGBK(O>C,RGB(360,0,10),RGB(10,0,1),0,'01',0);CC:IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL),COLOR000000; 止赢:1.05*CC,COLORFFFFFF,LINETHICK2;止损:0.97*CC,COLORFFFFFF,LINETHICK2;V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);V2:=(1-7/100)*(DMA(CLOSE,V1));V3:=(1+7/100)*(DMA(CLOSE,V1));V5:=MA((LOW+HIGH+CLOSE)/3,5);支撑:REFDATE(V2,DATE),POINTDOT,LINETHICK1,COLORCC66FF;阻力:REFDATE(V3,DATE),POINTDOT,LINETHICK1,COLORGREEN;涨幅:100*(CLOSE-REF(CLOSE,1))/REF(CLOSE,1),NODRAW,COLORWHITE;最大涨幅:100*(H-REF(CLOSE,1))/REF(CLOSE,1),NODRAW,COLORYELLOW; 最大跌幅:100*(L-REF(CLOSE,1))/REF(CLOSE,1),NODRAW,COLORYELLOW;实体幅:ABS(100*(CLOSE-OPEN)/OPEN),NODRAW,COLORRED;上影幅:IF(CLOSE>OPEN,100*(H-C)/C,100*(H-O)/O),NODRAW,COLORYELLOW; 下影幅:IF(CLOSE>OPEN,100*(O-L)/L,100*(C-L)/L),NODRAW,COLORWHITE; X:=(3*C+L+O+H)/6;AH1:=(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*RE F(X,5)+14*REF(X,6)+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*R EF(X,12)+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*RE F(X,18)+REF(X,20))/210;CP:=IF(C>REF(C,1),(3*H+4*C+3*OPEN+2*L)/12,(2*H+4*C+3*OPEN+3*L)/ 12);AH2:=EXPMEMA(CP,25);持股线:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4; VAR2M:=CLOSE*VOL;VAR3M:=EMA((EXPMA(VAR2M,3)/EXPMA(VOL,3)+EXPMA(VAR2M,6)/EXPMA(V OL,6)+EXPMA(VAR2M,12)/EXPMA(VOL,12)+EXPMA(VAR2M,24)/EXPMA(VOL,2 4))/4,13);SDN:=VAR3M*0.94;涨停B:=CLOSE>1.1*REF(CLOSE,1)-0.005 AND H>L;首个涨停:=BARSLAST(涨停B);大阳:=100*(H-REF(C,1))/REF(C,1)>7;DRAWICON((C>SDN AND 100*(L-持股线)/持股线<1.5 AND100*(L-((MIN(AH2,AH1)+MIN(持股线,AH2)+MIN(持股线,AH1))/2.95))/((MIN(AH2,AH1)+MIN(持股线,AH2)+MIN(持股线,AH1))/2.95)<1.5 AND (COUNT(大阳{ OR 倍量},13)>=2 OR 首个涨停<13) AND BARSLAST(大阳)>0 AND 涨幅<=2),L*0.98,1);DRAWTEXT(CLOSE>1.1*REF(CLOSE,1)-0.005,CLOSE*1.02,'停,'),COLORCYAN; DRAWTEXT(CLOSE<0.9*REF(CLOSE,1)+0.005,L*0.98,'停,'),COLORCCCCCC; VAR32:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*10;火:=BARSLAST(EMA(CLOSE,5)<REF(EMA(CLOSE,5),1));CRXP:=((REF(上影幅,1)>3 AND REF(下影幅,1)<1.15))AND ((下影幅>3 AND 上影幅<1.55)) AND 涨幅<8;JM:=(3*SMA(SMA(VAR32,2,1),2,1)-2*SMA(SMA(SMA(VAR32,2,1),2,1),3,1)); 强势回调:=(首个涨停<14 OR (首个涨停<26 AND 首个涨停>19));搓揉:=((强势回调AND CRXP) OR (CRXP AND (JM>REF(JM,1) OR (火>0 AND JM<7))));DRAWTEXT_FIX(1,0.85,0,0,''),COLORCYAN;DRAWTEXT(搓揉,L*0.96,'★搓揉买入,'),COLORFFFFFF;回调搓合承受价:(MIN(AH2,AH1)+MIN(BBI,AH2)+MIN(BBI,AH1))/2.95,NODRAW;大盘短期生命线:EMA(((SLOPE(INDEXC,22)*23)+INDEXC),48),COLORYELLOW,LINETHICK3, NODRAW;DA1:=IF(130>TOTALBARSCOUNT,TOTALBARSCOUNT,130);DA:=IF(CURRBARSCOUNT>DA1,0,DA1);HI:=REFDATE(HHV(H,DA),DATE);LO:=REFDATE(LLV(L,DA),DATE);C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);GZ:=EXP(LN(HI/LO)/10);LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);L1:=REFDATE(HHV(LH1,DA),DATE);L2:=REFDATE(HHV(LH2,DA),DATE);L3:=REFDATE(HHV(LH3,DA),DATE);L4:=REFDATE(HHV(LH4,DA),DATE);L5:=REFDATE(HHV(LH5,DA),DATE);L6:=REFDATE(HHV(LH6,DA),DATE);L7:=REFDATE(HHV(LH7,DA),DATE);L8:=REFDATE(HHV(LH8,DA),DATE);L9:=REFDATE(HHV(LH9,DA),DATE);L10:=REFDATE(HHV(LH10,DA),DATE);SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*99/100,HI/GZ,9,0 ),,COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*99/10 0,HI/POW(GZ,2),9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*99/10 0,HI/POW(GZ,3),9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*99/10 0,HI/POW(GZ,4),9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*99/10 0,HI/POW(GZ,5),9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*99/10 0,HI/POW(GZ,6),9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*99/10 0,HI/POW(GZ,7),9,0),COLOR181818;STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*P OW(GZ,3)*99/100,9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*P OW(GZ,2)*99/100,9,0),COLOR181818,LINETHICK3;STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)* 99/100,9,0),COLOR181818,LINETHICK3;DRAWKLINE(H,O,L,C);DRAWKLINE(H,O,L,C);DRAWTEXT(CURRBARSCOUNT=98,LOW*0.88,'☆压力越大暗条越长,做多越短越好★'),COLORYELLOW;N:=10;T1:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;量能平台:IF(CURRBARSCOUNT<=N+15,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL) ,COLOR4080FF,LINETHICK3;新量能点:IF(CURRBARSCOUNT=T1+1,量能平台,DRAWNULL),CIRCLEDOT,COLORFFFFFF,LINETHICK9;DRAWTEXT(ISLASTBAR,量能平台,' 量能平台'),COLOR00F0F0;JJ:=(CLOSE+HIGH+LOW)/3;A:=EMA(JJ,10);B:=REF(A,1);持股区域:STICKLINE(A>B,A,B,2,0),COLORYELLOW;持币区域:STICKLINE(A<B,A,B,2,0),COLORBLUE;。

通达信变态kdj指标公式

通达信变态kdj指标公式

通达信变态kdj指标公式通达信的KDJ指标是一种常用的技术分析指标,它是根据随机指标(KDJ)进行改进和优化得到的。

KDJ指标主要用于判断股票或其他交易品种的超买超卖情况和趋势转折点。

KDJ指标的计算公式如下:1. 计算周期(N)内的最低价(L)和最高价(H):L,N周期内的最低价。

H,N周期内的最高价。

2. 计算未成熟随机值(RSV):RSV = (收盘价 L) / (H L) 100。

3. 计算K值、D值和J值:K值 = 2/3 前一日K值 + 1/3 当日RSV.D值 = 2/3 前一日D值 + 1/3 当日K值。

J值 = 3 当日K值 2 当日D值。

需要注意的是,KDJ指标的计算是基于一定的周期和参数进行的,通常常用的参数是9。

也就是说,计算周期为9日的最低价和最高价,然后根据这些数据计算出RSV值,再根据RSV值计算K值、D值和J值。

KDJ指标的应用主要有以下几个方面:1. 判断超买超卖,当K值超过80时,表示股票或交易品种处于超买状态,可能会出现回调或反转;当K值低于20时,表示股票或交易品种处于超卖状态,可能会出现反弹或反转。

2. 分析趋势转折,当K值和D值交叉时,可以判断出趋势的转折点,例如K线向上穿过D线时,可能预示着股票或交易品种将出现上涨趋势,反之则可能出现下跌趋势。

3. 辅助其他指标,KDJ指标可以与其他技术指标结合使用,例如与均线、成交量等指标一起使用,来综合分析股票或交易品种的走势。

总结起来,KDJ指标是一种常用的技术分析指标,通过计算最低价、最高价和未成熟随机值,再根据一定的计算公式得出K值、D 值和J值,用于判断超买超卖和趋势转折点。

它可以辅助投资者进行交易决策和风险控制。

通达信指标公式源码MACD、KDJ、RSI三合一

通达信指标公式源码MACD、KDJ、RSI三合一

通达信指标公式源码MACD、KDJ、RSI三合⼀DIFF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIFF,9),COLORYELLOW;MACD:2*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)DIFF AND CROSS(DEA,DIFF); C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1)); D2:=REF(C,C2+1)"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1)); D3:=REF(C,C3+1)REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));{MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;}MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;{STICKLINE(B1>0,-0.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;}STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD=REF(MACD,1) ANDMACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED; NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA; VARA1:=(DVOL/C)/2,NODRAW;VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA3:=SUM(IF(VARA1>100 AND CLOSEREF(CLOSE,1),VARA1,0),0); VARA5:=SUM(IF(VARA1<100 AND CLOSE机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;主⼒差:=机买-机卖,LINETHICK2,NODRAW;强度:主⼒差-REF(主⼒差,1),NODRAW,COLORYELLOW;STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;N:=7{2,100};M:=5{2,100};VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;B:=SMA(VAR1,N,1);VAR2:=SMA(B,M,1);短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;DRAWICON(短买,0,1);。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档