通达信KDJ融入MACD也具实战性金叉,背离,买卖点 源码

[复制链接]
查看67 | 回复0 | 2022-7-24 09:02:00 | 显示全部楼层 |阅读模式

通达信KDJ融入MACD也具实战性金叉,背离,买卖点 源码

把kdj的j值融入到MACD中,比RSI更早的提前发生金叉和背离!与rsi相互印证,可以提高成功率,可以成为一个指标系统!!如图!可以明显的看出两个指标一起使用,绝非1+1=2的效果!可以大幅提升指标的实用性!如果,大家觉得对您有所帮助,请给加分,我对理想币的获得有些抵触

 

{牛牛指标网提供:www.tdx001.com}复制内容到剪贴板
  1. RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;   
  2. K:=SMA(RSV,M1,1),LINETHICK2,COLORWHITE;   
  3. D:=SMA(K,M2,1),COLORYELLOW;   
  4. 量能:=3*K-2*D,LINETHICK2;   
  5. RSIE:=EMA(量能,3);   
  6. DIFF : EMA(RSIE,12) - EMA(RSIE,26);   
  7. BBDIFF:=DIFF-REF(DIFF,1);   
  8. DEA  : EMA(DIFF,9);   
  9. DRAWBAND(DIFF,RGB(255,105,180),DEA,RGB(34,139,34));   
  10. BBDEA:=DEA-REF(DEA,1);   
  11. MACD : 2*(DIFF-DEA), COLORSTICK;   
  12. STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORFFFF00;   
  13. STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR00FF00;   
  14. STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR0099FF;   
  15. STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORRED;   
  16. 0,COLORFF8855,LINETHICK2;   
  17. IF(DIFF>DEA,DIFF,DRAWNULL),COLORRED,LINETHICK2;   
  18. IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORMAGENTA;   
  19. DRAWICON(CROSS(DIFF,DEA),DEA,1);   
  20. DRAWICON(CROSS(DEA,DIFF),DEA,2);   
  21. 低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;   
  22. STICKLINE(低位金叉,0,-1.5,2,0),COLORFFFF00;   
  23. DRAWTEXT(低位金叉,-1.5,' 低位金叉'),COLORFFFF00;   
  24. JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));   
  25. 二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;   
  26. STICKLINE(二次金叉,0,-1,5,0),COLORFF00FF;   
  27. DRAWICON(二次金叉,DEA*1.2,11) ;   
  28. DRAWTEXT(二次金叉,-1,' 二次金叉'),COLORFF00FF;   
  29. A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));   
  30. 底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);   
  31. STICKLINE(底背离,0,1.5,3,0),COLOR00FF00;   
  32. DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;   
  33. DRAWTEXT(底背离,2,' 底背离'),COLOR00FF00;   
  34. A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));   
  35. 顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);   
  36. STICKLINE(顶背离,0,2,3,0),COLORFF8855;   
  37. DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORFF8855,LINETHICK2;   
  38. DRAWTEXT(顶背离,2,' 顶背离'),COLORFF8855;   
  39.    

 

{牛牛指标网提供:www.tdx001.com}复制内容到剪贴板
  1. rsi融入macd源码如下:   
  2. LC:=REF(CLOSE,1);   
  3. RSI:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;   
  4. RSIE:=EMA(RSI,3);   
  5. DIFF : EMA(RSIE,12) - EMA(RSIE,26);   
  6. BBDIFF:=DIFF-REF(DIFF,1);   
  7. DEA  : EMA(DIFF,9);   
  8. DRAWBAND(DIFF,RGB(255,105,180),DEA,RGB(34,139,34));   
  9. BBDEA:=DEA-REF(DEA,1);   
  10. MACD : 2*(DIFF-DEA), COLORSTICK;   
  11. STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORFFFF00;   
  12. STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR00FF00;   
  13. STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR0099FF;   
  14. STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORRED;   
  15. 0,COLORFF8855,LINETHICK2;   
  16. IF(DIFF>DEA,DIFF,DRAWNULL),COLORRED,LINETHICK2;   
  17. IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORMAGENTA;   
  18. DRAWICON(CROSS(DIFF,DEA),DEA,1);   
  19. DRAWICON(CROSS(DEA,DIFF),DEA,2);   
  20. 低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;   
  21. STICKLINE(低位金叉,0,-1.5,2,0),COLORFFFF00;   
  22. DRAWTEXT(低位金叉,-1.5,' 低位金叉'),COLORFFFF00;   
  23. JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));   
  24. 二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;   
  25. STICKLINE(二次金叉,0,-1,5,0),COLORFF00FF;   
  26. DRAWICON(二次金叉,DEA*1.2,11) ;   
  27. DRAWTEXT(二次金叉,-1,' 二次金叉'),COLORFF00FF;   
  28. A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));   
  29. 底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);   
  30. STICKLINE(底背离,0,1.5,3,0),COLOR00FF00;   
  31. DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;   
  32. DRAWTEXT(底背离,2,' 底背离'),COLOR00FF00;   
  33. A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));   
  34. 顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);   
  35. STICKLINE(顶背离,0,2,3,0),COLORFF8855;   
  36. DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORFF8855,LINETHICK2;   
  37. DRAWTEXT(顶背离,2,' 顶背离'),COLORFF8855;   
  38.    

718355219.jpg

718355219.jpg

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则