在 Pine 中不可能循环遍历脚本的不同配置?
我想在不同的时间范围、交易对和参数值上测试我的策略。
为此,我想构建一个带有嵌套循环的脚本,有点像这样(伪代码):
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。
但是,您可以针对不同的条件使用不同的变量并分别计算结果。然后您可以将结果打印在表格中。这并不容易,但根据您的需要,它可能会起作用。
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.