1. //+------------------------------------------------------------------+
  2. //| guo.mq4 |
  3. //| Copyright 2015, MetaQuotes Software Corp. |
  4. //| https://www.mql5.com |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright 2015, MetaQuotes Software Corp."
  7. #property link "https://www.mql5.com"
  8. #property version "1.00"
  9. #property strict
  10. #property indicator_separate_window
  11.  
  12. #property indicator_buffers
  13. #property indicator_color1 Red
  14. #property indicator_width1
  15. //+------------------------------------------------------------------+
  16. //| Custom indicator initialization function |
  17. //+------------------------------------------------------------------+
  18. double ExtSignalBuffer[];
  19. int OnInit()
  20. {
  21. //--- indicator buffers mapping
  22. SetIndexStyle(,DRAW_LINE);
  23. SetIndexBuffer(,ExtSignalBuffer);
  24. SetIndexLabel(,"guo");
  25. //---
  26. return(INIT_SUCCEEDED);
  27. }
  28. //+------------------------------------------------------------------+
  29. //| Custom indicator iteration function |
  30. //+------------------------------------------------------------------+
  31. int OnCalculate(const int rates_total,
  32. const int prev_calculated,
  33. const datetime &time[],
  34. const double &open[],
  35. const double &high[],
  36. const double &low[],
  37. const double &close[],
  38. const long &tick_volume[],
  39. const long &volume[],
  40. const int &spread[])
  41. {
  42. //---
  43.  
  44. //--- return value of prev_calculated for next call
  45. int i,limit;
  46. //---
  47.  
  48. //--- last counted bar will be recounted
  49. limit=rates_total-prev_calculated;
  50. if(prev_calculated>)
  51. limit++;
  52. //--- macd counted in the 1-st buffer
  53. for(i=; i<limit; i++)
  54. ExtSignalBuffer[i]=close[i];
  55. //--- signal line counted in the 2-nd buffer
  56.  
  57. return(rates_total);
  58. }
  59. //+------------------------------------------------------------------+
  60. //| Timer function |
  61. //+------------------------------------------------------------------+
  62. void OnTimer()
  63. {
  64. //---
  65.  
  66. }
  67. //+------------------------------------------------------------------+

MT4 做指标模版的更多相关文章

  1. wp模版强制用CSS空两格的问题

    之前我写过一篇文章<关于模板该不该用css强制编辑器文本开头空两格>,里面有说到一个观点,模版作者设计的时候,不要控制文章段落空两格,但是我用久了wp,我才慢慢发现,做wp模版的时候,确实 ...

  2. Spring Boot (二):模版引擎 Thymeleaf 渲染 Web 页面

    Spring Boot (二):模版引擎 Thymeleaf 渲染 Web 页面 在<Spring Boot(一):快速开始>中介绍了如何使用 Spring Boot 构建一个工程,并且提 ...

  3. 聚光灯下的熊猫TV技术架构演进

    2015年开始的百播大战,熊猫TV是其中比较特别的一员. 说熊猫TV是含着金钥匙出生的公子哥不为过.还未上线,就频频曝光,科技号,微博稿,站上风口浪尖.内测期间更是有不少淘宝店高价倒卖邀请码,光内测时 ...

  4. EasyPR--开发详解

    我正在做一个开源的中文车牌识别系统,Git地址为:https://github.com/liuruoze/EasyPR. 我给它取的名字为EasyPR,也就是Easy to do Plate Reco ...

  5. 深入理解Azure自动扩展集VMSS(2)

    VMSS中Auto Scale基本原理及诊断 在前面的介绍中,我们看到通过定义规则可以实现虚拟机扩展集的auto scale,那么在后台执行上VMSS的扩展依赖于哪些组件,出现问题(比如自动扩展没有发 ...

  6. 【熊猫TV】《程序员》:聚光灯下的熊猫TV技术架构演进

    2015年开始的百播大战,熊猫TV是其中比较特别的一员. 说熊猫TV是含着金钥匙出生的公子哥不为过.还未上线,就频频曝光,科技号,微博稿,站上风口浪尖.内测期间更是有不少淘宝店高价倒卖邀请码,光内测时 ...

  7. EasyPR--开发详解(6)SVM开发详解

    在前面的几篇文章中,我们介绍了EasyPR中车牌定位模块的相关内容.本文开始分析车牌定位模块后续步骤的车牌判断模块.车牌判断模块是EasyPR中的基于机器学习模型的一个模块,这个模型就是作者前文中从机 ...

  8. spring boot(四):thymeleaf使用详解

    在上篇文章springboot(二):web综合开发中简单介绍了一下thymeleaf,这篇文章将更加全面详细的介绍thymeleaf的使用.thymeleaf 是新一代的模板引擎,在spring4. ...

  9. 网络/运维工程师visio2013模具图标 绘制漂亮的网络拓扑图 狮子XL工程师美学思想

    visio2013狮子XL自定义运维模具下载: 链接:http://pan.baidu.com/s/1bo779Kz 密码:xh3s 狮子XL 的美学思想: 1,一次痛苦,一生幸福. 之前,在绘制网络 ...

随机推荐

  1. mac安装软件系列

    1,mac安装homebrew,注意不能用root权限安装 #ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew ...

  2. team viewer - rollback framework could not be initialized

    rollback framework could not be initialized, 在安装team viewer 的时候出现的这个错误信息,求大师帮忙 https://zhidao.baidu. ...

  3. Xssf配合metaspolit使用

    安装xssf download:  svn export http://xssf.googlecode.com/svn/trunk /home/User/xssf install: svn expor ...

  4. Struts2-3.struts.xml的action可以简写

    如果只是跳转到某个页面的话,可以这样写 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE s ...

  5. oracle常用的数据字典

    一.oracle数据字典主要由以下几种视图构成:1.user视图以user_为前缀,用来记录用户对象的信息 2.all视图以all_为前缀,用来记录用户对象的信息及被授权访问的对象信息 3.dba视图 ...

  6. WEB前端组件思想【分页】

    DEMO1: 很早就想写一些功能性的组件,无奈技术有限一点一点的边工作,边学. 近日工作中用到分页功能,当然由于加快业务进度,第一选择肯定是选择插件,但是实用性来说,还是有那么一点不适合.毕竟插件是通 ...

  7. c#.net 获取时间日期年月日时分秒格式

    今天写代码发现两个比较不错的分享下:1.DateTime.ParseExact很多时候我们获取的时间是数字形式表示的,好比20140127134015.927856,通过这个方法DateTime.Pa ...

  8. 6、Struts2拦截器实现权限控制

    1.创建如下项目结果 2.在com.entity包下创建 package com.entity; public class User { private String name; private St ...

  9. MVC5 Entity Framework学习之创建复杂的数据模型

    目录(?)[-] 使用属性来自定义数据模型 DataType属性 StringLength属性 Column 属性 完成对Student实体的更改 Required 属性 Display 属性 Ful ...

  10. Excel教程(9) - 信息函数

    CELL   用途:返回某一引用区域的左上角单元格的格式.位置或 内容等信息,该函数主要用于保持与其它电子表格程序的兼容 性. 语法:CELL(info_type,reference) 参数:Info ...