如何在使用 MTF 时获取图表的分辨率

发布于 2025-01-16 03:35:17 字数 315 浏览 1 评论 0原文

借助多时间范围的支持(MTF)功能

timeframe.* 变量的值将表示脚本当前运行的分辨率,该分辨率由脚本输入中 Timeframe 字段的值确定,无论图表的分辨率如何。

既然图表的分辨率与脚本分辨率不同,那么如何获取图表的分辨率呢?或者如何知道它们是否不同?

With the support of multi-timeframe (MTF) functionality:

the value of timeframe.* variables will represent the resolution the script is currently running on as determined by the value of the Timeframe field in the script's Inputs, regardless of the chart's resolution.

So how to get the chart's resolution now that it's different from the script resolution? Or how to know whether they are different?

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

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

发布评论

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

评论(1

倾城花音 2025-01-23 03:35:17

timeframe.period 返回图表的分辨率。

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

in_htf = input.timeframe("", "Timeframe")

curr_tf = timeframe.period

var testTable = table.new(position = position.top_right, columns = 1, rows = 1, bgcolor = color.yellow, border_width = 1)
if barstate.islast
    s = (in_htf == curr_tf) or (in_htf == "") ? "True" : "False"
    table.cell(table_id = testTable, column = 0, row = 0, text = s)

输入图片此处描述

timeframe.period returns your chart's resolution.

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

in_htf = input.timeframe("", "Timeframe")

curr_tf = timeframe.period

var testTable = table.new(position = position.top_right, columns = 1, rows = 1, bgcolor = color.yellow, border_width = 1)
if barstate.islast
    s = (in_htf == curr_tf) or (in_htf == "") ? "True" : "False"
    table.cell(table_id = testTable, column = 0, row = 0, text = s)

enter image description here

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