29评论

0收藏

求助箭头显示的问题

avatar 藍色餅乾 | 5844 人阅读 | 29 人评论 | 2011-10-30

我下载了一个均线交叉报警指示指标,但是有两个问题不能解决,第一是箭头指示和K线靠的太近,看不清,第二是均线交叉的指示比交叉晚了三根K线,下面是指标源码,那位大侠帮我改改吧,先谢谢了!
  //+------------------------------------------------------------------+
  //|                                         EMA-Crossover_Signal.mq4 |
  //|                                                            
  //+------------------------------------------------------------------+
  
   
  
  #property indicator_chart_window
  #property indicator_buffers 4
  #property indicator_color1 DodgerBlue
  #property indicator_color2 Red
  #property indicator_color3 Red
  #property indicator_color4 Yellow
  
  double CrossUp[];
  double CrossDown[];
  double MAF[];
  double MAS[];
  
  extern bool Alert_X=true;
  extern int FasterMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
  extern int FasterMA =   5;
  extern int SlowerMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
  extern int SlowerMA =   10;
  static double UP_Alert,DO_Alert;
  //+------------------------------------------------------------------+
  //| Custom indicator initialization function                         |
  //+------------------------------------------------------------------+
  int init()
    {
  //---- indicators
     SetIndexStyle(0, DRAW_ARROW, 2,5);
     SetIndexArrow(0, 233);
     SetIndexBuffer(0, CrossUp);
     SetIndexStyle(1, DRAW_ARROW, 2,5);
     SetIndexArrow(1, 234);
     SetIndexBuffer(1, CrossDown);
     SetIndexBuffer(2, MAF);
     SetIndexBuffer(3, MAS);
     SetIndexStyle(2, DRAW_LINE);
     SetIndexStyle(3, DRAW_LINE);
  //----
     return(0);
    }
  //+------------------------------------------------------------------+
  //| Custom indicator deinitialization function                       |
  //+------------------------------------------------------------------+
  int deinit()
    {
  //----
     ObjectDelete(\"onefx_label0\");
  //----
     return(0);
    }
  //+------------------------------------------------------------------+
  //| Custom indicator iteration function                              |
  //+------------------------------------------------------------------+
  int start()
  {
     int limit, i, counter;
     double fasterMAnow, slowerMAnow, fasterMAprevious, slowerMAprevious, fasterMAafter, slowerMAafter;
     double Range;
     int counted_bars=IndicatorCounted();
  //---- check for possible errors
     if(counted_bars0) counted_bars--;
  
     limit=Bars-counted_bars;
     
     for(i = 0; i  MAS[i+1] && MAF[i+2] < MAS[i+2])
        {
           CrossUp = Open;//Low - Range*0.5;
        }
        if (MAF < MAS && MAF[i+1] < MAS[i+1] && MAF[i+2] > MAS[i+2])
        {
           CrossDown = Open;//High + Range*0.5;
        }
     }
     if (Alert_X==false)
     {
       DO_Alert=Time[0];
       UP_Alert=Time[0];
     }
     if (UP_Alert!=Time[0] && MAF[0] > MAS[0] && MAF[1] > MAS[1] && MAF[2] < MAS[2])
     {
       Alert(Symbol()+\"  \"+Period()+\"  MA-Crossover_Signal \"+FasterMA+\" 金叉 \"+SlowerMA);
       UP_Alert=Time[0];
     }
     if (DO_Alert!=Time[0] && MAF[0] < MAS[0] && MAF[1] < MAS[1] && MAF[2] > MAS[2])
     {
       Alert(Symbol()+\"  \"+Period()+\"  MA-Crossover_Signal \"+FasterMA+\" 死叉\"+SlowerMA);
       DO_Alert=Time[0];
     }
     return(0);
  }
  //+------------------------------------------------------------------+
""
还没有人打赏,支持一下

评论|共 29 个

盛满我的思念

发表于 2012-11-21 23:00:23 | 显示全部楼层

顶的就是你  

装逼

发表于 2012-11-21 23:00:23 | 显示全部楼层

终于看完了~~~  

michaelchen

发表于 2012-11-22 00:02:14 | 显示全部楼层

老大,我好崇拜你哟  

win8

发表于 2012-11-22 00:02:14 | 显示全部楼层

真是有你的!  

叫花子

发表于 2012-11-22 01:36:01 | 显示全部楼层

嘿嘿  

二元期权1

发表于 2012-11-22 01:36:01 | 显示全部楼层

厉害!强~~~~没的说了!  

EA定制

发表于 2012-11-22 01:36:01 | 显示全部楼层

围观来了哦  

富利外汇

发表于 2012-11-22 01:36:01 | 显示全部楼层

貌似我真的很笨????哎  

whyhui

发表于 2012-11-22 01:36:01 | 显示全部楼层

今天再看下  

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

EA之家评论守则