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

Method set_min_leverage

zipline/algorithm.py:2072–2084  ·  view source on GitHub ↗

Set a limit on the minimum leverage of the algorithm. Parameters ---------- min_leverage : float The minimum leverage for the algorithm. grace_period : pd.Timedelta The offset from the start date used to enforce a minimum leverage.

(self, min_leverage, grace_period)

Source from the content-addressed store, hash-verified

2070
2071 @api_method
2072 def set_min_leverage(self, min_leverage, grace_period):
2073 """Set a limit on the minimum leverage of the algorithm.
2074
2075 Parameters
2076 ----------
2077 min_leverage : float
2078 The minimum leverage for the algorithm.
2079 grace_period : pd.Timedelta
2080 The offset from the start date used to enforce a minimum leverage.
2081 """
2082 deadline = self.sim_params.start_session + grace_period
2083 control = MinLeverage(min_leverage, deadline)
2084 self.register_account_control(control)
2085
2086 ####################
2087 # Trading Controls #

Callers 1

initializeMethod · 0.80

Calls 2

MinLeverageClass · 0.90

Tested by 1

initializeMethod · 0.64