|
我看有很多倒计时的指标,为了感谢那些上传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);} |
MT5指标