Esempio n. 1
0
        void RunTemp()
        {
            StrategyBaseInput input = new StrategyBaseInput();
            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(0.33, 0.33, 0.34));
            strategy.Build();

            DollarPriceAdj dollarPriceAdj = new DollarPriceAdj(0.9);
            KrxCreditDepositRateAdjustment cdAdj = new KrxCreditDepositRateAdjustment(new CreditPolicyWithMA(1.5));
            KrxCreditDepositRateAdjustment cdAdj2 = new KrxCreditDepositRateAdjustment(new CreditPolicyWithUpDownMA(1.5));
            MaeKoVolAdj maeAdj = new MaeKoVolAdj(1.2);
            MaeBokRateAdj maeBokRateAdj = new MaeBokRateAdj(new BokRatePolicy_Static(), 1.0);
            MacroAA_Adj macroAA_Adj = new MacroAA_Adj();
            ExcelAdj excelAdj = new ExcelAdj("data\\LinMacEquityAdj.xlsx", "Sheet1", 0.8);
            //ExcelAdj excelAdj = new ExcelAdj("LinMacEquityAdj.xlsx", "LinMacEquityAdj_result");

            //strategy.AddAdjustment(dollarPriceAdj, "DP");
            ////strategy.AddAdjustment(cdAdj, "CD1");
            strategy.AddAdjustment(cdAdj2, "CD2");
            strategy.AddAdjustment(maeAdj, "MaeKoVol");
            strategy.AddAdjustment(maeBokRateAdj, "MaeBokRate");
            strategy.AddAdjustment(macroAA_Adj, "MacroAA");
            strategy.AddAdjustment(excelAdj, "LinMacEquityAdj");

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

            Experiment experiment = new Experiment(strategy, resultHandlers);
            experiment.Run();
        }
Esempio n. 2
0
        void RunDefaultStrategyExperiment()
        {
            StrategyBaseInput input = new StrategyBaseInput();
            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();
        }