diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-12 14:11:02 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-12 14:11:02 +0100 |
commit | 97922ff1826cc6b9c0329cc30e8d4621bb2644ee (patch) | |
tree | 1437590a98b10f64683e226d03fda130840f0ba6 /helper.py | |
parent | 9f54fd9acf98692ff7601fd3236c46745eb26e15 (diff) | |
download | Trader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.tar.gz Trader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.tar.zst Trader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.zip |
Add print_balances helper
Diffstat (limited to 'helper.py')
-rw-r--r-- | helper.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -118,6 +118,14 @@ def print_orders(market, base_currency="BTC"): | |||
118 | print(balance) | 118 | print(balance) |
119 | TradeStore.print_all_with_order() | 119 | TradeStore.print_all_with_order() |
120 | 120 | ||
121 | def print_balances(market, base_currency="BTC"): | ||
122 | BalanceStore.fetch_balances(market) | ||
123 | for currency, balance in BalanceStore.all.items(): | ||
124 | print(balance) | ||
125 | if base_currency is not None: | ||
126 | print("total:") | ||
127 | print(sum(BalanceStore.in_currency(base_currency, market).values())) | ||
128 | |||
121 | def process_sell_needed__1_sell(market, base_currency="BTC", debug=False): | 129 | def process_sell_needed__1_sell(market, base_currency="BTC", debug=False): |
122 | prepare_trades(market, base_currency=base_currency, debug=debug) | 130 | prepare_trades(market, base_currency=base_currency, debug=debug) |
123 | TradeStore.prepare_orders(compute_value="average", only="dispose") | 131 | TradeStore.prepare_orders(compute_value="average", only="dispose") |