INVITE-ONLY SCRIPT

HTF Candles [TakingProphets]

56
HTF Candles — Higher-Timeframe Structure, SMT Divergence, and Live OHLC Projections

**OVERVIEW**
HTF Candles projects higher-timeframe (HTF) structure directly onto your lower-timeframe chart, so you can align intraday decisions with institutional context. It combines three tools in one overlay:

- HTF candle visualization (up to 10 candles, offset to the right for clarity)
- Real-time and historical SMT divergence detection vs. a correlated asset (default: `CME_MINI:ES1!`)
- Live projections of the current HTF candle’s Open, High, Low, and Close

This is not a signal generator. It is an informational framework that consolidates HTF context into your workflow.

---

**WHAT IT DOES**

- Plot up to 10 HTF candles
- Draws HTF bodies and wicks on your LTF chart
- Offsets to the right to avoid cluttering price action

- HTF close timer
- Optional countdown showing when the active HTF candle will close

- SMT divergence detection
- Compares your chart vs. a correlated asset on the chosen HTF
- Detects and labels potential bearish (high-side) and bullish (low-side) SMTs
- Supports historical SMTs and developing real-time SMTs

- HTF OHLC projections
- Projects current HTF Open, High, Low, Close forward in real time
- Optional price labels and per-line styling for precision S/R reference

---

**HOW IT WORKS (TECHNICAL OUTLINE)**

- Timeframe mapping
- User selects a display TF (1m to 1M). Internally it maps to `request.security()` for O/H/L/C/time arrays.
- Up to `MAX_CANDLES = 10` are fetched and managed with arrays.

- Candle rendering
- For each HTF candle, the script computes a right-hand x-position using a user-set offset and spacing.
- Bodies are drawn with a box handle; wicks are drawn with lines.
- Colors, transparency, width, and borders are user-configurable.

- Smart time labeling
- Intraday frames display HH:MM (12h or 24h format).
- Daily+ frames display date labels.
- Label size is configurable.

- SMT divergence logic
- Uses HTF highs/lows of your chart and the correlated asset from `request.security()` at the same HTF.
- Historical SMT: compares the prior two completed HTF candles (indexes 2→1).
- Real-time SMT: compares the last completed candle and the developing candle (indexes 1→0).
- Bearish SMT (high-side): one makes a higher high vs. its previous high while the other does not.
- Bullish SMT (low-side): one makes a lower low vs. its previous low while the other does not.
- Lines and labels update as conditions form; optional labels can be toggled.

- OHLC projection engine
- Draws forward lines for current HTF Open, High, Low, Close.
- Start points are derived from the first occurrence of each level inside the current HTF period (or from the period start for Open/Close).
- Each projection has independent color, style, width, and optional price label.

- Alerts
- Four alert conditions: Bullish SMT, Bearish SMT, Bullish Real-time SMT, Bearish Real-time SMT.
- Fire on the bar where the condition first becomes true (edge detection).

---

**WHY IT’S ORIGINAL (INVITE-ONLY JUSTIFICATION)**

- Unified HTF overlay that merges candle rendering, real-time SMT detection, and dynamic OHLC projections into a single chart object.
- Historical and developing SMT logic implemented on true HTF series via arrayed `request.security()`
- Projection engine back-traces level origin inside the current HTF period and extends forward with optional labels for precise, persistent references.
- Immediate visual customization (colors, widths, transparency, offsets, label sizes) without redrawing the entire layout.

---

**HOW TO USE**

- Add the indicator to any instrument (e.g., NQ, ES).
- Choose the HTF you want to project (1m to 1M).
- Set how many HTF candles to show and adjust horizontal offset, spacing, candle width, and transparency.
- Optionally enable time labels and select 12h or 24h format.
- For SMT, enable the feature, choose a correlated asset (default: `CME_MINI:ES1!`), and pick line style/width/color.
- Enable OHLC projections and customize which lines to show and how they appear.
- Create alerts for any SMT condition you want to track.
- Use the overlay as HTF context only; combine with your own narrative and risk rules.

---

**INPUTS OVERVIEW**

- Timeframe Settings
- HTF selection (1m to 1M)

- Display Settings
- Number of candles (1–10), horizontal offset, candle width, transparency
- Time labels on/off, 12h/24h, label size
- HTF close timer on/off

- Visual Settings
- Bullish/bearish body colors, border color, wick color

- SMT Settings
- Enable SMT, correlated asset, line color/style/width, labels on/off
- SMT alerts on/off

- Projection Settings
- Enable projections, per-level toggles (Open, High, Low, Close)
- Colors, line style, width,

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.