aboutsummaryrefslogtreecommitdiff
path: root/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'helper.py')
-rw-r--r--helper.py39
1 files changed, 28 insertions, 11 deletions
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"):
115 print(balance) 115 print(balance)
116 TradeStore.print_all_with_order() 116 TradeStore.print_all_with_order()
117 117
118def make_orders(market, base_currency="BTC"): 118def 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
130def 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
126def process_sell_all_sell(market, base_currency="BTC", debug=False): 143def 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
138def process_sell_all_buy(market, base_currency="BTC", debug=False): 155def 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():