data(x) => d = security(syminfo.tickerid, timeframe.period, x, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on) d getLow(x, y, z, a) => lastlow = y v = data(x) m = v==lastlow or data(z) - v > a*syminfo.mintick if v!=lastlow lastlow := v if m v := 0.0 [v,lastlow] getHigh(x, y, z, a) => lasthigh = y v = data(x) m = v==lasthigh or v - data(z) > a*syminfo.mintick if v!=lasthigh lasthigh := v if m v := 0.0 [v,lasthigh]
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.