Example #1
0
        public void testGetCotation()
        {
            DataGestion dg   = new DataGestion();
            DateTime    date = new DateTime(2010, 1, 1);
            double      d    = dg.getCotation("AC FP", date);

            Console.WriteLine(d);
        }
Example #2
0
        public void testTailleTableauCotation()
        {
            DataGestion dataConn = new DataGestion();

            double[] tabCote = dataConn.getCotation("CA FP", 10);
            if (tabCote.Length != 10)
            {
                throw new ArgumentOutOfRangeException("le tableau de cotation n'a pas la bonne taille");
            }
            Debug.Assert(tabCote.Length == 10);
        }
Example #3
0
        public void testValeurTableauCotation()
        {
            DataGestion dataConn = new DataGestion();

            double[] tabCote = dataConn.getCotation("CA FP", 10);
            if (tabCote[0] != 29.4250 ||
                tabCote[1] != 29.5050 ||
                tabCote[2] != 30.2000 ||
                tabCote[3] != 30.2800)
            {
                throw new ArgumentOutOfRangeException("une des valeurs n'est pas bonne dans le tableau de  cotation");
            }
        }
Example #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);
            }
        }