在 Pine 中不可能循环遍历脚本的不同配置?

发布于 2025-01-14 07:04:57 字数 368 浏览 2 评论 0原文

我想在不同的时间范围、交易对和参数值上测试我的策略。

为此,我想构建一个带有嵌套循环的脚本,有点像这样(伪代码):

for pair in [EURUSD, BTCUSD, ETHBNB]:

    for tf in [5m, 15m, 1h, 4h]

        for va1 in [1, 2, 3, 4]:

            for va2 in [0.2, 0.5]:

                perform_strategy()
                write results somewhere

但是在阅读文档后,我担心这对于 Pine 来说是不可能的。有人可以证实吗?

多谢

I would like to test my strategy with on different timeframes, trading pairs and parameter values.

For this I would like to build a script with nested loops, a bit like this (pseudo code):

for pair in [EURUSD, BTCUSD, ETHBNB]:

    for tf in [5m, 15m, 1h, 4h]

        for va1 in [1, 2, 3, 4]:

            for va2 in [0.2, 0.5]:

                perform_strategy()
                write results somewhere

But after having read the doc I am afraid this is not possible with Pine. Could someone confirm ?

Thanks a lot

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

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

发布评论

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

评论(1

终陌 2025-01-21 07:04:57

不,这是不可能的。

但是,您可以针对不同的条件使用不同的变量并分别计算结果。然后您可以将结果打印在表格中。这并不容易,但根据您的需要,它可能会起作用。

No, it is not possible.

However, you can have different variables for different conditions and calculate the results separately. Then you can print the results in a table. It won't be easy tho but depending on your needs, it might work.

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