通达信KD牛股副图红色做多金黄k线与蓝色k线同样也显示多空阶段
中轴线:50,COLORYELLOW,LINETHICK1;A1:=EMA(EMA(CLOSE,7),2)-EMA(EMA(CLOSE,21),2);B1:=EMA((0.668*REF(A1,1)+0.333*A1),1);短线做多:IF(A1>=B1,A1,B1),LINETHICK3,COLORFF00FF;短线做空:B1,LINETHICK2,COLORFFAA00;STICKLINE(B1<0 AND B1<REF(B1,1),B1*0.7,0,0.05,0),COLORRED;STICKLINE(B1<0 AND B1>REF(B1,1),B1*0.7,0,0.05,0),COLORYELLOW;STICKLINE(B1>REF(B1,1) AND B1>0,B1*0.7,0,0.05,0),COLORRED;STICKLINE(B1<REF(B1,1) AND B1>0,B1*0.7,0,0.05,0),COLORGREEN;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),2,1)/SMA(ABS(CLOSE-LC),2,1)*100;RSI2:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;RSI3:=SMA(MAX(CLOSE-LC,0),4,1)/SMA(ABS(CLOSE-LC),4,1)*100;RSI4:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;RSI5:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;RSI6:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;RSI7:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;RSI8:=SMA(MAX(CLOSE-LC,0),9,1)/SMA(ABS(CLOSE-LC),9,1)*100;RSI9:=SMA(MAX(CLOSE-LC,0),10,1)/SMA(ABS(CLOSE-LC),10,1)*100;RSI10:=SMA(MAX(CLOSE-LC,0),11,1)/SMA(ABS(CLOSE-LC),11,1)*100;RSI11:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;RSI12:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)*100;RSI13:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;RSI14:=SMA(MAX(CLOSE-LC,0),15,1)/SMA(ABS(CLOSE-LC),15,1)*100;RSI15:=SMA(MAX(CLOSE-LC,0),16,1)/SMA(ABS(CLOSE-LC),16,1)*100;RSI16:=SMA(MAX(CLOSE-LC,0),17,1)/SMA(ABS(CLOSE-LC),17,1)*100;RSI17:=SMA(MAX(CLOSE-LC,0),18,1)/SMA(ABS(CLOSE-LC),18,1)*100;RSI18:=SMA(MAX(CLOSE-LC,0),19,1)/SMA(ABS(CLOSE-LC),19,1)*100;RSI19:=SMA(MAX(CLOSE-LC,0),20,1)/SMA(ABS(CLOSE-LC),20,1)*100;RSI21:=SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*100;短线RSI:=(RSI1+RSI2+RSI3+RSI4+RSI5)/5,COLORWHITE;中线RSI:=(RSI6+ RSI7+ RSI8+ RSI9+ RSI10+ RSI11+ RSI12+ RSI13+ RSI14+ RSI15+ RSI16+ RSI17+ RSI18+ RSI19+ RSI21)/15,COLORYELLOW;{股票指标网http://}A:=CROSS(短线RSI,中线RSI);B:=CROSS(中线RSI,短线RSI);M1 := EMA( CLOSE, 9 );M2 := EMA( CLOSE, 18 );MD : M1 - M2, COLORWHITE, LINETHICK3;MM := EMA( MD, 3 );吸 : IF( MD >= MM AND MD < 0, MD, DRAWNULL ), COLORLIRED, LINETHICK3;拉 : IF( MD >= MM AND MD >= 0, MD, DRAWNULL ), COLORRED, LINETHICK3;派 : IF( MD < MM AND MD >= 0, MD, DRAWNULL ), COLORGREEN, LINETHICK3;落 : IF( MD < MM AND MD < 0, MD, DRAWNULL ), COLORWHITE, LINETHICK3;VAR2:MA(C,13),COLORRED,LINETHICK1;上翘:IF(VAR2>REF(VAR2,1),VAR2,DRAWNULL),COLORRED,LINETHICK1;下拐:IF(VAR2<REF(VAR2,1),VAR2,DRAWNULL),COLORGREEN,LINETHICK1;支撑位:IF((EMA(CLOSE,13)-REF(EMA(CLOSE,13),1))/REF(EMA(CLOSE,13),1)*100>=0,REF(EMA(CLOSE,13),BARSLAST(CROSS((EMA(CLOSE,13)-REF(EMA(CLOSE,13),1))/REF(EMA(CLOSE,13),1)*100,0))+1),DRAWNULL),COLORRED,LINETHICK3;阻力位:IF((EMA(CLOSE,13)-REF(EMA(CLOSE,13),1))/REF(EMA(CLOSE,15),1)*100<0,REF(EMA(CLOSE,15),BARSLAST(CROSS(0,(EMA(CLOSE,13)-REF(EMA(CLOSE,13),1))/REF(EMA(CLOSE,13),1)*100))+1),DRAWNULL),COLORGREEN,LINETHICK3;N:=13;STICKLINE(C>0,79.5,80,15/3,0),COLORCYAN,LINETHICK2;STICKLINE(C>0,50,49,8/3,0),COLORWHITE,LINETHICK2;STICKLINE(C>0,20,19.5,15/3,0),COLORCYAN,LINETHICK2;RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;K:SMA(RSV,5,1);D:SMA(K,3,1);J:=3*K-2*D;
DRAWBAND(D,RGB(200,0,0),K,RGB(0,200,0));STICKLINE(J>REF(J,1),J,REF(J,1),8/3,0),COLOR0022FF;STICKLINE(J>REF(J,1),HHV(J,3),LLV(J,3),1/3,0),COLOR0022FF;STICKLINE(J>REF(J,1),J,REF(J,1),5/3,0),COLOR0066FF;STICKLINE(J>REF(J,1),J,REF(J,1),3/3,0),COLOR0099FF;STICKLINE(J>REF(J,1),J,REF(J,1),1.5/3,0),COLOR00DDFF;STICKLINE(J>REF(J,1),J,REF(J,1),0,0),COLOR00DDFF;STICKLINE(J<REF(J,1),J,REF(J,1),8/3,0),COLORFF2200;STICKLINE(J<REF(J,1),HHV(J,3),LLV(J,3),1/3,0),COLORFF2200;STICKLINE(J<REF(J,1),J,REF(J,1),5/3,0),COLORFF6600;STICKLINE(J<REF(J,1),J,REF(J,1),3/3,0),COLORFF9900;STICKLINE(J<REF(J,1),J,REF(J,1),1.5/3,0),COLORFFDD00;STICKLINE(J<REF(J,1),J,REF(J,1),0,0),COLORFFDD00;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出中轴线:50,画黄色,LINETHICK1
A1赋值:收盘价的7日指数移动平均,2)-收盘价的21日指数移动平均,2)
B1赋值:EMA((0.668*1日前的A1+0.333*A1),1)
如果A1>=B1返回A1否则返回B1
输出短线做空:B1,LINETHICK2,COLORFFAA00
STICKLINE(B1<0 AND B1<1日前的B1,B1*0.7,0,0.05,0),COLORRED
STICKLINE(B1<0 AND B1>1日前的B1,B1*0.7,0,0.05,0),画黄色
STICKLINE(B1>1日前的B1 AND B1>0,B1*0.7,0,0.05,0),COLORRED
STICKLINE(B1<1日前的B1 AND B1>0,B1*0.7,0,0.05,0),COLORGREEN
LC赋值:1日前的收盘价
RSI1赋值:SMA(收盘价-LC和0较大值,2,1)/SMA(收盘价-LC的绝对值,2,1)*100
RSI2赋值:SMA(收盘价-LC和0较大值,3,1)/SMA(收盘价-LC的绝对值,3,1)*100
RSI3赋值:SMA(收盘价-LC和0较大值,4,1)/SMA(收盘价-LC的绝对值,4,1)*100
RSI4赋值:SMA(收盘价-LC和0较大值,5,1)/SMA(收盘价-LC的绝对值,5,1)*100
RSI5赋值:SMA(收盘价-LC和0较大值,6,1)/SMA(收盘价-LC的绝对值,6,1)*100
RSI6赋值:SMA(收盘价-LC和0较大值,7,1)/SMA(收盘价-LC的绝对值,7,1)*100
RSI7赋值:SMA(收盘价-LC和0较大值,8,1)/SMA(收盘价-LC的绝对值,8,1)*100
RSI8赋值:SMA(收盘价-LC和0较大值,9,1)/SMA(收盘价-LC的绝对值,9,1)*100
RSI9赋值:SMA(收盘价-LC和0较大值,10,1)/SMA(收盘价-LC的绝对值,10,1)*100
RSI10:=SMA(收盘价-LC和0较大值,11,1)/SMA(收盘价-LC的绝对值,11,1)*100
RSI11:=SMA(收盘价-LC和0较大值,12,1)/SMA(收盘价-LC的绝对值,12,1)*100
RSI12:=SMA(收盘价-LC和0较大值,13,1)/SMA(收盘价-LC的绝对值,13,1)*100
RSI13:=SMA(收盘价-LC和0较大值,14,1)/SMA(收盘价-LC的绝对值,14,1)*100
RSI14:=SMA(收盘价-LC和0较大值,15,1)/SMA(收盘价-LC的绝对值,15,1)*100
RSI15:=SMA(收盘价-LC和0较大值,16,1)/SMA(收盘价-LC的绝对值,16,1)*100
RSI16:=SMA(收盘价-LC和0较大值,17,1)/SMA(收盘价-LC的绝对值,17,1)*100
RSI17:=SMA(收盘价-LC和0较大值,18,1)/SMA(收盘价-LC的绝对值,18,1)*100
RSI18:=SMA(收盘价-LC和0较大值,19,1)/SMA(收盘价-LC的绝对值,19,1)*100
RSI19:=SMA(收盘价-LC和0较大值,20,1)/SMA(收盘价-LC的绝对值,20,1)*100
RSI21:=SMA(收盘价-LC和0较大值,21,1)/SMA(收盘价-LC的绝对值,21,1)*100
短线RSI赋值:(RSI1+RSI2+RSI3+RSI4+RSI5)/5,画白色
中线RSI赋值:(RSI6+ RSI7+ RSI8+ RSI9+ RSI10+ RSI11+ RSI12+ RSI13+ RSI14+ RSI15+ RSI16+ RSI17+ RSI18+ RSI19+ RSI21)/15,画黄色
{股票指标网HTTP://}A:=短线RSI上穿中线RSI
B赋值:中线RSI上穿短线RSI
M1 := 收盘价的 9 日指数移动平均
M2 := 收盘价的 18 日指数移动平均
MD : M1 - M2, 画白色, LINETHICK3
MM := MD的 3 日指数移动平均
如果 MD >= MM AND MD < 0返回 MD否则返回 DRAWNULL
如果 MD >= MM AND MD >= 0返回 MD否则返回 DRAWNULL
如果 MD < MM AND MD >= 0返回 MD否则返回 DRAWNULL
如果 MD < MM AND MD < 0返回 MD否则返回 DRAWNULL
输出VAR2:C的13日简单移动平均,COLORRED,LINETHICK1
输出上翘:IF(VAR2>1日前的VAR2,VAR2,DRAWNULL),COLORRED,LINETHICK1
输出下拐:IF(VAR2<1日前的VAR2,VAR2,DRAWNULL),COLORGREEN,LINETHICK1
输出支撑位:IF((收盘价的13日指数移动平均-1日前的收盘价的13日指数移动平均)/1日前的收盘价的13日指数移动平均*100>=0,REF(收盘价的13日指数移动平均,上次CROSS((收盘价的13日指数移动平均-1日前的收盘价的13日指数移动平均距今天数/1日前的收盘价的13日指数移动平均*100,0))+1),DRAWNULL),COLORRED,LINETHICK3
输出阻力位:IF((收盘价的13日指数移动平均-1日前的收盘价的13日指数移动平均)/1日前的收盘价的15日指数移动平均*100<0,REF(收盘价的15日指数移动平均,上次CROSS(0,(收盘价的13日指数移动平均-1日前的收盘价的13日指数移动平均距今天数/1日前的收盘价的13日指数移动平均*100))+1),DRAWNULL),COLORGREEN,LINETHICK3
N赋值:13
当满足条件C>0时,在79.5和80之间画柱状线
当满足条件C>0时,在50和49之间画柱状线
当满足条件C>0时,在20和19.5之间画柱状线
RSV赋值:(收盘价-N日内最低价最低值)/(N日内最高价最高值-N日内最低价最低值)*100
RSV的5日[1日权重]移动平均
K的3日[1日权重]移动平均
J赋值:3*K-2*D
DRAWBAND(D,RGB(200,0,0),K,RGB(0,200,0))
STICKLINE(J>1日前的J,J,1日前的J,8/3,0),COLOR0022FF
STICKLINE(J>1日前的J,3日内J最高值,3日内J最低值,1/3,0),COLOR0022FF
STICKLINE(J>1日前的J,J,1日前的J,5/3,0),COLOR0066FF
STICKLINE(J>1日前的J,J,1日前的J,3/3,0),COLOR0099FF
STICKLINE(J>1日前的J,J,1日前的J,1.5/3,0),COLOR00DDFF
STICKLINE(J>1日前的J,J,1日前的J,0,0),COLOR00DDFF
STICKLINE(J<1日前的J,J,1日前的J,8/3,0),COLORFF2200
STICKLINE(J<1日前的J,3日内J最高值,3日内J最低值,1/3,0),COLORFF2200
STICKLINE(J<1日前的J,J,1日前的J,5/3,0),COLORFF6600
STICKLINE(J<1日前的J,J,1日前的J,3/3,0),COLORFF9900
STICKLINE(J<1日前的J,J,1日前的J,1.5/3,0),COLORFFDD00
STICKLINE(J<1日前的J,J,1日前的J,0,0),COLORFFDD00