📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    请教大家一个问题

    2021-06-08 · 19098 阅读
    我有一个指标不显示,不知道哪儿错了,请高手赐教


    #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 LV1

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

    补充一下原文件

    chen210 LV4

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

    支持下

    闲暇时光在这里 LV5

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

    支持下

    rsblvlgo LV3

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

    谢谢

    战斗 LV1

    发表于 2021-7-3 20:16:49 | 显示全部楼层

    谢谢

    reyer LV3

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

    谢谢

    独佳记忆 LV3

    发表于 2021-8-12 16:55:31 | 显示全部楼层

    顶下

    严序润 LV1

    发表于 2021-8-13 17:56:44 | 显示全部楼层

    谢谢

    小人物大世界 LV1

    发表于 2021-8-13 18:42:40 | 显示全部楼层

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

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服