Jayadev Rana Get a custom script
Free indicator · Pine Script v6

Mini Screener

One table on one chart that watches five markets at once: price, change since the last candle, and whether each one is above its trend average. Built with arrays and a loop.

IndicatorPine Script v6OverlayFree

Get the codeDownload .pine.txt

Snapshots

Five crypto markets in one table: symbol, price and change, with the symbol cell green above the trend and red below it.
Five crypto markets in one table: symbol, price and change, with the symbol cell green above the trend and red below it.
Symbol 5 swapped from XRP to DOGE in the settings: the last row updates without touching a line of code.
Symbol 5 swapped from XRP to DOGE in the settings: the last row updates without touching a line of code.
The complete script, including the function that returns three values at once.
The complete script, including the function that returns three values at once.

How it works

  1. One small function returns three answers in a bag: [close, change, above trend].
  2. request.security runs that function on each symbol you pick, so each call carries three values instead of one.
  3. array.from stores the answers and a for loop fills every row, so adding markets does not mean adding code.

Settings

SettingDefaultWhat it does
Symbol 1BINANCE:BTCUSDTFirst row of the screener
Symbol 2BINANCE:ETHUSDTSecond row
Symbol 3BINANCE:SOLUSDTThird row
Symbol 4BINANCE:BNBUSDTFourth row
Symbol 5BINANCE:XRPUSDTFifth row
Trend average length50EMA used for the trend question on every symbol

Source code

In TradingView: open the Pine Editor, create a new indicator, paste the code, then click "Add to chart".

mini-screener.pine.txtGitHubDownload
//@version=6
indicator("Mini Screener", overlay = true)

// 1. Settings: five symbols and the trend length
sym1   = input.symbol("BINANCE:BTCUSDT", "Symbol 1")
sym2   = input.symbol("BINANCE:ETHUSDT", "Symbol 2")
sym3   = input.symbol("BINANCE:SOLUSDT", "Symbol 3")
sym4   = input.symbol("BINANCE:BNBUSDT", "Symbol 4")
sym5   = input.symbol("BINANCE:XRPUSDT", "Symbol 5")
emaLen = input.int(50, "Trend average length")

// 2. One question, asked about any symbol
report() =>
    ema = ta.ema(close, emaLen)
    chg = 100 * (close - close[1]) / close[1]
    [close, chg, close > ema]

// 3. Ask the same question about all five
[p1, c1, u1] = request.security(sym1, timeframe.period, report())
[p2, c2, u2] = request.security(sym2, timeframe.period, report())
[p3, c3, u3] = request.security(sym3, timeframe.period, report())
[p4, c4, u4] = request.security(sym4, timeframe.period, report())
[p5, c5, u5] = request.security(sym5, timeframe.period, report())

// 4. Put the answers into arrays, so we can loop over them
names  = array.from(sym1, sym2, sym3, sym4, sym5)
prices = array.from(p1, p2, p3, p4, p5)
changes = array.from(c1, c2, c3, c4, c5)
trends = array.from(u1, u2, u3, u4, u5)

// 5. The table, created once
var table screen = table.new(position.top_right, 3, 6, border_width = 2)

// 6. A helper that writes one cell
cell(col, row, txt, bg) =>
    table.cell(screen, col, row, txt, text_color = color.white,
      bgcolor = bg, text_size = size.normal)

// 7. Fill the screener on the last candle only
if barstate.islast
    cell(0, 0, "Symbol", color.gray)
    cell(1, 0, "Price", color.gray)
    cell(2, 0, "Change", color.gray)
    for i = 0 to 4
        name = str.replace_all(array.get(names, i), "BINANCE:", "")
        up = array.get(trends, i)
        chg = array.get(changes, i)
        cell(0, i + 1, name, up ? color.green : color.red)
        cell(1, i + 1, str.tostring(array.get(prices, i), "#.##"), color.gray)
        cell(2, i + 1, str.tostring(chg, "#.##") + "%", color.gray)

Watch it built

This script is written and explained step by step in the video lesson.

Need a custom indicator or strategy?

Non-repainting Pine Script v6, backtested with real costs, alert and webhook ready. Fixed quote within 24 hours.

Free and open source under the Mozilla Public License 2.0. Educational content only, not financial advice. Backtest results are historical and include the costs stated; past performance does not predict future results. © Jayadev Rana · Privacy · Terms