restricted list trading control added.

This commit is contained in:
fawce
2015-02-05 13:56:45 -05:00
parent 4255016747
commit 52f78fcbc7
4 changed files with 61 additions and 0 deletions
+9
View File
@@ -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):
"""