aboutsummaryrefslogtreecommitdiff
path: root/store.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-08 20:34:05 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-08 20:34:05 +0200
commitaa169ddfbcf0a5002d5da6d62a76477c3e33e72e (patch)
tree047b8069d8889e251bd359f27e72b0a6ab212660 /store.py
parent8a87fda40d24e3048809990f965c07d4a1e7559e (diff)
parent3a15ffc79ea84e5ec6200545bcbf11fc6c1c6564 (diff)
downloadTrader-1.8.tar.gz
Trader-1.8.tar.zst
Trader-1.8.zip
Merge branch 'dev'v1.8
Diffstat (limited to 'store.py')
-rw-r--r--store.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/store.py b/store.py
index 2a71bed..32c4121 100644
--- a/store.py
+++ b/store.py
@@ -305,7 +305,7 @@ class BalanceStore:
305 return amounts 305 return amounts
306 306
307 def fetch_balances(self, tag=None, add_portfolio=False, 307 def fetch_balances(self, tag=None, add_portfolio=False,
308 checkpoint=None, log_tickers=False, 308 checkpoint=None, log_tickers=False, add_usdt=False,
309 ticker_currency="BTC", ticker_compute_value="average", ticker_type="total"): 309 ticker_currency="BTC", ticker_compute_value="average", ticker_type="total"):
310 all_balances = self.market.ccxt.fetch_all_balances() 310 all_balances = self.market.ccxt.fetch_all_balances()
311 for currency, balance in all_balances.items(): 311 for currency, balance in all_balances.items():
@@ -315,6 +315,8 @@ class BalanceStore:
315 if add_portfolio: 315 if add_portfolio:
316 for currency in Portfolio.repartition(from_cache=True): 316 for currency in Portfolio.repartition(from_cache=True):
317 self.all.setdefault(currency, portfolio.Balance(currency, {})) 317 self.all.setdefault(currency, portfolio.Balance(currency, {}))
318 if add_usdt:
319 self.all.setdefault("USDT", portfolio.Balance("USDT", {}))
318 if log_tickers: 320 if log_tickers:
319 tickers = self.in_currency(ticker_currency, compute_value=ticker_compute_value, type=ticker_type) 321 tickers = self.in_currency(ticker_currency, compute_value=ticker_compute_value, type=ticker_type)
320 self.market.report.log_balances(tag=tag, checkpoint=checkpoint, 322 self.market.report.log_balances(tag=tag, checkpoint=checkpoint,