使用 security() 时重新绘制

发布于 2025-01-15 04:27:38 字数 693 浏览 4 评论 0原文

当我使用 security() 时,我的 pine 代码中存在一些问题,

我对图表和 security() 函数使用不同的时间范围,并且它在我的策略中发出虚假警报,

我阅读了此常见问题解答(链接),但我无法解决我的问题 有人可以帮忙吗?

res5 = input("45", type=input.resolution)

o = security(syminfo.tickerid, res5, open, barmerge.gaps_off, barmerge.lookahead_on)
c = security(syminfo.tickerid, res5, close, barmerge.gaps_off, barmerge.lookahead_on)
hz = security(syminfo.tickerid, res5, high, barmerge.gaps_off, barmerge.lookahead_on)
l = security(syminfo.tickerid, res5, low, barmerge.gaps_off, barmerge.lookahead_on)

i have some problem in my pine code when i use security()

i use diffrent timeframe for chart and security() function, and its make fake alert in my strategy

i read this FAQ (link) but i can't fix my problem
can anyone help ?

res5 = input("45", type=input.resolution)

o = security(syminfo.tickerid, res5, open, barmerge.gaps_off, barmerge.lookahead_on)
c = security(syminfo.tickerid, res5, close, barmerge.gaps_off, barmerge.lookahead_on)
hz = security(syminfo.tickerid, res5, high, barmerge.gaps_off, barmerge.lookahead_on)
l = security(syminfo.tickerid, res5, low, barmerge.gaps_off, barmerge.lookahead_on)

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

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

发布评论

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

评论(1

孤独患者 2025-01-22 04:27:38

当柱线关闭时,您应该请求更高时间范围的数据。常见问题解答中明确说明了这一点。

使用它来进行安全调用:

f_secureSecurity(_symbol, _res, _src) => security(_symbol, _res, _src[1], lookahead = barmerge.lookahead_on)

You should request data from a higher time frame when the bar is closed. It is clearly stated in that FAQ.

Use this for your security calls:

f_secureSecurity(_symbol, _res, _src) => security(_symbol, _res, _src[1], lookahead = barmerge.lookahead_on)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文