MCPcopy Create free account
hub / github.com/quantopian/zipline / set_max_leverage

Method set_max_leverage

zipline/algorithm.py:2059–2069  ·  view source on GitHub ↗

Set a limit on the maximum leverage of the algorithm. Parameters ---------- max_leverage : float The maximum leverage for the algorithm. If not provided there will be no maximum.

(self, max_leverage)

Source from the content-addressed store, hash-verified

2057
2058 @api_method
2059 def set_max_leverage(self, max_leverage):
2060 """Set a limit on the maximum leverage of the algorithm.
2061
2062 Parameters
2063 ----------
2064 max_leverage : float
2065 The maximum leverage for the algorithm. If not provided there will
2066 be no maximum.
2067 """
2068 control = MaxLeverage(max_leverage)
2069 self.register_account_control(control)
2070
2071 @api_method
2072 def set_min_leverage(self, min_leverage, grace_period):

Callers 1

initializeMethod · 0.80

Calls 2

MaxLeverageClass · 0.90

Tested by 1

initializeMethod · 0.64