hlcc4 - PineScript Variable
Overview
Section titled “Overview”hlcc4 is shorthand for (high + low + close + close) / 4. It weights the close twice while still accounting for the bar’s range, creating a smoother series than the raw close.
floatQualifier
Section titled “Qualifier”series
Remarks
Section titled “Remarks”- Useful when you want to dampen intrabar spikes without losing the influence of the close.
- Because the close appears twice, the value tracks closing moves more closely than
hl2orhlc3. - Like other derived prices, it updates intrabar when extremes shift and finalises after the bar closes.
Example
Section titled “Example”//@version=5indicator("HLCC4 smoothing", overlay=false)
plot(close, "Close", color=color.blue)plot(hlcc4, "HLCC4", color=color.orange)plot(ta.sma(hlcc4, 14), "HLCC4 SMA", color=color.green)