class_docstr: AccountControl representing a limit on the maximum leverage allowed
  by the algorithm.
class_docstr_tok: ["AccountControl","representing","a","limit","on","the","maximum","leverage","allowed","by","the","algorithm","."]
docstr: max_leverage is the gross leverage in decimal form. For example,
  2, limits an algorithm to trading at most double the account value.
docstr_tok: ["max_leverage","is","the","gross","leverage","in","decimal","form",".","For","example",",","2",",","limits","an","algorithm","to","trading","at","most","double","the","account","value","."]
code: def __init__(self, max_leverage):
      """
      max_leverage is the gross leverage in decimal form. For example,
      2, limits an algorithm to trading at most double the account value.
      """
      super(MaxLeverage, self).__init__(max_leverage=max_leverage)
      self.max_leverage = max_leverage
  
      if max_leverage is None:
          raise ValueError("Must supply max_leverage")
  
      if max_leverage < 0:
          raise ValueError("max_leverage must be positive")
  
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 1 to create a new MaxLeverage object from inherited base classes: AccountControl with example: obj = MaxLeverage(max_leverage)