交易危机

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

QQ登录

只需一步,快速开始

搜索
广告位
查看: 4730|回复: 34

[代码] 论坛里有不少极其美妙的指标

[复制链接]

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
发表于 2016-6-27 21:21 | 显示全部楼层 |阅读模式
刚又发掘一个
待检测结果公布

30

主题

1万

积分

0

精华

操盘专家

金钱
13785 美元
权重
1
发表于 2016-10-11 10:19 | 显示全部楼层

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1
#property indicator_width5 1
#property indicator_width6 1
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Gold
#property indicator_color4 Gold
#property indicator_color5 White
#property indicator_color6 White
extern int LeftBars  = 3;
extern int RightBars = 3;
double 阻力Buffer1[];
double 支撑Buffer2[];
double 上分形Buffer3[];
double 下分形Buffer4[];
double 上突破Buffer5[];
double 下突破Buffer6[];
int init()
{
   SetIndexStyle(0, DRAW_LINE);
   SetIndexArrow(0, 158);
   SetIndexBuffer(0, 阻力Buffer1);
   SetIndexEmptyValue(0, 0.0);
   SetIndexLabel(0, "阻力");
   
   SetIndexStyle(1, DRAW_LINE);
   SetIndexArrow(1, 158);
   SetIndexBuffer(1, 支撑Buffer2);
   SetIndexEmptyValue(1, 0.0);
   SetIndexLabel(1, "支撑");
   
   SetIndexStyle(2, DRAW_ARROW);
   SetIndexArrow(2, 119);
   SetIndexBuffer(2, 上分形Buffer3);
   SetIndexEmptyValue(2, 0.0);
   SetIndexLabel(2, "上分形");
   SetIndexStyle(3, DRAW_ARROW);
   SetIndexArrow(3, 119);
   SetIndexBuffer(3, 下分形Buffer4);
   SetIndexEmptyValue(3, 0.0);
   SetIndexLabel(3, "下分形");
   
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexArrow(4, 119);
   SetIndexBuffer(4, 上突破Buffer5);
   SetIndexEmptyValue(4, 0.0);
   SetIndexLabel(4, "上破");
   
   SetIndexStyle(5, DRAW_ARROW);
   SetIndexArrow(5, 119);
   SetIndexBuffer(5, 下突破Buffer6);
   SetIndexEmptyValue(5, 0.0);
   SetIndexLabel(5, "下破");
   return(0);
}
int deinit(){return(0);}
int start()
{
   int counted_bars = IndicatorCounted();
   if(counted_bars < 0)  return(-1);
   if(counted_bars > 0)   counted_bars--;
   int limit = Bars - counted_bars;
   if(counted_bars==0) limit-=1+MathMax(LeftBars,RightBars);
   for(int i = limit-1; i >= 0; i--)
   {
      阻力Buffer1 = isFractalUp(i, LeftBars, RightBars,limit);
      if(阻力Buffer1 == 0)
         阻力Buffer1 = 阻力Buffer1[i+1];
      else
         上分形Buffer3 = 阻力Buffer1;
      
      支撑Buffer2 = isFractalDown(i, LeftBars, RightBars,limit);
      if(支撑Buffer2 == 0)
         支撑Buffer2 = 支撑Buffer2[i+1];
      else
         下分形Buffer4 = 支撑Buffer2;
         
      if(Close < 支撑Buffer2 && Close[i+1] >= 支撑Buffer2[i+1])
         下突破Buffer6 = Close;
      if(Close > 阻力Buffer1 && Close[i+1] <= 阻力Buffer1[i+1])
         下突破Buffer6 = Close;   }
   //阻力Buffer1[-1] = 阻力Buffer1[0];
   //支撑Buffer2[-1] = 支撑Buffer2[0];
   return(0);
}
double isFractalUp(int index, int lBars, int rBars, int maxind)
{
   int left = lBars, right = rBars;
   double max = High[index];
   for(int i = index - right; i <= (index + left); i++)
   {
     if (i<0 || i>maxind) return(0);
      if(!(High > 0.0))return(0);
      if(max < High && i != index)
      {
         if(max < High)  return(0);
         if(MathAbs(i - index) > 1) return(0);
      }
   }
   return(max);
}
double isFractalDown(int index, int lBars, int rBars, int maxind)
{
   int left = lBars, right = rBars;
   double min = Low[index];
   for(int i = index - right; i <= (index + left); i++)
   {
      if (i<0 || i>maxind) return(0);
      if(!(Low > 0.0))return(0);
    //if(min >= Low && i != index)
      if(min > Low && i != index)
      {
         if(min > Low)
            return(0);
         if(MathAbs(i - index) > 1)
            return(0);
      }
   }
   return(min);
}
360截图20161011101508984.jpg
回复 支持 1 反对 0

使用道具 举报

12

主题

7674

积分

2

精华

高级操盘手

金钱
7674 美元
权重
10
发表于 2016-6-27 21:30 | 显示全部楼层
开心科目为快乐到家

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 05:48 | 显示全部楼层
说说是哪个?

以前宝马哥发了一个,灰常喜欢

好久不见宝马哥

95

主题

7万

积分

9

精华

钓鱼大师:镇定,沉住气,放轻松

大型投行

金钱
78029 美元
权重
111
发表于 2016-6-28 13:41 | 显示全部楼层
论坛的情绪指标,,就很好
今天明显人少,,,,观望的多,还是亏的多?????
日间波段交易者,只关注澳美,欧美,镑美,美加,美瑞,美日,镑日,黄金八个品种

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 13:42 | 显示全部楼层
williamwoo 发表于 2016-6-28 13:41
论坛的情绪指标,,就很好
今天明显人少,,,,观望的多,还是亏的多?????

大战之后百业凋零

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 13:54 | 显示全部楼层
阿建GG 发表于 2016-6-28 05:48
说说是哪个?

以前宝马哥发了一个,灰常喜欢

  1. #property indicator_chart_window
  2. #property indicator_buffers 6
  3. #property indicator_width1 2
  4. #property indicator_width2 2
  5. #property indicator_width3 2
  6. #property indicator_width4 2
  7. #property indicator_width5 2
  8. #property indicator_width6 2
  9. #property indicator_color1 Blue
  10. #property indicator_color2 Red
  11. #property indicator_color3 Gold
  12. #property indicator_color4 Gold
  13. #property indicator_color5 White
  14. #property indicator_color6 White
  15. extern int LeftBars  = 3;
  16. extern int RightBars = 3;
  17. double LineUpBuffer1[];
  18. double LineDownBuffer2[];
  19. double ArrowUpBuffer3[];
  20. double ArrowDownBuffer4[];
  21. double ArrowBreakUpBuffer5[];
  22. double ArrowBreakDownBuffer6[];
  23. int init()
  24. {
  25.    SetIndexStyle(0, DRAW_LINE);
  26.    SetIndexArrow(0, 158);
  27.    SetIndexBuffer(0, LineUpBuffer1);
  28.    SetIndexEmptyValue(0, 0.0);
  29.    SetIndexLabel(0, "Фрактальное сопротивление");
  30.    SetIndexStyle(1, DRAW_LINE);
  31.    SetIndexArrow(1, 158);
  32.    SetIndexBuffer(1, LineDownBuffer2);
  33.    SetIndexEmptyValue(1, 0.0);
  34.    SetIndexLabel(1, "Фрактальная поддержка");
  35.    SetIndexStyle(2, DRAW_ARROW);
  36.    SetIndexArrow(2, 119);
  37.    SetIndexBuffer(2, ArrowUpBuffer3);
  38.    SetIndexEmptyValue(2, 0.0);
  39.    SetIndexLabel(2, "Фрактал ВЕРХ");
  40.    SetIndexStyle(3, DRAW_ARROW);
  41.    SetIndexArrow(3, 119);
  42.    SetIndexBuffer(3, ArrowDownBuffer4);
  43.    SetIndexEmptyValue(3, 0.0);
  44.    SetIndexLabel(3, "Фрактал ВНИЗ");
  45.    SetIndexStyle(4, DRAW_ARROW);
  46.    SetIndexArrow(4, 119);
  47.    SetIndexBuffer(4, ArrowBreakUpBuffer5);
  48.    SetIndexEmptyValue(4, 0.0);
  49.    SetIndexLabel(4, "Пробой ВВЕРХ");
  50.    SetIndexStyle(5, DRAW_ARROW);
  51.    SetIndexArrow(5, 119);
  52.    SetIndexBuffer(5, ArrowBreakDownBuffer6);
  53.    SetIndexEmptyValue(5, 0.0);
  54.    SetIndexLabel(5, "Пробой ВНИЗ");
  55.    return(0);
  56. }
  57. int deinit(){return(0);}
  58. int start()
  59. {
  60.    int counted_bars = IndicatorCounted();
  61.    if(counted_bars < 0)  return(-1);
  62.    if(counted_bars > 0)   counted_bars--;
  63.    int limit = Bars - counted_bars;
  64.    if(counted_bars==0) limit-=1+MathMax(LeftBars,RightBars);
  65.    for(int i = limit-1; i >= 0; i--)
  66.    {
  67.       LineUpBuffer1[i] = isFractalUp(i, LeftBars, RightBars,limit);
  68.       if(LineUpBuffer1[i] == 0)
  69.          LineUpBuffer1[i] = LineUpBuffer1[i+1];
  70.       else
  71.          ArrowUpBuffer3[i] = LineUpBuffer1[i];
  72.       
  73.       LineDownBuffer2[i] = isFractalDown(i, LeftBars, RightBars,limit);
  74.       if(LineDownBuffer2[i] == 0)
  75.          LineDownBuffer2[i] = LineDownBuffer2[i+1];
  76.       else
  77.          ArrowDownBuffer4[i] = LineDownBuffer2[i];
  78.          
  79.       if(Close[i] < LineDownBuffer2[i] && Close[i+1] >= LineDownBuffer2[i+1])
  80.          ArrowBreakDownBuffer6[i] = Close[i];
  81.    }
  82.    //LineUpBuffer1[-1] = LineUpBuffer1[0];
  83.    //LineDownBuffer2[-1] = LineDownBuffer2[0];
  84.    return(0);
  85. }
  86. double isFractalUp(int index, int lBars, int rBars, int maxind)
  87. {
  88.    int left = lBars, right = rBars;
  89.    double max = High[index];
  90.    for(int i = index - right; i <= (index + left); i++)
  91.    {
  92.      if (i<0 || i>maxind) return(0);
  93.       if(!(High[i] > 0.0))return(0);
  94.       if(max < High[i] && i != index)
  95.       {
  96.          if(max < High[i])  return(0);
  97.          if(MathAbs(i - index) > 1) return(0);
  98.       }
  99.    }
  100.    return(max);
  101. }
  102. double isFractalDown(int index, int lBars, int rBars, int maxind)
  103. {
  104.    int left = lBars, right = rBars;
  105.    double min = Low[index];
  106.    for(int i = index - right; i <= (index + left); i++)
  107.    {
  108.       if (i<0 || i>maxind) return(0);
  109.       if(!(Low[i] > 0.0))return(0);
  110.       //if(min >= Low[i] && i != index)
  111.       if(min > Low[i] && i != index)
  112.       {
  113.          if(min > Low[i])
  114.             return(0);
  115.          if(MathAbs(i - index) > 1)
  116.             return(0);
  117.       }
  118.    }
  119.    return(min);
  120. }
复制代码

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 14:03 | 显示全部楼层
williamwoo 发表于 2016-6-28 13:41
论坛的情绪指标,,就很好
今天明显人少,,,,观望的多,还是亏的多?????

深在套中等待解套时机

95

主题

7万

积分

9

精华

钓鱼大师:镇定,沉住气,放轻松

大型投行

金钱
78029 美元
权重
111
发表于 2016-6-28 15:21 | 显示全部楼层
阿建GG 发表于 2016-6-28 14:03
深在套中等待解套时机

这套可是很大啊,,,,,,,,,,
日间波段交易者,只关注澳美,欧美,镑美,美加,美瑞,美日,镑日,黄金八个品种

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:34 | 显示全部楼层
williamwoo 发表于 2016-6-28 15:21
这套可是很大啊,,,,,,,,,,

解的好毫发无损,解不好死翘翘

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:35 | 显示全部楼层

有没有效果图,上一个看看,搞EA搞得头疼,就不加载了

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 15:36 | 显示全部楼层
阿建GG 发表于 2016-6-28 15:34
解的好毫发无损,解不好死翘翘


573有句名言,解着解着资金成三角收敛,最后解没了

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 15:36 | 显示全部楼层
阿建GG 发表于 2016-6-28 15:35
有没有效果图,上一个看看,搞EA搞得头疼,就不加载了

我是怕加载,容我缓过神来,再补

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:42 | 显示全部楼层
frlin2003 发表于 2016-6-28 15:36
我是怕加载,容我缓过神来,再补

你的mt4如果已经使用这个指标,截个图就行了

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 15:44 | 显示全部楼层
阿建GG 发表于 2016-6-28 15:42
你的mt4如果已经使用这个指标,截个图就行了

当时过了眼,就delete了
是个较好的通道指标

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 15:46 | 显示全部楼层
阿建GG 发表于 2016-6-28 15:42
你的mt4如果已经使用这个指标,截个图就行了


回复三次,直接纠结了
加上了

QQ截图20160628154515.png

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:47 | 显示全部楼层
frlin2003 发表于 2016-6-28 15:36
573有句名言,解着解着资金成三角收敛,最后解没了

等到英镑触底反弹之时就是我的解套之日,希望别太久。。。

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:49 | 显示全部楼层
frlin2003 发表于 2016-6-28 15:46
回复三次,直接纠结了
加上了

这个有点那啥了,走出来之后,才能画出来

跟均线差不多,等均线走顺了,行情已经走了一大半了

2127

主题

6万

积分

157

精华

大型投行

金钱
61244 美元
权重
640
 楼主| 发表于 2016-6-28 15:51 | 显示全部楼层
阿建GG 发表于 2016-6-28 15:49
这个有点那啥了,走出来之后,才能画出来

跟均线差不多,等均线走顺了,行情已经走了一大半了

无法回测。盯了会。
边走边画

352

主题

7816

积分

3

精华

高级操盘手

金钱
7816 美元
权重
224
发表于 2016-6-28 15:54 | 显示全部楼层
frlin2003 发表于 2016-6-28 15:51
无法回测。盯了会。
边走边画

收盘一个柱子,确定一个点,慢慢的点连成线。。。

2

主题

7404

积分

0

精华

高级操盘手

金钱
7404 美元
权重
0
发表于 2016-6-29 09:49 | 显示全部楼层
为什么没有向上突破信号  F大想办法
您需要登录后才可以回帖 登录 | 快捷注册(禁q号)

本版积分规则

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

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

浙公网安备 33011802001420号

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

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