104评论

1收藏

有偿50RMB,帮忙看看,插入指标报警array out of range

avatar sanqiandd | 15314 人阅读 | 104 人评论 | 2021-02-06

本帖最后由 sanqiandd 于 2021-2-6 22:29 编辑
  1. #property copyright "Copyright 2019, MetaQuotes Software Corp."
  2. #property link      "https://www.mql5.com"
  3. #property version   "1.00"
  4. #property strict
  5. #property indicator_chart_window
  6. #property indicator_buffers 10
  7. #property indicator_color1 clrNONE
  8. #property indicator_color2 clrNONE
  9. #property indicator_color3 clrNONE
  10. #property indicator_color4 clrRed
  11. #property indicator_width4 1
  12. #property indicator_color5 clrRed
  13. #property indicator_width5 1
  14. #property indicator_color6 clrLime
  15. #property indicator_width6 1
  16. #property indicator_color7 clrLime
  17. #property indicator_width7 1

  18. #define  FONT_NAME "Microsoft YaHei"
  19. bool upexist_fanbao=0;
  20. bool downexist_fanbao=0;
  21. int timeup_fanbao,t_fanbao=0,timedown_fanbao;
  22. string period_fanbao="";
  23. int kxianshu_fanbao=34;//K线数
  24. extern int juli_fanbao=20;//箭头距离
  25. double linshi_fanbao[]/*原数量1200*/,ave_fanbao[]/*原数量1200*/,zhenfu_fanbao[],sum_fanbao=0;
  26. double up_fanbao[]/*原数量1200*/,upopen_fanbao,upzancun_fanbao[]/*原数量1200*/;
  27. double down_fanbao[]/*原数量1200*/,downopen_fanbao,downzancun_fanbao[]/*原数量1200*/;
  28. double upxiao_fanbao[]/*原数量1200*/,yangxianzancun_fanbao,yangxian_fanbao,duozuigao_fanbao;
  29. string up2_fanbao="",down2_fanbao="";
  30. double upda_fanbao[]/*原数量1200*/;
  31. double downxiao_fanbao[]/*原数量1200*/,yinxianzancun_fanbao,yinxian_fanbao,kongzuidi_fanbao;
  32. double downda_fanbao[]/*原数量1200*/,junzhi_fanbao[]/*原数量1200*/;
  33. double duolot_fanbao,konglot_fanbao,duosun_fanbao,kongsun_fanbao,rineikongjian_fanbao;
  34. int tup_fanbao,tdown_fanbao,emazhouqi_fanbao,bulinxiabao_fanbao,bulinshangbao_fanbao;
  35. color clrup_fanbao=clrAqua,clrdown_fanbao=clrAqua;
  36. double zhenshiprice_fanbao,yijiaprice_fanbao;
  37. double duokaipan_fanbao,kongkaipan_fanbao,duosunlinshi_fanbao,kongsunlinshi_fanbao,duoshoulinshi_fanbao,kongshoulinshi_fanbao;

  38. int OnInit()
  39.   {
  40.     IndicatorDigits(Digits);
  41.     SetIndexBuffer(0,zhenfu_fanbao);
  42.     SetIndexBuffer(1,up_fanbao);
  43.     SetIndexStyle(1,DRAW_NONE);
  44.     SetIndexLabel(1,"up_fanbao");
  45.     SetIndexBuffer(2,down_fanbao);
  46.     SetIndexStyle(2,DRAW_NONE);
  47.     SetIndexLabel(2,"down_fanbao");
  48.     SetIndexBuffer(3,upxiao_fanbao);
  49.     SetIndexStyle(3,DRAW_ARROW);
  50.     SetIndexLabel(3,"upxiao_fanbao");
  51.     SetIndexArrow(3,241);
  52.     SetIndexBuffer(4,upda_fanbao);
  53.     SetIndexStyle(4,DRAW_ARROW);
  54.     SetIndexLabel(4,"upda_fanbao");
  55.     SetIndexArrow(4,233);
  56.     SetIndexBuffer(5,downxiao_fanbao);
  57.     SetIndexStyle(5,DRAW_ARROW);
  58.     SetIndexLabel(5,"downxiao_fanbao");
  59.     SetIndexArrow(5,242);
  60.     SetIndexBuffer(6,downda_fanbao);
  61.     SetIndexStyle(6,DRAW_ARROW);
  62.     SetIndexLabel(6,"downda_fanbao");
  63.     SetIndexArrow(6,234);
  64.     SetIndexBuffer(7,upzancun_fanbao);
  65.     SetIndexStyle(7,DRAW_NONE);
  66.     SetIndexLabel(7,"upzancun_fanbao");
  67.     SetIndexBuffer(8,downzancun_fanbao);
  68.     SetIndexStyle(8,DRAW_ARROW);
  69.     SetIndexLabel(8,"downzancun_fanbao");
  70.     SetIndexBuffer(9,junzhi_fanbao);
  71.     SetIndexStyle(9,DRAW_LINE,0,1,clrNONE);
  72.     SetIndexLabel(9,"junzhi_fanbao");
  73.     IndicatorShortName("fanbao("+Symbol()+Period()+")");
  74.     ArrayInitialize(upzancun_fanbao,0);
  75.     ArrayInitialize(downzancun_fanbao,0);
  76.     if(Period()==1) {period_fanbao="M1";}
  77.     if(Period()==5) {period_fanbao="M5";emazhouqi_fanbao=1;}
  78.     if(Period()==15) {period_fanbao="M15";emazhouqi_fanbao=5;}
  79.     if(Period()==30) {period_fanbao="M30";}
  80.     if(Period()==60) {period_fanbao="H1";emazhouqi_fanbao=15;}
  81.     if(Period()==240) {period_fanbao="H4";emazhouqi_fanbao=60;}
  82.     if(Period()==1440) {period_fanbao="D1";emazhouqi_fanbao=240;}
  83.     if(Period()==10080) {period_fanbao="W1";emazhouqi_fanbao=1440;}
  84.     if(Period()==43200) {period_fanbao="MN1";emazhouqi_fanbao=10080;}
  85.     if(Symbol()=="XTIUSD") juli_fanbao=2;
  86.     return(INIT_SUCCEEDED);
  87.   }
复制代码
指标编写过程中没报警,MT4插入指标报警。私我或留言,发你源码
""
还没有人打赏,支持一下

评论|共 104 个

Suliguo

发表于 2021-2-8 12:30:30 来自手机 | 显示全部楼层

需要怎么报警

mcmsgped

发表于 2021-2-8 13:10:19 | 显示全部楼层

顶下

sanqiandd

发表于 2021-2-9 09:52:35 | 显示全部楼层


感谢关注,问题已经解决了

xmuwqh

发表于 2021-2-9 10:00:42 | 显示全部楼层

谢谢

草尼玛

发表于 2021-2-9 10:16:23 | 显示全部楼层

支持下

小猪猪

发表于 2021-2-15 21:01:52 | 显示全部楼层

小李飞刀2013

发表于 2021-2-17 12:55:17 | 显示全部楼层

谢谢

叫你二大爷

发表于 2021-2-17 19:45:05 | 显示全部楼层

gjlbrtcu

发表于 2021-2-21 20:10:15 | 显示全部楼层

顶下

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则