From 065ee3422a6ee9d40136cfa6b272e951e15c2e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 1 Mar 2018 17:39:48 +0100 Subject: Add processors --- helper.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'helper.py') diff --git a/helper.py b/helper.py index 21e95c7..83e981b 100644 --- a/helper.py +++ b/helper.py @@ -129,8 +129,8 @@ def main_process_market(user_market, actions, before=False, after=False): if before: process_sell_all__1_all_sell(user_market) if after: - portfolio.Portfolio.wait_for_recent(user_market) - process_sell_all__2_all_buy(user_market) + process_sell_all__2_wait(user_market) + process_sell_all__3_all_buy(user_market) else: for action in actions: if action in globals(): @@ -191,15 +191,20 @@ def process_sell_all__1_all_sell(market, base_currency="BTC", liquidity="medium" market.balances.fetch_balances(tag="process_sell_all__1_all_sell_end") market.report.log_stage("process_sell_all__1_all_sell_end") -def process_sell_all__2_all_buy(market, base_currency="BTC", liquidity="medium"): - market.report.log_stage("process_sell_all__2_all_buy_begin") - market.balances.fetch_balances(tag="process_sell_all__2_all_buy_begin") +def process_sell_all__2_wait(market, liquidity="medium", base_currency="BTC"): + market.report.log_stage("process_sell_all__2_wait_begin") + portfolio.Portfolio.wait_for_recent(market) + market.report.log_stage("process_sell_all__2_wait_end") + +def process_sell_all__3_all_buy(market, base_currency="BTC", liquidity="medium"): + market.report.log_stage("process_sell_all__3_all_buy_begin") + market.balances.fetch_balances(tag="process_sell_all__3_all_buy_begin") market.prepare_trades(liquidity=liquidity, base_currency=base_currency) market.trades.prepare_orders(compute_value="average") market.move_balances() market.trades.run_orders() market.follow_orders() - market.balances.fetch_balances(tag="process_sell_all__2_all_buy_end") - market.report.log_stage("process_sell_all__2_all_buy_end") + market.balances.fetch_balances(tag="process_sell_all__3_all_buy_end") + market.report.log_stage("process_sell_all__3_all_buy_end") -- cgit v1.2.3