Freqtrade 设置protections

杂谈 · 07-16
Freqtrade 设置protections

Freqtrade 从 2025 年起已弃用 protections 在 config.json 中直接定义 的方式(这是新版 2025.6 的变更之一),现在必须使用 策略插件化方式加载风控
将风控插件配置放入单独的文件夹

  1. 在你的用户目录下创建文件:
    mkdir -p /opt/ft_userdata/user_data/protections
  2. 创建文件 /opt/ft_userdata/user_data/protections/custom_protections.py
    步骤三:修改 config.json 中添加此风控插件路径:
    在配置中加上:"protection_path": "/opt/ft_userdata/user_data/protections"
    最终增加的行应放在 config.json 根级,比如:
    "bot_name": "freqtrade",
    "initial_state": "running",
    "protection_path": "/opt/ft_userdata/user_data/protections",
    "force_entry_enable": false,
    你现在使用的是 Freqtrade 2025.6+ 版本,必须采用“插件路径方式”加载风控,这样更灵活并能自定义风控逻辑。
Theme Jasmine by Kent Liao