Esempio n. 1
0
        void RunKrxCreditDepositRateOptimizerExperiment()
        {
            SimInputData input = new SimInputData();
            //input.StartDate = new DateTime(2001, 1, 1);
            input.StartDate = new DateTime(2006, 1, 1);
            input.EndDate = new DateTime(2011, 5, 1);
            input.EndDate = DateTime.Now;
            input.InitInvestAmount = 1000000000;
            GeneralOptimizer strategy = new GeneralOptimizer("KrxCreditDepositRateOptimizer", input);
            strategy.Build();

            for (int i = 0; i < 20; ++i)
            {
                double weight = 0.5 + 0.1 * (double)i;
                strategy.AddAdjustment(new KrxCreditDepositRateAdjustment(new CreditPolicyStatic(weight)),
                    String.Format("Static ({0:n2})", weight));
                strategy.AddAdjustment(new KrxCreditDepositRateAdjustment(new CreditPolicyWithMA(weight)),
                    String.Format("MA ({0:n2})", weight));
            }

            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 RunOptimization()
        {
            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 = 1000000000; // 100억
            GeneralOptimizer strategy = new GeneralOptimizer("", input);
            strategy.Build();

            for (int i = 0; i < 40; ++i)
            {
                double kospiWeight = 1 + 0.1 * i;

                //const String kAdjName = "DeltaVolEqIrAdj_result";
                //const String kAdjName = "DeltaVolBaseEqIrAdj_result";
                const String kAdjName = "DeltaVolEqIrAggrAdj_result";
                //const String kAdjName = "DeltaVolBaseEqIrAggrAdj_result";

                ExcelAdjustment adj = new ExcelAdjustment(
                    String.Format("{0}.xlsx", kAdjName), "Sheet1", kospiWeight);
                strategy.AddAdjustment(adj, String.Format("kAdjName ({0:n2})", kospiWeight));

            }

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

            Experiment experiment = new Experiment(strategy, resultHandlers);
            experiment.Run();
        }
Esempio n. 3
0
        void RunDollarPriceAdjExperiment()
        {
            SimInputData input = new SimInputData();
            input.StartDate = new DateTime(2001, 1, 1);
            //input.StartDate = new DateTime(2006, 1, 1);
            input.EndDate = new DateTime(2011, 5, 1);
            input.EndDate = DateTime.Now;
            input.InitInvestAmount = 1000000000;
            GeneralOptimizer strategy = new GeneralOptimizer("DollarPriceOptimizer", input);
            strategy.Build();

            for (int i = 0; i < 20; ++i)
            {
                double weight = 0.5 + 0.1 * (double)i;
                //double weight = i;
                strategy.AddAdjustment(new DollarPriceAdjustment(weight), String.Format("{0:n2}", weight));
            }

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

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