小白求个MT5的指标,多空线DKX,有MT4的代码

 

不会改,求大佬相助,改成MT5的。

   

#property copyright "dkx"
#property link      "http://www.mql5.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Yellow

//--- buffers
double a[];
double b[];
double d[];
extern int mx=10;  

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(8); 
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,b);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,d);
   SetIndexBuffer(2,a);

   
   IndicatorShortName("DKX"); 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {


   int    counted=IndicatorCounted();
   if(counted<0)return(-1);
   if(counted>0)counted--;
   int i=Bars-counted;
   for(int m=0;m<i;m++)
   {
   a[m]=(3*Close[m]+Low[m]+Open[m]+High[m])/6;
   }

   for(m=0;m<i;m++)
   { 
   b[m]=(20*a[m]+19*a[m+1]+18*a[m+2]+17*a[m+3]+16*a[m+4]+15*a[m+5]+14*a[m+6]
   +13*a[m+7]+12*a[m+8]+11*a[m+9]+10*a[m+10]+9*a[m+11]+8*a[m+12]
   +7*a[m+13]+6*a[m+14]+5*a[m+15]+4*a[m+16]+3*a[m+17]+2*a[m+18]+
   a[m+20])/210;  
   }

  
   for(m=0;m<i;m++)
   { 
   d[m]=iMAOnArray(b,0,mx,0,MODE_SMA,m);
   }
      
   return(0);
  }
//+------------------------------------------------------------------+


附加的文件:
[删除]  

这就是均线而已,多空的指标很多

如果你用mt5 可以下载附件中指标

附加的文件:
 
Any Hold:

这就是均线而已,多空的指标很多

如果你用mt5 可以下载附件中指标

没办法,用习惯了,其他的也不会看