public void testVolatilityBasket() { ForwardTestGenerate f = new ForwardTestGenerate(); f.vanillaCallName = "Basket NAME"; Share[] under = new Share[4]; under[0] = new Share("1A", "ID1"); under[1] = new Share("2A", "ID2"); under[2] = new Share("3A", "ID3"); under[3] = new Share("4A", "ID4"); f.underlyingShares = under; f.weight = new double[4] { 0.25, 0.25, 0.25, 0.25 }; f.endTime = new DateTime(2014, 09, 09); f.startDate = new DateTime(2013, 12, 12); f.strike = 20.0; List <DataFeed> datum = f.generateHistory(); BasketPricingModel vcpm = new BasketPricingModel(); vcpm.oWeights = f.weight; vcpm.oSpot = new double[4] { 10, 10, 10, 10 }; vcpm.currentDate = f.startDate; vcpm.oStrike = 20.0; vcpm.oMaturity = f.endTime; vcpm.oShares = f.underlyingShares; vcpm.oName = f.vanillaCallName; vcpm.calculVolatility(datum); //Console.WriteLine(vcpm.oVolatility); /*for (int i = 0; i < 4; i++) * {*/ //System.Diagnostics.Debug.Assert(vcpm.oVolatility[i] > 0.3 && vcpm.oVolatility[i] < 0.5); Console.WriteLine(vcpm.oVolatility[0]); //} }