下载MetaTrader 5
要添加评论,请登录注册
共享 您的知识。成为众所周知的开发者!
wxy1708
40
wxy1708 2008.01.11 15:44 
25周期内的每根K线的"CLOSE-OPEN"的值加起来,在指标窗口画一条线 出来,该怎么编写,非常感谢您看我的留言,要是能帮我一把,我会把赚的钱全部拿出请您吃巴西烤肉
mkdaoyi
150
mkdaoyi 2008.01.12 04:48  

哈哈,好啊!我试试!

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- input parameters
int    periods=25;
double line[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,line);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i,j;
   double a;
   for (i=Bars-1;i>=0;i--)
     {
      a=0;
      for (j=i;j<i+periods;j++) a+=Close[j]-Open[j];
      line[i]=a;
     }
//----
   return(0);
  }
wxy1708
40
wxy1708 2008.01.12 05:15  
mkdaoyi:

哈哈,好啊!我试试!

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- input parameters
int    periods=25;
double line[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,line);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i,j;
   double a;
   for (i=Bars-1;i>=0;i--)
     {
      a=0;
      for (j=i;j<i+periods;j++) a+=Close[j]-Open[j];
      line[i]=a;
     }
//----
   return(0);
  }
mkdaoyi:

哈哈,好啊!我试试!

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- input parameters
int    periods=25;
double line[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,line);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i,j;
   double a;
   for (i=Bars-1;i>=0;i--)
     {
      a=0;
      for (j=i;j<i+periods;j++) a+=Close[j]-Open[j];
      line[i]=a;
     }
//----
   return(0);
  }
wxy1708
40
wxy1708 2008.01.12 05:17  

非常感谢,我先试试,然后再次感谢

/
要添加评论,请登录注册