mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-21 12:30:16 +08:00
Fixed get_id() bug per Stephen's suggestion. Changed handle_data() back to handle_frame().
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user