下午,
我似乎无法理解我哪里出错了。
我想要做的是根据价格在蜡烛内的位置确定新线的颜色:
如果价格在烛身内,颜色等于蓝色
如果价格较低,灯芯颜色等于绿色
如果价格是上部灯芯颜色等于红色
UW = max(open, close) > high
LW = low < min(open, close)
CandleBody = max(open, close) < min(open, close) and max(open, close) > min(open, close)
show_BTSL = input(true, title = "Show Candle Color", type = input.bool)
WickandCandleColor = show_BTSL ?
UW ? color.red :
LW ? color.green :
CandleBody ? color.blue :
color.blue :
na
答案 0 :(得分:0)
close
是当前价格,因此在该柱上,您的代码不会按照您预期的方式运行。max(open, close) > high
永远不会为真。这两者都不是:max(open, close) < min(open, close)
,因为两个值之间的最大值永远不会小于相同值之间的最小值。