诚信为本
量力而为
当前位置:峰汇在线 > MetaTrader 4 > MT4指标 > 正文

K线倒计时 Clock.mq4

Clock指标显示K线倒计时。

图表:Clock指标

源码:

//+------------------------------------------------------------------+
//|                                                        Clock.mq4 |
//|                                     Core time code by Nick Bilak |
//+------------------------------------------------------------------+
#property copyright "Copyright @2005, Nick Bilak"
#property link      "http://www.125808047.com/"

#property indicator_chart_window
double s1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit(void)
{
   Comment("www.125808047.com");
  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[])
  {
	double i;
   int m,s;
   m=Time[0]+Period()*60-CurTime();
   i=m/60.0;
   s=m%60;
   m=(m-m%60)/60;

   ObjectDelete("time");
   
   if(ObjectFind("time") != 0)
   {
   ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0]+ 0.0005);
   ObjectSetText("time", "                  <"+m+":"+s, 12, "Arial", White);
   }
   else
   {
   ObjectMove("time", 0, Time[0], Close[0]+0.0005);
   }
   return(rates_total);
  }
打赏
版权所有转载请注明标题及链接:峰汇在线 » K线倒计时 Clock.mq4
上一篇:
下一篇:
分享到: 更多 (0)

如您觉得此文不错请扫码打赏!

支付宝扫一扫打赏

微信扫一扫打赏