You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python交易机器人报错ValueError:Long orders require: SL < LIMIT < TP求解

Python交易机器人ValueError异常排查及疑问

异常问题详情

运行代码时触发ValueError,错误提示为:

Long orders require: SL < LIMIT < TP

目前无法设置较小的止盈(TP)数值,且不想通过提高TP值解决问题,需要协助排查。相关代码片段如下:

def support_trade_level(self, support, resistance, lower_support): 
    if self.close <= support + self.buy_point1 and self.close >= support - self.buy_point2:
        self.buy(sl= support - self.slo_buy_point, tp= resistance - self.tp_buy_point)

额外疑问

开仓时输入的TP值为何会被系统视为LIMIT?

内容的提问来源于stack exchange,提问作者Zeeshan Ansari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 16:24:54