牛指标-----优化KDJ 源码中有错误
更多金钻指标股票技术讨论QQ群:966329692 技术讨论QQ群:220302856 技术讨论QQ群:39652085 如群满可换一个

编写要求:

KDJ指标乃为人熟知的常用振荡类指标,默认参数9,3,3,一般书上理论都是如下:KDJ在20附近金叉时买入,KDJ在80附近死叉时卖出。可见80,20,为人为之高低区,并非市场本身的高低区域,片面性较大。实战中,越是大牛股,在趋势未变的前提下,常常是高位死叉小跌或横盘,金叉就大涨! 反之,越是大熊股,在趋势未变的前提下,常常是低位金叉小涨或横盘,死叉就大跌!为了更好地发挥实战效果,本人经多年参学,受《布林线》及《股市密码》二书相关内容的启发,主要结合布林线的用法,将人为高低改为布林上下轨道,此轨道一出,KDJ的用法就清晰明了也!-------------------------------------------------------------------------------------公式原码如下:hp:=hhv(h,9);lp:=llv(l,9);r:=(c-lp)/(hp-lp)*100;k:sma(r,3,1),coloryellow,linethick2;d:sma(k,3,1),colorwhite,linethick2;j:3*k-2*d,colorff9999,linethick2;m:=ma(r,40);s:=std(r,40);高:=m+2*s;中:=m;低:=m-2*s;【高】: 高,color0099ff;【中】: 中,pointdot,colorwhite;【低】: 低,color00ff00;drawtext(cross(高,j) ,j*1.2,'★'),coloryellow;drawtext(cross(中,j) and m<=80 ,高,'抛'),colorred;drawtext(cross(j,低) ,j,'▲'),color00ff00;drawtext(cross(j,低) and k<10 ,j,'▲'),colorred;drawtext(cross(j,中) and K>D ,0,'吸'),coloryellow;drawtext(cross(d,k) and (d>m or d>=50),d,'★'),coloryellow;drawtext(cross(d,k) and m>80,高,'逃顶'),coloryellow;drawtext(cross(d,k) and d>85,d,'★'),colorred;drawtext(cross(k,d) and d<15,d,'▲'),colorred;drawtext(中>80 ,中,'★'),colorred;--------------------------------------------------------------------红三角为相对低位的金叉信号,绿三角为关注信号,黄色星代表死叉信号,红色星代表高位死叉信号。.

解答:

 HP:=HHV(H,9);

LP:=LLV(L,9);
R:=(C-LP)/(HP-LP)*100;
K:SMA(R,3,1),COLORYELLOW,LINETHICK2;
D:SMA(K,3,1),COLORWHITE,LINETHICK2;
J:3*K-2*D,COLORFF9999,LINETHICK2;
M:=MA(R,40);
S:=STD(R,40);
高:=M+2*S;
中:=M;
低:=M-2*S;
【高】: 高,COLOR0099FF;
【中】: 中,POINTDOT,COLORWHITE;
【低】: 低,COLOR00FF00;
DRAWTEXT(CROSS(高,J),J*1.2,'★'),COLORYELLOW;
DRAWTEXT(CROSS(中,J) AND M>=80 ,高,'抛'),COLORRED;
DRAWTEXT(CROSS(J,低) ,J,'▲'),COLOR00FF00;
DRAWTEXT(CROSS(J,低) AND K>10 ,J,'▲'),COLORRED;
DRAWTEXT(CROSS(J,中) AND K>D ,0,'吸'),COLORYELLOW;
DRAWTEXT(CROSS(D,K) AND (D>M OR D>=50),D,'★'),COLORYELLOW;
DRAWTEXT(CROSS(D,K) AND M>80,高,'逃顶'),COLORYELLOW;
DRAWTEXT(CROSS(D,K) AND D>85,D,'★'),COLORRED;
DRAWTEXT(CROSS(K,D) AND D>15,D,'▲'),COLORRED;
DRAWTEXT(中>80 ,中,'★'),COLORRED;
 

选股票看什么指标最好 >股票指标网