Pineify

common

Pineify Telah dikemas kini   
The "Pineify/common" library presents a specialized toolkit crafted to empower traders and script developers with state-of-the-art time manipulation functions on the TradingView platform. It is instead a foundational utility aimed at enriching your script's ability to process and interpret time-based data with unparalleled precision.

Key Features


String Splitter:

The 'str_split_into_two' function is a universal string handler that separates any given input into two distinct strings based on a specified delimiter. This function is especially useful in parsing time strings or any scenario where a string needs to be divided into logical parts efficiently.

Example:

[a, b] = str_split_into_two("a:b", ":")
// a = "a"
// b = "b"


Time Parser:

With 'time_to_hour_minute', users can effortlessly convert a time string into numerical hours and minutes. This function is pivotal for those who need to exact specific time series data or wish to schedule their trades down to the minute.

Example:

[time_hour, time_minute] = time_to_hour_minute("02:30")
// time_hour = 2
// time_minute = 30

Unix Time Converter

The 'time_range_to_unix_time' function transcends traditional boundaries by converting a given time range into Unix timestamp format. This integration of date, time, and timezone, accounts for a comprehensive approach, allowing scripts to make timed decisions, perform historical analyses, and account for international markets across different time zones.

Example:

// Support 'hhmm-hhmm' and 'hh:mm-hh:mm'
[start_unix_time, end_unix_time] = time_range_to_unix_time("09:30-12:00")

Summary:

Each function is meticulously designed to minimize complexity and maximize versatility. Whether you are a programmer seeking to streamline your code, or a trader requiring precise timing for your strategies, our library provides the logical framework that aligns with your needs.

The "Pineify/common" library is the bridge between high-level time concepts and actionable trading insights. It serves a multitude of purposes – from crafting elegant time-based triggers to dissecting complex string data. Embrace the power of precision with "Pineify/common" and elevate your TradingView scripting experience to new heights.
Nota Keluaran:
v2

Added:
time_range_to_start_unix_time(time_range, date_time, timezone)
  Convert the time range to start unix time
  Parameters:
    time_range (string): timeRange
    date_time (int): The Unix timestamp for the date.
    timezone (string): Timezone
  Returns: start_unix_time

time_range_to_end_unix_time(time_range, date_time, timezone)
  Convert the time range to end unix time
  Parameters:
    time_range (string): timeRange
    date_time (int): The Unix timestamp for the date.
    timezone (string): Timezone
  Returns: end_unix_time
Nota Keluaran:
v3

Added:
timeframe_to_seconds(tf)
  Convert the timeframe to seconds
  Parameters:
    tf (simple string): timeframe
  Returns: seconds
Perpustakaan Pine

Di dalam semangat sebenar TradingView, pengarang telah menerbitkan kod Pine ini sebagai perpustakaan sumber terbuka, jadi pengaturcara-pengaturcara Pine yang lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau pada penerbitan-penerbitan sumber terbuka lain, tetapi penggunaan semula kod ini di dalam penerbitan adalah ditadbir oleh Peraturan Dalaman.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Mahu gunakan perpustakaan ini?

Salin garisan ini dan tampalkan ia di dalam skrip anda.