def should_trade(strategy, date, previous_trade_date):
    """Determines whether a trade is happening for the strategy."""

    # We invest the whole value, so we can only trade once a day.
    if (previous_trade_date and
        previous_trade_date.replace(hour=0, minute=0, second=0) ==
            date.replace(hour=0, minute=0, second=0)):
        return False

    # The strategy needs to be active.
    if strategy["action"] == "hold":
        return False

    # We need to know the stock price.
    if not strategy["price_at"] or not strategy["price_eod"]:
        return False

    return True