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

    高手帮忙看一下这是怎么回事

    2015-09-02 · 4993 阅读
    我在主窗口上画垂直线,怎么程序会自动生成一个子窗口???这是为啥?我不需要这个子窗口啊,请高手赐教!

    //+------------------------------------------------------------------+
    //|                                                          ATR.mq4 |
    //|                   Copyright 2005-2014, MetaQuotes Software Corp. |
    //|                                              http://www.mql4.com |
    //+------------------------------------------------------------------+
    #property copyright   "2005-2014, MetaQuotes Software Corp."
    #property link        "http://www.mql4.com"
    #property description "Average True Range"
    #property strict

    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int OnInit(void)
      {
    //---
       return(INIT_SUCCEEDED);
      }
    //+------------------------------------------------------------------+
    //| Average True Range                                               |
    //+------------------------------------------------------------------+
    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 myhour,mymin;
       int i;

       for(i = 0; i < rates_total; i++)
         {

       myhour=TimeHour(time);
       mymin=TimeMinute(time);

           if((myhour==0 && mymin==0) || (myhour==9 && mymin==30))
             {
    ObjectCreate("time"+string(i),OBJ_VLINE,0,time,0);
             }
         }


    //--- return value of prev_calculated for next call
       return(rates_total);
      }
    //+------------------------------------------------------------------+


    QQ图片20150902125144.png
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 7 个

    阅乐芙月 LV7

    发表于 2018-9-13 16:27:12 | 显示全部楼层

    学习了,不错,讲的太有道理了

    没那么简单 LV7

    发表于 2020-7-4 22:50:47 | 显示全部楼层

    学习了,不错

    aviva1234 LV3

    发表于 2020-7-8 20:39:54 | 显示全部楼层

    学习了,不错

    ecuig LV0

    发表于 2020-7-12 14:53:50 | 显示全部楼层

    谢谢楼主分享

    盘点幸福 LV3

    发表于 2020-7-24 20:54:31 | 显示全部楼层

    谢谢楼主分享
    您需要登录后才可以回帖 登录 | 注册

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

    微信二维码

    有问题联系客服