public PortfolioTotalStatus[] getPortfolioTotalStatus() {

		Portfolio portfolio = getPortfolio();
		Map<Date, Float> map = new HashMap<>();

		// get stock status from db.
		Stock[] stocks = portfolio.getStocks();
		for (int i = 0; i < stocks.length; i++) {
			Stock stock = stocks[i];

			if (stock != null) {
				List<StockStatus> history = datastoreService.getStockHistory(
						stock.getSymbol(), DAYS_BACK);

				for (int j = 0; j < history.size(); j++) {
					StockStatus curr = history.get(j);
					Date date = dateMidnight(curr.getDate());
					float value = curr.getBid() * curr.getStockQuantity();

					Float total = map.get(date);
					if (total == null) {
						total = value;
					} else {
						total += value;
					}

					map.put(date, value);
				}
			}
		}

		PortfolioTotalStatus[] ret = new PortfolioTotalStatus[map.size()];

		int index = 0;
		// create dto objects
		for (Date date : map.keySet()) {
			ret[index] = new PortfolioTotalStatus(date, map.get(date));
			index++;
		}

		// sort by date ascending.
		Arrays.sort(ret);

		return ret;
	}