下面的代码在交易视图范围条形图中绘制蜡烛,因为平台没有提供将条形(OHLC)更改为蜡烛的选项。下面的代码是一种变通方法,但是它不会使最后一根柱线(当前柱线)变成蜡烛,并且我不知道如何解决此问题。感谢您的协助。
//@version=4
// Copyright (c) 2020-present, Alex Orekhov (everget)
// Range Candles script may be freely distributed under the terms of the GPL-3.0 license.
study("Range Candles", overlay=true)
bullColor = #095616
bearColor = #ac0011
isBull = close >= open
plotcandle(
isBull ? open : na,
isBull ? high : na,
isBull ? low : na,
isBull ? close : na,
title="",
color=bullColor,
bordercolor=bullColor,
wickcolor=#5d606b
)
plotcandle(
isBull ? na : open,
isBull ? na : high,
isBull ? na : low,
isBull ? na : close,
title="",
color=bearColor,
bordercolor=bearColor,
wickcolor=#5d606b
)