TradingView
使用plotcandle
函数,给蜡烛灯芯上色。
但是当图表更改为折线图时,这些灯芯仍然存在。
auto-hide/disable
当我将图表类型更改为线条时如何处理?
//@version=4
study("5 ema", overlay=true)
x = ema(close, 5)
x1 = sma(x, 5)
y = x >= x1
y1 = x <= x1
f_check() => high != 0 and open != 0 and low != 0
red = color.new(color.red, 0)
green = color.new(color.green, 0)
f_red() => f_check() ? color.new(color.red, 0) : color.new(color.red, 100)
f_green() => f_check() ? color.new(color.green, 0) : color.new(color.green, 100)
f_wickcolor() => y ? f_green() : y1 ? f_red() : color.new(color.black, 0)
f_bordercolor() => color.new(color.black, 100) //f_wickcolor()
plotcandle( open, high, low, close, color = color.new(color.white, 100), wickcolor = f_wickcolor(), bordercolor = f_bordercolor(), display = display.all )