📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    大佬们,帮忙加一行报警,谢谢啦20个金币奉上!

    2024-04-14 · 1477 阅读
    悬赏20金币未解决



    //------------------------------------------------------------------
    #property indicator_chart_window
    #property indicator_buffers 2
    #property indicator_color1  clrDeepSkyBlue
    #property indicator_color2  clrRed

    #property indicator_width1  2
    #property indicator_width2  2

    extern int    ArrowCodeDn          =   233;
    extern int    ArrowCodeUp          =   234;
    extern int    LagBar               =     1;
    extern string NoteLagBar           = "0 = Signal on current ; 1 = Wait for close";


    double ArrowsUp[];
    double ArrowsDn[];
    double body[];
    double trend[];


    int init()
    {
       IndicatorBuffers(4);
          SetIndexBuffer(0,ArrowsUp); SetIndexArrow(0,ArrowCodeDn);
          SetIndexBuffer(1,ArrowsDn); SetIndexArrow(1,ArrowCodeUp);
          SetIndexBuffer(2,trend);
          SetIndexBuffer(3,body);


          SetIndexStyle(0,DRAW_ARROW);
          SetIndexStyle(1,DRAW_ARROW);


       return(0);
    }
    int deinit()

    {
       return(0);
    }

    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+

    int start()
    {
       int counted_bars=IndicatorCounted();
       int i, limit;

       if(counted_bars<0) return(-1);
       if(counted_bars>0) counted_bars--;
             limit = MathMin(Bars-counted_bars,Bars-1);

          for(i=limit; i>=0; i--)
          {
             double gap = 3.0*iATR(NULL,0,20,i)/4.0;

             body[i] = MathAbs(Open[i]-Close[i]);

             trend[i] =  0.0;

             if((High[i+1] < Low[i-1]) && (body[i] > body[i+1]) && (body[i] > body[i+2]) && (body[i] > body[i+3]) && (iVolume(NULL,0,i-LagBar)>1))
             {
             trend[i] = 1;
             }
             if((Low[i+1] > High[i-1]) && (body[i] > body[i+1]) && (body[i] > body[i+2]) && (body[i] > body[i+3]) && (iVolume(NULL,0,i-LagBar)>1))
             {
             trend[i] =- 1;
             }

            ArrowsUp[i] =  EMPTY_VALUE;
            ArrowsDn[i] =  EMPTY_VALUE;

            if (trend[i] != trend[i+1])
            {
               if (trend[i] == 1)
               ArrowsUp[i] = Low[i] - gap;

               else if (trend[i] ==- 1)
               ArrowsDn[i] = High[i] + gap;

            }

          }

       return(0);
       }      

    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+

    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 7 个

    scbxiaoqiang LV0

    发表于 2024-4-14 17:36:51 | 显示全部楼层

    就这个文件,谢谢大佬啦!

    WA263222 LV4

    发表于 2024-4-14 17:52:10 | 显示全部楼层

    这个有现成的啊

    scbxiaoqiang LV0

    发表于 2024-4-14 18:18:20 | 显示全部楼层

    在哪儿呢?我咋找不见

    baige LV0

    发表于 2024-4-14 22:38:01 | 显示全部楼层

    研究指标走不出来

    triple3 LV10

    发表于 2024-4-15 12:01:08 | 显示全部楼层

    张安和 LV1

    发表于 2024-5-9 12:00:24 | 显示全部楼层

    顶下
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服