customized-take-profit
📘 一行代码提升10%收益?教你用 custom_roi 精准止盈
⚙️ custom_roi 函数介绍
def custom_roi(self, trade, current_profit: float, current_time) -> float | None:
"""
自定义止盈策略
参数:
- trade: 当前交易对象,包含持仓信息
- current_profit: 当前收益率(浮点数)
- current_time: 当前时间
返回:
- float类型止盈目标收益率,或者 None 表示使用默认ROI
"""
pass🔍 示例:实现基于持仓时间和收益率动态调整止盈
❓ 使用 custom_roi 后,minimal_roi 是否还生效?
✅ 实践建议
🧠 总结
Last updated