mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 18:31:39 +08:00
Merge pull request #1151 from quantopian/broker-order-id
BUG: need `broker_order_id` for downstream code
This commit is contained in:
@@ -41,7 +41,7 @@ class Order(object):
|
||||
# to cut down on the memory footprint of this object.
|
||||
__slots__ = ["id", "dt", "reason", "created", "sid", "amount", "filled",
|
||||
"commission", "_status", "stop", "limit", "stop_reached",
|
||||
"limit_reached", "direction", "type"]
|
||||
"limit_reached", "direction", "type", "broker_order_id"]
|
||||
|
||||
def __init__(self, dt, sid, amount, stop=None, limit=None, filled=0,
|
||||
commission=None, id=None):
|
||||
@@ -78,7 +78,8 @@ class Order(object):
|
||||
def to_dict(self):
|
||||
dct = {name: getattr(self, name)
|
||||
for name in self.__slots__
|
||||
if name not in {'type', 'direction', '_status'}}
|
||||
if name not in {'type', 'direction', '_status',
|
||||
'broker_order_id'}}
|
||||
dct['status'] = self.status
|
||||
return dct
|
||||
|
||||
|
||||
Reference in New Issue
Block a user