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

如何在图表底部上下排列两个plotshape系列并避免重叠?

解决Pine Script中plotshape底部重叠问题,实现上下排列

可以通过给plotshape添加vertical_offset参数控制垂直偏移,实现两组形状在图表底部上下排列,避免重叠。

修改后的代码

plotshape(longSlide, style=shape.circle, location=location.bottom, color=color.green, size=size.auto, title="Bullish Slide", display=display.all, vertical_offset=-15)
plotshape(shortSlide, style=shape.circle, location=location.bottom, color=color.red, size=size.auto, title="Bearish Slide", display=display.all, vertical_offset=-15)
plotshape(longEntries and condLongAO, style=shape.circle, location=location.bottom, color=color.green, size=size.auto, title='Buy', display = display.all)
plotshape(shortEntries and condShortAO, style=shape.circle, location=location.bottom, color=color.red, size=size.auto, title='Sell', display = display.all)

参数说明

  • vertical_offset:控制形状的垂直偏移量,单位为像素。正数表示向上偏移,负数表示向下偏移(相对于location指定的位置)。
  • 你可以根据图表实际显示效果调整偏移数值(比如-10、-15、-20),直到两组形状完全分离,达到预期的上下排列效果。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.21 17:53:12