秃鹫老师请进
秃鹫老师:请帮助我看看这个原代码有什么错误?
我是在其它地方收集的。对于代码,我是一窍不通的。
《k线波动幅度报警》
//+------------------------------------------------------------------+
//|                                                       AAAAAA.mq4 |
//|                       Copyright ?2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property indicator_separate_window
#property  indicator_buffers 1       //有多少个(1~7)储存指标数据的数组
#property  indicator_color1  Red  //说明对应将画指标的绘画颜色,编号1~7
#property  indicator_width1  2       //说明对应将画指标的绘画宽度
extern int ZF=12;
extern int 报警间隔_分钟=15;     //所用的时间线,控制报警使用
int PrevAlertTime = 0;
double     MacdBuffer;
//+------------------------------------------------------------------+
int init()
  { SetIndexStyle(0,DRAW_HISTOGRAM); 
    SetIndexBuffer(0,MacdBuffer);  
    IndicatorDigits(Digits+1);
   return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int ZZFF;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(int i=0; iZF )
          MacdBuffer=1;
      else
          if( (high-low)/Point<-ZF )
             MacdBuffer=1;
          else
             MacdBuffer=0;
   if (TimeCurrent()-PrevAlertTime>报警间隔_分钟*60)                               //这个if语句用于判定报警次数
   {
     if( MathAbs(high[0]-low[0])/Point>ZF ) Alert (Symbol (), "突破");
     PrevAlertTime = TimeCurrent();
    }
   return(0);
  }
//+------------------------------------------------------------------+ 
3楼 
太谢谢老师了。我还可以学习一些代码知识。
好,我来试试看。
韬客社区www.talkfx.co














 DFHDDH.GIF
DFHDDH.GIF
