scbxiaoqiang 发表于 2024-4-14 17:33:04

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




//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1clrDeepSkyBlue
#property indicator_color2clrRed

#property indicator_width12
#property indicator_width22

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 = MathAbs(Open-Close);

         trend =0.0;

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

      ArrowsUp =EMPTY_VALUE;
      ArrowsDn =EMPTY_VALUE;

      if (trend != trend)
      {
         if (trend == 1)
         ArrowsUp = Low - gap;

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

      }

      }

   return(0);
   }      

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

scbxiaoqiang 发表于 2024-4-14 17:36:51

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

WA263222 发表于 2024-4-14 17:52:10

这个有现成的啊

scbxiaoqiang 发表于 2024-4-14 18:18:20

在哪儿呢?我咋找不见{:1_177:}

baige 发表于 2024-4-14 22:38:01

研究指标走不出来

triple3 发表于 2024-4-15 12:01:08

加了

张安和 发表于 2024-5-9 12:00:24

顶下
页: [1]
查看完整版本: 大佬们,帮忙加一行报警,谢谢啦20个金币奉上!