aboutsummaryrefslogtreecommitdiff
path: root/store.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-04 12:59:57 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-04 12:59:57 +0100
commit17598517c544a3dda8b9f773dfeb669c886ea92b (patch)
treeeb02553743f2aa2cdd64e2b1cdd02d3c02d4a6cd /store.py
parent9db7d156833cd384baa64b6148b5c646bfcc41f8 (diff)
downloadTrader-17598517c544a3dda8b9f773dfeb669c886ea92b.tar.gz
Trader-17598517c544a3dda8b9f773dfeb669c886ea92b.tar.zst
Trader-17598517c544a3dda8b9f773dfeb669c886ea92b.zip
Add close trades action
Diffstat (limited to 'store.py')
-rw-r--r--store.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/store.py b/store.py
index 43fee03..d9038b7 100644
--- a/store.py
+++ b/store.py
@@ -234,7 +234,7 @@ class TradeStore:
234 234
235 @property 235 @property
236 def pending(self): 236 def pending(self):
237 return list(filter(lambda t: not t.is_fullfiled, self.all)) 237 return list(filter(lambda t: t.pending, self.all))
238 238
239 def compute_trades(self, values_in_base, new_repartition, only=None): 239 def compute_trades(self, values_in_base, new_repartition, only=None):
240 computed_trades = [] 240 computed_trades = []
@@ -275,6 +275,10 @@ class TradeStore:
275 orders.append(trade.prepare_order(compute_value=compute_value)) 275 orders.append(trade.prepare_order(compute_value=compute_value))
276 self.market.report.log_orders(orders, only, compute_value) 276 self.market.report.log_orders(orders, only, compute_value)
277 277
278 def close_trades(self):
279 for trade in self.all:
280 trade.close()
281
278 def print_all_with_order(self, ind=""): 282 def print_all_with_order(self, ind=""):
279 for trade in self.all: 283 for trade in self.all:
280 trade.print_with_order(ind=ind) 284 trade.print_with_order(ind=ind)