松文字?理解
有人可以确认我正在正确阅读本文,因为我对pinescript的新手很陌生,
vcolor= Oo > Cc ? color.red : up > down? color.green:color.red
这本质上是确定颜色的陈述吗?
因此,我的理解是
if its Oo > Cc
vcolor = red
else if up > down
vcolor = green
最后的颜色是什么意思。为什么如果这是含义的话,为什么要在if语句中使用它?
提前致谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
?:
被称为。您可以将该语句写为:
因此,最后一个
color.red
是如果这些语句都不是true
。至于为什么您可能想使用此功能只是个人喜好。我喜欢它,因为它允许我一行写下这些陈述。
?:
is called Ternary operator.You can write that statement as:
So, the last
color.red
is if none of those statements aretrue
.As to why you may want to use this is just personal preference. I personnaly like it because it allows me to write those statements in one line.