예제 #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 InitRootInputs(STR_Arb strategy, STR_ArbInput input, ref _InnerObjectsForUnittest innerData)
        {
            TossClientSession.Ins().StartReadSession();

            // 1.2. Account
            strategy.InitAccount_1(input.Root_BondAccountName, input.Root_FutureAccountName);

            // 1.3. Agent
            strategy.InitAgent_2();

            strategy.InitDefaultBondOrderLimit_3_1(input.BondArb_MaxNotionalPerOnce);
            strategy.InitEmptyRMDBondOrderLimit_3_2(input.BondArb_MaxNotionalPerOnce);
            strategy.InitDefaultFutureOrderLimit_3_3(input.Future_MaxCountPerOnce);

            // 1.5. EnterLimit
            strategy.InitEnterLimit_4(input.Root_MaxLiveSweepCount, input.Root_MaxNewSweepCount);

            // 1.6. MonitorLimit
            strategy.InitMonitorLimitWithMarketDataAccount_5();
        }
예제 #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);
        }