+ if self.exchange_total > 0:
+ if self.exchange_free > 0 and self.exchange_used > 0:
+ exchange = " Exch: [✔{} + ❌{} = {}]".format(str(self.exchange_free), str(self.exchange_used), str(self.exchange_total))
+ elif self.exchange_free > 0:
+ exchange = " Exch: [✔{}]".format(str(self.exchange_free))
+ else:
+ exchange = " Exch: [❌{}]".format(str(self.exchange_used))
+ else:
+ exchange = ""
+
+ if self.margin_total > 0:
+ if self.margin_free != 0 and self.margin_borrowed != 0:
+ margin = " Margin: [✔{} + borrowed {} = {}]".format(str(self.margin_free), str(self.margin_borrowed), str(self.margin_total))
+ elif self.margin_free != 0:
+ margin = " Margin: [✔{}]".format(str(self.margin_free))
+ else:
+ margin = " Margin: [borrowed {}]".format(str(self.margin_borrowed))
+ elif self.margin_total < 0:
+ margin = " Margin: [{} @@ {}/{}]".format(str(self.margin_total),
+ str(self.margin_borrowed_base_price),
+ str(self.margin_lending_fees))
+ else:
+ margin = ""
+
+ if self.margin_total != 0 and self.exchange_total != 0:
+ total = " Total: [{}]".format(str(self.total))
+ else:
+ total = ""
+
+ return "Balance({}".format(self.currency) + "".join([exchange, margin, total]) + ")"