Ejemplo n.º 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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
            }
        }