我想在 Renko Candle 结束时绘制形状,收盘时间为 30 分钟。但它只在时间间隔开始时绘制。
//@version=5
indicator(title='Renko Brick Close', overlay=true)
res = input('30')
isnew = ta.change(time(res)) != 0
plotshape(isnew)
如何在那个时期结束而不是开始时绘制形状。没有
request.security
和offset
是否可以做到这一点?
使用 barstate.isconfirmed 它只会在蜡烛关闭后绘制形状
例如,这会在除实时蜡烛之外的每根蜡烛上绘制一个向上或向下的箭头
closeup = close > open
closedown = close < open
plotshape(closeup and barstate.isconfirmed, 'close up', shape.arrowup, location = location.belowbar)
plotshape(closedown and barstate.isconfirmed, 'close down', shape.arrowdown, location = location.abovebar)