1
This commit is contained in:
parent
ac6a8d4388
commit
3a61910461
@ -147,17 +147,13 @@ class PaperTradingExecutor(BaseExecutor):
|
||||
success_count = 0
|
||||
total_pnl = 0
|
||||
for order_id in orders_to_close:
|
||||
result = self.paper_trading.close_order(
|
||||
result = self.paper_trading.close_order_manual(
|
||||
order_id=order_id,
|
||||
close_price=current_price,
|
||||
close_reason='manual'
|
||||
exit_price=current_price
|
||||
)
|
||||
if result.get('success'):
|
||||
if result:
|
||||
success_count += 1
|
||||
# 计算盈亏
|
||||
order = result.get('order')
|
||||
if order:
|
||||
total_pnl += order.realized_pnl
|
||||
total_pnl += result.get('pnl_amount', 0)
|
||||
|
||||
result = {
|
||||
'success': success_count > 0,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user