Files
crypto_monitor/docs/position-sizing-mode.md
T
dekun f7bac11694 feat: add full-margin position sizing mode across four exchanges
Env POSITION_SIZING_MODE switches risk vs full-margin (available*buffer, BTC/ETH 10x). Blocks trend/roll/key auto opens in full margin, purges breakout/fib monitors with WeChat notice, keeps RR check and initial SL snapshot for records.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:24:35 +08:00

1.7 KiB
Raw Blame History

计仓模式(四所统一)

配置

在各实例 .env 中设置(仅能通过 env 切换,修改后须重启进程):

# risk(默认)= 以损定仓
# full_margin = 全仓杠杆(合约可用保证金 × 比例)
POSITION_SIZING_MODE=risk
FULL_MARGIN_BUFFER_RATIO=0.98

切换为全仓杠杆前:交易所须无持仓MAX_ACTIVE_POSITIONS 默认 1,全仓模式会强制单仓)。

模式说明

模式 保证金计算 杠杆 允许入口
risk RISK_PERCENT × 交易资金,按止损距离反推 表单可选 / 同步交易所 实盘人工、关键位自动、趋势回调、顺势加仓
full_margin 合约账户可用 USDT × FULL_MARGIN_BUFFER_RATIO(保留 2 位小数) BTC/ETH 10x,其它 5x(与 BTC_LEVERAGE/ALT_LEVERAGE 一致) 实盘人工下单;阻力/支撑仅提醒

全仓模式下:

  • 仍校验 计划盈亏比MANUAL_MIN_PLANNED_RR)。
  • 下单张数由 prepare_order_amount + 交易所 amount_to_precision 决定。
  • order_monitors.initial_stop_loss 仍记录开仓时止损快照;交易记录复盘以该快照为准。
  • 已存在的 箱体突破 / 收敛突破 / 斐波 监控:进程启动时自动撤销并企业微信通知。

不允许(全仓模式)

  • 关键位:箱体突破、收敛突破、斐波自动单(添加时拒绝;已存在则启动时撤销)。
  • 趋势回调、顺势加仓(策略入口返回明确错误)。

部署

git pull
# 四所 .env 增加 POSITION_SIZING_MODE=risk 或 full_margin
pm2 restart crypto-monitor-binance crypto-monitor-okx crypto-monitor-gate crypto-monitor-gate-bot