class_docstr: TradingControl representing a limit on the number of orders that can be
  placed in a given trading day.
class_docstr_tok: ["TradingControl","representing","a","limit","on","the","number","of","orders","that","can","be","placed","in","a","given","trading","day","."]
docstr: Fail if we've already placed self.max_count orders today.
docstr_tok: ["Fail","if","we","'ve","already","placed","self.max_count","orders","today","."]
code: def validate(
      self, asset, amount, portfolio, algo_datetime, algo_current_data
  ):
      """
      Fail if we've already placed self.max_count orders today.
      """
      algo_date = algo_datetime.date()
  
      # Reset order count if it's a new day.
      if self.current_date and self.current_date != algo_date:
          self.orders_placed = 0
      self.current_date = algo_date
  
      if self.orders_placed >= self.max_count:
          self.handle_violation(asset, amount, algo_datetime)
      self.orders_placed += 1
  
imports: import abc
  import logbook
  import pandas
  from six import with_metaclass
  from catalyst.errors import AccountControlViolation, TradingControlViolation
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 2 for calling the MaxOrderCount obj's underlying member method code with example usage: obj.validate(asset, amount, portfolio, algo_datetime, algo_current_data) without return types