: | : | :期货量化学习 | :期货量化 |
返回列表 发帖

[文华源码] [文华指标]DMI顶底背离 MACD底背离 KDJ底背离 RSI底背离 圆弧底[文华财经公式]

[文华源码] [文华指标]DMI顶底背离 MACD底背离 KDJ底背离 RSI底背离 圆弧底[文华财经公式]

相关标签: DMI底背离 、DMI顶背离、 MACD底背离 、KDJ底背离 RSI底背离 、 文华程序化收盘价模型 、 文华程序化视频 、 文华程序化模型 、 文华程序化开盘价模型 、 文华财经博客指标公式 、

[文华指标]源码:

  1. DIFELSEF := EMA(CLOSE,12) - EMA(CLOSE,26);
  2. DEA:= EMA(DIFELSEF,9);
  3. LC := REF(CLOSE,1);
  4. RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
  5. RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
  6. RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
  7. K:=SMA(RSV,3,1);
  8. D:=SMA(K,3,1);
  9. J:=3*K-2*D;
  10. K2:EMA(CLOSE,6),COLORCYAN;
  11. K3:EMA(CLOSE,9),COLORCYAN;
  12. K5:EMA(CLOSE,12),COLORCYAN;
  13. K7:EMA(CLOSE,15),COLORCYAN;
  14. K10:EMA(CLOSE,18),COLORCYAN;
  15. K13:EMA(CLOSE,21),COLORCYAN;
  16. K16:EMA(CLOSE,24),COLORCYAN;
  17. IFELSE (K2>REF(K2,1),K2,K2),COLORRED;
  18. IFELSE (K3>REF(K3,1),K3,K2),COLORRED;
  19. IFELSE (K5>REF(K5,1),K5,K2),COLORRED;
  20. IFELSE (K7>REF(K7,1),K7,K2),COLORRED;
  21. IFELSE (K10>REF(K10,1),K10,K2),COLORRED;
  22. IFELSE (K13>REF(K13,1),K13,K2),COLORRED;
  23. IFELSE (K16>REF(K16,1),K16,K2),COLORRED;
  24. HHV(HIGH,20),COLORYELLOW;
  25. LLV(LOW,20),COLORYELLOW;
  26. STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORRED,0);
  27. STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORGREEN,0);
  28. STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORYELLOW,0);
  29. STICKLINE(CLOSE>=OPEN,HIGH,LOW,COLORYELLOW,0);
  30. STICKLINE(CLOSE<=OPEN,CLOSE,OPEN,COLORBLUE,0);
  31. STICKLINE(CLOSE<=OPEN,CLOSE,OPEN,COLORMAGENTA,0);
  32. STICKLINE(CLOSE<=OPEN,CLOSE,OPEN,COLORLIGHTGREEN,0);
  33. STICKLINE(CLOSE<=OPEN,HIGH,LOW,COLORLIGHTGREEN,0);
  34. TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
  35. HD := HIGH-REF(HIGH,1);
  36. LD := REF(LOW,1)-LOW;
  37. PDM:= SUM(IFELSE(HD>0 && HD>LD,HD,0),14);
  38. MDM:= SUM(IFELSE(LD>0 && LD>HD,LD,0),14);
  39. PDI:= PDM*100/TR;
  40. MDI:= MDM*100/TR;
  41. A1:=BARSLAST(REF(CROSS(DIFELSEF,DEA),1));
  42. B1:=REF(CLOSE,A1+1)>CLOSE && REF(DIFELSEF,A1+1)
  43. <DIFELSEF && CROSS(DIFELSEF,DEA);
  44. A2:=BARSLAST(REF(CROSS(K,D),1));
  45. B2:=REF(CLOSE,A2+1)>CLOSE && REF(K,A2+1)<K && CROSS(K,D);
  46. A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
  47. B3:=REF(CLOSE,A3+1)>CLOSE && REF(RSI1,A3+1)
  48. <RSI1 && CROSS(RSI1,RSI2);
  49. C1:=BARSLAST(REF(CROSS(DEA,DIFELSEF),1));
  50. D1:=REF(CLOSE,C1+1)<CLOSE && REF(DIFELSEF,C1+1)
  51. >DIFELSEF && CROSS(DEA,DIFELSEF);
  52. C2:=BARSLAST(REF(CROSS(D,K),1));
  53. D2:=REF(CLOSE,C2+1)<CLOSE && REF(K,C2+1)>K && CROSS(D,K);
  54. C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
  55. D3:=REF(CLOSE,C3+1)<CLOSE && REF(RSI1,C3+1)
  56. >RSI1 && CROSS(RSI2,RSI1);
  57. C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
  58. D4:=REF(CLOSE,C4+1)<CLOSE && REF(MDI,C4+1)>MDI && CROSS(MDI,PDI);
  59. A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
  60. B4:=REF(CLOSE,A4+1)>CLOSE && REF(PDI,A4+1)<PDI && CROSS(PDI,MDI);
  61. STICKLINE(B4,LOW,LOW-0.06,COLORBLUE,0);
  62. DRAWTEXT(B4,LOW-0.09,'DMI底背');
  63. STICKLINE(D4,HIGH,HIGH+0.06,COLORWHITE,0);
  64. DRAWTEXT(D4,HIGH+0.09,'DMI顶背');
  65. STICKLINE(B1,LOW,LOW-0.06,COLORGREEN,0);
  66. DRAWTEXT(B1,LOW-0.09,'MACD底背');
  67. STICKLINE(B2,LOW,LOW-0.06,COLORYELLOW,0);
  68. DRAWTEXT(B2,LOW-0.09,'KDJ底背');
  69. STICKLINE(B3,LOW,LOW-0.04,COLORRED,0);
  70. DRAWTEXT(B3,LOW-0.09,'RSI底背');
  71. STICKLINE(D1,HIGH,HIGH+0.06,COLORMAGENTA,0);
  72. DRAWTEXT(D1,HIGH+0.09,'MACD顶背');
  73. STICKLINE(D2,HIGH,HIGH+0.06,COLORLIGHTRED,0);
  74. DRAWTEXT(D2,HIGH+0.09,'KDJ顶背');
  75. STICKLINE(D3,HIGH,HIGH+0.06,COLORLIGHTGREEN,0);
  76. DRAWTEXT(D3,HIGH+0.09,'RSI顶背');
  77. MA13:=MA(CLOSE,13),COLORWHITE;
  78. VLL:=CROSS(MA(CLOSE,13),MA(CLOSE,21));
  79. DRAWTEXT(VLL,MA13,'●');
  80. DRAWTEXT(VLL,MA13-0.09,'圆弧底');
复制代码

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

返回列表