MT4软件双线MACD设置方法_第1页
MT4软件双线MACD设置方法_第2页
MT4软件双线MACD设置方法_第3页
MT4软件双线MACD设置方法_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、众所周知,一般的MT4平台提供的MACD指标是单线的,使用起来非常的不方便,这里 提供的关于MT4的双线MACD设置和双线MACD指标下载(点击下载)和安奘方法,供 大家参考使用。一、第一个方法:找到MT4安装目录expertsindicators下的“MACD.mq2”,双击打开,之后弹出“MACD” 的源代码。将其全部删除,粘贴上以下代码:然后在MT4平台的“插入选项中,选择:技术指标一自定义一MACD,就可以成功的调 用MT4的双线MACD指标了。第二个方法:MT4双线MACD指标的安装方法:第一步:将文件下载至电脑中,然后解压压缩包中的指标。会得到两个文件,分别是MACD.mq4 和

2、MACD.ex4。第二步:将这两个文件放到MT4文件夹experts”的子文件夹indicators”文件夹里 面。(原来已经有的话,就替换掉原有文件。)第三步:关闭交易平台,重新启动平台,然后在MT4平台的“插入选项中,选择:技术 指标一自定义一MACD,就可以成功的调用MT4的双线MACD指标了。代码:/+/|Custom MACD.mq4 |/|Copyright ?2004, MetaQuotes Software Corp. |/|url HYPERLINK /%5b/url /url |/+#property copyright Copyright ?2004, MetaQuote

3、s Software Corp.#property link HYPERLINK / /- indicator settings#property indicator_separate_window#property indicator_buffers 4#property indicator_color1 Silver#property indicator_color2 Yellow#property indicator_color3 Red#property indicator_color4 Turquoise/int indicator_color3;/- indicator param

4、etersextern int FastEMA=12;extern int SlowEMA=26;extern int SignalSMA=9;/- indicator buffersdoubleind_buffer1;doubleind_buffer2;doubleind_buffer3;doubleind_buffer4;doubletemp; TOC o 1-5 h z /+/| Custom indicator initialization function|/+int init()/- drawing settingsSetIndexStyle(0,DRAW_LINE,STYLE_S

5、OLID,1);SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);SetIndexDrawBegin(1,SignalSMA);IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);/- indicator buffers mappingif(!SetIndexBuffer(0,ind_buffer1)& !SetIndexBuff

6、er(1,ind_buffer2)& !SetIndexBuffer(2,ind_buffer3)& !SetIndexBuffer( 3,ind_buffer4)Print(cannot set indicator buffers!);/- name for DataWindow and indicator subwindow labelIndicatorShortName(MACD(+FastEMA+,+SlowEMA+,+SignalSMA+)”);SetIndexLabel(0,MACD);SetIndexLabel(1,Signal);/- initialization donere

7、turn(0); TOC o 1-5 h z /+/| Moving Averages Convergence/Divergence|/+int start()int limit;int counted_bars=IndicatorCounted();/- check for possible errorsif(counted_bars0) counted_bars-;limit=Bars-counted_bars;/- macd counted in the 1-st bufferfor(int i=0; ilimit; i+)ind_buffer1i=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA ,0,MODE_EMA,PRICE_CLOSE,i);/- signal line counted in the 2-nd bufferfor(i=0; ilimit; i+)ind_buffer2i=iMAOnArray(ind_buffer1,Bars,Signal

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论