[求助]MQL指标求改文华指标,万分感谢 (文华财经WH6赢顺V6.7)

投资者咨询:[求助]MQL指标求改文华指标,万分感谢 (文华财经WH6赢顺V6.7)
来源:文华财经  日期:2018-8-5 5:30
 #property copyright ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_color1 Red
#property indicator_color2 LimeGreen
#property indicator_width1 1
#property indicator_style1 0
#property indicator_width2 1
#property indicator_style2 2
#property indicator_level1 20
#property indicator_level2 50
#property indicator_level3 80
//
//
//
//
//

   extern int PeriodRSI  =13;
   extern int PeriodStoch= 8;
   extern int PeriodSK   = 5;
   extern int PeriodSD   = 3;
         //    0 = SMA
         //    1 - EMA
         //    2 - SMMA
         //    3 - LWMA
   extern int MAMode=1;

//
//
//
//
//

double SK[];
double SD[];
double StoRSI[];
double RSI[];

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(4);
      SetIndexBuffer(0,SK);
      SetIndexBuffer(1,SD);
      SetIndexBuffer(2,StoRSI);
      SetIndexBuffer(3,RSI);
   IndicatorShortName("DTOSC ("+PeriodRSI+","+PeriodStoch+","+PeriodSK+","+PeriodSD+")");
return(0);
}
int deinit() { return(0); }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
{
   int i,limit;
   int counted_bars = IndicatorCounted();

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

   //
   //
   //
   //
   //
             
   for(i=limit; i>=0; i--)
   {
      RSI[i] = iRSI(NULL,0,PeriodRSI,PRICE_WEIGHTED,i);
      double LLV = RSI[ArrayMinimum(RSI,PeriodStoch,i)];
      double HHV = RSI[ArrayMaximum(RSI,PeriodStoch,i)];
      if ((HHV-LLV)!=0)
            StoRSI[i] = 100.0*((RSI[i] - LLV)/(HHV - LLV));
      else  StoRSI[i] = 0;
   }   
   for(i=limit; i>=0; i--) SK[i]=iMAOnArray(StoRSI,0,PeriodSK,0,MAMode,i);
   for(i=limit; i>=0; i--) SD[i]=iMAOnArray(    SK,0,PeriodSD,0,MAMode,i);
   return(0);
}
技术人员回复
日期:2018-8-5 11:16

您1楼的指标含有FOR循环,而wh6是大众看盘软件,不支持这类复杂的循环函数的

 

您可以直接提供下看盘指标的编写思路,我们直接帮您编写实现

 

 

       
投资者咨询:[求助]MQL指标求改文华指标,万分感谢 (文华财经WH6赢顺V6.7)
来源:文华财经  日期:2018-8-5 5:30
 可以,谢谢老师了