显示北京时间

楼主  收藏   举报   帖子创建时间:  2019-05-05 13:00 回复:0 关注量:294
  1. #property indicator_chart_window
  2. extern color TextColor = Black;
  3. int init()
  4.   {
  5.   ObjectCreate( "北京时间", OBJ_LABEL, 0,0,0,0,0,0,0);
  6.   ObjectSet( "北京时间", OBJPROP_CORNER, 0);
  7.   ObjectSet( "北京时间", OBJPROP_XDISTANCE, 0);
  8.   ObjectSet( "北京时间", OBJPROP_YDISTANCE, 12);
  9.   ObjectSetText(  "北京时间", "", 12, "Arial", TextColor);
  10.     return(0);
  11.   }
  12. //----
  13. int deinit()
  14.   {
  15.     ObjectDelete("北京时间");
  16.     return(0);
  17.   }
  18. int start()
  19.   {
  20.     ObjectSetText("北京时间", TimeToStr(TimeLocal(), TIME_DATE|TIME_MINUTES|TIME_SECONDS), 12, "Arial", TextColor );
  21.     return(0);
  22.   }


打赏