专注股票、期货、外汇程序化交易开发
 企业微信
520量化编程
开启左侧

[MACD] MACD——牛马线MID

[复制链接]
520量化编程 发表于 2024-11-5 00:25:27 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 


  1. MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
  2. 牛线:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14
  3. *REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8
  4. *REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)
  5. +2*REF(MID,18)+REF(MID,20))/210,COLORRED;
  6. 马线:MA(牛线,6),COLORGREEN;
  7. VAR0:=SMA(MAX(CLOSE-REF(C,1),0),12,1)/SMA(ABS(CLOSE-REF(C,1)),15,1)*100;
  8. DRAWTEXT(CROSS(82,VAR0),H*1.04,'快卖'),COLORWHITE;
  9. S:=C-REF(C,1);
  10. DX:=100*EMA(EMA(S,6),6)/EMA(EMA(ABS(S),6),6);
  11. 买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
  12. DRAWTEXT(FILTER(买=1,5),L*0.96,'拉升'),COLORFFDE00;
  13. DA:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;
  14. DB:=(EMA(C,10)+EMA(C,20)+EMA(C,40)+EMA(C,80))/4;
  15. DRAWICON(CROSS(DA-DB,0),L*0.98,7);
  16. JH:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100;
  17. DRAWICON(CROSS(84,JH),H*1.04,8);
  18. 字:=STRCAT(STRCAT(STRCAT(STRCAT('名称: ',STKNAME),' 代码: '),CODE),'   ' );
  19. 板块:=STRCAT('概念板块: ',GNBLOCK);
  20. DRAWTEXT_FIX(ISLASTBAR,0.2,0,0,STRCAT(字,板块)),COLORYELLOW;
  21. YC:=REF(CLOSE,1);
  22. 止损价位:=(YC*1.0035*97+0.2)/99.65;
  23. DRAWTEXT_FIX(C!=0,0.02,0.05,0,'★ =================='),COLORRED;
  24. DRAWTEXT_FIX(C!=0,0.02,0.1,0,'操 '),COLORRED;
  25. DRAWTEXT_FIX(C!=0,0.02,0.15,0,'盘 '),COLORRED;
  26. DRAWTEXT_FIX(C!=0,0.02,0.2,0,'铁 '),COLORRED;
  27. DRAWTEXT_FIX(C!=0,0.02,0.25,0,'律 '),COLORRED;
  28. DRAWTEXT_FIX(C!=0,0.02,0.3,0,'★ =================='),COLORRED;
  29. DRAWTEXT_FIX(C!=0,0.04,0.1,0,'买入条件    E13 CCI'),COLORYELLOW;
  30. DRAWTEXT_FIX(C!=0,0.04,0.15,0,'买入条件    2:30以后'),COLORYELLOW;
  31. DRAWTEXT_FIX(C!=0,0.04,0.2,0,STRCAT('止损价位    ',STRCAT(CON2STR(止损价位,2),' 元'))),COLORYELLOW;
  32. DRAWTEXT_FIX(C!=0,0.04,0.25,0,'线上:工作   线下:休息'),COLORYELLOW;
  33. E:=(HIGH+LOW+OPEN+2*CLOSE)/5;
  34. 明日阻力:=2*E-LOW;
  35. 明日支撑:=2*E-HIGH;
  36. 明日突破:=E+(HIGH-LOW);
  37. 明日反转:=E-(HIGH-LOW);
  38. 今日阻力:=REF(明日阻力 , 1);
  39. 今日支撑:=REF(明日支撑 , 1);
  40. DRAWTEXT_FIX(C!=0,0.2,0.05,0,STRCAT('今日阻力: ',STRCAT(CON2STR(今日阻力,2),' 元'))),COLORFFFF00;
  41. DRAWTEXT_FIX(C!=0,0.2,0.1,0,STRCAT('今日支撑: ',STRCAT(CON2STR(今日支撑,2),' 元'))),COLORRED;
  42. DRAWTEXT_FIX(C!=0,0.2,0.15,0,STRCAT('明日突破: ',STRCAT(CON2STR(明日突破,2),' 元'))),COLORFF00FF;
  43. DRAWTEXT_FIX(C!=0,0.2,0.2,0,STRCAT('明日阻力: ',STRCAT(CON2STR(明日阻力,2),' 元'))),COLORFFFF00;
  44. DRAWTEXT_FIX(C!=0,0.2,0.25,0,STRCAT('明日支撑: ',STRCAT(CON2STR(明日支撑,2),' 元'))),COLORRED;
  45. DRAWTEXT_FIX(C!=0,0.2,0.3,0,STRCAT('明日反转: ',STRCAT(CON2STR(明日反转,2),' 元'))),COLORYELLOW;
  46. A:=HHV(HIGH,13)=HIGH AND HIGH>REF(HIGH,1);
  47. A1:=FILTER(A,12);
  48. DRAWTEXT_FIX(2>1,0,0,0,'520量化编程——编译通过'),COLOR80FFFF;
  49. B:=LLV(LOW,13)=LOW AND LOW<REF(LOW,1);
  50. B1:=FILTER(B,12);
  51. TS1:=BARSLAST(A1);
  52. 箱顶:REF(HIGH,TS1),COLORFF00FF,NODRAW;
  53. STICKLINE(1,箱顶,箱顶,1.5,0),COLORFF00FF;
  54. TS2:=BARSLAST(B1);
  55. 箱底:REF(LOW,TS2),COLORFFBB80,NODRAW;
  56. STICKLINE(1,箱底,箱底,1.5,0),COLORFFBB80;
  57. 箱高:100*(箱顶-箱底)/箱底,NODRAW;
  58. 均价:=(3*C+H+L+O)/6;
  59. VAR1:=(8*均价+7*REF(均价,1)+6*REF(均价,2)+5*REF(均价,3)+
  60. 4*REF(均价,4)+3*REF(均价,5)+2*REF(均价,6)+REF(均价,8))/36;
  61. VAR2:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
  62. SZ1:=REF(VAR1,1)=REF(VAR2,1) AND VAR1>VAR2 AND CLOSE>VAR1;
  63. SZ2:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)
  64. AND H/VAR1<1.1 AND L>VAR2 AND CLOSE>VAR1;
  65. SZ3:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>=REF(VAR2,1) AND H/VAR1>1.1;
  66. SZ4:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)
  67. AND CLOSE>VAR2 AND CLOSE<VAR1;
  68. SZ5:=(VAR1>VAR2 AND VAR2>REF(VAR2,1) AND VAR1<>REF(VAR1,1)
  69. AND CLOSE<VAR2) OR (VAR1>VAR2 AND VAR1<REF(VAR1,1)
  70. AND VAR2<REF(VAR2,1) AND CLOSE<VAR2);
  71. SZ6:=REF(VAR1,1)>REF(VAR2,1) AND VAR1=VAR2 AND CLOSE<VAR2;
  72. XD1:=VAR1=VAR2 AND CLOSE<VAR2 OR (VAR1<REF(VAR1,1) AND VAR2<REF(VAR2,1)
  73. AND REF(VAR1,1)=REF(VAR2,1) AND CLOSE<VAR2);
  74. XD2:=VAR1=VAR2 AND CLOSE>VAR1;
  75. SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));
  76. 量能饱和度:=IF(SAT>1,1,SAT)*100;
  77. DRAWTEXT_FIX(BARSTATUS=2 AND SZ1,0.8,0.05,0,'调整结束短线介入'),COLORRED;
  78. DRAWTEXT_FIX(BARSTATUS=2 AND SZ2,0.8,0.05,0,'上升通道走势良好'),COLORRED;
  79. DRAWTEXT_FIX(BARSTATUS=2 AND SZ3,0.8,0.05,0,'股价偏离注意调整'),COLORRED;
  80. DRAWTEXT_FIX(BARSTATUS=2 AND SZ4,0.8,0.05,0,'上升通道调整洗盘'),COLORGREEN;
  81. DRAWTEXT_FIX(BARSTATUS=2 AND SZ5,0.8,0.05,0,'转向特征注意离场'),COLORGREEN;
  82. DRAWTEXT_FIX(BARSTATUS=2 AND SZ6,0.8,0.05,0,'通道改变坚决离场'),COLORGREEN;
  83. DRAWTEXT_FIX(BARSTATUS=2 AND XD1,0.8,0.05,0,'下跌通道只宜观望'),COLORGREEN;
  84. DRAWTEXT_FIX(BARSTATUS=2 AND XD2,0.8,0.05,0,'短期底部准备进入'),COLORYELLOW;





复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

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

本版积分规则

热门图文
热门帖子
排行榜
作者专栏

关注我们:微信订阅号

公众号/p>

企业微信

全国服务热线:

18081412300

公司地址:四川省安岳县柠都大道226号

运营中心::四川省安岳县柠都大道226号

邮编:6243650 Email:525406187@qq.com

川公安网备案51202102000095

备案许可证:蜀ICP备20018290号-1

增值电信业务经营许可证:川B2-20220450

Copyright   ©2015-2016  520量化编程Powered by©Discuz!技术支持:迪恩网络    ( 蜀ICP备20018290号-1 )