STY: Prepend order_ to all target methods.

This commit is contained in:
Thomas Wiecki
2013-11-25 11:28:27 -05:00
parent 571e07f89c
commit 9cb9831c08
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -469,7 +469,7 @@ class TradingAlgorithm(object):
value = self.portfolio.portfolio_value * percent
return self.order_value(sid, value, limit_price, stop_price)
def target(self, sid, target, limit_price=None, stop_price=None):
def order_target(self, sid, target, limit_price=None, stop_price=None):
"""
Place an order to adjust a position to a target number of shares. If
the position doesn't already exist, this is equivalent to placing a new
@@ -484,7 +484,7 @@ class TradingAlgorithm(object):
else:
return self.order(sid, target, limit_price, stop_price)
def target_value(self, sid, target, limit_price=None, stop_price=None):
def order_target_value(self, sid, target, limit_price=None, stop_price=None):
"""
Place an order to adjust a position to a target value. If
the position doesn't already exist, this is equivalent to placing a new
@@ -501,7 +501,7 @@ class TradingAlgorithm(object):
else:
return self.order_value(sid, target, limit_price, stop_price)
def target_percent(self, sid, target, limit_price=None, stop_price=None):
def order_target_percent(self, sid, target, limit_price=None, stop_price=None):
"""
Place an order to adjust a position to a target percent of the
current portfolio value. If the position doesn't already exist, this is