public static void getStockFromYahoo(String stockName, Date startDate,
				Date endDate, List<Double> prices) throws IOException, ParseException {
			Calendar calendar = Calendar.getInstance();
			calendar.setTime(startDate);
			int startDay = calendar.get(Calendar.DAY_OF_MONTH);
			int startMonth = calendar.get(Calendar.MONTH);
			int startYear = calendar.get(Calendar.YEAR);
			calendar.setTime(endDate);
			int endDay = calendar.get(Calendar.DAY_OF_MONTH);
			int endMonth = calendar.get(Calendar.MONTH);
			int endYear = calendar.get(Calendar.YEAR);
			
			File directorty = new File("stock_data");
			if (!directorty.exists()) {
				directorty.mkdir();
			}

			String url = getYahooStockUrl(stockName, startDay, startMonth,
					startYear, endDay, endMonth, endYear);
			String fileName = getFileName(stockName, startDay, startMonth, startYear, endDay, endMonth, endYear);
			File f = new File(fileName);
			if (f.exists()) {
				System.out.println("File " + fileName + " already exists");
				setMarketFeed(f, prices, null, DataSource.YAHOO);
				return;
			}
			BufferedInputStream inputStream = null;
			FileOutputStream outputStream = null;

			try {
				inputStream = new BufferedInputStream(new URL(url).openStream());
				outputStream = new FileOutputStream(f);
				byte data[] = new byte[1024];
				int count;
				while ((count = inputStream.read(data)) != -1) {
					outputStream.write(data, 0, count);
				}
			} catch (MalformedURLException e) {
				// simply ignore
				return;
			} catch (IOException e) {
				// ignore
				System.out.println("For this period stock data for " + stockName + " could not be find");
				return;
			} finally {
				if (inputStream != null) {
					try {
						inputStream.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				if (outputStream != null) {
					try {
						outputStream.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}

			System.out.println("Downloaded data for " + stockName);
			setMarketFeed(f, prices, null, DataSource.YAHOO);
		}