a
This commit is contained in:
parent
8874b68387
commit
ba8396827a
|
|
@ -15,3 +15,6 @@ python-dotenv==1.0.0
|
|||
python-binance==1.0.19
|
||||
websocket-client==1.6.1
|
||||
aiohttp==3.9.1
|
||||
|
||||
# Redis/Valkey 缓存依赖(与 trading_system 保持一致)
|
||||
aioredis==2.0.1
|
||||
|
|
|
|||
|
|
@ -668,19 +668,16 @@ class BinanceClient:
|
|||
logger.info(f" 平仓模式: {reduce_only}")
|
||||
|
||||
# 检查名义价值是否满足最小要求
|
||||
# 注意:对于平仓操作(reduce_only=True),币安允许更小的名义价值,所以放宽检查
|
||||
# 但为了安全,仍然检查一个更小的阈值(0.1 USDT)
|
||||
min_notional_for_order = 0.1 if reduce_only else min_notional
|
||||
|
||||
if notional_value < min_notional_for_order:
|
||||
# 注意:对于平仓操作(reduce_only=True),完全跳过名义价值检查
|
||||
# 因为平仓是关闭现有持仓,币安允许任意大小的平仓订单(只要大于0)
|
||||
if reduce_only:
|
||||
logger.info(f" 平仓操作:跳过名义价值检查(名义价值: {notional_value:.2f} USDT)")
|
||||
elif notional_value < min_notional:
|
||||
logger.warning(
|
||||
f"❌ {symbol} 订单名义价值不足: {notional_value:.2f} USDT < "
|
||||
f"最小要求: {min_notional_for_order:.2f} USDT"
|
||||
f"最小要求: {min_notional:.2f} USDT"
|
||||
)
|
||||
if reduce_only:
|
||||
logger.warning(f" 这是平仓订单,但名义价值仍然太小,无法执行")
|
||||
else:
|
||||
logger.warning(f" 需要增加数量或提高仓位大小")
|
||||
logger.warning(f" 需要增加数量或提高仓位大小")
|
||||
return None
|
||||
|
||||
# 检查最小保证金要求(避免手续费侵蚀收益)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user