if isinstance(obj, (datetime, date)):
return obj.isoformat()
return str(obj)
- return json.dumps(self.logs, default=default_json_serial)
+ return json.dumps(self.logs, default=default_json_serial, indent=" ")
def set_verbose(self, verbose_print):
self.verbose_print = verbose_print
@property
def pending(self):
- return list(filter(lambda t: not t.is_fullfiled, self.all))
+ return list(filter(lambda t: t.pending, self.all))
def compute_trades(self, values_in_base, new_repartition, only=None):
computed_trades = []
orders.append(trade.prepare_order(compute_value=compute_value))
self.market.report.log_orders(orders, only, compute_value)
+ def close_trades(self):
+ for trade in self.all:
+ trade.close()
+
def print_all_with_order(self, ind=""):
for trade in self.all:
trade.print_with_order(ind=ind)