From d1968429f1be627c3c876fe7fdfa56bf72f22293 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 12 Jun 2013 10:10:09 -0400 Subject: [PATCH] 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. --- zipline/finance/blotter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zipline/finance/blotter.py b/zipline/finance/blotter.py index c3ad52d3..6f4bcfd2 100644 --- a/zipline/finance/blotter.py +++ b/zipline/finance/blotter.py @@ -261,3 +261,7 @@ class Order(object): return False return True + + @property + def open_amount(self): + return self.amount - self.filled