|
@@ -340,9 +340,10 @@ class ArbitrageProcess:
|
|
|
|
|
|
|
|
if order['status'] in ["FILLED", "PARTIALLY_CANCELED"]:
|
|
if order['status'] in ["FILLED", "PARTIALLY_CANCELED"]:
|
|
|
# 以实际成交数量为准
|
|
# 以实际成交数量为准
|
|
|
|
|
+ money = Decimal(order['cummulativeQuoteQty'])
|
|
|
self.already_bought_amount = self.already_bought_amount + Decimal(order['executedQty'])
|
|
self.already_bought_amount = self.already_bought_amount + Decimal(order['executedQty'])
|
|
|
|
|
|
|
|
- self.buy_value = self.buy_value + Decimal(order['cummulativeQuoteQty'])
|
|
|
|
|
|
|
+ self.buy_value = self.buy_value + money
|
|
|
self.buy_price = self.buy_value / self.already_bought_amount
|
|
self.buy_price = self.buy_value / self.already_bought_amount
|
|
|
self.buy_price = self.buy_price.quantize(Decimal('1e-16'), rounding=ROUND_DOWN)
|
|
self.buy_price = self.buy_price.quantize(Decimal('1e-16'), rounding=ROUND_DOWN)
|
|
|
|
|
|
|
@@ -352,6 +353,7 @@ class ArbitrageProcess:
|
|
|
add_state_flow_entry(self.process_item, self.current_state, msg, "success")
|
|
add_state_flow_entry(self.process_item, self.current_state, msg, "success")
|
|
|
|
|
|
|
|
self.exchange_withdrawal_amount = self.already_bought_amount
|
|
self.exchange_withdrawal_amount = self.already_bought_amount
|
|
|
|
|
+ break
|
|
|
else:
|
|
else:
|
|
|
time.sleep(1)
|
|
time.sleep(1)
|
|
|
waiting_times = waiting_times - 1
|
|
waiting_times = waiting_times - 1
|