static void InitBondArbNodeInputs(STR_Arb strategy, STR_ArbInput input, ref _InnerObjectsForUnittest innerData) { StrategyNode node = new StrategyNode(); innerData.BondArbNode = node; node.InitRoot_1(strategy); innerData.BondArbNodeEnterLimit = new EnterConditionLimit( Util.ConvertFormatStringToInt64(input.BondArb_MaxLiveSweepCount), Util.ConvertFormatStringToInt64(input.BondArb_MaxNewSweepCount)); node.InitEnterLimit_2(innerData.BondArbNodeEnterLimit); DateTime dtStart = DateUtil.GetTodayDateTime(9 + Const.kHourAdjustment_Start, 0, 0); DateTime dtEnd = DateUtil.GetTodayDateTime(12 + 2 + Const.kHourAdjustment_End, 37, 00); innerData.BondArbNodeMonitorLimit = new MonitorLimit_Time(dtStart, dtEnd); node.InitMonitorTimeLimit_3(innerData.BondArbNodeMonitorLimit); SweeperCollectionDefault sweeperCollection = new SweeperCollectionDefault(); innerData.BondArbSweeperLeaf = sweeperCollection; node.InitSweeperCollection_4(sweeperCollection); innerData.BondArb_MonitorEnter = new MonitorEnter_BondArb(node); node.InitMonitorEnter_5(innerData.BondArb_MonitorEnter); strategy.AddNode(node, STR_Arb.NodeType.BondArb); }
static void InitNodeInputs(STR_Test_PB_Fut_HTS strategy, STR_Test_PB_HTSInput input) { SweeperCollectionDefault sweeperLeaf = new SweeperCollectionDefault(); StrategyNode node = new StrategyNode(); node.InitRoot_1(strategy); node.InitEnterLimit_2(new EnterConditionLimit( Util.ConvertFormatStringToInt64(input.Root_MaxLiveSweepCount), Util.ConvertFormatStringToInt64(input.Root_MaxNewSweepCount))); DateTime dtStart = DateUtil.GetTodayDateTime(9 + Const.kHourAdjustment_Start, 0, 0); DateTime dtEnd = DateUtil.GetTodayDateTime(12 + 3 + Const.kHourAdjustment_End, 4, 30); if (KospiFutureUtil.Ins().GetFutureMaturityRemainDays(DateTime.Now) == 0) { // 만기일에는 오후 2시 45분 30초까지만 하도록 한다. dtEnd = DateUtil.GetTodayDateTime(12 + 2 + Const.kHourAdjustment_End, 45, 30); } node.InitMonitorTimeLimit_3(new MonitorLimit_Time(dtStart, dtEnd)); node.InitSweeperCollection_4(new SweeperCollectionDefault()); node.InitMonitorEnter_5(new Test_PB_HTS_MonitorEnter(node)); strategy.AddNode(node); }
public MonitorEnter_BondArb(StrategyNode node) { this._node = node; STR_Arb root = node.Root as STR_Arb; this._bondAccount = root.BondAccount; }
public Test_PB_HTS_MonitorEnter(StrategyNode node) { this.IsPermissionOK = false; this._node = node; this._monitorLimit = new MonitorLimit_LastUpdatedRmd(); String fut1 = KospiFutureUtil.Ins().KFSI.FutureCode1; _referenceRmdFut1 = RmdManager.Ins().GetData(fut1); _referenceRmdFut1List = new List<RawMarketData>(); _referenceRmdFut1List.Add(_referenceRmdFut1); _root = node.Root as STR_Test_PB_Fut_HTS; _futureAccount = _root.FutureAccount; }
public MonitorEnter_CalFut( StrategyNode node, Detail.ProductType pt, String fut1, String spread, String fut2, ForwardBackward fb) { this._node = node; IMarketDataBoard board = null; switch (pt) { case Detail.ProductType.KospiFuture: board = RmdManager.Ins().KospiFuture; break; case Detail.ProductType.UsdFuture: board = RmdManager.Ins().Future; break; case Detail.ProductType.KtbFuture: board = RmdManager.Ins().Future; break; default: String errorMsg = String.Format("{0} is not valid type", pt); logger.Error(errorMsg); Util.KillWithNotice(errorMsg); break; } _refRmdFut1 = board.GetData(fut1); _refRmdSpread = board.GetData(spread); _refRmdFut2 = board.GetData(fut2); _referenceRmds.Add(_refRmdFut1); _referenceRmds.Add(_refRmdSpread); _referenceRmds.Add(_refRmdFut2); STR_Arb root = node.Root as STR_Arb; _futureAccount = root.FutureAccount; }
static void InitCalFutNodeInputs(STR_Arb strategy, STR_ArbInput input, ref _InnerObjectsForUnittest innerData) { StrategyNode node = new StrategyNode(); innerData.CalFutNode = node; node.InitRoot_1(strategy); innerData.CalFutNodeEnterLimit = new EnterConditionLimit( Util.ConvertFormatStringToInt64(input.CalFut_MaxLiveSweepCount), Util.ConvertFormatStringToInt64(input.CalFut_MaxNewSweepCount)); node.InitEnterLimit_2(innerData.CalFutNodeEnterLimit); DateTime dtStart = DateUtil.GetTodayDateTime(9 + Const.kHourAdjustment_Start, 0, 0); DateTime dtEnd = DateUtil.GetTodayDateTime(12 + 3 + Const.kHourAdjustment_End, 4, 00); innerData.CalFutNodeMonitorLimit = new MonitorLimit_Time(dtStart, dtEnd); node.InitMonitorTimeLimit_3(innerData.CalFutNodeMonitorLimit); SweeperCollectionDefault sweeperCollection = new SweeperCollectionDefault(); innerData.CalFutSweeperLeaf = sweeperCollection; node.InitSweeperCollection_4(sweeperCollection); innerData.CalFut_MonitorEnter = new MonitorEnter_CalFut( node, Detail.ProductType.KospiFuture, KospiFutureUtil.Ins().KFSI.FutureCode1, KospiFutureUtil.Ins().KFSI.Code, KospiFutureUtil.Ins().KFSI.FutureCode2, MonitorEnter_CalFut.ForwardBackward.Forward); node.InitMonitorEnter_5(innerData.CalFut_MonitorEnter); strategy.AddNode(node, STR_Arb.NodeType.CalFut); }