From 5a72ded790f8b5e7c9b38a3cc91c12fbfb6cb97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 11 Feb 2018 22:40:30 +0100 Subject: Add missing tests --- helper.py | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'helper.py') diff --git a/helper.py b/helper.py index 8a29f40..421e8cd 100644 --- a/helper.py +++ b/helper.py @@ -115,16 +115,33 @@ def print_orders(market, base_currency="BTC"): print(balance) TradeStore.print_all_with_order() -def make_orders(market, base_currency="BTC"): - prepare_trades(market, base_currency=base_currency) - for trade in TradeStore.all: - print(trade) - for order in trade.orders: - print("\t", order, sep="") - order.run() +def process_sell_needed__1_sell(market, base_currency="BTC", debug=False): + prepare_trades(market, base_currency=base_currency, debug=debug) + TradeStore.prepare_orders(compute_value="average", only="dispose") + print("------------------") + for currency, balance in BalanceStore.all.items(): + print(balance) + print("------------------") + TradeStore.print_all_with_order() + print("------------------") + TradeStore.run_orders() + follow_orders() + +def process_sell_needed__2_sell(market, base_currency="BTC", debug=False): + update_trades(market, base_currency=base_currency, debug=debug, only="acquire") + TradeStore.prepare_orders(compute_value="average", only="acquire") + print("------------------") + for currency, balance in BalanceStore.all.items(): + print(balance) + print("------------------") + TradeStore.print_all_with_order() + print("------------------") + move_balances(market, debug=debug) + TradeStore.run_orders() + follow_orders() -def process_sell_all_sell(market, base_currency="BTC", debug=False): - prepare_trades_to_sell_all(market, debug=debug) +def process_sell_all__1_all_sell(market, base_currency="BTC", debug=False): + prepare_trades_to_sell_all(market, base_currency=base_currency, debug=debug) TradeStore.prepare_orders(compute_value="average") print("------------------") for currency, balance in BalanceStore.all.items(): @@ -135,8 +152,8 @@ def process_sell_all_sell(market, base_currency="BTC", debug=False): TradeStore.run_orders() follow_orders() -def process_sell_all_buy(market, base_currency="BTC", debug=False): - prepare_trades(market, debug=debug) +def process_sell_all__2_all_buy(market, base_currency="BTC", debug=False): + prepare_trades(market, base_currency=base_currency, debug=debug) TradeStore.prepare_orders() print("------------------") for currency, balance in BalanceStore.all.items(): -- cgit v1.2.3