获取酒吧关闭的时间

Getting time of day of bar close

我想在 pinescript 中查看柱线收盘时间是世界标准时间上午 8 点(对于策略中的每个柱线)。

我想我也许可以使用 time_close(尽管这可能不是动态的)。由于这个 returns 是一个 unix 时间戳,我对如何测试收盘价是否为 8amUTC 有点不知所措。第一步是从 unix 时间戳中提取时间...

您可以只使用内置变量 'hour',它 returns 当前柱的收盘时间。

hour()函数可以接受时间:

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

//@version=4
study("My Script")
plot(hour(time_close))