顺水外汇EA交易网MT4

标题: 求修改K线离均线的距离 [打印本页]

作者: 看好了是真的    时间: 2018-1-11 20:15
标题: 求修改K线离均线的距离
下面是代码  但是箭头离着均线很远  请大神给说一下怎样改代码能让箭头离均线进一些!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//+------------------------------------------------------------------+
//|                                                         均线交叉.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots   4
//--- plot Label1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2
//--- plot Label2
#property indicator_label2  "Label2"
#property indicator_type2   DRAW_LINE
#property indicator_color2  clrBlue
#property indicator_style2  STYLE_SOLID
#property indicator_width2  2
//--- plot Label3
#property indicator_label3  "Label3"
#property indicator_type3   DRAW_ARROW
#property indicator_color3  clrRed
#property indicator_style3  STYLE_SOLID
#property indicator_width3  2
//--- plot Label4
#property indicator_label4  "Label4"
#property indicator_type4   DRAW_ARROW
#property indicator_color4  clrWhite
#property indicator_style4  STYLE_SOLID
#property indicator_width4  2
//--- indicator buffers
double         Label1Buffer[];
double         Label2Buffer[];
double         Label3Buffer[];
double         Label4Buffer[];
datetime jincha=0;
datetime sicha=0;
extern int T1= 5;
extern int T2 = 10;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,Label1Buffer);
   SetIndexBuffer(1,Label2Buffer);
   SetIndexBuffer(2,Label3Buffer);
   SetIndexBuffer(3,Label4Buffer);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   PlotIndexSetInteger(2,PLOT_ARROW,233);
   PlotIndexSetInteger(3,PLOT_ARROW,234);
   SetIndexArrow(2,233);
   SetIndexArrow(3,234);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
      int limit=Bars-IndicatorCounted();
      for(int i=0;iBuffer2)&&(Buffer11[B]Buffer21))//死叉
       {
         if(i==0)
          {
            if(sicha!=Time[0])
            {
            Alert(Symbol()+"死叉");
            sicha=Time[0];
            }
          }
        Label4Buffer[i]=High[i]+100*Point;
       }
     }   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

作者: 求学者    时间: 2018-1-11 21:30
很好很强大

作者: 求学者    时间: 2018-1-11 21:45
金币我来了……

作者: 看好了是真的    时间: 2018-1-11 23:07

金币我来了……

作者: jueeee    时间: 2018-1-12 00:25
100*Point改成10*Point就够了
作者: 一秒永恒    时间: 2018-1-12 01:52
很好很强大

作者: pylzw4023    时间: 2018-1-12 03:13

很好很强大
作者: panda88    时间: 2018-1-12 03:37
学习学习了
作者: mahuamin    时间: 2018-1-12 04:01
Label3Buffer[i]=Low[i]-100*Point;
Label4Buffer[i]=High[i]+100*Point;
100改小就好了
作者: notebooklw    时间: 2018-1-12 04:52
学习学习了
作者: doudousha    时间: 2018-1-12 05:24
学习了

作者: 看好了是真的    时间: 2018-1-12 05:42

太棒了 还真行

作者: neilyoemp    时间: 2018-1-12 07:03
支持ichi 和HAHA
作者: 沉沦丶帝恨    时间: 2018-1-12 07:42
此帖仅作者可见此帖仅作者可见此帖仅作者可见
作者: baijiao828    时间: 2018-1-12 08:54

来来来挺好快快快




欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/) Powered by Discuz! X3.2