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

    求解,为何蓝色线无法显示

    2019-06-10 · 1325 阅读
    以下为程序,求解为何蓝色线无法显示出来,求指教
    ===================================================================
    //+------------------------------------------------------------------+
    //|                                                    MA System.mq4 |
    //|                                                      Philip Hall |
    //|                                                              APP |
    //+------------------------------------------------------------------+
    #property copyright "Philip Hall"
    #property link      "APP"
    #property version   "1.00"
    #property strict
    #property indicator_separate_window
    #property indicator_buffers 2
    #property indicator_color1 Red
    #property indicator_color2 Blue
    #property indicator_width1 2
    #property indicator_width2 2
    //指标参数设置
    input int MA_1=5;
    input int MA_2=8;

    double MASystem_1[];
    double MASystem_2[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int OnInit(void)
      {
      IndicatorDigits(Digits+1);
    //--- indicator buffers mapping
      SetIndexStyle(0,DRAW_LINE);
      SetIndexStyle(1,DRAW_LINE);
      SetIndexDrawBegin(0,MA_12);
      SetIndexDrawBegin(1,MA_12);
      SetIndexBuffer(0,MASystem_1);
      SetIndexBuffer(1,MASystem_2);
    //---
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function                              |
    //+------------------------------------------------------------------+
    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[])
      {
      int i,limit;
      limit=rates_total-prev_calculated;
      if(prev_calculated>0){limit++;};
      
      for(i=0; i<limit; i++)
      
      
      MASystem_1[i]
      =iMA(NULL,0,MA_1,0,MODE_EMA,PRICE_CLOSE,i);
      
      MASystem_2[i]
      =iMA(NULL,0,MA_2,0,MODE_EMA,PRICE_CLOSE,i);
      
    //---
       
    //--- return value of prev_calculated for next call
       return(rates_total);
      }
    //+------------------------------------------------------------------+
    //| Timer function                                                   |
    //+------------------------------------------------------------------+
    void OnTimer()
      {
    //---
       
      }
    //+------------------------------------------------------------------+



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

    举报

     

    回答|共 4 个

    yljcnb LV3

    发表于 2019-6-10 22:28:13 | 显示全部楼层

    我这里只显示了红线

    PhilipHall LV2

    发表于 2019-6-11 08:52:30 | 显示全部楼层

    所以求指教,是否哪里出了问题,为何蓝线无法显示

    凌风 LV3

    发表于 2026-3-17 16:31:47 | 显示全部楼层

    支持下
    您需要登录后才可以回帖 登录 | 注册

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

    微信二维码

    有问题联系客服