Pineify

common

Pineify Aggiornato   
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.
Note di rilascio:
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
Note di rilascio:
v3

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

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzare questa libreria in privato o all'interno di altre pubblicazioni open-source, ma il riutilizzo del codice è subordinato al rispetto del Regolamento.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questa libreria?

Copia il testo ed incollalo nel tuo script.