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

    公开倒计时的MQ5

    pty LV6
    2026-02-04 · 188 阅读
    我看有很多倒计时的指标,为了感谢那些上传MQ5源码的,也为感谢平台对我的帮助,公开一个倒计时,你只要复制到你的新建指标里就行啦。


    #property copyright "H2O"
    #property version   "1.00"
    #include <调用.mqh>
    #property indicator_chart_window
    input string 左右       ="左";
    //+------------------------------------------------------------------+
    int OnInit() {return(INIT_SUCCEEDED);}
    int OnCalculate(const int32_t rates_total,  const int32_t 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 int32_t &spread[])
    {int tS,iS,iM,iH; string sS,sM,sH,cmt;
      tS=(int) time[rates_total-1]+PeriodSeconds()-(int) TimeCurrent();
      iS=tS%60;  iM=(tS-iS); if(iM!=0) iM/=60; iM-=(iM-iM%60); iH=(tS-iS-iM*60);
      if(iH!=0) iH/=60; if(iH!=0) iH/=60; sS=IntegerToString(iS,2,'0');
      sM=IntegerToString(iM,2,'0'); sH=IntegerToString(iH,2,'0'); cmt=sH+":"+sM+":"+sS;
      if(左右=="左") {写("A2",0,3,19,"时间:",8,Aqua); 写("A时置",0,30,16,cmt,10,Aqua);}
      if(左右=="右") {写("A2",3,58,19,"时间:",8,Aqua); 写("A时置",3,5,16,cmt,10,Aqua);}
       return(rates_total);}
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 1 个

    pty LV6

    发表于 2026-2-5 13:56:40 | 显示全部楼层

    忘了上图,补上
    捕获.PNG
    您需要登录后才可以回帖 登录 | 注册

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

    微信二维码

    有问题联系客服