class_docstr: TradingControl representing a limit on the magnitude of any single order
  placed with the given asset.  Can be specified by share or by dollar
  value.
class_docstr_tok: ["TradingControl","representing","a","limit","on","the","magnitude","of","any","single","order","placed","with","the","given","asset",".","Can","be","specified","by","share","or","by","dollar","value","."]
code: def __init__(
      self, on_error, asset=None, max_shares=None, max_notional=None
  ):
      super(MaxOrderSize, self).__init__(
          on_error,
          asset=asset,
          max_shares=max_shares,
          max_notional=max_notional,
      )
      self.asset = asset
      self.max_shares = max_shares
      self.max_notional = max_notional
  
      if max_shares is None and max_notional is None:
          raise ValueError(
              "Must supply at least one of max_shares and max_notional"
          )
  
      if max_shares and max_shares < 0:
          raise ValueError("max_shares cannot be negative.")
  
      if max_notional and max_notional < 0:
          raise ValueError("max_notional must be positive.")
  
imports: import abc
  import logbook
  from datetime import datetime
  import pandas
  from six import with_metaclass
  from zipline.errors import AccountControlViolation, TradingControlViolation
  from zipline.utils.input_validation import expect_bounded, expect_types
label_desc: Use image node_id 1 to create a new MaxOrderSize object from inherited base classes: TradingControl with example: obj = MaxOrderSize(on_error, asset, max_shares, max_notional)