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

Method set_long_only

zipline/algorithm.py:2227–2231  ·  view source on GitHub ↗

Set a rule specifying that this algorithm cannot take short positions.

(self, on_error='fail')

Source from the content-addressed store, hash-verified

2225
2226 @api_method
2227 def set_long_only(self, on_error='fail'):
2228 """Set a rule specifying that this algorithm cannot take short
2229 positions.
2230 """
2231 self.register_trading_control(LongOnly(on_error))
2232
2233 ##############
2234 # Pipeline API

Callers 2

initializeMethod · 0.80
handle_dataMethod · 0.80

Calls 2

LongOnlyClass · 0.90

Tested by 2

initializeMethod · 0.64
handle_dataMethod · 0.64