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

Pine Script中止损止盈(SL/TP)订单无法执行问题咨询

Pine Script策略止损止盈(SL/TP)无法执行问题
  • 我使用以下代码下单,执行完全正常:
//place order        
strategy.entry(
    currentOrder.orderEntryId,
    direction = longCondition ? strategy.long : strategy.short, 
    qty = currentOrder.quantity,
    stop = currentOrder.entryPrice,
    limit = currentOrder.limitPrice
)
  • 我希望为同一订单设置止损(SL)和止盈(TP),但使用以下代码时订单无法执行:
//setup SL and TP for the currently placed order
strategy.exit(
    id = currentOrder.orderExitId, 
    from_entry = currentOrder.orderEntryId,
    qty = currentOrder.quantity,
    qty_percent = 100,
    limit = currentOrder.takeProfit,
    stop = currentOrder.stopLoss
)

我检查了所有参数的赋值,均无异常。调试显示价格已突破止盈(TP)线(绿色),但strategy.exit未执行。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 22:57:06