网友求助:
这是谦虚老师的指标,请老师把它改为大智慧可用的,谢谢
《周KDJ双J阶梯》副图指标编辑思路及简单使用方法:
1,周KDJ是在实战中被广大用户用来判断趋势的得力指标之一,而其中的周J线的形态对趋势的判断又是起到重要的作用。因此在《周KDJ双J阶梯》指标中利用了周J线的两种表达方式组成了阶梯彩带,为使用者操盘决策提供了鲜明的持仓与空仓的信息。
2,指标中同时标志:周KD与日KD彩带、在上下部有月周日KD金死叉标志,便于不同人根据不同操盘习惯低吸高抛。
3,图中用不同色块分别提示周J线的形态。
4,指标不是万能的,使用者只能用以作为参考工具。
源码如下:
ZJ1:=MA("KDJ.J#WEEK"(9,3,3) ,5);
STICKLINE(ZJ1>=0 AND ZJ1>=REF(ZJ1,1),0,50,4,0),COLORAA0077;
STICKLINE(ZJ1<0 ,0,50,4,0),COLOR060099;
STICKLINE(ZJ1<0 AND ZJ1>=REF(ZJ1,1),0,50,4,0),COLOR660088;
AA1:=IF(ZJ1<0 AND ZJ1<REF(ZJ1,1),-5,0),COLOR00FFFF;
BB1:=IF(ZJ1<0 AND ZJ1>=REF(ZJ1,1),-8,0),COLOR000088;
YK:=MA("KDJ.K#MONTH"(9,3,3),20),LINETHICK0;
YD:=MA("KDJ.D#MONTH"(9,3,3),20),LINETHICK0;
YJ:=MA("KDJ.J#MONTH"(9,3,3),20);
ZK:MA("KDJ.K#WEEK"(9,3,3) ,5),LINETHICK0;
ZD:MA("KDJ.D#WEEK"(9,3,3) ,5),LINETHICK0;
IF(ZJ1>85,100,DRAWNULL),COLOR00FFFF,LINETHICK4;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1),LINETHICK0;
D:=SMA(K,3,1),LINETHICK0;
J:3*K-2*D,LINETHICK0;
DRAWBAND(0,RGB(150,200,0),AA1,RGB(0,0,0));
DRAWBAND(0,RGB(200,50,150),BB1,RGB(0,0,0));
ZJ:=ZJ1,COLOR0000FF,LINETHICK2;
STICKLINE(C>0,50,50,2,0),COLOR00FFFF;
100;
周J:"KDJ.J#WEEK"(9,3,3),COLOR00FFFF,LINETHICK1;
STICKLINE(周J>REF(ZJ,1),50,100,4,0),COLOR888800;
DRAWBAND(ZK,RGB(200,0,0),ZD,RGB(0,200,200));
STICKLINE(K>=D,K,D,2,0),COLORBBAA00;
STICKLINE(K<D,K,D,2,1),COLOR00FFFF;
DRAWBAND(周J,RGB(250,50,250),ZJ,RGB(100,190,250));
日金叉:STICKLINE(CROSS(K,D),0,7,2,0), COLORMAGENTA,LINETHICK2;
DRAWTEXT(CROSS(K,D),9,'日金叉'),COLORMAGENTA;
日死叉:STICKLINE(CROSS(D,K),93,100,2,0), COLOR00FF00,LINETHICK2;
DRAWTEXT(CROSS(D,K),95,'日死叉'),COLOR00FF00;
周金叉:STICKLINE(CROSS(ZK,ZD),0,12,2,0),COLORRED,LINETHICK2;
DRAWTEXT(CROSS(ZK,ZD),15,'周金叉'),COLORRED;
周死叉:STICKLINE(CROSS(ZD,ZK),87,100,2,0), COLORFFFF00,LINETHICK2;
DRAWTEXT(CROSS(ZD,ZK),85,'周死叉'), COLORFFFF00;
月金叉:STICKLINE(CROSS(YK,YD),0,17,2,0),COLORYELLOW,LINETHICK2;
DRAWTEXT(CROSS(YK,YD),19,'月金叉'),COLORYELLOW;
月死叉:STICKLINE(CROSS(YD,YK),82,100,2,0),COLORFF0000,LINETHICK2;
DRAWTEXT(CROSS(YD,YK),80,'月死叉'),COLORFF0000;
DRAWTEXT_FIX(1,0.2,0,0,'★★ 深红色--提示准备★★暗粉红色--买入区★★紫粉色--加仓区★★上部绿色--持仓区★★顶部黄色带--风险提示★★'),COLORFFFF00;
解答如下:
ZJ1:=MA("KDJ.J#WEEK"(9,3,3) ,5);
STICKLINE(ZJ1>=0 AND ZJ1>=REF(ZJ1,1),0,50,10,0),COLORAA0077;
STICKLINE(ZJ1<0 ,0,50,10,0),COLOR060099;
STICKLINE(ZJ1<0 AND ZJ1>=REF(ZJ1,1),0,50,10,0),COLOR660088;
POLYLINE(C,100),COLORWHITE;
STICKLINE(ZJ1>85,101,99,10,0),COLOR00FFFF;
AA1:=IF(ZJ1<0 AND ZJ1<REF(ZJ1,1),-5,0);
BB1:=IF(ZJ1<0 AND ZJ1>=REF(ZJ1,1),-8,0);
YK:=MA("KDJ.K#MONTH"(9,3,3),20);
YD:=MA("KDJ.D#MONTH"(9,3,3),20);
YJ:=MA("KDJ.J#MONTH"(9,3,3),20);
ZK:MA("KDJ.K#WEEK"(9,3,3) ,5),LINETHICK0,COLORWHITE;
ZD:MA("KDJ.D#WEEK"(9,3,3) ,5),LINETHICK0,COLORYELLOW;
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,LINETHICK0,COLORGREEN;
POLYLINE(C,50),COLORYELLOW,DOTLINE;
POLYLINE(C,0),COLOR9632C8;
周J:"KDJ.J#WEEK"(9,3,3),COLOR00FFFF;
STICKLINE(周J>REF(ZJ1,1),50,100,10,0),COLOR888800;
STICKLINE(AA1<0,AA1,0,10,0),Color00C896;
STICKLINE(BB1<0,BB1,0,10,0),Color9632C8;
FILLRGN(ZK,ZD,ZK>ZD,RGB(200,0,0),ZK<ZD,RGB(0,200,200)),LAYER1;
STICKLINE(K>=D,K,D,6,0),COLORBBAA00,LAYER0;
STICKLINE(K<D,K,D,6,1),COLOR00FFFF,LAYER0;
FILLRGN(周J,ZJ1,周J>ZJ1,RGB(250,50,250),周J<ZJ1,RGB(100,190,250)),LAYER1;
日金叉:STICKLINE(CROSS(K,D),0,7,6,0),COLORMAGENTA;
DRAWTEXT(CROSS(K,D),9,'日金叉'),COLORMAGENTA;
日死叉:STICKLINE(CROSS(D,K),93,100,6,0),COLOR00FF00;
DRAWTEXT(CROSS(D,K),95,'日死叉'),COLOR00FF00;
周金叉:STICKLINE(CROSS(ZK,ZD),0,12,6,0),COLORRED;
DRAWTEXT(CROSS(ZK,ZD),15,'周金叉'),COLORRED;
周死叉:STICKLINE(CROSS(ZD,ZK),87,100,6,0),COLORFFFF00;
DRAWTEXT(CROSS(ZD,ZK),85,'周死叉'), COLORFFFF00;
月金叉:STICKLINE(CROSS(YK,YD),0,17,6,0),COLORYELLOW;
DRAWTEXT(CROSS(YK,YD),19,'月金叉'),COLORYELLOW;
月死叉:STICKLINE(CROSS(YD,YK),82,100,6,0),COLORFF0000;
DRAWTEXT(CROSS(YD,YK),80,'月死叉'),COLORFF0000;