交易危机

 找回密码
 快捷注册(禁q号)

QQ登录

只需一步,快速开始

搜索
广告位
查看: 7177|回复: 2
打印 上一主题 下一主题

[其他] 手机MT4安卓版怎么添加双线MACD?

[复制链接]

4

主题

230

积分

0

精华

见习操盘手

金钱
230 美元
权重
2
跳转到指定楼层
楼主
发表于 2014-4-8 20:57 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 wccmcd 于 2015-12-4 12:46 编辑


手机MT4安卓版怎么添加双线MACD?MT4自已的单线MACD感觉不好用。
听说MT4手机安卓版没有办法自定义指标,我用RE管理软件,把MT4手机版打包出来,可以用软件改不?自己也不会编程,希望程序员高手能帮一下忙。
代码:

  1. //+------------------------------------------------------------------+
  2. //|                                                  Custom MACD.mq4 |
  3. //|                      Copyright ?2004, MetaQuotes Software Corp. |
  4. //+------------------------------------------------------------------+
  5. #property  copyright "Copyright ?2004, MetaQuotes Software Corp."
  6. //---- indicator settings
  7. #property  indicator_separate_window
  8. #property  indicator_buffers 4
  9. #property  indicator_color1  Blue
  10. #property  indicator_color2  Yellow
  11. #property  indicator_color3  Red
  12. #property  indicator_color4  Green
  13. //int indicator_color3;
  14. //---- indicator parameters
  15. extern int FastEMA=12;
  16. extern int SlowEMA=26;
  17. extern int SignalSMA=9;
  18. //---- indicator buffers
  19. double     ind_buffer1[];
  20. double     ind_buffer2[];
  21. double     ind_buffer3[];
  22. double     ind_buffer4[];
  23. double     temp;
  24. //+------------------------------------------------------------------+
  25. //| Custom indicator initialization function                         |
  26. //+------------------------------------------------------------------+
  27. int init()
  28.   {
  29. //---- drawing settings
  30.    SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
  31.    SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
  32.    SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
  33.    SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
  34.    SetIndexDrawBegin(1,SignalSMA);
  35.    IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
  36. //---- indicator buffers mapping
  37.    if(!SetIndexBuffer(0,ind_buffer1) && !SetIndexBuffer(1,ind_buffer2)&& !SetIndexBuffer(2,ind_buffer3)&& !SetIndexBuffer(3,ind_buffer4))
  38.       Print("cannot set indicator buffers!");
  39. //---- name for DataWindow and indicator subwindow label
  40.    IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
  41.    SetIndexLabel(0,"MACD");
  42.    SetIndexLabel(1,"Signal");
  43. //---- initialization done
  44.    return(0);
  45.   }
  46. //+------------------------------------------------------------------+
  47. //| Moving Averages Convergence/Divergence                           |
  48. //+------------------------------------------------------------------+
  49. int start()
  50.   {
  51.    int limit;
  52.    int counted_bars=IndicatorCounted();
  53. //---- check for possible errors
  54.    if(counted_bars<0) return(-1);
  55. //---- last counted bar will be recounted
  56.    if(counted_bars>0) counted_bars--;
  57.    limit=Bars-counted_bars;
  58. //---- macd counted in the 1-st buffer
  59.    for(int i=0; i<limit; i++)
  60.       ind_buffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
  61. //---- signal line counted in the 2-nd buffer
  62.    for(i=0; i<limit; i++)
  63.       ind_buffer2[i]=iMAOnArray(ind_buffer1,Bars,SignalSMA,0,MODE_SMA,i);
  64.       
  65.    for(i=0; i<limit; i++)
  66.       {
  67.        temp=1.3*(ind_buffer1[i]-ind_buffer2[i]);
  68.        if(temp>0) {ind_buffer3[i]=temp;ind_buffer4[i]=0;}
  69.        else       {ind_buffer3[i]=0;ind_buffer4[i]=temp;}
  70.       
  71.       }
  72.       
  73. //---- done
  74.    return(0);
  75.   }
复制代码


myMACD.rar

1.02 KB, 下载次数: 7, 下载积分: 金钱 -8

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏2 转播转播 分享分享 分享淘帖 支持支持 保留保留

52

主题

1万

积分

4

精华

操盘专家

金钱
15549 美元
权重
22
沙发
发表于 2014-4-30 13:06 | 只看该作者
本帖最后由 wccmcd 于 2015-12-4 12:46 编辑

没玩过这样的。
新手,膇醺 $  的娇巭

0

主题

21

积分

0

精华

外汇入门

金钱
21 美元
权重
0
板凳
发表于 2017-4-7 16:43 | 只看该作者
手机也能装吗
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

QQ|黄金吧|黄金论坛|手机版|指标下载|非农|目录|交易危机

版权所有: ©2014-2021 fx3q.com Powered by Discuz! X3
浙ICP备: ICP14039028

浙公网安备 33011802001420号

风险提示:杠杆风险高,交易要谨慎 声明:坛友发言和回复均为个人观点,不代表论坛立场。
若有侵权请联系fx3q@qq.com删除

快速回复 返回顶部 返回列表