首页 > 解决方案 > 如何在交易视图上的自定义变量系列上方绘制形状

问题描述

我想在一个单独的窗格中的指标上方绘制一个 shape.triangleup。

cpc = 基于 RSI 的指标系列

hhv = highest(cpc, 20)
hhvcross = cpc > hhv[1]
plotshape(hhvcross, style=shape.triangleup, location=location.abovebar, color=purple)

这段代码以这样一种方式缩放绘图,我只能看到箭头和空白。

我尝试了 location.absolute,但不明白它也没有工作。

我想看到在 cpc 线上方绘制的 triangleup。

谢谢

标签: pine-script

解决方案


cpc > hhv[1] isn't capturing the cross, it's capturing that cpc is greater than hhv[1]. If your trying to put your shape at the place where they cross try crossover(cpc,hhv)


推荐阅读