源码如下: KDJ的多周期金叉 RSV:=(CLOSE-LLV(LOW,90))/(HHV(HIGH,90)-LLV(LOW,90))*200-100; 长K:SMA(RSV,25,1); 长D:SMA(长K,7,1),LINETHICK2; 长J:3*长K-2*长D; RS:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*200-100; 中K:SMA(RS,5,1); 中D:SMA(中K,3,1),COLORRED,LINETHICK2; 中J:3*中K-2*中D,COLORCYAN; AA:="KDJ.K#WEEK"; BB:="KDJ.D#WEEK"; AAA:="KDJ.K#MONTH"; BBB:="KDJ.D#MONTH"; 60分钟金叉:IF(CROSS("KDJ.K#MIN60","KDJ.D#MIN60"),-75,-100),COLOR00FFFF; 日金叉:IF((CROSS("KDJ.K#DAY","KDJ.D#DAY") AND ("KDJ.K#DAY" < 20)),-50,-100),COLOR00FF33; 周金叉:IF(CROSS(AA,BB),-25,-100),COLOR0000FF; 月金叉:IF(CROSS(AAA,BBB),0,-100),COLORFF9999; DRAWTEXT(60分钟金叉=-75,-70,'60分钟金叉')COLOR00FFFF; DRAWTEXT(日金叉=-50,-40,'日金叉')COLOR00FF33; DRAWTEXT(周金叉=-25,-20,'周金叉')COLORRED; DRAWTEXT(月金叉=0,2,'月金叉')COLORFF9999; MACD的多周期金叉 日DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26); 日DEA:=EMA(日DIFF,9); MACD:=2*(日DIFF-日DEA); 周DIF:="MACD.DIF#WEEK"(12,26,9); 周DEA:="MACD.DEA#WEEK"(12,26,9); 周MACD:="MACD.MACD#WEEK"(12,26,9); 月DIF:="MACD.DIF#MONTH"(12,26,9); 月DEA:="MACD.DEA#MONTH"(12,26,9); 月MACD:="MACD.MACD#MONTH"(12,26,9); 日金叉:IF(CROSS(日DIFF,日DEA),20,0),COLORWHITE; 周金叉:IF(CROSS(周DIF,周DEA),40,0),COLORRED; 月金叉:IF(CROSS(月DIF,月DEA),60,0),COLOR0080FF; DRAWICON(周金叉 AND 日金叉,5,15); DRAWICON(周金叉 AND 月金叉,8,11); DRAWICON(日金叉 AND 月金叉,13,17); 老师能不能帮我在这2个指标都同时出现周金叉时或同时出现月金叉时帮我做一个选股公式?非常感谢
爱约股解答:
PS:选股一:={body over}以上 + ㈠ ;选股二:={body over}以上 + ㈡.
RSV:=(CLOSE-LLV(LOW,90))/(HHV(HIGH,90)-LLV(LOW,90))*200-100;
长K:SMA(RSV,25,1);
长D:SMA(长K,7,1),LINETHICK2;
长J:3*长K-2*长D;
RS:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*200-100;
中K:SMA(RS,5,1);
中D:SMA(中K,3,1),COLORRED,LINETHICK2;
中J:3*中K-2*中D,COLORCYAN;
AA:="KDJ.K#WEEK";
BB:="KDJ.D#WEEK";
{KDJ body over}
日DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
日DEA:=EMA(日DIFF,9);
MACD:=2*(日DIFF-日DEA);
周DIF:="MACD.DIF#WEEK"(12,26,9);
周DEA:="MACD.DEA#WEEK"(12,26,9);
周MACD:="MACD.MACD#WEEK"(12,26,9);
月DIF:="MACD.DIF#MONTH"(12,26,9);
月DEA:="MACD.DEA#MONTH"(12,26,9);
月MACD:="MACD.MACD#MONTH"(12,26,9);
{MACD body over}
{body over}
㈠
K周金叉:=CROSS(AA,BB);
M周金叉:=CROSS(周DIF,周DEA);
K周金叉 AND M周金叉;
㈡
K月金叉:=CROSS(AAA,BBB);
M月金叉:=CROSS(月DIF,月DEA);
K月金叉 AND M月金叉;