83评论

0收藏

请教大家一个问题

avatar ww1234512345 | 12738 人阅读 | 83 人评论 | 2021-06-08

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


#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[i]=iMA(NULL,0,m,0,MODE_EMA,PRICE_CLOSE,i);
     }

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

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

}

""
还没有人打赏,支持一下

评论|共 83 个

ww1234512345

发表于 2021-6-8 09:37:48 | 显示全部楼层

补充一下原文件

太阳花非常

发表于 2021-6-14 19:02:48 | 显示全部楼层

qcchw

发表于 2021-6-18 16:39:37 | 显示全部楼层

chen210

发表于 2021-6-22 18:11:59 | 显示全部楼层

支持下

闲暇时光在这里

发表于 2021-6-23 19:08:16 | 显示全部楼层

支持下

枫林

发表于 2021-6-24 11:37:56 | 显示全部楼层

悟空小宝

发表于 2021-6-28 18:55:01 | 显示全部楼层

final

发表于 2021-6-29 19:59:26 | 显示全部楼层

rsblvlgo

发表于 2021-6-30 13:56:06 | 显示全部楼层

谢谢

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则