ww1234512345 发表于 2021-6-8 09:35:24

请教大家一个问题

我有一个指标不显示,不知道哪儿错了,请高手赐教


#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 3

input int      m=144;
input int      k=5;


double A1[];
double A2[];
double A3[];

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
{


   SetIndexStyle(0,DRAW_NONE);
   SetIndexBuffer(0,A1);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(1,A2);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1,clrWhite);
   SetIndexBuffer(2,A3);
   return(INIT_SUCCEEDED);
}


//------------------------------------------------------------------
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   if(rates_total<16)
   {
      return(0);
   }

   int i,limit;
   limit=rates_total-prev_calculated;
   if(prev_calculated>0)limit++;
   ppp(i,limit);

   return(rates_total);
}


//+------------------------------------------------------------------+
void ppp(int i,int limit)
{

//TR1:=EMA(CLOSE,16);
   for(i=0;i<limit-1;i++)
   {
      A1=iMA(NULL,0,m,0,MODE_EMA,PRICE_CLOSE,i);
   }

//TR2:=EMA(TR1,16);
   for(i=0;i<limit-1;i++)
   {
      A2=iMAOnArray(A1,0,k,0,MODE_EMA,i);
   }

   for(i=0;i<limit-1;i++)
   {
      A3=100000*(A2-A2)/A2;
   }

}

ww1234512345 发表于 2021-6-8 09:37:48

补充一下原文件

太阳花非常 发表于 2021-6-14 19:02:48

{:1_179:}

qcchw 发表于 2021-6-18 16:39:37

{:1_179:}

chen210 发表于 2021-6-22 18:11:59

支持下

闲暇时光在这里 发表于 2021-6-23 19:08:16

支持下

枫林 发表于 2021-6-24 11:37:56

{:1_186:}

悟空小宝 发表于 2021-6-28 18:55:01

{:1_179:}

final 发表于 2021-6-29 19:59:26

{:1_179:}

rsblvlgo 发表于 2021-6-30 13:56:06

谢谢
页: [1] 2 3 4 5 6 7 8 9
查看完整版本: 请教大家一个问题