class_docstr: TradingControl representing a prohibition against holding short positions.
class_docstr_tok: ["TradingControl","representing","a","prohibition","against","holding","short","positions","."]
docstr: Fail if we would hold negative shares of asset after completing this
  order.
docstr_tok: ["Fail","if","we","would","hold","negative","shares","of","asset","after","completing","this","order","."]
code: def validate(
      self, asset, amount, portfolio, algo_datetime, algo_current_data
  ):
      """
      Fail if we would hold negative shares of asset after completing this
      order.
      """
      if portfolio.positions[asset].amount + amount < 0:
          self.handle_violation(asset, amount, algo_datetime)
  
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 LongOnly obj's underlying member method code with example usage: obj.validate(asset, amount, portfolio, algo_datetime, algo_current_data) without return types