a
This commit is contained in:
parent
9983a892bd
commit
2539ebc300
|
|
@ -599,14 +599,14 @@ class PositionManager:
|
|||
# 部分平仓50%
|
||||
partial_quantity = quantity * 0.5
|
||||
try:
|
||||
# 部分平仓
|
||||
close_side = 'SELL' if position_info['side'] == 'BUY' else 'BUY'
|
||||
partial_order = await self.client.place_order(
|
||||
symbol=symbol,
|
||||
side=close_side,
|
||||
quantity=partial_quantity,
|
||||
order_type='MARKET'
|
||||
)
|
||||
# 部分平仓
|
||||
close_side = 'SELL' if position_info['side'] == 'BUY' else 'BUY'
|
||||
partial_order = await self.client.place_order(
|
||||
symbol=symbol,
|
||||
side=close_side,
|
||||
quantity=partial_quantity,
|
||||
order_type='MARKET'
|
||||
)
|
||||
if partial_order:
|
||||
position_info['partialProfitTaken'] = True
|
||||
position_info['remainingQuantity'] = remaining_quantity - partial_quantity
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user