mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 08:51:59 +08:00
ENH: Add a convenience property for open amount of a blotter.Order
Found that when implementing different slippage model, needed the open amount in several places/functions, having the open amount as a property of an order should help reduce the need for passing that around and maintaining the value separately.
This commit is contained in:
@@ -261,3 +261,7 @@ class Order(object):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@property
|
||||
def open_amount(self):
|
||||
return self.amount - self.filled
|
||||
|
||||
Reference in New Issue
Block a user