在MT里加北京时间
LocalTimeZone为时区常数;中国在8时区 如:北京时间 LocalTimeZone=8;。。其他地方按需要修改时间参数 /*+------------------------------------------------------------------+ | sosopoptang_trme | | Author: Copyright ?20061211, | | | | | +------------------------------------------------------------------+*/ #property copyright "Copyright ?2006sosopoptang," #property link "http://sosopoptang.51.com" #property indicator_chart_window //---- buffers extern int LocalTimeZone=8; extern string Author="Copyright ?2006sosopoptang,"; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double i; string timeX= TimeToStr(CurTime()+(LocalTimeZone=8)*3600, TIME_SECONDS); Comment(" Now the time is " + timeX); ObjectDelete("time"); //---- if(ObjectFind("time") != 0) { ObjectCreate("time", OBJ_TEXT, 0, iTime(NULL,0,0), Ask); ObjectSetText("time", "Now" + timeX, 12, "Arial Black", Red); } else { ObjectCreate("time", OBJ_TEXT, 0, iTime(NULL,0,0), Ask); ObjectSetText("time", "Now" + timeX, 12, "Arial Black", Red); } return(0); } //+------------------------------------------------------------------+
搜索更多相关主题的帖子:
MT4