Range flip snipers

Wait 5 sec.

Range flip snipers Micro E-mini Nasdaq-100 Index FuturesCME_MINI:MNQ1!tswanson666//@version=5 indicator("Yesterday Range + Flip Levels", overlay=true, max_labels_count=10) lookback = input.int(250, "Daily bars to scan back", minval=3, maxval=1000) showLabels = input.bool(true, "Show labels") colRange = input.color(color.new(color.gray, 0), "Range (yesterday H/L)") colFlipUp = input.color(color.new(color.red, 0), "Flip level above") colFlipDn = input.color(color.new(color.green, 0), "Flip level below") // Runs on daily bars: yesterday's H/L, then the most recent earlier // daily high above yesterday's high, and earlier daily low below yesterday's low. f() => pdh = high pdl = low float fh = na float fl = na for i = 2 to lookback if na(fh) and high > pdh fh := high if na(fl) and low < pdl fl := low if not na(fh) and not na(fl) break = request.security(syminfo.tickerid, "D", f(), lookahead=barmerge.lookahead_on) plot(pdh, "Yesterday High", colRange, 2, plot.style_linebr) plot(pdl, "Yesterday Low", colRange, 2, plot.style_linebr) plot(flipHi, "Flip High", colFlipUp, 2, plot.style_linebr) plot(flipLo, "Flip Low", colFlipDn, 2, plot.style_linebr) if showLabels and barstate.islast label.new(bar_index, pdh, "Y High " + str.tostring(pdh, format.mintick), style=label.style_label_left, color=color.new(colRange, 70), textcolor=color.white) label.new(bar_index, pdl, "Y Low " + str.tostring(pdl, format.mintick), style=label.style_label_left, color=color.new(colRange, 70), textcolor=color.white) if not na(flipHi) label.new(bar_index, flipHi, "Flip High " + str.tostring(flipHi, format.mintick), style=label.style_label_left, color=color.new(colFlipUp, 70), textcolor=color.white) if not na(flipLo) label.new(bar_index, flipLo, "Flip Low " + str.tostring(flipLo, format.mintick), style=label.style_label_left, color=color.new(colFlipDn, 70), textcolor=color.white)