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

大智慧KDJ+ MACD+均线结合解盘源码[大智慧公式]

大智慧KDJ+ MACD+均线结合解盘源码[大智慧公式]

相关标签: macd 与均线 、 macd与均线的最佳设置 、 macd与均线的综合运用 、 macd+kd+20均线ea 、 macd套用均线八法 、 均线 趋势 60分macd 、 均线上macd红缩柱 、 均线发散macd拐点向上 、 macd均线的涨跌速度 、


大智慧KDJ+ MACD+均线结合解盘源码


  1. Var31:=SARTURN( 10,2 ,20 );
  2. Var32:=ref(HIGH,1)*1.1;
  3. Var33:=HIGH*1.1;
  4. Var34:=(Var33*VOL+Var32*(CAPITAL-VOL))/CAPITAL;
  5. Var35:=ref(LOW,1)*0.9;
  6. Var36:=LOW*0.9;
  7. Var37:=(Var36*VOL+Var35*(CAPITAL-VOL))/CAPITAL;
  8. Var38:=EMA(Var37,20);
  9. Var39:=EMA(Var34,20);
  10. VarA:=Var39-1.5;
  11. VarB:=IF(CLOSE<=Var38,VarA,Var39);
  12. 别样:= VarB;
  13. 红:= VarA;
  14. CXH:=STRTONUM(STRRIGHT(DATESTR(CURRENTDATE),1));
  15. WARNING('http://www.cxh99.com',CURRENTTIME>180000 and (CXH=3 OR CXH=8));
  16. DRAWTEXTREL(10 ,10 ,'');
  17. DRAWFLAGTEXT(别样=红,C ,'股价严重超跌,阶段底部可择机买入');
  18. 股价趋势:= 3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)
  19. -2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
  20. 买入:=IF(股价趋势<=10,30,0);
  21. DRAWFLAGTEXT(买入,C,'底部区域' );
  22. Var8:=LLV(LOW,26);
  23. Var6:=HHV(HIGH,34);
  24. Var7:=EMA((CLOSE-Var8)/(Var6-Var8)*4,4)*25;
  25. 派发:=IF((Var7>90),-30,0);
  26. DRAWFLAGTEXT(派发,C,'派发区域');

  27. b1:=AMOUNT/VOL/500;
  28. b2:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
  29. d3:=SUM(AMOUNT,13)/b1/500;
  30. e4:=DMA(b2,VOL/d3);
  31. A1:=(CLOSE-e4)/e4*500 ;
  32. A2:=(CLOSE-e4)/e4*1000 ;
  33. 吸筹:=(CLOSE-MA(CLOSE,60))/MA(CLOSE,60)*500;
  34. DRAWFLAGTEXT((ref(a1,1)<-80 and a1>ref(a1,1)or ref(吸筹,1)<-80 and 吸筹>ref(吸筹,1)), C,'历史大底全仓买入');
  35. Var3o:=ref(CLOSE,1);
  36. Var4o:=SMA(MAX(CLOSE-Var3o,0),6,1)/SMA(ABS(CLOSE-Var3o),6,1)*100;
  37. 卖出:=CROSS(80,Var4o);
  38. DRAWFLAGTEXT(卖出, C,'高度危险,清仓');
  39. 生命指数:EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),Color00FFFF;
  40. DRAWFLAGTEXT(IF(生命指数>92,生命指数,0),生命指数 ,'危险,清仓');
  41. DRAWFLAGTEXT((VOL/CAPITAL)>0.075 ,C,
  42. '换手过大,小心主力出逃,短期头部');
  43. K:="KD.K"(17,4,4);
  44. D:="KD.D"(17,4,4);
  45. K:="KD.K"(17,4,4);
  46. D:="KD.D"(17,4,4);
  47. DRAWFLAGTEXT(K>80 AND CROSS(D,K)=0,C,'KD指标提示该股已经处于超买状态,如果KD指标死叉应及时卖出。');
  48. DRAWFLAGTEXT(K<20 AND CROSS(K,D)=0,C,'KD指标提示该股已经处于超卖状态,如果KD指标金叉应及时买入。');
  49. DRAWFLAGTEXT(CROSS(K,D) AND LLV(K,3)<20,C,'KD低位金叉,建议买入。');
  50. DRAWFLAGTEXT(CROSS(D,K) AND HHV(K,3)>80,C,'KD高位死叉,建议卖出。');
  51. RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
  52. K:=SMA(RSV,3,1);
  53. D:=SMA(K,3,1);
  54. J:=3*K-2*D;
  55. DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
  56. DEA :=EMA(DIFF,9);
  57. MACD:=2*(DIFF-DEA);
  58. DRAWFLAGTEXT(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)) and"kdj.k"(9,3,3)<=20,C,'KDJ在20以下金叉,可关注!');
  59. DRAWFLAGTEXT(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)) and"kdj.k"(9,3,3)>=80,C,'KDJ在80以上死叉,注意风险!');
  60. DRAWFLAGTEXT("MAcd.MAcd"(12,26,9)>ref("MAcd.MAcd"(12,26,9),1) and "MAcd.MAcd"(12,26,9)>0,C,'MACD的红柱增长。');
  61. DRAWFLAGTEXT("MAcd.MAcd"(12,26,9)<ref("MAcd.MAcd"(12,26,9),1) and "MAcd.MAcd"(12,26,9)>0,C,'MACD的红柱缩短。');
  62. DRAWFLAGTEXT("MAcd.MAcd"(12,26,9)<ref("MAcd.MAcd"(12,26,9),1) and "MAcd.MAcd"(12,26,9)<0,C,'MACD的绿柱增长。');
  63. DRAWFLAGTEXT("MAcd.MAcd"(12,26,9)>ref("MAcd.MAcd"(12,26,9),1) and "MAcd.MAcd"(12,26,9)<0,C,'MACD的绿柱缩短。');
  64. DRAWFLAGTEXT(cross("MAcd.diff"(12,26,9),"MAcd.dea"(12,26,9)) and "MAcd.MAcd"(12,26,9)<=0,C,'MACD的DIFF与DEA在0轴或0轴下金叉。');
  65. DRAWFLAGTEXT(cross(MA(c,10),MA(c,20)) and MA(c,5)>MA(c,10) and MA(c,10)>MA(c,20),C,'短期均线今日多头排列。');
  66. DRAWFLAGTEXT(cross(MA(c,20),MA(c,10)) and MA(c,5)<MA(c,10) and MA(c,10)<MA(c,20),C,'短期均线今日空头排列。');
  67. DRAWFLAGTEXT(MA(c,5)>=ref(MA(c,5),1) and count(ref(MA(c,5),1)<ref(MA(c,5),2),5)=5,C,'5日均线已开始走平或勾头向上,股价有可能走出低部,密切关注!');
  68. DRAWFLAGTEXT(cross(c,MA(c,5)),C,'今日股价站上5日均线!');
  69. DRAWFLAGTEXT(cross(c,MA(c,10)),C,'今日股价站上10日均线!');
  70. DRAWFLAGTEXT(cross(c,MA(c,20)),C,'今日股价站上20日均线!');
  71. DRAWFLAGTEXT(cross(c,MA(c,30)),C,'今日股价站上30日均线!');
  72. DRAWFLAGTEXT(cross(c,MA(c,60)),C,'今日股价站上60日均线!');
  73. DRAWFLAGTEXT(cross(c,MA(c,120)),C,'今日股价站上120日均线!');
  74. DRAWFLAGTEXT(cross(c,MA(c,240)),C,'今日股价站上240日均线!');
  75. DRAWFLAGTEXT(cross(MA(c,5),c),C,'今日股价下穿5日均线!');
  76. DRAWFLAGTEXT(cross(MA(c,10),c),C,'今日股价下穿10日均线!');
  77. DRAWFLAGTEXT(cross(MA(c,20),c),C,'今日股价下穿20日均线!');
  78. DRAWFLAGTEXT(cross(MA(c,30),c),C,'今日股价下穿30日均线!');
  79. DRAWFLAGTEXT(cross(MA(c,60),c),C,'今日股价下穿60日均线!');
  80. DRAWFLAGTEXT(cross(MA(c,120),c),C,'今日股价下穿120日均线!');
  81. DRAWFLAGTEXT(cross(MA(c,240),c),C,'今日股价下穿240日均线!');
  82. DRAWFLAGTEXT(MA(c,30)>MA(c,20) and MA(c,20)>MA(c,10) and MA(c,10)>MA(c,5) and c<MA(c,5) ,C,'5日、10日、20日、30日均线空头排列,并且股价在5日均线之下,持币观望!');
  83. DRAWFLAGTEXT(MA(c,5)>MA(c,10) and MA(c,10)>MA(c,20) and MA(c,20)>MA(c,30) and c>MA(c,5) ,C,'5日、10日、20日、30日均线多头排列,并且股价在5日均线之上,可继续持有!');



  84. c1:=c/ref(eMA(c,30),30);
  85. c2:=indexc/ref(eMA(indexc,30),30);
  86. l1:=c1/c2*10-10;
  87. c3:=c/MA(c,60);
  88. c4:=indexc/MA(indexc,60);
  89. l2:=c3/c4*10-10;
  90. c5:=c/MA(c,120);
  91. c6:=indexc/MA(indexc,120);
  92. l3:=c5/c6*10-10;
  93. L4:=MA(L1+L2+L3,5);
  94. DRAWFLAGTEXT(ref(L4,1)>0 AND ref(L4,1)>ref(L4,2),C,'该股中长期走势强于大盘,且近期继续走强。');
  95. DRAWFLAGTEXT(ref(L4,1)>0 AND ref(L4,1)<=ref(L4,2),C,'该股中长期走势强于大盘,但近期有所走弱。');
  96. DRAWFLAGTEXT(ref(L4,1)<=0 AND ref(L4,1)>ref(L4,2),C,'该股中长期走势弱于大盘,但近期有所转强。');
  97. DRAWFLAGTEXT(ref(L4,1)<=0 AND ref(L4,1)<=ref(L4,2),C,'该股中长期走势弱于大盘,且近期继续走弱。');
  98. 半年线:=EMA(C,148);
  99. 年线:=EMA(C,250);
  100. DRAWFLAGTEXT(C>=半年线,C,'股价在半年线之上');
  101. DRAWFLAGTEXT(C>=年线,C,'股价在年线之上');
  102. DRAWFLAGTEXT(C<半年线,C,'股价在半年线之下');
  103. DRAWFLAGTEXT(C<年线,C,'股价在年线之下');
  104. DRAWFLAGTEXT(半年线>=ref(半年线,1),C,'半年线趋势向上'); {内容来至程序化交易网 CXH99.COM}
  105. DRAWFLAGTEXT(年线>=ref(年线,1),C,'年线趋势向上');
  106. DRAWFLAGTEXT(半年线<ref(半年线,1),C,'半年线趋势向下');
  107. DRAWFLAGTEXT(年线<ref(年线,1),C,'年线趋势向下');

  108. TYP := (HIGH + LOW + CLOSE)/3;
  109. 货币比:=SUM(IF(TYP>ref(TYP,1),TYP*VOL,0),14)/SUM(IF(TYP<ref(TYP,1),TYP*VOL,0),14);
  110. MFI:=100-(100/(1+货币比));
  111. a1:=count(cross(mfi,80),20);
  112. a2:=count(cross(20,mfi),20);
  113. DRAWFLAGTEXT(mfi<20,C,'mfi指标在20以下处于超卖信号区,不久将要上涨') ;
  114. DRAWFLAGTEXT(mfi>80,C,'mfi指标在80以上处于超买信号区,股价将要下跌') ;
  115. DRAWFLAGTEXT(a1,C,'mfi指标在两月前曾发出超买信号,表明股价将会下跌') ;
  116. DRAWFLAGTEXT(a2,C,'mfi指标在两月前曾发出超卖信号,表明股价将会上涨') ;
  117. {盖印}
  118. DRAWRECTABS(0,0,30,35,rgb(250,60,80)),color000099;
  119. DRAWRECTABS(0,30,30,45,rgb(250,250,80)),color009999;
  120. DRAWTEXTABS(2,5,'金城'),colorFFFFFF,LINETHICK1;
  121. DRAWTEXTABS(2,18,'特别'),colorFFFFFF,LINETHICK1;
  122. DRAWTEXTABS(2,30,'优化'),color0000FF,LINETHICK1;
复制代码


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

返回列表