zoukankan      html  css  js  c++  java
  • MT4 做指标模版

    //+------------------------------------------------------------------+
    //|                                                          guo.mq4 |
    //|                        Copyright 2015, MetaQuotes Software Corp. |
    //|                                             https://www.mql5.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2015, MetaQuotes Software Corp."
    #property link      "https://www.mql5.com"
    #property version   "1.00"
    #property strict
    #property indicator_separate_window
    
    #property  indicator_buffers 1
    #property  indicator_color1  Red
    #property  indicator_width1  2
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    double    ExtSignalBuffer[];
    int OnInit()
      {
    //--- indicator buffers mapping
       SetIndexStyle(0,DRAW_LINE);
       SetIndexBuffer(0,ExtSignalBuffer);
       SetIndexLabel(0,"guo");
    //---
       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[])
      {
    //---
       
    //--- return value of prev_calculated for next call
       int i,limit;
    //---
    
    //--- last counted bar will be recounted
       limit=rates_total-prev_calculated;
       if(prev_calculated>0)
          limit++;
    //--- macd counted in the 1-st buffer
       for(i=0; i<limit; i++)
          ExtSignalBuffer[i]=close[i];
    //--- signal line counted in the 2-nd buffer
       
    
       return(rates_total);
      }
    //+------------------------------------------------------------------+
    //| Timer function                                                   |
    //+------------------------------------------------------------------+
    void OnTimer()
      {
    //---
       
      }
    //+------------------------------------------------------------------+
  • 相关阅读:
    golang的reflect
    minium-介绍
    selenium+Node.js在windows下的配置和安装
    Jmeter-逻辑控制器之Switch控制器(Switch Controller)
    Jmeter-逻辑控制器之Foreach
    chrome插件-YSlow 一个使用的web性能测试插件
    jmeter
    Jmeter-从数据库中获取数据并作为变量传输
    Jmeter-无法启动,'findstr'不是内部或外部命令,也不是可运行的程序
    Jmeter-响应结果unicode转成中文显示
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5493799.html
Copyright © 2011-2022 走看看