mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-12 11:50:11 +08:00
restricted list trading control added.
This commit is contained in:
@@ -48,6 +48,7 @@ from zipline.finance.controls import (
|
||||
MaxOrderCount,
|
||||
MaxOrderSize,
|
||||
MaxPositionSize,
|
||||
RestrictedListOrder
|
||||
)
|
||||
from zipline.finance.execution import (
|
||||
LimitOrder,
|
||||
@@ -1080,6 +1081,14 @@ class TradingAlgorithm(object):
|
||||
control = MaxOrderCount(max_count)
|
||||
self.register_trading_control(control)
|
||||
|
||||
@api_method
|
||||
def set_do_not_order_list(self, restricted_list):
|
||||
"""
|
||||
Set a restriction on which sids can be ordered.
|
||||
"""
|
||||
control = RestrictedListOrder(restricted_list)
|
||||
self.register_trading_control(control)
|
||||
|
||||
@api_method
|
||||
def set_long_only(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user