コード例 #1
0
        public static void booking2()
        {
            DateTime refDate = DateTime.Now.AddDays(-1);

            RootBookViewModel root_bvm = new RootBookViewModel();

            RootBookViewModel.setRootBookReferenceDate(refDate);

            root_bvm.loadPosition();

            BookViewModel bvm = root_bvm.getBook("deltaHedgeBookCode");

            Make_instrument_structuredBond makeStructuredBond = new Make_instrument_structuredBond();

            DateTime eff      = new DateTime(2014, 10, 11);
            DateTime mat      = new DateTime(2015, 10, 11);
            double   notional = 10000;
            string   curr     = "KRW";
            string   daycount = "KOR";

            DateTime cpn1 = new DateTime(2015, 1, 11);
            DateTime cpn2 = new DateTime(2015, 4, 11);
            DateTime cpn3 = new DateTime(2015, 7, 11);
            DateTime cpn4 = new DateTime(2015, 10, 11);

            makeStructuredBond.makeIssueInfo(eff, mat, notional, curr, daycount);

            List <double> lowerRngList = new List <double>()
            {
                0.0, 0.6
            };
            List <string> referenceUnderCodeList = new List <string>()
            {
                "CD91AAA", "SX5E"
            };
            List <double> upperRngList = new List <double>()
            {
                0.06, 10.0
            };

            double fixedAccRate = 0.055;

            makeStructuredBond.addSingleConditionDualRangAccrualFixedCoupon(eff, cpn1, cpn1, lowerRngList, referenceUnderCodeList, upperRngList, fixedAccRate);
            makeStructuredBond.addSingleConditionDualRangAccrualFixedCoupon(cpn1, cpn2, cpn2, lowerRngList, referenceUnderCodeList, upperRngList, fixedAccRate);
            makeStructuredBond.addSingleConditionDualRangAccrualFixedCoupon(cpn2, cpn3, cpn3, lowerRngList, referenceUnderCodeList, upperRngList, fixedAccRate);
            makeStructuredBond.addSingleConditionDualRangAccrualFixedCoupon(cpn3, cpn4, cpn4, lowerRngList, referenceUnderCodeList, upperRngList, fixedAccRate);

            root_bvm.booking("deltaHedgeBookCode", makeStructuredBond.InstVM_);

            root_bvm.saveXml();
        }
コード例 #2
0
        public string setReferenceDate(DateTime refDate)
        {
            try
            {
                RootBookViewModel.setRootBookReferenceDate(refDate);

                this.root_bvm.loadPosition();

                return("set and position loaded complete.");
            }
            catch (Exception e)
            {
                return("set Reference Fail : " + e.Message);
            }
        }
コード例 #3
0
        private void treeViewTestBtn_Click(object sender, RoutedEventArgs e)
        {
            //System.GC.Collect();

            DataBaseConnectManager.DBConnection_
                = DataBaseConnectManager.ConnectionFactory(EnvironmentVariable.MarketDataDBFile_);

            //EVENT_INFO_Table_DAOManager d = new EVENT_INFO_Table_DAOManager();

            //d.delete(DataBaseConnectManager.DBConnection_);

            ProgramVariable.initialize_CurrencyStringList();

            RootBookViewModel.setRootBookReferenceDate(DateTime.Now);

            BookFolderView bfv = new BookFolderView();

            bfv.ReferenceDate_ = this.loadLastPositionDate();
            bfv.positionXmlReload();

            //RootBookViewModel root_bvm = new RootBookViewModel();

            //root_bvm.loadPosition();

            //RootFavoriteViewModel root_fvm = new RootFavoriteViewModel();

            //root_fvm.loadPosition();

            //bfv.RootBookViewModel_ = root_bvm;
            //bfv.RootFavoriteViewModel_ = root_fvm;

            Window w = new Window();

            w.Width      = 600;
            w.Height     = 400;
            w.Content    = bfv;
            w.Visibility = 0;
        }
コード例 #4
0
        public static void booking()
        {
            DateTime refDate = DateTime.Now.AddDays(-1);

            RootBookViewModel root_bvm = new RootBookViewModel();

            RootBookViewModel.setRootBookReferenceDate(refDate);

            root_bvm.loadPosition();

            BookViewModel bvm = root_bvm.getBook("deltaHedgeBookCode");

            Make_instrument_structuredBond makeStructuredBond = new Make_instrument_structuredBond();

            DateTime eff      = new DateTime(2014, 10, 11);
            DateTime mat      = new DateTime(2015, 10, 11);
            double   notional = 10000;
            string   curr     = "KRW";
            string   daycount = "KOR";

            DateTime cpn1 = new DateTime(2015, 1, 11); double fixedRate = 0.03;
            DateTime cpn2 = new DateTime(2015, 4, 11);
            DateTime cpn3 = new DateTime(2015, 7, 11);
            DateTime cpn4 = new DateTime(2015, 10, 11);


            makeStructuredBond.makeIssueInfo(eff, mat, notional, curr, daycount);

            makeStructuredBond.addFixedCoupon(eff, cpn1, cpn1, fixedRate);
            makeStructuredBond.addFixedCoupon(cpn1, cpn2, cpn2, fixedRate);
            makeStructuredBond.addFixedCoupon(cpn2, cpn3, cpn3, fixedRate);
            makeStructuredBond.addFixedCoupon(cpn3, cpn4, cpn4, fixedRate);

            root_bvm.booking("deltaHedgeBookCode", makeStructuredBond.InstVM_);

            root_bvm.saveXml();
        }
コード例 #5
0
        public static void calculation()
        {
            DateTime refDate = DateTime.Now.AddDays(-1);

            RootBookViewModel root_bvm = new RootBookViewModel();

            RootBookViewModel.setRootBookReferenceDate(refDate);

            root_bvm.loadPosition();

            BookViewModel bvm = root_bvm.getBook("deltaHedgeBookCode");

            CalculationManagerViewModel cmvm = new CalculationManagerViewModel();

            cmvm.setBook(bvm);

            CalculationSetting setting = new CalculationSetting();

            setting.CalculateTypeEnum_ = CalculationSetting.CalculateTypeEnum.Parellel;

            cmvm.CalculationSetting_ = setting;

            cmvm.calculate(refDate);
        }