public Order() { InitializeComponent(); myXASessionClass._IXASessionEvents_Event_Login += new _IXASessionEvents_LoginEventHandler(myXASessionClass__IXASessionEvents_Event_Login); ConnectionString = GetDbConnStr(); logPath = GetLogPath(); flog = new BANG.Common.Log.FileLog("ORDERFORM", logPath, BANG.Common.Log.LogFileInteval.DAILY); AutoLogIn_Exec(); button2.BackColor = Color.Green; myTimer = new BANG.Common.Timer.MyThreadTimer(1100); myTimer.OnTick += myTimer_OnTick; myTimer.Start(); myTimerServer = new BANG.Common.Timer.MyThreadTimer(1000 * 60 * 10); myTimerServer.OnTick += myTimerServer_OnTick; myTimerServer.Start(); }
protected override void OnStart(string[] args) { myTimer = new BANG.Common.Timer.MyThreadTimer(1000); myTimerSIGNAL = new BANG.Common.Timer.MyThreadTimer(1000); gStockCodeList = new List <string>(); dbConnString = GetDbConnStr(); ExeSecond = GetExeSecond(); StockGroup = GetStockGroup(); SimType = GetSimType(); flog = new BANG.Common.Log.FileLog("SimulService" + StockGroup, "C:\\Log", BANG.Common.Log.LogFileInteval.DAILY); flog.write(LogType.INFORMATION, "Simulator 시작"); SqlDal sd = new SqlDal(dbConnString); //gStockCodeList = sd.GetStockCode("GROUP"); gStockCodeList = sd.GetStockCode(StockGroup); isHoliday = sd.isHoliday(); EventLog.WriteEntry("SimulatorSVC", "종목수 : " + gStockCodeList.Count.ToString() + Environment.NewLine + string.Format("{0} , {1} , {2}", SimType, ExeSecond, StockGroup)); flog.write(LogType.INFORMATION, "종목수 : " + gStockCodeList.Count.ToString() + Environment.NewLine + string.Format("{0} , {1} , {2}", SimType, ExeSecond, StockGroup)); INSERTTODAYTRADESUMMARY = sd.GetConfigValue("TRADER", "INSERTTODAYTRADESUMMARY"); if (SimType == "ALL" || SimType == "SIGNAL") { myTimerSIGNAL.OnTick += myTimerSIGNAL_OnTick; myTimerSIGNAL.Start(); } if (SimType == "ALL" || SimType == "DATA") { myTimer.OnTick += myTimer_OnTick; myTimer.Start(); } }