交易危机

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

QQ登录

只需一步,快速开始

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

[其他] WSOWROTrend 其他指标

[复制链接]

824

主题

27万

积分

28

精华

大型投行

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

代码:

  1. //+------------------------------------------------------------------+
  2. //|                                       Ind-WSO+WRO+Trend Line.mq4 |
  3. //+------------------------------------------------------------------+
  4. #property copyright "nsi2000"
  5. #property indicator_chart_window
  6. //---- input parameters
  7. extern int nPeriod=9;
  8. extern int Limit=350;
  9. ///---- int Widners Oscilator
  10. int cnt,nCurBar=0;
  11. //+------------------------------------------------------------------+
  12. //| Custom indicator initialization function                         |
  13. //+------------------------------------------------------------------+
  14. int init()
  15.   {
  16. //---- Output in Char
  17.    for(cnt=0; cnt<=5; cnt++)
  18.     {
  19.       ObjectCreate("WSO-"+cnt,OBJ_HLINE,0,0,0);
  20.       ObjectSet("WSO-"+cnt,OBJPROP_COLOR,Red);
  21.    if(cnt<5)
  22.       {
  23.       ObjectCreate("Trend DN-"+cnt,OBJ_TREND,0,0,0,0,0);
  24.       ObjectSet("Trend DN-"+cnt,OBJPROP_COLOR,Red);
  25.       }
  26. //----
  27.       ObjectCreate("WRO-"+cnt,OBJ_HLINE,0,0,0);
  28.       ObjectSet("WRO-"+cnt,OBJPROP_COLOR,Blue);
  29.    if(cnt<5)
  30.       {
  31.       ObjectCreate("Trend UP-"+cnt,OBJ_TREND,0,0,0,0,0);
  32.       ObjectSet("Trend Up-"+cnt,OBJPROP_COLOR,Blue);
  33.       }
  34.     }
  35. //----
  36.    return(0);
  37.   }
  38. //+------------------------------------------------------------------+
  39. //| Custor indicator deinitialization function                       |
  40. //+------------------------------------------------------------------+
  41. int deinit()
  42.   {
  43. //---- TODO: add your code here
  44.    for(cnt=0; cnt<=5; cnt++)
  45.       {
  46.       ObjectDelete("Trend UP-"+cnt);
  47.       ObjectDelete("Trend DN-"+cnt);
  48.       ObjectDelete("WSO-"+cnt);
  49.       ObjectDelete("WRO-"+cnt);
  50.       }
  51. //----
  52.    return(0);
  53.   }
  54. //+------------------------------------------------------------------+
  55. //| Custom indicator iteration function                              |
  56. //+------------------------------------------------------------------+
  57. int start()
  58.   {
  59. //---- TODO: add your code here
  60.    double r1,r2,r3,r4,r5,r6;
  61.    int rt1,rt2,rt3,rt4,rt5,rt6;
  62.    double s1,s2,s3,s4,s5,s6;
  63.    int st1,st2,st3,st4,st5,st6;
  64. for(nCurBar=Limit; nCurBar>0; nCurBar--)
  65.    {
  66.    if(Low[nCurBar+(nPeriod-1)/2] == Low[Lowest(NULL,0,MODE_LOW,nPeriod,nCurBar)])
  67.       {
  68.       s6=s5; s5=s4; s4=s3; s3=s2; s2=s1; s1=Low[nCurBar+(nPeriod-1)/2];
  69.       st6=st5; st5=st4; st4=st3; st3=st2; st2=st1; st1=nCurBar+(nPeriod-1)/2;
  70.       }
  71.    if(High[nCurBar+(nPeriod-1)/2] == High[Highest(NULL,0,MODE_HIGH,nPeriod,nCurBar)])
  72.       {
  73.       r6=r5; r5=r4; r4=r3; r3=r2; r2=r1; r1=High[nCurBar+(nPeriod-1)/2];
  74.       rt6=rt5; rt5=rt4; rt4=rt3; rt3=rt2; rt2=rt1; rt1=nCurBar+(nPeriod-1)/2;
  75.       }
  76.    }
  77. //---- Move Object in Chart
  78. ObjectMove("WSO-0",0,Time[st1],s1);
  79. ObjectMove("Trend DN-0",1,Time[st1],s1);
  80. ObjectMove("Trend DN-0",0,Time[st2],s2);
  81. ObjectMove("WSO-1",0,Time[st2],s2);
  82. ObjectMove("Trend DN-1",1,Time[st2],s2);
  83. ObjectMove("Trend DN-1",0,Time[st3],s3);
  84. ObjectMove("WSO-2",0,Time[st3],s3);
  85. ObjectMove("Trend DN-2",1,Time[st3],s3);
  86. ObjectMove("Trend DN-2",0,Time[st4],s4);
  87. ObjectMove("WSO-3",0,Time[st4],s4);
  88. ObjectMove("Trend DN-3",1,Time[st4],s4);
  89. ObjectMove("Trend DN-3",0,Time[st5],s5);
  90. ObjectMove("WSO-4",0,Time[st5],s5);
  91. ObjectMove("Trend DN-4",1,Time[st5],s5);
  92. ObjectMove("Trend DN-4",0,Time[st6],s6);
  93. ObjectMove("WSO-5",0,Time[st6],s6);
  94. //----
  95. ObjectMove("WRO-0",0,Time[rt1],r1);
  96. ObjectMove("Trend UP-0",1,Time[rt1],r1);
  97. ObjectMove("Trend UP-0",0,Time[rt2],r2);
  98. ObjectMove("WRO-1",0,Time[rt2],r2);
  99. ObjectMove("Trend UP-1",1,Time[rt2],r2);
  100. ObjectMove("Trend UP-1",0,Time[rt3],r3);
  101. ObjectMove("WRO-2",0,Time[rt3],r3);
  102. ObjectMove("Trend UP-2",1,Time[rt3],r3);
  103. ObjectMove("Trend UP-2",0,Time[rt4],r4);
  104. ObjectMove("WRO-3",0,Time[rt4],r4);
  105. ObjectMove("Trend UP-3",1,Time[rt4],r4);
  106. ObjectMove("Trend UP-3",0,Time[rt5],r5);
  107. ObjectMove("WRO-4",0,Time[rt5],r5);
  108. ObjectMove("Trend UP-4",1,Time[rt5],r5);
  109. ObjectMove("Trend UP-4",0,Time[rt6],r6);
  110. ObjectMove("WRO-5",0,Time[rt6],r6);
  111. //----
  112.    return(0);
  113.   }
  114. //--------------------------------------------------+  
复制代码

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

0

主题

30

积分

0

精华

外汇入门

金钱
30 美元
权重
0
沙发
发表于 2015-6-10 17:41 | 只看该作者
本帖最后由 wccmcd 于 2015-12-4 12:02 编辑

谢谢分享!!
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

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

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

浙公网安备 33011802001420号

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

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