MirPapa_Handler_HTF

High Time Frame Handler Library:
Provides utilities for working with High Time Frame (HTF) and chart (LTF) conversions and data retrieval.
IsChartTFcomparisonHTF(_chartTf, _htfTf)
IsChartTFcomparisonHTF
description
Determine whether the given High Time Frame (HTF) is greater than or equal to the current chart timeframe.
Parameters:
_chartTf (string): The current chart’s timeframe string (examples: "5", "15", "1D").
_htfTf (string): The High Time Frame string to compare (examples: "60", "1D").
return
Returns true if HTF minutes ≥ chart minutes, false otherwise or na if conversion fails.
GetHTFrevised(_tf, _case)
GetHTFrevised
description
Retrieve a specific bar value from a Higher Time Frame (HTF) series.
Supports current and historical OHLC values, based on a case identifier.
Parameters:
_tf (string): The target HTF string (examples: "60", "1D").
_case (string): A case string determining which OHLC value and bar offset to request:
"b" → HTF bar_index
"o" → HTF open
"h" → HTF high
"l" → HTF low
"c" → HTF close
"o1" → HTF open one bar ago
"h1" → HTF high one bar ago
"l1" → HTF low one bar ago
"c1" → HTF close one bar ago
… up to "o5", "h5", "l5", "c5" for five bars ago.
return
Returns the requested HTF value or na if _case does not match any condition.
GetHTFfromLabel(_label)
GetHTFfromLabel
description
Convert a Korean HTF label into a Pine Script-recognizable timeframe string.
Examples:
"5분" → "5"
"1시간" → "60"
"일봉" → "1D"
"주봉" → "1W"
"월봉" → "1M"
"연봉" → "12M"
Parameters:
_label (string): The Korean HTF label string (examples: "5분", "1시간", "일봉").
return
Returns the Pine Script timeframe string corresponding to the label, or "1W" if no match is found.
GetHTFoffsetToLTFoffset(_offset, _chartTf, _htfTf)
GetHTFoffsetToLTFoffset
description
Adjust an HTF bar index and offset so that it aligns with the current chart’s bar index.
Useful for retrieving historical HTF data on an LTF chart.
Parameters:
_offset (int): The HTF bar offset (0 means current HTF bar, 1 means one bar ago, etc.).
_chartTf (string): The current chart’s timeframe string (examples: "5", "15", "1D").
_htfTf (string): The High Time Frame string to align (examples: "60", "1D").
return
Returns the corresponding LTF bar index after applying HTF offset. If result is negative, returns 0.
업데이트됨
GetHTFrevised(_tf, _case)
Parameters:
_tf (string)
_case (string)
Biblioteca Pine
Siguiendo fielmente el espíritu de TradingView, el autor ha publicado este código Pine como una biblioteca de código, permitiendo que otros programadores de Pine en nuestra comunidad puedan volver a utilizarlo. ¡Un brindis por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en publicaciones se rige por las Normas internas.
Exención de responsabilidad
Biblioteca Pine
Siguiendo fielmente el espíritu de TradingView, el autor ha publicado este código Pine como una biblioteca de código, permitiendo que otros programadores de Pine en nuestra comunidad puedan volver a utilizarlo. ¡Un brindis por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en publicaciones se rige por las Normas internas.