public void Run(EDoorCenterData centerData) { Trace.Assert(centerData.GetAvailableChannelCount() > 0); _monitorEnter = _monitorEnter.Run(centerData, _data); }
void RebalanceStateTest_RebalanceRun( EDoorEachMonitorEnterController_Accessor each, RebalanceState_Accessor rsa, EDoorCenterData centerData) { //Run실행 후 sweeper, state, availableCount check MonitorState.MonitorDataThisTurn monitorData = EDoorUtil.CreateThisTurnInput(each._data); SetAsDefaultPrice(monitorData); String elwCode = each._data.LiveOrder.Code; double elwReqPrice = each._data.LiveOrder.ReqPrice; double optionPriceOfElwReqPrice = ElwOptionUtil.ConvertToOptionPrice(elwCode, elwReqPrice); RawMarketData rmdElw = monitorData.RmdElw; RawMarketData rmd_2 = monitorData.RmdKoi_2; RawMarketData rmd_3 = monitorData.RmdKoi_3; RawMarketData rmd_4 = monitorData.RmdKoi_4; TickValue tvElw = ProductUtil.Ins().GetTick(rmdElw.Code, elwReqPrice); double oneTickUpElwPrice = elwReqPrice + tvElw.UpTickValue; double oneTickDownElwPrice = elwReqPrice - tvElw.DownTickValue; double optionPriceOfOneTickUpElwReqPrice = ElwOptionUtil.ConvertToOptionPrice(elwCode, oneTickUpElwPrice); TickValue tv = ProductUtil.Ins().GetTick(rmd_3.Code, optionPriceOfOneTickUpElwReqPrice); double oneTickUpOptionPrice = optionPriceOfOneTickUpElwReqPrice + tv.UpTickValue; double oneTickDownOptionPrice = optionPriceOfOneTickUpElwReqPrice - tv.DownTickValue; rmd_3.BidPrice1 = oneTickUpOptionPrice; rmdElw.BidPrice1 = oneTickUpElwPrice; String log = ""; Assert.AreEqual(true, rsa.IsRebalanceCondition(centerData, each._data, monitorData, ref log)); int prevChannel = centerData.GetAvailableChannelCount(); POrder o = each._data.LiveOrder; IEDoorEachMonitorEnterState next = rsa.Run(centerData, each._data, monitorData); Assert.AreEqual(next.GetState(), EDoorEachMonitorEnterState.MonitorState); Assert.AreEqual(prevChannel - 1, centerData.GetAvailableChannelCount()); Assert.AreEqual(true, o.IsCancelRemains()); }
Boolean IsValid(EDoorCenterData centerData) { int availableCount = centerData.GetAvailableChannelCount(); if (availableCount > 0) { return true; } return false; }
void EDoorCenterDataTest(EDoorCenterData centerData) { Assert.AreEqual( centerData.CurEnterCountType, EDoorCenterData.EnterCountType.Ten); // 기본값 2개 Assert.AreEqual(centerData.MaxChannelCount, 2); Assert.AreEqual(centerData.GetAvailableChannelCount(), 2); }