})
@classmethod
- def log_balances(cls, market):
+ def log_balances(cls, market, tag=None):
cls.print_log("[Balance]")
for currency, balance in BalanceStore.all.items():
cls.print_log("\t{}".format(balance))
cls.add_log({
"type": "balance",
+ "tag": tag,
"balances": BalanceStore.as_json()
})
return amounts
@classmethod
- def fetch_balances(cls, market):
+ def fetch_balances(cls, market, tag=None):
all_balances = market.fetch_all_balances()
for currency, balance in all_balances.items():
if balance["exchange_total"] != 0 or balance["margin_total"] != 0 or \
currency in cls.all:
cls.all[currency] = portfolio.Balance(currency, balance)
- ReportStore.log_balances(market)
+ ReportStore.log_balances(market, tag=tag)
@classmethod
def dispatch_assets(cls, amount, liquidity="medium", repartition=None):