Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public static String GetInputTemplate()
 {
     STR_Test_PB_HTSInput input = new STR_Test_PB_HTSInput();
     Serializer serializer = new Serializer(typeof(STR_Test_PB_HTSInput));
     String jsonText = serializer.Serialize(input);
     return jsonText;
 }
Ejemplo n.º 3
0
        static void InitRootInputs(STR_Test_PB_Fut_HTS strategy, STR_Test_PB_HTSInput input)
        {
            // 1.2. Account
            strategy.InitAccount_1(input.Root_FutureAccountName);

            // 1.3. Agent
            strategy.InitAgent_2();

            // 1.4. OrderLimit
            strategy.InitFutureOrderLimit_3(input.Root_MaxFutureNotionalPerOnce);

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

            // 1.6. MonitorLimit
            strategy.InitMonitorLimitWithMarketDataAccount_7();

            // 1.7. Validate init
            strategy.ValidateInits_8();
        }