尚未关闭的蜡烛的 pinescript,尚未关闭的蜡烛应该是不可见的

问题描述 投票:0回答:1

您能否分享交易视图的pinescript,它应该隐藏当前移动的蜡烛,我的意思是尚未关闭的蜡烛应该是不可见的,一旦关闭它应该是可见的

//@version=4
//Paints an unconfirmed candle gray to remind the trader that the bar can look different by close and reduce mistakes.

study("!", overlay=true)

rt = barstate.isconfirmed

barcolor(rt ? na : color.white, title="Unconfirmed candle")

我尝试了上面的代码,但它仍然显示灯芯颜色,我希望整个蜡烛不可见。 请帮助我

pine-script algorithmic-trading technical-indicator candlesticks
1个回答
0
投票

抱歉,没有可用于为灯芯着色的功能,但您可以创建自己的烛台图。

New_Color = not barstate.isconfirmed ? color.new(color.gray, 0) : close >= 
open ? color.green : color.red
plotcandle(open, high, low, close, 'New Candles', New_Color, New_Color, 
bordercolor = New_Color)
© www.soinside.com 2019 - 2024. All rights reserved.