决策主力股票论坛|今日股市行情大盘分析查询

 找回密码
 立即/注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

搜索
上证指数 2890.38 -1.33 -0.05% 香港恒生 27705.939 +0.000 +0.00% 日经225 21117.00 -166.37 -0.78% 韩国综合 2051.56 -13.30 -0.64%
道琼斯 25776.61 -100.72 -0.39% 纳斯达克 7750.84 -34.88 -0.45% 英国富时 7343.97 +15.05 +0.21% 德国DAX 12169.44 +25.97 +0.21%
人民币 6.9064 +0.0000 +0.00% 原油 61.15 -0.44% NYMEX原油 黄金 1273.3 -0.07% 黄金全球股市行情 2019年05月23日09时19分
查看: 28727|回复: 0

[通达信] 通达信MACD定量结构四色优化指标公式

[复制链接]
发表于 2019-3-1 14:03:02 | 显示全部楼层 |阅读模式

  1. DIF:100*(EMA(CLOSE,12)-EMA(CLOSE,26)),COLORWHITE,LINETHICK1;
  2. DEA:EMA(DIF,9),COLORYELLOW,LINETHICK1;
  3. MACD:(DIF-DEA)*2,COLORSTICK;
  4. STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,0.2,0),COLORRED;
  5. STICKLINE(MACD0,0,MACD,0.2,0),COLORYELLOW;
  6. STICKLINE(MACD>REF(MACD,1)AND MACD=0 AND COUNT(MACD>REF(MACD,1),1)=1;
  7. FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);
  8. FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)0,COLORYELLOW,NODRAW;
  9. DRAWICON(二次翻红,-0.05,1);
  10. DRAWTEXT(二次翻红,-0.15,'↖翻红'),COLORRED;
  11. DRAWTEXT(CROSS(DIF,DEA) AND DIF0,DEA-0.05,'↖加油'),COLORYELLOW;
  12. XG:二次翻红 OR 低买 OR 加油,NODRAW;
  13. YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01)/100);
  14. A1:=C>REF(C,4);
  15. NT:=BARSLASTCOUNT(A1);
  16. TJ11:=NT=9;
  17. TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);
  18. AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
  19. DRAWTEXT(AY>0,MACD*1.02,VAR2STR(AY,0)),COLORLIRED;
  20. DRAWTEXT(NT=9,MACD*1.02,'9'),COLORGREEN;
  21. B1:=C0,9) OR BACKSET(TJ23>0,NT0))*NT0;
  22. DRAWTEXT(AY1>0,MACD*0.98,VAR2STR(AY1,0)),COLORGREEN;
  23. DRAWTEXT(NT0=9,MACD*0.98,'9'),COLORRED;
  24. DRAWICON(CROSS(DIF,DEA),DEA,1);
  25. DRAWICON(CROSS(DEA,DIF),DEA,2);
  26. 死叉:=CROSS(DEA,DIF);
  27. N1:=BARSLAST(死叉),NODRAW;{http://jue-ce.com}
  28. N2:=REF(BARSLAST(死叉),N1+1),NODRAW;{http://jue-ce.com}
  29. N3:=REF(BARSLAST(死叉),N2+N1+2),NODRAW;{http://jue-ce.com}
  30. CL1:=LLV(C,N1+1),NODRAW;{http://jue-ce.com}
  31. DIFL1:=LLV(DIF,N1+1),NODRAW;
  32. CL2:=REF(CL1,N1+1),NODRAW;{http://jue-ce.com}
  33. DIFL2:=REF(DIFL1,N1+1),NODRAW;
  34. CL3:=REF(CL2,N1+1),NODRAW;{http://jue-ce.com}
  35. DIFL3:=REF(DIFL2,N1+1),NODRAW;
  36. PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);
  37. MDIFL2:=INTPART(DIFL2/POW(10,PDIFL2));
  38. PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);
  39. MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3));
  40. MDIFB2:=INTPART(DIF/POW(10,PDIFL2));
  41. MDIFB3:=INTPART(DIF/POW(10,PDIFL3));
  42. 直接底背离:=(CL1MDIFL2) AND (MACDMDIFL3) AND (MACDREF(MDIFB2,1))*REF(直接底背离,1)) OR ((MDIFB3>REF(MDIFB3,1))*REF(隔峰底背离,1)),NODRAW;
  43. {http://jue-ce.com}
  44. STICKLINE(底部钝化,DIF,DEA,1,0),COLORRED;
  45. DRAWTEXT(TFILTER(底背离,C0,INTPART(LOG(DIFH2))-1,INTPART(LOG(-DIFH2))-1);
  46. MDIFH2:=INTPART(DIFH2/POW(10,PDIFH2));
  47. PDIFH3:=IF(DIFH3>0,INTPART(LOG(DIFH3))-1,INTPART(LOG(-DIFH3))-1);
  48. MDIFH3:=INTPART(DIFH3/POW(10,PDIFH3));
  49. MDIFT2:=INTPART(DIF/POW(10,PDIFH2));
  50. MDIFT3:=INTPART(DIF/POW(10,PDIFH3));
  51. 直接顶背离:=(CH1>CH2 ) AND (MDIFT20 AND REF(MACD,1)>0) AND MDIFT2>=REF(MDIFT2,1);
  52. 隔峰顶背离:=(CH1>CH3 AND CH3>CH2 ) AND (MDIFT30 AND REF(MACD,1)>0) AND MDIFT3>=REF(MDIFT3,1);
  53. 顶部钝化:直接顶背离 OR 隔峰顶背离,NODRAW;
  54. 顶背离:((MDIFT2REF(CH1,1),1),DIF*1.02,'顶部结构形成'),COLORMAGENTA;
  55. DRAWICON(CROSS(DIF,DEA),DEA,36);
  56. DRAWICON(CROSS(DEA,DIF),DEA,37);
  57. MACDDIF:=IF(ABS(MACD)>ABS(DIF),MACD,DIF);
  58. DRAWICON(REF(DIF,1)>REF(DIF,2) AND DIF0 AND DIF>DEA,MACDDIF*1.1,39),COLORGREEN;
  59. DRAWICON(REF(DIF,1)REF(DIF,1) AND DIF<0 AND DIF<DEA,MACDDIF*1.1,38),COLORRED;
复制代码
回复

使用道具 举报

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

本版积分规则



手机版|今日股市行情|联系我们|决策主力股票论坛 ( 鄂ICP备15024813号-1)点击这里给我发消息

GMT+8, 2019-5-23 09:20

Powered by 今日股市

© 2001-2017 http://jue-ce.com/

快速回复 返回顶部 返回列表