PINE LIBRARY
업데이트됨 OhMyHtfLibrary

Library "OhMyHtfLibrary"
HTF candle platform: timeframe alignment, profiles, and (future) packed OHLC / draw helpers. Import as `import daggerok/OhMyHtfLibrary/1 as omhl`. Sweep/OB domain → future `OhMyHtfSweepLibrary` (`omhsl`).
resolveHtfContext(chart_tf_seconds, default_htf, default_candle_count, align_ctf_max_seconds, align_htf, align_enabled, profile_ctf_exact_seconds, profile_htf, profile_enabled, profile_candle_counts)
Resolves HTF string, enable flag, and candle count from Timeframes Alignment + Profiles.
TFA: first alignment row where `chart_tf_seconds <= align_ctf_max_seconds` wins.
Profiles: first enabled row where `chart_tf_seconds == profile_ctf_exact_seconds` overrides TFA.
Parameters:
chart_tf_seconds (int): Chart timeframe in seconds.
default_htf (string): Fallback HTF when no alignment rule matches.
default_candle_count (int): Default HTF candle count (HTF Candles input).
align_ctf_max_seconds (array<int>): Upper-bound CTF seconds per TFA row (length 14).
align_htf (array<string>): HTF string per TFA row.
align_enabled (array<bool>): Enabled flag per TFA row.
profile_ctf_exact_seconds (array<int>): Exact chart TF seconds per profile row (length 12).
profile_htf (array<string>): HTF string per profile row.
profile_enabled (array<bool>): Profile row enabled flags.
profile_candle_counts (array<int>): Candle count per profile row.
Returns: `HtfContext` with resolved settings.
HtfContext
Resolved HTF timeframe settings for the current chart.
Fields:
htf (series string): Higher timeframe string for `request.security` and draw logic.
is_enabled (series bool): Whether HTF features are active for this chart TF (TFA enable flag or profile override).
candle_count (series int): Number of HTF candles to display (profile may override default).
profile_override (series bool): True when a profile row matched (exact CTF).
HTF candle platform: timeframe alignment, profiles, and (future) packed OHLC / draw helpers. Import as `import daggerok/OhMyHtfLibrary/1 as omhl`. Sweep/OB domain → future `OhMyHtfSweepLibrary` (`omhsl`).
resolveHtfContext(chart_tf_seconds, default_htf, default_candle_count, align_ctf_max_seconds, align_htf, align_enabled, profile_ctf_exact_seconds, profile_htf, profile_enabled, profile_candle_counts)
Resolves HTF string, enable flag, and candle count from Timeframes Alignment + Profiles.
TFA: first alignment row where `chart_tf_seconds <= align_ctf_max_seconds` wins.
Profiles: first enabled row where `chart_tf_seconds == profile_ctf_exact_seconds` overrides TFA.
Parameters:
chart_tf_seconds (int): Chart timeframe in seconds.
default_htf (string): Fallback HTF when no alignment rule matches.
default_candle_count (int): Default HTF candle count (HTF Candles input).
align_ctf_max_seconds (array<int>): Upper-bound CTF seconds per TFA row (length 14).
align_htf (array<string>): HTF string per TFA row.
align_enabled (array<bool>): Enabled flag per TFA row.
profile_ctf_exact_seconds (array<int>): Exact chart TF seconds per profile row (length 12).
profile_htf (array<string>): HTF string per profile row.
profile_enabled (array<bool>): Profile row enabled flags.
profile_candle_counts (array<int>): Candle count per profile row.
Returns: `HtfContext` with resolved settings.
HtfContext
Resolved HTF timeframe settings for the current chart.
Fields:
htf (series string): Higher timeframe string for `request.security` and draw logic.
is_enabled (series bool): Whether HTF features are active for this chart TF (TFA enable flag or profile override).
candle_count (series int): Number of HTF candles to display (profile may override default).
profile_override (series bool): True when a profile row matched (exact CTF).
릴리즈 노트
v2Added:
chartOpenPack()
Packed HTF opens for `request.security(sym, htf, …, lookahead_on)` — slots h7…h0.
Returns: `array<float>` length 8; evaluate on HTF via security expression only.
chartHighPack()
Packed HTF highs — slots h7…h0.
chartLowPack()
Packed HTF lows — slots h7…h0.
chartClosePack()
Packed HTF closes — slots h7…h0.
chartTimePack()
Packed HTF bar open times — slots h7…h0.
smtDataPack()
Packed comparison-symbol HTF data for SMT — h7…h0, l7…l0, t1, t0 (18 floats).
htfDataReady(chart_times)
Whether chart `request.security` time pack has enough data for HTF draw (early replay guard).
Parameters:
chart_times (array<int>): `chartTimePack()` result from security.
Returns: `true` when size ≥ 8 and forming + prior slot times are non-na.
htfFormingBarTime(chart_times)
Open time of the forming HTF candle (pack slot 7).
Parameters:
chart_times (array<int>)
htfPeriodMs(chart_times)
HTF period length in ms from forming vs prior slot open times.
Parameters:
chart_times (array<int>)
htfStartIndex(candle_count)
First pack index to draw for `candle_count` visible HTF candles.
Parameters:
candle_count (int)
formingHtfChartBarIndex(forming_bar_time)
Chart bar_index when the forming HTF period started (for last-open line anchor).
Call every bar from indicator scope with `htfFormingBarTime(chart_times)`.
Parameters:
forming_bar_time (int)
릴리즈 노트
v3Added:
fun(x)
TODO: add function description here
Parameters:
x (float): TODO: add parameter x description here
Returns: TODO: add what function returns
Removed:
resolveHtfContext(chart_tf_seconds, default_htf, default_candle_count, align_ctf_max_seconds, align_htf, align_enabled, profile_ctf_exact_seconds, profile_htf, profile_enabled, profile_candle_counts)
Resolves HTF string, enable flag, and candle count from Timeframes Alignment + Profiles.
TFA: first alignment row where `chart_tf_seconds <= align_ctf_max_seconds` wins.
Profiles: first enabled row where `chart_tf_seconds == profile_ctf_exact_seconds` overrides TFA.
chartOpenPack()
Packed HTF opens for `request.security(sym, htf, …, lookahead_on)` — slots h7…h0.
chartHighPack()
Packed HTF highs — slots h7…h0.
chartLowPack()
Packed HTF lows — slots h7…h0.
chartClosePack()
Packed HTF closes — slots h7…h0.
chartTimePack()
Packed HTF bar open times — slots h7…h0.
smtDataPack()
Packed comparison-symbol HTF data for SMT — h7…h0, l7…l0, t1, t0 (18 floats).
htfDataReady(chart_times)
Whether chart `request.security` time pack has enough data for HTF draw (early replay guard).
htfFormingBarTime(chart_times)
Open time of the forming HTF candle (pack slot 7).
htfPeriodMs(chart_times)
HTF period length in ms from forming vs prior slot open times.
htfStartIndex(candle_count)
First pack index to draw for `candle_count` visible HTF candles.
formingHtfChartBarIndex(forming_bar_time)
Chart bar_index when the forming HTF period started (for last-open line anchor).
Call every bar from indicator scope with `htfFormingBarTime(chart_times)`.
HtfContext
Resolved HTF timeframe settings for the current chart.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.