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

[通达信指标/源码] 杂交版KDJ (源码,副图,有图)

[通达信指标/源码] 杂交版KDJ (源码,副图,有图)

N:=9;M1:=3;M2:=3;
  1. RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
  2. K:SMA(RSV,3,1);
  3. D:SMA(K,3,1);
  4. J:3*K-2*D,LINETHICK1;
  5. IF(J<0,J,DRAWNULL),COLORGREEN,LINETHICK2;
  6. IF(K>90,K,DRAWNULL),COLOR0000FF,LINETHICK2;
  7. IF(D>85,D,DRAWNULL),COLORFFFF11,LINETHICK2;
  8. DRAWICON(K>80 AND D>80 AND CROSS(D,K),95,2);
  9. OBV:=K;
  10. P:=12;
  11. A1:=REF(OBV,P)=HHV(OBV,2*P+1);
  12. B1:=FILTER(A1,P);
  13. C1:=BACKSET(B1,P+1);
  14. D1:=FILTER(C1,P);{高点1}
  15. R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1);
  16. DRAWLINE(D1,OBV,S11,OBV,1),COLORLIRED,LINETHICK1;
  17. A2:=REF(OBV,P)=LLV(OBV,2*P+1);
  18. B2:=FILTER(A2,P);
  19. C2:=BACKSET(B2,P+1);
  20. D2:=FILTER(C2,P);{低点1}
  21. T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1);
  22. DRAWLINE(D2,OBV,U11,OBV,1),COLORLIGREEN,LINETHICK1;
  23. Q1:=INTPART(3*8/18);
  24. A12:=REF(OBV,Q1)=HHV(OBV,2*Q1+1);
  25. B12:=FILTER(A12,Q1);
  26. C12:=BACKSET(B12,Q1+1);
  27. D12:=FILTER(C12,Q1);{高点2}
  28. R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); S112:=R112>REF(R112,1);
  29. DRAWLINE(S11,OBV,S112,OBV,1),COLORRED,LINETHICK1;
  30. Q2:=INTPART(3*8/18);
  31. A22:=REF(OBV,Q2)=LLV(OBV,2*Q2+1);
  32. B22:=FILTER(A22,Q2);
  33. C22:=BACKSET(B22,Q2+1);
  34. D22:=FILTER(C22,Q2);{低点2}
  35. T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1); U112:=T112>REF(T112,1);
  36. DRAWLINE(U11,OBV,U112,OBV,1),COLORGREEN,LINETHICK1;
  37. DRAWICON(D2,OBV,1);
  38. DRAWICON(D1,OBV,2);
  39. 压力:REF(OBV,BARSLAST(D1)),COLORFF00FF,NODRAW;
  40. 支撑:REF(OBV,BARSLAST(D2)),COLOR00FF00,NODRAW;
  41. 向上:CROSS(OBV,压力*1.01),NODRAW;
  42. 相对能量:(OBV-支撑)/(压力-支撑)*100,COLORYELLOW,NODRAW;
  43. STICKLINE(C>0,支撑,支撑,1,0),COLORGREEN;
  44. STICKLINE(C>0,压力,压力,1,0),COLORRED;
  45. DRAWTEXT(CROSS(OBV,压力*1.01),压力,'压力线'),COLORRED;
  46. DRAWTEXT(CROSS(支撑*0.99,OBV),支撑,'支撑线'),COLORGREEN;
  47. RSVQ:=(CLOSE-LLV(LOW,INTPART(N*4.4)))/(HHV(HIGH,INTPART(N*4.4))-LLV(LOW,INTPART(N*4.4)))*100;
  48. KQ:SMA(RSVQ,INTPART(M1*4.4),4),LINETHICK1,COLOR006FDD,NODRAW;
  49. DQ:SMA(KQ,INTPART(M2*4.4),4),LINETHICK1,COLOR009F00,NODRAW;
  50. JQ:3*KQ-2*DQ,LINETHICK,COLORABAB56;
  51. RSVE:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-LLV(LOW,14))*100;
  52. K0:=SMA(RSV,3,1);
  53. D0:=SMA(K0,3,1);
  54. JE:=3*K0-2*D0;
  55. STICKLINE(KQ>=DQ,KQ,DQ,0.5,0),COLOR006FDD;
  56. STICKLINE(KQ<DQ,KQ,DQ,0.3,0),COLOR009F00;
  57. STICKLINE(KQ>DQ,KQ,DQ,0.3,0),COLOR0000EF;
  58. STICKLINE(KQ<=DQ,KQ,DQ,0.3,0),COLOR33AA33;
  59. STICKLINE(J>REF(J,1),HHV(J,3),LLV(J,3),0,0),COLOR00AAFF;
  60. STICKLINE(J>REF(J,1),J,REF(J,1),0.5,0),COLOR0044FF;
  61. STICKLINE(J>REF(J,1),J,REF(J,1),0.3,0),COLOR0088FF;
  62. STICKLINE(J>REF(J,1),J,REF(J,1),0,0),COLOR00AAFF;
  63. STICKLINE(J<REF(J,1),HHV(J,3),LLV(J,3),0,0),COLORFFAA00;
  64. STICKLINE(J<REF(J,1),J,REF(J,1),0.5,0),COLORFF4400;
  65. STICKLINE(J<REF(J,1),J,REF(J,1),0.3,0),COLORFF8800;
  66. STICKLINE(J<REF(J,1),J,REF(J,1),0,0),COLORFFAA00;
  67. VAR1:=C-REF(C,1);
  68. VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6);
  69. MA5:=EMA(C,5);
  70. MA13:=EMA(C,13);
  71. UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS(MA13,MA5))+1),H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROSS
  72. (MA5,MA13))+1),0),COLOR0000FF;
  73. DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROSS
  74. (MA5,MA13))+1),L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS
  75. (MA13,MA5))+1),0),COLOR00FF00;
  76. BT:(LLV(VAR2,2)=LLV(VAR2,7) AND COUNT(VAR2<0,2) AND CROSS(VAR2,MA(VAR2,2))) AND
  77. REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1);
  78. STICKLINE(BT,0,3,2,0),COLOR0000CC;
  79. DRAWTEXT(BT,-3,'短牛'),COLOR0000FF;
  80. TJ1:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HHV(H,21)*0.82;
  81. STICKLINE(TJ1,0,2,2,0),COLORFF00FF;
  82. DRAWTEXT(TJ1,-5,'中牛'),COLORFF00FF;
  83. HR:=HHV(HIGH,55);
  84. HRY:=LLV(LOW,55);
  85. HRY11:=HR*HRY;
  86. HRY33:=SQRT(HRY11);
  87. TJ2:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HRY33;
  88. STICKLINE(TJ2,0,2,4,0),COLORRED;
  89. DRAWTEXT(TJ2,6,'大牛'),COLOR00FFFF;
  90. ST:=REF(UP,1)>REF(UP,2) AND DOWN<REF(UP,1);
  91. STICKLINE(ST,100,102,2,0),COLOR00FF00;
  92. DRAWTEXT(ST,106,'卖'),COLOR00FF00;
  93. N1:=6;
  94. N2:=12;
  95. N3:=24;
  96. LC := REF(CLOSE,1);
  97. RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
  98. RSI2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
  99. RSI3:=SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100;
  100. 周RSI1:=MA("RSI.RSI1#WEEK"(N1,N2,N3) ,5),LINETHICK3,COLORYELLOW;
  101. 周RSI2:=MA("RSI.RSI2#WEEK"(N1,N2,N3) ,5),LINETHICK3,COLORFF00FF;
  102. 周RSI3:=MA("RSI.RSI3#WEEK"(N1,N2,N3) ,5),LINETHICK3,COLORGREEN;
  103. 周金▲:DRAWTEXT(CROSS("RSI.RSI1#WEEK"(N1,N2,N3),"RSI.RSI2#WEEK"(N1,N2,N3)) ,10,'▲周金'),COLORRED;
  104. 周死▼:DRAWTEXT(CROSS("RSI.RSI2#WEEK"(N1,N2,N3),"RSI.RSI1#WEEK"(N1,N2,N3)) ,100,'▼周死'),COLORGREEN;
复制代码

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   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

微信截图_20181030110705.png
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

太花了,不知道好用不

TOP

返回列表