交易危机

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

QQ登录

只需一步,快速开始

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

[其他] WoodiesCCI 趋势振荡指标

[复制链接]

824

主题

27万

积分

28

精华

大型投行

金钱
273475 美元
权重
2293
跳转到指定楼层
楼主
发表于 2014-10-24 06:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
图示:

代码: WoodiesCCI 趋势振荡指标.zip (1.09 KB, 下载次数: 4)

  1. //+------------------------------------------------------------------+
  2. //|                                                   WoodiesCCI.mq4 |
  3. //|                                                             Rosh |
  4. //+------------------------------------------------------------------+
  5. #property copyright "created by Luis Damiani; converted by Rosh"
  6. #property indicator_separate_window
  7. #property indicator_buffers 3
  8. #property indicator_color1 Red
  9. #property indicator_color2 DeepSkyBlue
  10. #property indicator_color3 DimGray
  11. //---- input parameters
  12. extern int       A_period=14;
  13. extern int       B_period=6;
  14. extern int       num_bars=550;
  15. // parameters
  16. int shift=0;
  17. bool initDone=true; // 猁腩 init
  18. int bar=0;
  19. int prevbars=0;
  20. int startpar=0;  // 猁腩 start
  21. int cs=0;
  22. int prevcs=0;
  23. string commodt="nonono";
  24. int frame=0;
  25. int bars=0;
  26. //---- buffers
  27. double FastWoodieCCI[];
  28. double SlowWoodieCCI[];
  29. double HistoWoodieCCI[];
  30. //+------------------------------------------------------------------+
  31. //| Custom indicator initialization function                         |
  32. //+------------------------------------------------------------------+
  33. int init()
  34.   {
  35. //---- indicators
  36.    SetIndexStyle(0,DRAW_LINE);
  37.    SetIndexBuffer(0,FastWoodieCCI);
  38.    SetIndexStyle(1,DRAW_LINE,1,3);
  39.    SetIndexBuffer(1,SlowWoodieCCI);
  40.    SetIndexStyle(2,DRAW_HISTOGRAM);
  41.    SetIndexBuffer(2,HistoWoodieCCI);
  42. //----
  43.    return(0);
  44.   }
  45. //+------------------------------------------------------------------+
  46. //| Custor indicator deinitialization function                       |
  47. //+------------------------------------------------------------------+
  48. int deinit()
  49.   {
  50. //---- TODO: add your code here
  51.    
  52. //----
  53.    return(0);
  54.   }
  55. //+------------------------------------------------------------------+
  56. //| Custom indicator iteration function                              |
  57. //+------------------------------------------------------------------+
  58. int start()
  59.   {
  60.    int    counted_bars=IndicatorCounted();
  61. //---- TODO: add your code here
  62. cs= A_period+B_period+num_bars; //checksum used to see if parameters have been changed
  63. if ((cs==prevcs)&&(commodt==Symbol())&&(frame==(Time[4]-Time[5]))&&((Bars-prevbars)<2)) startpar=Bars-prevbars; else startpar=-1;  //params haven't changed only need to calculate new bar
  64. commodt=Symbol();
  65. frame=Time[4]-Time[5];
  66. prevbars = Bars;
  67. prevcs = cs;
  68. if (startpar==1 | startpar==0)  bar=startpar; else initDone = true;
  69. if (initDone)
  70.    {
  71.    FastWoodieCCI[num_bars-1]=0;
  72.    SlowWoodieCCI[num_bars-1]=0;
  73.    HistoWoodieCCI[num_bars-1]=0;  
  74.    //SetIndexValue(num_bars-1, 0);
  75.    //SetIndexValue2(num_bars-1, 0);
  76.    bar=num_bars-2;
  77.    initDone=false;
  78.    };
  79. //SetLoopCount(0);
  80. for (shift = bar;shift>=0;shift--)
  81.    {
  82.    FastWoodieCCI[shift]=iCCI(NULL,0,B_period,PRICE_TYPICAL,shift);
  83.    SlowWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);
  84.    HistoWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);  
  85.    //SetIndexValue(shift,iCCIEx(A_period,PRICE_TYPICAL,shift));
  86.    //SetIndexValue2(shift,iCCIEx(B_period,PRICE_TYPICAL,shift));
  87.    };
  88. //----
  89.    return(0);
  90.   }
  91. //+------------------------------------------------------------------+
复制代码


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

122

主题

3万

积分

23

精华

地佐更接地气

大型投行

金钱
30820 美元
权重
870
沙发
发表于 2015-12-26 19:03 来自手机 | 只看该作者
沙发消灭零回复。

0

主题

1万

积分

0

精华

操盘专家

金钱
12943 美元
权重
0
板凳
发表于 2023-4-5 08:46 | 只看该作者
谢谢楼主,还有没有更新版本的??
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

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

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

浙公网安备 33011802001420号

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

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