RicardoSantos

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/T...tils/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.
مكتبة باين

كمثال للقيم التي تتبناها TradingView، نشر المؤلف شيفرة باين كمكتبة مفتوحة المصدر بحيث يمكن لمبرمجي باين الآخرين من مجتمعنا استخدامه بحرية. تحياتنا للمؤلف! يمكنك استخدام هذه المكتبة بشكل خاص أو في منشورات أخرى مفتوحة المصدر، ولكن إعادة استخدام هذا الرمز في المنشور تحكمه قواعد الموقع.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذه المكتبة؟

انسخ النص إلى الحافظة وألصقه في النص البرمجي الخاص بك.