TradingView screening workflow

Inside-bar screener: mother bars and nested ranges

An inside bar screener compares each candle's full high-low range with a reference candle. A strict match has a lower high and a higher low. Decide whether equal boundaries count and whether later bars must fit the immediately preceding bar or the original mother bar. The three-symbol Pine example below reports both sequences on completed daily bars; open each matching chart to confirm the date, session and reference range.

Explore Market Screener

Define containment and equal boundaries

Let H and L be the candidate high and low, and MHigh and MLow the reference range. Strict containment means H < MHigh and L > MLow. The optional inclusive rule means H ≤ MHigh and L ≥ MLow. TradingView describes an inside bar as covered by the previous candle; the equality setting here is an explicit scanner choice, so two scripts can disagree without either making an arithmetic error.

  • Equality uses the quoted prices, not a tolerance inferred from rounded screen labels. A one-tick overshoot fails both rules.
  • An identical range qualifies only in inclusive mode. A zero-range candidate can qualify inside a wider reference; this geometry alone says nothing about trading activity or liquidity.
  • An inside bar need not be a harami: body containment and full-range containment are different tests.
Hypothetical reference: high 110, low 100Strict resultInclusive result
Candidate high 108, low 102MatchMatch
Candidate high 110, low 102No match: equal highMatch
Candidate high 108, low 100No match: equal lowMatch
Candidate high 110, low 100No matchMatch: identical range
Candidate high 111, low 102No matchNo match
Candidate high 105, low 105MatchMatch

Separate nested bars from a continuing mother range

For adjacent-bar screening, the preceding candle is the reference on every comparison. For a fixed-mother sequence, hold its high and low while subsequent bars remain contained. Reset the mother to the current bar, and the count to zero, when either containment boundary fails. In strict mode, touching a mother boundary also resets the sequence. This page uses that reset rule rather than retaining an older, wider range indefinitely.

  • At C, an adjacent-bar filter excludes the symbol; the fixed-mother filter keeps it with A as mother. C does not become the mother merely because it is larger than B.
  • At D, the nested count is one, not three: the adjacent sequence broke at C. The mother run still counts B, C and D.
  • The script initializes its mother on the first available requested daily bar. A sequence already underway before that history begins has an unknown earlier anchor; inspect the chart before treating its count as complete.
Hypothetical barHigh / lowNested countFixed-mother count
A: initial mother110 / 10000
B: inside A108 / 10211
C: inside A, outside B109 / 10102
D: inside C and A107 / 10313
E: touches A high110 / 10400 with strict mode; 4 with inclusive mode

Run a three-symbol daily scanner on an intraday chart

Paste this Pine Script v6 indicator into TradingView's Pine Editor, save it and add it to a standard 60-minute chart. Choose three exchange-qualified symbols in Settings. The daily calculations run separately for each symbol. Nested > 0 means the reported daily bar is inside its predecessor; Mother run > 0 means it remains inside the retained mother. Green rows identify the latter condition. The default tickers are examples, not recommendations.

  • The [1] offsets return the previous daily result with lookahead_on. The result becomes available when the next requested daily period begins; it is not an immediate end-of-session scan of the day that just closed. This deliberate delay avoids using the developing daily high or low.
  • Bar date UTC is the opening date of the reported daily bar in UTC. It is not the time the table refreshed. Holidays, different market sessions and suspended trading can leave dates different across rows.
  • Requests use gaps_off, so the last available result can remain visible. Check the date even when the row is green. Invalid symbols or insufficient history show No data rather than a negative match.
  • The indicator rejects daily and higher chart intervals. Use standard time-based candles, consistent exchange symbols and matching session settings when reviewing results. It contains no order placement or alert logic.
Three explicit symbol inputs; completed daily ranges; strict containment by default. Syntax checked with Pineify on 2026-10-17.pine
//@version=6
indicator("Inside-bar list: completed daily bars", overlay = true)
bool allowEqual = input.bool(false, "Allow equal highs/lows")
string ticker1 = input.symbol("NASDAQ:AAPL", "Symbol 1")
string ticker2 = input.symbol("NASDAQ:MSFT", "Symbol 2")
string ticker3 = input.symbol("NASDAQ:NVDA", "Symbol 3")
if not timeframe.isintraday or timeframe.in_seconds() >= timeframe.in_seconds("1D")
    runtime.error("Use a standard intraday chart, such as 60 minutes.")

inside(float h, float l, float mh, float ml) =>
    allowEqual ? h <= mh and l >= ml : h < mh and l > ml

scan() =>
    var float motherHigh = na
    var float motherLow = na
    var int motherRun = 0
    var int nestedRun = 0
    bool pairInside = not na(high[1]) and inside(high, low, high[1], low[1])
    nestedRun := pairInside ? nestedRun + 1 : 0
    if na(motherHigh) or not inside(high, low, motherHigh, motherLow)
        motherHigh := high
        motherLow := low
        motherRun := 0
    else
        motherRun += 1
    [nestedRun[1], motherRun[1], motherHigh[1], motherLow[1], time[1], not na(high[2])]

[n1, r1, h1, l1, t1, ok1] = request.security(ticker1, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[n2, r2, h2, l2, t2, ok2] = request.security(ticker2, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
[n3, r3, h3, l3, t3, ok3] = request.security(ticker3, "1D", scan(), gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on, ignore_invalid_symbol = true)
var table results = table.new(position.top_right, 6, 4, border_width = 1)
showRow(int row, string symbol, int nested, int run, float mh, float ml, int stamp, bool ready) =>
    bool hasData = ready and not na(stamp)
    color shade = hasData and run > 0 ? color.new(color.green, 75) : color.new(color.gray, 85)
    table.cell(results, 0, row, symbol, bgcolor = shade, text_color = color.white)
    table.cell(results, 1, row, hasData ? str.tostring(nested) : "No data", bgcolor = shade, text_color = color.white)
    table.cell(results, 2, row, hasData ? str.tostring(run) : "No data", bgcolor = shade, text_color = color.white)
    table.cell(results, 3, row, hasData ? str.tostring(mh, "#.########") : "N/A", bgcolor = shade, text_color = color.white)
    table.cell(results, 4, row, hasData ? str.tostring(ml, "#.########") : "N/A", bgcolor = shade, text_color = color.white)
    table.cell(results, 5, row, hasData ? str.format_time(stamp, "yyyy-MM-dd", "UTC") : "N/A", bgcolor = shade, text_color = color.white)
if barstate.islast
    array<string> headings = array.from("Symbol", "Nested", "Mother run", "Mother high", "Mother low", "Bar date UTC")
    for col = 0 to 5
        table.cell(results, col, 0, array.get(headings, col), bgcolor = color.navy, text_color = color.white)
    showRow(1, ticker1, n1, r1, h1, l1, t1, ok1)
    showRow(2, ticker2, n2, r2, h2, l2, t2, ok2)
    showRow(3, ticker3, n3, r3, h3, l3, t3, ok3)

Budget requests before extending the list

This example uses three request.security calls, each returning the counts, reference levels, date and readiness in one tuple. A different symbol or timeframe generally adds a distinct request context. TradingView's Pine documentation currently lists a limit of 40 unique request calls, or 64 on Ultimate. These are script request limits, not a promise that a script can scan every symbol in your watchlist.

  • A design with 20 symbols at two timeframes needs 40 contexts if it uses one request per symbol and timeframe. Under a 40-request limit that leaves no capacity for other distinct requests or requests inside imported libraries.
  • Keep related outputs in one request. Separate requests for each high, low, date and condition can consume the budget much faster; other execution and tuple limits still apply.
  • This table accepts exactly three input symbols and does not import the TradingView watchlist. For a larger list, use deliberately bounded batches or assess TradingView's separate Pine Screener and its own indicator requirements.
  • Pine Screener is not this chart table. Do not paste a multi-symbol table into it and assume it will scan the same universe or display table cells as filter outputs.

Use Pineify for the shortlist and custom rule

Pineify Market Screener exposes supported current OHLC, RSI 14 and Relative Volume fields in symbol collections. Use those available columns to narrow your research list, verify that the selected symbols belong to the intended market, and set the collection to 1D. Check symbol-level timeframe overrides and snapshot timestamps. The current field catalog does not provide this inside-bar or mother-run condition; current high and low alone cannot compare two daily candles.

  • Review data age before copying candidates into TradingView. Pineify's snapshot model distinguishes bar time, received time and missing data; a page refresh alone does not prove a new market observation.
  • Open the supported symbol on TradingView, then run the finite-list indicator and verify the range on its daily chart. Differences in feed, session or adjustments can produce different high-low ranges.
  • For a different symbol count, equality policy or reset rule, give the Pine Script AI Coding Agent the exact specification. Ask it to return readable Pine source with dated output and missing-data handling, then compile and compare matching and failing cases. Custom code is not executed as a new Market Screener field.

Review every match before acting

For each candidate, open the exact exchange-qualified symbol on a standard daily chart and locate the table's reported date. Read the highs and lows from the chart data, then trace back the mother range using the chosen reset policy. Record the candidate date, mother date, equality mode, session and both counts with your saved shortlist.

  • Recalculate one match and one failure by hand. In the example above, C must pass the fixed-mother test and fail the adjacent-bar test. A screener showing both as one condition is hiding a meaningful choice.
  • A live candle can start inside and later cross a boundary. Comparing that candle with the completed-day table creates a false discrepancy.
  • Inspect missing sessions, split adjustments, unusual wicks and illiquid zero-range bars. Do not silently replace missing values with zeros.
  • A later wick beyond the mother is different from a close beyond it. A gap can skip a proposed entry, and a breakout can reverse. Screening geometry does not establish an entry, stop, position size or expected return.
Where Pineify fits

Pineify Market Screener

Organize supported symbols and compare available technical columns before checking custom inside-bar conditions on TradingView.

Also useful: Pine Script AI Coding Agent. Draft and revise a finite-list Pine scanner with explicit equality, mother-reset and completed-bar rules.

Explore Market Screener

Frequently asked questions

Educational screening rules and hypothetical price examples, not investment advice. Range containment does not predict breakout direction or trading returns.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.