Primarily for equities as no provision has been made to control the timing at which the open close high low are determined, indeed, I see no straightforward mechanism to do so in Pinescript.
Development aided by: tradingview.com/script/IXIi0Uoy/, but with the entirely different calculations presented in "Secrets of a Pivot Boss" by Franklin Ochoa. And far cleaner and less-redundant code.
To trade the indicator, watch the H3,H4,H5 and L3,L4,L5 bars. There are two built-in strategies. Depending on pivot width, sell at H3 and buy at L3 with stop at H4/L4 or above. For strongly trending environments: buy at H4, cover at H5--similarly for downtrends.