aboutsummaryrefslogtreecommitdiff
path: root/helper.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-12 14:11:02 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-12 14:11:02 +0100
commit97922ff1826cc6b9c0329cc30e8d4621bb2644ee (patch)
tree1437590a98b10f64683e226d03fda130840f0ba6 /helper.py
parent9f54fd9acf98692ff7601fd3236c46745eb26e15 (diff)
downloadTrader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.tar.gz
Trader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.tar.zst
Trader-97922ff1826cc6b9c0329cc30e8d4621bb2644ee.zip
Add print_balances helper
Diffstat (limited to 'helper.py')
-rw-r--r--helper.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/helper.py b/helper.py
index 8ef2d64..3e39785 100644
--- a/helper.py
+++ b/helper.py
@@ -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
121def 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
121def process_sell_needed__1_sell(market, base_currency="BTC", debug=False): 129def 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")