每根单位K线时间
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © qqqq95

//@version=5
indicator("每根单位K线时间",overlay = true)
second_tostr(s) => 
    h = (s - s%(3600*1000))/(3600*1000)
    h_t = (s - s%(3600*1000))
    min = ((s-h_t) - (s-h_t)%(60*1000))/(60*1000)
    str = str.tostring(h)+"h"+str.tostring(min)+'min'
    str
label.new(time[1],close,xloc = xloc.bar_time,text = second_tostr(time -time[1]))
plot(close)
