zxl678 发表于 2015-10-22 19:23:14

这样的代码怎么才能用在MT4上

//+------------------------------------------------------------------+
//|                                          i-IntradayFibonacci.mq4 |
//|                                           疏? 茹铕? ?. aka KimIV |
//|                                              http://www.kimiv.ru |
//|                                                                  |
//| 14.10.2005  马篁痂漤邂睇? 箴钼龛 澡犷磬鼢?                       |
//+------------------------------------------------------------------+
#property copyright "疏? 茹铕? ?. aka KimIV"
#property link      "http://www.kimiv.ru"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Lime
#property indicator_color3 Yellow
#property indicator_color4 Salmon

//------- 秒钺嚯   镥疱戾眄  --------------------------------------

//------- 项觌 屙桢 忭屮龛? 祛潴脲? ---------------------------------

//------- 马屮龛? 镟疣戾蝠? 桧滂赅蝾疣 -------------------------------
extern int NumberOfBars = 1000;  // 暑腓麇耱忸 徉痤? 钺聍蛤? (0-怦?)

//------- 馏翦瘥 桧滂赅蝾疣 ------------------------------------------
double buf24[];
double buf38[];
double buf62[];
double buf76[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init() {
  SetIndexBuffer(0, buf24);
  SetIndexStyle (0, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(0, EMPTY_VALUE);

  SetIndexBuffer(1, buf38);
  SetIndexStyle (1, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(1, EMPTY_VALUE);

  SetIndexBuffer(2, buf62);
  SetIndexStyle (2, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(2, EMPTY_VALUE);

  SetIndexBuffer(3, buf76);
  SetIndexStyle (3, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(3, EMPTY_VALUE);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start() {
  double dMax, dMin;
  int    loopbegin, nsb, prevDay, shift;

        if (NumberOfBars==0) loopbegin = Bars - 1;
  else loopbegin = NumberOfBars - 1;

  for (shift=loopbegin; shift>=0; shift--) {
    if (prevDay!=TimeDay(Time)) {
      nsb=iBarShift(NULL, PERIOD_D1, Time);
      dMax=iHigh(NULL, PERIOD_D1, nsb);
      dMin=iLow (NULL, PERIOD_D1, nsb);
    }
    buf24=dMin-(dMin-dMax)*0.236;
    buf38=dMin-(dMin-dMax)*0.382;
    buf62=dMin-(dMin-dMax)*0.618;
    buf76=dMin-(dMin-dMax)*0.764;
    prevDay=TimeDay(Time);
  }
}
//+------------------------------------------------------------------+

EUR168 发表于 2016-10-11 13:50:42

感谢你的辛勤劳动!感谢你的无私奉献

福相随 发表于 2017-7-7 13:38:47

伸手习惯了,慢慢的习气就坏了
页: [1]
查看完整版本: 这样的代码怎么才能用在MT4上