如何在图表底部上下排列两个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
相关产品推荐
相关产品推荐

