PINE LIBRARY
FunctionTimeFrequency

Library "FunctionTimeFrequency"
Functions to encode time in a normalized space (-0.5, 0.5) that corresponds to the position of the
current time in the referrence frequency of time.
The purpose of normalizing the time value in this manner is to provide a consistent and easily comparable
representation of normalized time that can be used for various calculations or comparisons without needing
to consider the specific scale of time. This function can be particularly useful when working with high-precision
timing data, as it allows you to compare and manipulate time values more flexibly than using absolute second
counts alone.
Reference:
github.com/xll0328/TimeSieve/blob/main/utils/timefeatures.py
second_of_minute(t)
Second of minute encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
minute_of_hour(t)
Minute of hour encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
hour_of_day(t)
Hour of day encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_week(t)
Day of week encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_month(t)
Day of month encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_year(t)
Day of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
month_of_year(t)
Month of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
week_of_year(t)
Week of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
Functions to encode time in a normalized space (-0.5, 0.5) that corresponds to the position of the
current time in the referrence frequency of time.
The purpose of normalizing the time value in this manner is to provide a consistent and easily comparable
representation of normalized time that can be used for various calculations or comparisons without needing
to consider the specific scale of time. This function can be particularly useful when working with high-precision
timing data, as it allows you to compare and manipulate time values more flexibly than using absolute second
counts alone.
Reference:
github.com/xll0328/TimeSieve/blob/main/utils/timefeatures.py
second_of_minute(t)
Second of minute encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
minute_of_hour(t)
Minute of hour encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
hour_of_day(t)
Hour of day encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_week(t)
Day of week encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_month(t)
Day of month encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
day_of_year(t)
Day of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
month_of_year(t)
Month of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
week_of_year(t)
Week of year encoded as value between (-0.5, 0.5).
Parameters:
t (int): Time value.
Returns: normalized time.
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。