Fixed get_id() bug per Stephen's suggestion. Changed handle_data() back to handle_frame().

This commit is contained in:
Thomas Wiecki
2012-05-15 17:28:59 -04:00
parent 5cf472c5b2
commit 809841d690
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class BuySellAlgorithm():
def set_portfolio(self, portfolio):
self.portfolio = portfolio
def handle_data(self, frame):
def handle_frame(self, frame):
order_size = self.buy_or_sell * (self.amount - (self.offset**2))
self.order(self.sid, order_size)
+8
View File
@@ -98,6 +98,14 @@ class SpecificEquityTrades(TradeDataSource):
def get_type(self):
zp.COMPONENT_TYPE.SOURCE
@property
def get_id(self):
"""
The descriptive name of the component.
"""
# Prevents the bug that Thomas ran into
return "Unique ID"
def do_work(self):
if(len(self.event_list) == 0):