Electrified

Time

Electrified Обновлено   
Library "Time"
Utilities for measuring time.

bar() Gets the number of milliseconds per bar.
Информация о релизе:
v2 Added shortcut for getting the date.

Added:
date(datetime) Gets the start of the day for the provided time value.
  Parameters:
    datetime: The time of day to acquire the date from.
  Returns: The number of milliseconds representing the date for the given value.
Информация о релизе:
v3

Added:
timeOfDay(datetime) Gets milliseconds from the start of the day.
  Parameters:
    datetime: The date/time to acquire the time of day from.
  Returns: The number of milliseconds representing time of day.
Информация о релизе:
v4 Adds spanToLen functions
Информация о релизе:
v5

Added:
spanToLen(timespan, type, sessionMinutes)
  Returns the number (float) bars that represents the timespan provided.
  Parameters:
    timespan: The number of units to convert to bar count.
    type: The type of units to measure. ('Bar', 'Minute' or 'Day')
    sessionMinutes: Optional override for the number of minutes per session. (Default: Regular = 390, Extended = 1440)
  Returns: The number bars that represents the timespan provided.

spanToIntLen(timespan, type)
  Returns the number (int) bars that represents the timespan provided.
  Parameters:
    timespan: The number of units to convert to bar count.
    type: The type of units to measure. ('Bar', 'Minute' or 'Day')
  Returns: The number bars that represents the timespan provided.
Информация о релизе:
v6 improve spanToLen to allow for more types
Информация о релизе:
v7 cleanup bar() calculation
Библиотека Pine

В истинном духе TradingView автор опубликовал этот код Pine как библиотеку с открытым исходным кодом, чтобы другие разработчики Pine из нашего сообщества могли использовать его повторно. Поблагодарим автора! Вы можете использовать эту библиотеку приватно или в других публикациях с открытым исходным кодом, но повторное использование этого кода в публикации регулируется Правилами поведения.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать эту библиотеку?

Скопируйте текст в буфер обмена и вставьте в свой скрипт.