r/pinescript • u/level_research_4h • 18h ago
Reproducing a closed-source TradingView indicator's 3 levels (high, mid, low) from a 4H window
I'm trying to reproduce the behavior of a closed-source TradingView indicator that draws 3 horizontal levels (high, mid, low) from a 4H window. I can read the levels from the chart for given days and timeframes, but I can't see the source. Fixed grids (Murrey Math) and standard pivot indicators did not match. Has anyone modeled this kind of rule (which bars define the window, how the mid is computed) or know open-source scripts that behave similarly? Any pointers welcome.
1
Upvotes
1
u/TSDevStuff 13h ago
First thing I'd check is which 4H candle it's anchored to. A lot of these are just the previous completed 4H bar's high/low with mid = (h+l)/2, or the first 4H block of the day, and when they don't match it's usually the session/timezone (exchange time vs UTC vs New York).
I'd plot a few versions side by side, e.g. request.security(syminfo.tickerid, "240", high[1], lookahead = barmerge.lookahead_on) and the same for low, then compare against the levels you've written down over 10+ days. If the mid isn't exactly halfway it's probably built from the close or something like VWAP instead.