【发布时间】:2022-01-04 14:54:11
【问题描述】:
假设我有 3 个条件,如果满足其中 2 个条件,我想执行一些操作。有几个组合,比如 3,解决方案可能是这样的:
c1=...
c2=...
c3=...
if (c1==true and c2==true) then
elseif (c1==true and c3==true) then
elseif (c2==true and c3==true) then
这不是很实用,比如 100 个条件,其中 90 个应该满足。 有没有更紧凑的方法在 PineScript 中实现这一点?
【问题讨论】:
-
我不知道 Pine Script,但快速浏览一下,它似乎是大多数程序语言。这取决于您的条件来确定您应该如何编写。
标签: if-statement conditional-statements pine-script conditional-formatting