如何在图表上绘制先前蜡烛高点和低点的水平线?

发布于 2025-01-20 14:57:59 字数 87 浏览 2 评论 0原文

我在绘制水平线路的绘制延伸的水平线上遇到了麻烦,使用先前的蜡烛高和低。希望使用多个时间范围(4小时,D,W,M)蜡烛作为参考。我该如何在Pine脚本中进行编辑?

I'm having trouble plotting horizontal lines that extend using previous candles high and low. Would love to be bale to use multiple time frames (4hr, D, W, M) candles as reference. How do I go about editing this in pine script?

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

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

发布评论

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

评论(1

如歌彻婉言 2025-01-27 14:57:59

要从不同时间范围获取数据,您应该使用 request.security() 函数。

然后您可以使用 lineplot() 来显示此信息。

下面的代码绘制了前一天的高点和低点。

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", overlay=true)

d_h = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
d_l = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)

plot(d_h, style=plot.style_circles, color=color.green)
plot(d_l, style=plot.style_circles, color=color.red)

输入图片此处描述

To get data from different timeframes, you should use the request.security() function.

Then you can either use line or plot() to display this information.

Below code plots previous day's high and low.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", overlay=true)

d_h = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
d_l = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)

plot(d_h, style=plot.style_circles, color=color.green)
plot(d_l, style=plot.style_circles, color=color.red)

enter image description here

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