r/pinescript • • 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

4 comments sorted by

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.

1

u/level_research_4h 12h ago

Thanks, this is really helpful. A few follow-ups if you don't mind: 1) The levels I'm seeing look like fractions of a frame built from the previous daily bar, for example one level sits at 7/8 of a prior bar's range, and the step between levels is about 39 points on US500. Have you seen indicators that draw levels as Murrey-style fractions of a prior-bar range like that? 2) For the anchor-bar approach with request.security, which settings would you use for session/timezone when the levels stay stable intraday but shift day to day? 3) Do you know of any open-source script that behaves like that?

1

u/TSDevStuff 11h ago

Yeah, that smells like Murrey math: 8 equal steps of a range, so 7/8 and a fixed step size fits. I'd pull prior-day high/low with request.security, lookahead off, on the exchange's own session and time zone. If the levels only jump at the daily rollover, it's usually the time zone. There's a pile of open-source Murrey scripts on TradingView if you search for it.

1

u/level_research_4h 10h ago

Thanks a lot, that gives me a clear next test. Much appreciated!