public double getDividendYield(SimpleStock ss) { double dividendYield; if (ss.getType().equals("Common")) { dividendYield = ss.getLastDividend() / getPrice(ss); } else { dividendYield = (ss.getFixedDividend() * ss.getParValue()) / getPrice(ss); } return dividendYield; }
public void addTrade(SimpleStock ss, int quantity, String indicator, double price) { Trade trade = new Trade(DateTime.now(), quantity, indicator, price); if (stockTrades.get(ss.getStockSymbol()).size() > 0) { stockTrades.get(ss.getStockSymbol()).add(trade); } else { List<Trade> trades = new ArrayList<Trade>(); trades.add(trade); stockTrades.put(ss.getStockSymbol(), trades); } }
public double getPrice(SimpleStock ss) { List<Trade> listTrades = stockTrades.get(ss.getStockSymbol()); for (Trade tr : listTrades) {} return 0; }
public void addSimpleStock(SimpleStock ss) { simpleStockCollection.put(ss.getStockSymbol(), ss); }