如何计算2个蜡烛之间分别符合松树脚本不同条件的棒数

发布于 2025-01-22 15:35:41 字数 364 浏览 0 评论 0原文

给定2个真正的虚假条件A和B 我想搜索这两个条件之间所有蜡烛的低点。 脚本加载,但错误说“'length”参数的无效值(0.0)在“最低”函数中。必须是> 0”

有人可以帮忙吗?谢谢

var int nb_bars = 0
nb_bars := B? ta.barssince(A)[2] : 0     // I have [2] because condition A could trigger just before condition B, I want to search the A which is further away
ClusterLow =  B ? ta.lowest(nb_bars) : na

Given 2 true false conditions A and B
I would like to search for the low of all the candles between these 2 conditions.
the script load, but an error say "invalid value of the 'length' argument (0.0) in the "lowest" function. it must be >0"

Could someone help please? Thanks

var int nb_bars = 0
nb_bars := B? ta.barssince(A)[2] : 0     // I have [2] because condition A could trigger just before condition B, I want to search the A which is further away
ClusterLow =  B ? ta.lowest(nb_bars) : na

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦初启 2025-01-29 15:35:41

错误是明确的,您无法将length设置为零。

ta.barssince(a)[2]如果条件A从现在开始2 bars发生,则发生在2个Bars 2 bars之前,它发生了。如果用[2]偏向索引,则必须偏长参数。

尝试clusterlow = b? ta.Lowest(NB_BARS + 2):NA

The error is clear, you cannot set the length to zero.

And ta.barssince(A)[2] can also be zero if condition A happened 2 bars ago from now, then it happened 0 bars back 2 bars ago. If you skew the index with [2], you have to skew the length parameter as well.

Try ClusterLow = B ? ta.lowest(nb_bars + 2) : na

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文