PINE LIBRARY

TimeLibrary

Library "TimeLibrary"
TODO: add library description here

Line_Type_Control(Type)
  Line_Type_Control: This function changes between common line types options available are "Solid","Dashed","Dotted"
  Parameters:
    Type (string): : The string to choose the line type from
  Returns: Line_Type : returns the pine script equivalent of the string input

Text_Size_Switch(Text_Size)
  Text_Size_Switch : This function changes between common text sizes options are "Normal", "Tiny", "Small", "Large", "Huge", "Auto"
  Parameters:
    Text_Size (string): : The string to choose the text type from
  Returns: Text_Type : returns the pine script equivalent of the string input

TF(TF_Period, TF_Multip)
  TF generates a string representation of a time frame based on the provided time frame unit (`TF_Period`) and multiplier (`TF_Multip`).
  Parameters:
    TF_Period (simple string)
    TF_Multip (simple int)
  Returns: A string that represents the time frame in Pine Script format, depending on the `TF_Period`:
- For "Minute", it returns the multiplier as a string (e.g., "5" for 5 minutes).
- For "Hour", it returns the equivalent number of minutes (e.g., "120" for 2 hours).
- For "Day", it appends "D" to the multiplier (e.g., "2D" for 2 days).
- For "Week", it appends "W" to the multiplier (e.g., "1W" for 1 week).
- For "Month", it appends "M" to the multiplier (e.g., "3M" for 3 months).
If none of these cases match, it returns the current chart's time frame.

TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip)
  TF_Display generates a string representation of a time frame based on user-defined inputs or the current chart's time frame settings.
  Parameters:
    Chart_as_Timeframe (bool): (bool): Determines whether to use the current chart's time frame or a custom time frame.
TF_Period` (string): The time frame unit (e.g., "Minute", "Hour", "Day", "Week", "Month").
TF_Multip` (int): The multiplier for the time frame (e.g., 15 for 15 minutes, 2 for 2 days).
    TF_Period (string)
    TF_Multip (int)
  Returns: If `Chart_as_Timeframe` is `false`, the function returns a time frame string based on the provided `TF_Period` and `TF_Multip` values (e.g., "5Min", "2D").
If `Chart_as_Timeframe` is `true`, the function determines the current chart's time frame and returns it as a string:
For minute-based time frames, it returns the number of minutes with "Min" (e.g., "15Min") unless it's an exact hour, in which case it returns the hour (e.g., "1H").
For daily, weekly, and monthly time frames, it returns the multiplier with the appropriate unit (e.g., "1D" for daily, "1W" for weekly, "1M" for monthly).

MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length)
  MTF_MS_Display This function calculates and returns a modified swing length value based on the selected time frame and current chart's time frame.
  Parameters:
    Chart_as_Timeframe (bool)
    TF_Period (string)
    TF_Multip (int)
    Swing_Length (int)

HTF_Structure_Control(Chart_as_Timeframe, Show_Only_On_Lower_Timeframes, TF_Period, TF_Multip)
  Parameters:
    Chart_as_Timeframe (bool)
    Show_Only_On_Lower_Timeframes (bool)
    TF_Period (string)
    TF_Multip (int)
mtftimesessions

Pine腳本庫

在真正的TradingView精神中,作者將這段Pine程式碼發佈為開源程式庫,以便我們社群的其他Pine程式設計師可以重複使用它。請向作者致敬!您可以私下使用這個函式庫,或在其他開源出版品中使用,但在出版物中再次使用這段程式碼將受到網站規則的約束。


更多:

免責聲明