PINE LIBRARY
Cập nhật MirPapa_Handler_HTF

Library "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.
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.
Phát hành các Ghi chú
v2업데이트됨
GetHTFrevised(_tf, _case)
Parameters:
_tf (string)
_case (string)
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.