This commit is contained in:
薇薇安 2026-01-16 15:43:59 +08:00
parent 8874b68387
commit ba8396827a
2 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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
# 检查最小保证金要求(避免手续费侵蚀收益)