@Override
	public ArrayList<Trade> placeTrade(int currentRound,
			ArrayList<EconomicIndicator> indicators, ArrayList<Stock> stocks,
			Portfolio portfolioCopy) {
		
		ArrayList<Trade> toBePlaced = new ArrayList<Trade> ();		
		ArrayList<Stock> toBeBought = new ArrayList<Stock> ();
		double pendingTransactionFees = 0;
		
		//If last round, liquidate that shit
		if(currentRound == Market.getMaxRounds()) {
			toBePlaced.clear();
			for(Stock s: portfolioCopy.getAllStocks()) {
				toBePlaced.add(new Trade(Trade.SELL, s, portfolioCopy.getSharesOwned(s)));
			}
			return toBePlaced;
		}
		
		//If we forecast price going up by more than 2*transaction cost, buy
		for(Stock s: stocks) {
			Object[] current = regressions.get(s.getName());
			double forecastedPrice = (Double) current[0]; //intercept
			for(int i = 1; i < current.length; i++) {
				forecastedPrice += ((Double) current[i]) * indicators.get(i-1).currentValue();
			}
			
			if((forecastedPrice - s.currentPrice()) > (Market.getTransactionFee()*2)) {
				toBeBought.add(s);
			}
		}
		
		for(Stock s: portfolioCopy.getAllStocks()) {
			if(!toBeBought.contains(s)) {
				toBePlaced.add(new Trade(Trade.SELL, s, portfolioCopy.getSharesOwned(s)));
				pendingTransactionFees += Market.getTransactionFee();
			}
		}
		
		double availableCapital = portfolioCopy.getMonetaryValue() - pendingTransactionFees;
		availableCapital -= Market.getTransactionFee() * toBeBought.size();
		double capitalPerStock = availableCapital/toBeBought.size();
		
		for(Stock s: toBeBought) {
			if(!portfolioCopy.getAllStocks().contains(s)) {
				availableCapital -= Market.getTransactionFee();
				toBePlaced.add(new Trade(Trade.BUY, s, (int) Math.floor(capitalPerStock/s.currentPrice())));
			}
		}
		
		return toBePlaced;
	}