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

Pine Script添加吞没蜡烛形态检测时多title参数错误修复求助

问题修复方案

错误原因

你调用plotshape时传递了两个位置参数(bullishEngulfing != na 和 buyCondition),而Pine Script中plotshape的第一个位置参数是触发绘制的布尔序列,第二个位置参数默认对应title参数。这就导致你后面显式指定的title = "Long Signal"变成了重复的title参数,从而触发错误提示。

修复代码

将两个条件合并为一个布尔表达式作为plotshape的第一个参数,去掉多余的位置参数:

// 看涨信号绘制
plotshape(bullishEngulfing != na and buyCondition, style=shape.triangleup, location=location.belowbar, size=size.tiny, text='Long', textcolor=color.gray, color=color.new(color.green, 0), title = "Long Signal")

// 看跌信号绘制(修正原代码中形态条件的错误)
plotshape(bearishEngulfing != na and sellCondition, style=shape.triangledown, location=location.abovebar, size=size.tiny, text='Short', textcolor=color.gray, color=color.new(color.red, 0), title = "Short Signal")

额外提示

原代码中看跌信号错误使用了bullishEngulfing != na作为条件,应替换为对应的bearishEngulfing != na,否则会用看涨形态触发看跌信号,导致逻辑错误。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.22 05:52:37