将Pine-Script版本2.0转换为版本5.0
我需要帮助将此指标从V2转换为V5。对我来说非常复杂。
//@version=2
study("Heiken Ashi MTF")
ha_t = heikinashi(tickerid)
res = input('60', title="TM 1")
ha_open = security(ha_t, res, open)
ha_close = security(ha_t, res, close)
ha_dif = ha_open-ha_close
ha_diff=iff(ha_dif > 0, 1, iff(ha_dif<0, 2, 3))
res2 = input('240', title="TM 2")
ha_open2 = security(ha_t, res2, open)
ha_close2 = security(ha_t, res2, close)
ha_dif2 = ha_open2-ha_close2
ha_diff2=iff(ha_dif2 > 0, 1, iff(ha_dif2<0, 2, 3))
res3 = input('D', title="TM 3")
ha_open3 = security(ha_t, res3, open)
ha_close3 = security(ha_t, res3, close)
ha_dif3 = ha_open3-ha_close3
ha_diff3=iff(ha_dif3 > 0, 1, iff(ha_dif3<0, 2, 3))
plot(15, title="TF1", color=iff(ha_diff==1, red, iff(ha_diff==2, green, white)), style=circles, linewidth=5, join=true)
plot(14, title="TF2", color=iff(ha_diff2==1, red, iff(ha_diff2==2, green, white)), style=circles, linewidth=5, join=true)
plot(13, title="TF3", color=iff(ha_diff3==1, red, iff(ha_diff3==2, green, white)), style=circles, linewidth=5, join=true)
代码为v2,我需要v5。但这是如此复杂。我需要V5中的一些功能。
i need help to convert this Indicator from V2 to V5. It is very complex for me.
//@version=2
study("Heiken Ashi MTF")
ha_t = heikinashi(tickerid)
res = input('60', title="TM 1")
ha_open = security(ha_t, res, open)
ha_close = security(ha_t, res, close)
ha_dif = ha_open-ha_close
ha_diff=iff(ha_dif > 0, 1, iff(ha_dif<0, 2, 3))
res2 = input('240', title="TM 2")
ha_open2 = security(ha_t, res2, open)
ha_close2 = security(ha_t, res2, close)
ha_dif2 = ha_open2-ha_close2
ha_diff2=iff(ha_dif2 > 0, 1, iff(ha_dif2<0, 2, 3))
res3 = input('D', title="TM 3")
ha_open3 = security(ha_t, res3, open)
ha_close3 = security(ha_t, res3, close)
ha_dif3 = ha_open3-ha_close3
ha_diff3=iff(ha_dif3 > 0, 1, iff(ha_dif3<0, 2, 3))
plot(15, title="TF1", color=iff(ha_diff==1, red, iff(ha_diff==2, green, white)), style=circles, linewidth=5, join=true)
plot(14, title="TF2", color=iff(ha_diff2==1, red, iff(ha_diff2==2, green, white)), style=circles, linewidth=5, join=true)
plot(13, title="TF3", color=iff(ha_diff3==1, red, iff(ha_diff3==2, green, white)), style=circles, linewidth=5, join=true)
the code is v2 and i need v5. but this is so complicated. i need some features in v5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)