예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }