htf computes support/resistance, Fair Value Gaps, and market-structure trend on higher timeframes and projects every in-bounds level cleanly onto your execution chart with zero lookahead.
Parameters
Timeframe Mapping (HTF_MAP)
Algorithm & Nuances
- Zero-lookahead HTF input: Uses supplied closed HTF candles trimmed to
Math.min(input.now, windowEnd) so panning back in history never reveals future HTF bars. If a target HTF is not yet cached, aggregates complete buckets locally from the active chart’s Series. Requires at least 30 closed HTF bars per target timeframe (<= 500 bars kept).
- HTF sub-analysis: Runs
sr (up to maxLevels, keeping non-broken levels), fvg (up to maxFvg), and structure (maxLabels: 0, maxEvents: 1) using parameters resolved for the higher timeframe (resolveParams(..., tfMs)).
- Cross-timeframe alignment: Classifies
facts.alignment across all analyzed HTFs as 'aligned_bull' (all bullish), 'aligned_bear' (all bearish), 'mixed' (disagreeing trends), or 'none'.
- In-bounds projection & graceful band→level fallbacks:
- All projected drawings are checked against the execution chart’s visible price envelope
[ltfLo - boundAtr, ltfHi + boundAtr].
- HTF S/R: Emits a full
band (with +20 edge-label priority boost over LTF bands) when [bLo, bHi] fits cleanly inside [minP, maxP]. If an HTF band’s edge spills outside the LTF range while its center price is in bounds, it falls back cleanly to a level line (${tfTag} S|R).
- HTF FVG: Clamps
from to the LTF timeline via lowerBound. Emits a faint zone when [g.low, g.high] fits inside the spanned LTF price bounds; otherwise falls back to a level at Consequent Encroachment (${tfTag} FVG CE).
- HTF Dealing Range
EQ: Emits a neutral level (${tfTag} EQ (premium|discount|equilibrium)) when in bounds.
Drawings & Facts
- Drawings: Tagged with uppercase timeframe prefixes (
1H, 4H, 1D) across band/level S/R, faint zone/level FVGs, and level EQ lines.
- Facts (
HtfFacts): lastClose, alignment, and timeframes[] (interval, trend, levels, gaps, dealingRange).
Activation
- Studies menu:
Higher timeframe: HTF S/R, FVGs and EQ (HTF)
- Slash command:
/htf
- Chat phrases:
htf, mtf, higher timeframe, multi timeframe, htf levels