예제 #1
0
        public void testVolatility()
        {
            DataGestion             dg   = new DataGestion();
            VanillaCallPricingModel vcpm = new VanillaCallPricingModel();
            Share share = new Share("ACCOR SA", "AC FP     ");

            vcpm.oShares    = new Share[1];
            vcpm.oShares[0] = share;
            List <DataFeed> ldf = dg.getListDataField(new DateTime(2013, 10, 10), new DateTime(2014, 10, 10), vcpm.oShares);

            vcpm.calculVolatility(ldf);
        }
예제 #2
0
        public void TestMethod1()
        {
            BasketPricingModel bpm = new BasketPricingModel();

            bpm.oMaturity = new DateTime(2015, 8, 20);
            bpm.oName     = "test";
            Share share = new Share("ACCOR SA", "AC FP     ");

            bpm.oShares    = new Share[1];
            bpm.oShares[0] = share;
            bpm.oStrike    = 45.5;
            DataGestion     dg   = new DataGestion();
            DateTime        date = new DateTime(2013, 8, 21);
            List <DataFeed> ldf  = dg.getListDataField(date, bpm.oMaturity, bpm.oShares);
            PricingResults  pR   = bpm.getPayOff(ldf);

            Console.WriteLine(pR.Price);
        }
예제 #3
0
        public void TestMethod1()
        {
            VanillaCallPricingModel vcpm = new VanillaCallPricingModel();

            vcpm.oMaturity = new DateTime(2015, 8, 20);
            vcpm.oName     = "test";
            Share share = new Share("ACCOR SA", "AC FP     ");

            vcpm.oShares    = new Share[1];
            vcpm.oShares[0] = share;
            vcpm.oStrike    = 45.5;
            vcpm.oSpot      = new double[1];
            vcpm.oSpot[0]   = 48;
            DataGestion     dg   = new DataGestion();
            DateTime        date = new DateTime(2013, 8, 20);
            List <DataFeed> ldf  = dg.getListDataField(date, vcpm.oMaturity, vcpm.oShares);
            PricingResults  pR   = vcpm.getPayOff(ldf);

            Console.WriteLine(pR.Price);
        }
예제 #4
0
        public void TestMethod2()
        {
            DataGestion             dg   = new DataGestion();
            VanillaCallPricingModel vcpm = new VanillaCallPricingModel();

            vcpm.oMaturity = new DateTime(2015, 8, 20);
            vcpm.oName     = "test";
            Share share = new Share("ACCOR SA", "AC FP     ");

            vcpm.oShares    = new Share[1];
            vcpm.oShares[0] = share;
            vcpm.oStrike    = 10;
            vcpm.oSpot      = new double[1];
            DateTime date = new DateTime(2015, 1, 12);

            vcpm.oSpot[0] = dg.getCotation("AC FP", date);
            List <DataFeed>       ldf = dg.getListDataField(date, vcpm.oMaturity, vcpm.oShares);
            List <PricingResults> LpR = vcpm.pricingUntilMaturity(ldf);

            foreach (PricingResults pr in LpR)
            {
                Console.WriteLine(pr.Price);
            }
        }
예제 #5
0
        /**
         * Transmet la liste des dataFeed venant de la base de données
         * en précisant certains paramètres passés comme attributs de la classe
         *
         * */
        public List <DataFeed> generateHistory()
        {
            DataGestion dg = new DataGestion();

            return(dg.getListDataField(startDate, endTime, underlyingShares));
        }