diff options
Diffstat (limited to 'helper.py')
-rw-r--r-- | helper.py | 39 |
1 files changed, 28 insertions, 11 deletions
@@ -115,16 +115,33 @@ def print_orders(market, base_currency="BTC"): | |||
115 | print(balance) | 115 | print(balance) |
116 | TradeStore.print_all_with_order() | 116 | TradeStore.print_all_with_order() |
117 | 117 | ||
118 | def make_orders(market, base_currency="BTC"): | 118 | def process_sell_needed__1_sell(market, base_currency="BTC", debug=False): |
119 | prepare_trades(market, base_currency=base_currency) | 119 | prepare_trades(market, base_currency=base_currency, debug=debug) |
120 | for trade in TradeStore.all: | 120 | TradeStore.prepare_orders(compute_value="average", only="dispose") |
121 | print(trade) | 121 | print("------------------") |
122 | for order in trade.orders: | 122 | for currency, balance in BalanceStore.all.items(): |
123 | print("\t", order, sep="") | 123 | print(balance) |
124 | order.run() | 124 | print("------------------") |
125 | TradeStore.print_all_with_order() | ||
126 | print("------------------") | ||
127 | TradeStore.run_orders() | ||
128 | follow_orders() | ||
129 | |||
130 | def process_sell_needed__2_sell(market, base_currency="BTC", debug=False): | ||
131 | update_trades(market, base_currency=base_currency, debug=debug, only="acquire") | ||
132 | TradeStore.prepare_orders(compute_value="average", only="acquire") | ||
133 | print("------------------") | ||
134 | for currency, balance in BalanceStore.all.items(): | ||
135 | print(balance) | ||
136 | print("------------------") | ||
137 | TradeStore.print_all_with_order() | ||
138 | print("------------------") | ||
139 | move_balances(market, debug=debug) | ||
140 | TradeStore.run_orders() | ||
141 | follow_orders() | ||
125 | 142 | ||
126 | def process_sell_all_sell(market, base_currency="BTC", debug=False): | 143 | def process_sell_all__1_all_sell(market, base_currency="BTC", debug=False): |
127 | prepare_trades_to_sell_all(market, debug=debug) | 144 | prepare_trades_to_sell_all(market, base_currency=base_currency, debug=debug) |
128 | TradeStore.prepare_orders(compute_value="average") | 145 | TradeStore.prepare_orders(compute_value="average") |
129 | print("------------------") | 146 | print("------------------") |
130 | for currency, balance in BalanceStore.all.items(): | 147 | for currency, balance in BalanceStore.all.items(): |
@@ -135,8 +152,8 @@ def process_sell_all_sell(market, base_currency="BTC", debug=False): | |||
135 | TradeStore.run_orders() | 152 | TradeStore.run_orders() |
136 | follow_orders() | 153 | follow_orders() |
137 | 154 | ||
138 | def process_sell_all_buy(market, base_currency="BTC", debug=False): | 155 | def process_sell_all__2_all_buy(market, base_currency="BTC", debug=False): |
139 | prepare_trades(market, debug=debug) | 156 | prepare_trades(market, base_currency=base_currency, debug=debug) |
140 | TradeStore.prepare_orders() | 157 | TradeStore.prepare_orders() |
141 | print("------------------") | 158 | print("------------------") |
142 | for currency, balance in BalanceStore.all.items(): | 159 | for currency, balance in BalanceStore.all.items(): |