예제 #1
0
        void RunMixUp()
        {
            SimInputData input = new SimInputData();
            input.ReadStartDate = new DateTime(1990, 1, 1);
            input.StartDate = new DateTime(2001, 1, 1);
            input.EndDate = new DateTime(2011, 5, 1);
            //input.EndDate = DateTime.Now;
            input.InitInvestAmount = (long)100 * 100000000;

            DefaultStrategy strategy = new DefaultStrategy("", input);
            strategy.SetBaseAlloc(new StaticAlloc("SA", 0.33, 0.33, 0.34));
            strategy.Build();

            DollarPriceAdjustment dollarPriceAdj = new DollarPriceAdjustment(0.9);
            KrxCreditDepositRateAdjustment cdAdj = new KrxCreditDepositRateAdjustment(new CreditPolicyWithMA(1.5));
            KrxCreditDepositRateAdjustment cdAdj2 = new KrxCreditDepositRateAdjustment(new CreditPolicyWithUpDownMA(1.5));
            MaeKoVolAdjustment maeAdj = new MaeKoVolAdjustment(1.2);
            MaeBokRateAdjustment maeBokRateAdj = new MaeBokRateAdjustment(new BokRatePolicy_Static(), 1.0);
            MacroAA_Adjustment macroAA_Adj = new MacroAA_Adjustment();

            strategy.AddAdjustment(cdAdj2, "CD2");
            strategy.AddAdjustment(maeAdj, "MaeKoVol");
            strategy.AddAdjustment(maeBokRateAdj, "MaeBokRate");
            strategy.AddAdjustment(macroAA_Adj, "MacroAA");

            ExcelAdjustment deltaVol_Adj = new ExcelAdjustment("DeltaVolEqIrAdj_result.xlsx", "Sheet1", 1.5);
            strategy.AddAdjustment(deltaVol_Adj, "DeltaVolEqIr");

            //ExcelAdj deltaVolBase_Adj = new ExcelAdj("DeltaVolBaseEqIrAdj_result.xlsx", "Sheet1", 1.5);
            //strategy.AddAdjustment(deltaVolBase_Adj, "DeltaVolBaseEqIr");

            //ExcelAdj deltaVolAggr_Adj = new ExcelAdj("DeltaVolEqIrAggrAdj_result.xlsx", "Sheet1", 1.0);
            //strategy.AddAdjustment(deltaVolAggr_Adj, "DeltaVolEqIrAggr");

            //ExcelAdj deltaVolBaseAggr_Adj = new ExcelAdj("DeltaVolBaseEqIrAggrAdj_result.xlsx", "Sheet1", 1.5);
            //strategy.AddAdjustment(deltaVolBaseAggr_Adj, "DeltaVolBaseEqIrAggr");

            List<IResultHandler> resultHandlers = new List<IResultHandler>();
            //resultHandlers.Add(new CsvOutHandler());
            resultHandlers.Add(this);

            Experiment experiment = new Experiment(strategy, resultHandlers);
            experiment.Run();
        }
예제 #2
0
        void RunDefaultStrategyExperiment()
        {
            SimInputData input = new SimInputData();
            input.StartDate = new DateTime(2001, 1, 1);
            input.EndDate = DateTime.Now;
            input.InitInvestAmount = 1000000000;
            IStrategy strategy = new DefaultStrategy("Default", input);
            strategy.Build();

            List<IResultHandler> resultHandlers = new List<IResultHandler>();
            //resultHandlers.Add(new CsvOutHandler());
            resultHandlers.Add(this);

            Experiment experiment = new Experiment(strategy, resultHandlers);
            experiment.Run();
        }