Indicator · Pine Script v5 · On the chart

Kurutoga Screener Template

by NakliTechie

This indicator monitors and displays signals across up to five selectable symbols using an on-chart table.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code175
Settings13inputs
LicenceMIT
Last update1 year ago19 Sep 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

175 lines of Pine Script v5 from templates/kurutoga_screener_template.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

kurutoga_screener_template.pine
//@version=5
indicator("Kurutoga Screener Template", overlay=true, max_lines_count=500, max_labels_count=500, max_boxes_count=500)

// --- Inputs ---
// Screener Display
col_width = input.float(5, title="Column Width (%)", group="Screener Display")
scr_numb = input.int(1, title="Screen #", tooltip="1 - rightmost screener", minval=1, group="Screener Display")

// Signal Parameters
baseLength = input.int(14, title="Base Length", minval=1, group="Signal Parameters")

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
// SYMBOLS - Enable Flags
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
u01 = input.bool(true, title="", group="Symbols", inline="s01")
u02 = input.bool(true, title="", group="Symbols", inline="s02")
u03 = input.bool(true, title="", group="Symbols", inline="s03")
u04 = input.bool(true, title="", group="Symbols", inline="s04")
u05 = input.bool(true, title="", group="Symbols", inline="s05")

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
// SYMBOLS - Tickers
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
s01 = input.symbol("NVDA", group="Symbols", inline="s01")
s02 = input.symbol("AAPL", group="Symbols", inline="s02")
s03 = input.symbol("TSLA", group="Symbols", inline="s03")
s04 = input.symbol("AMZN", group="Symbols", inline="s04")
s05 = input.symbol("GOOGL", group="Symbols", inline="s05")

// --- Script Name ---
string SCRIPT_NAME = "KURU"

// --- Colors Definition ---
colorNeutralBG = color.new(color.gray, 0)
colorSignalTXT = color.new(color.white, 0)
colorBullishBG = color.new(color.green, 75)
colorBearishBG = color.new(color.red, 75)

// --- Helper function for symbol name ---
_only_symbol_name(s) => 
    string _sym = ""
    if not na(s)
        if str.contains(s, ":")
            _sym := array.get(str.split(s, ':'), 1)
        else
            _sym := s
        _sym := str.replace_all(_sym, "_", "-")
    _sym

// --- Helper function to calculate midpoint ---
_calc_midpoint(h, l) =>
    (h + l) / 2

// --- Calculation Function for request.security ---
calculateKurutogaSignal() => 
    // Define the three lengths
    len1 = baseLength
    len2 = baseLength * 2
    len3 = baseLength * 4

    // Calculations for Length 1 (baseLength)
    high1 = ta.highest(high, len1)
    low1 = ta.lowest(low, len1)
    midpoint1 = _calc_midpoint(high1, low1)
    divergence1 = close - midpoint1

    // Calculations for Length 2 (2 * baseLength)
    high2 = ta.highest(high, len2)
    low2 = ta.lowest(low, len2)
    midpoint2 = _calc_midpoint(high2, low2)
    divergence2 = close - midpoint2

    // Calculations for Length 3 (4 * baseLength)
    high3 = ta.highest(high, len3)
    low3 = ta.lowest(low, len3)
    midpoint3 = _calc_midpoint(high3, low3)
    divergence3 = close - midpoint3

    // Signal Logic
    // Bullish condition: All three are positive, and weren't on the previous bar
    allPositive = divergence1 > 0 and divergence2 > 0 and divergence3 > 0
    bullishSignal = allPositive and not allPositive[1]

    // Bearish condition: All three are negative, and weren't on the previous bar
    allNegative = divergence1 < 0 and divergence2 < 0 and divergence3 < 0
    bearishSignal = allNegative and not allNegative[1]

    // Signal Determination
    string signalCode = "---"
    if bullishSignal
        signalCode := "BUY"
    else if bearishSignal
        signalCode := "SELL"

    // Append percentage change if a signal exists
    if signalCode != "---"
        // Use the current bar's close and previous bar's close for percentage change
        float pct_change = ((close - close[1]) / close[1]) * 100.0
        string pct_change_str = str.format("{0,number,#.##}%", pct_change)
        signalCode := signalCode + " " + pct_change_str
        
    signalCode

// --- Security Calls ---
s_expr = calculateKurutogaSignal() 

signal01 = request.security(s01, timeframe.period, s_expr)
signal02 = request.security(s02, timeframe.period, s_expr)
signal03 = request.security(s03, timeframe.period, s_expr)
signal04 = request.security(s04, timeframe.period, s_expr)
signal05 = request.security(s05, timeframe.period, s_expr)

// --- ARRAYS ---
var s_arr = array.new_string(5)
var u_arr = array.new_bool(5)
var signal_arr = array.new_string(5)

if barstate.isfirst
    array.set(s_arr, 0, _only_symbol_name(s01))
    array.set(u_arr, 0, u01)
    array.set(s_arr, 1, _only_symbol_name(s02))
    array.set(u_arr, 1, u02)
    array.set(s_arr, 2, _only_symbol_name(s03))
    array.set(u_arr, 2, u03)
    array.set(s_arr, 3, _only_symbol_name(s04))
    array.set(u_arr, 3, u04)
    array.set(s_arr, 4, _only_symbol_name(s05))
    array.set(u_arr, 4, u05)

// Update signal_arr on every bar
array.set(signal_arr, 0, signal01)
array.set(signal_arr, 1, signal02)
array.set(signal_arr, 2, signal03)
array.set(signal_arr, 3, signal04)
array.set(signal_arr, 4, signal05)

// --- Table Drawing ---
var tbl = table.new(position.top_right, scr_numb > 1 ? 3 : 2, 10, frame_color=#151715, frame_width=1, border_width=2, border_color=color.new(color.white, 100))

if barstate.islast
    table.clear(tbl, 0, 0, scr_numb > 1 ? 2 : 1, 9)

    var int countBuy = 0
    var int countSell = 0
    countBuy := 0
    countSell := 0

    int rounded_col_width = int(math.round(col_width))

    string header_text = SCRIPT_NAME + " - " + str.tostring(scr_numb)
    table.cell(tbl, 0, 0, 'Symbol', width=rounded_col_width, text_halign=text.align_center, bgcolor=color.gray, text_color=color.white, text_size=size.small)
    table.cell(tbl, 1, 0, header_text, width=rounded_col_width, text_halign=text.align_center, bgcolor=color.gray, text_color=color.white, text_size=size.small)
    if scr_numb > 1
        table.cell(tbl, 2, 0, '', width=rounded_col_width * 2 * (scr_numb - 1), text_halign=text.align_center, bgcolor=color.new(color.gray, 100), text_size=size.small)

    int visible_row_index = 1 
    for i = 0 to 4 by 1
        if array.get(u_arr, i) 
            string signal_val_from_array = array.get(signal_arr, i)
            string current_signal = na(signal_val_from_array) ? "---" : signal_val_from_array
            string ticker_name = array.get(s_arr, i)

            color signal_bg_col = colorNeutralBG 
            
            if str.contains(current_signal, "BUY")
                countBuy += 1
                signal_bg_col := colorBullishBG
            else if str.contains(current_signal, "SELL")
                countSell += 1
                signal_bg_col := colorBearishBG

            table.cell(tbl, 0, visible_row_index, ticker_name, text_halign=text.align_center, bgcolor=color.gray, text_color=color.white, text_size=size.small, width=rounded_col_width)
            table.cell(tbl, 1, visible_row_index, current_signal, text_halign=text.align_center, bgcolor=signal_bg_col, text_color=colorSignalTXT, text_size=size.small, width=rounded_col_width)

            visible_row_index += 1

Overview

Kurutoga Screener Template evaluates price relative to the midpoints of highest highs and lowest lows over three lengths derived from a configurable base length. Bullish signals occur when the price crosses above all three midpoints simultaneously, while bearish signals trigger when falling below all three. Settings allow configuring the base length, symbol choices, and table column width.

Details

Published by

NakliTechie on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Screeners & dashboards, Trend, Support & resistance

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Column Width (%)float5col_width
Screen #int1scr_numb
Base Lengthint14baseLength
u01booltrueu01
u02booltrueu02
u03booltrueu03
u04booltrueu04
u05booltrueu05
s01symbolNVDAs01
s02symbolAAPLs02
s03symbolTSLAs03
s04symbolAMZNs04
Show all 13 settings
SettingTypeDefaultVariable
s05symbolGOOGLs05
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

257 stars

This indicator overlays an intraday SPX and ES chart with a midnight session range, regular-trading-hours opening levels, and a VWAP projection box. It draws the midnight high, mid, and low, flags edge rejections within an absolute tolerance, and plots optiona

Indicator v6 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of SPX Midnight Box + Snag Logic
53 stars

Apex Trend & Liquidity Master calculates a trend cloud using customizable moving averages expanded by a volatility multiplier directly on the main price chart. It identifies dynamic support and resistance liquidity zones from swing high and low pivots, extendi

Indicator v6 TrendSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Apex Trend & Liquidity Master

Market Monitor - 1m

by chris-c-thomas
14 stars

Market Monitor - 1m is an overlay indicator designed for multi-chart monitoring and directional bias assessment. It plots a fast, mid, and slow EMA ribbon with a fill cloud, session VWAP with standard deviation bands, and previous day key levels. It evaluates

Indicator v6 TrendMoving averages Repaints
Updated 6 months ago · MIT GitHub repository of Market Monitor - 1m
13 stars

The Adaptive Trend Finder calculates logarithmic linear regression channels overlaid on the price chart. Operating on the most recent historical bar, it fits a log-transformed regression line and standard deviation bands. It evaluates linear correlation using

Indicator v6 TrendSupport & resistance Repaints
Updated 6 months ago · MIT GitHub repository of Adaptive Trend Finder (log)

5 EMAs

by hirawatt
11 stars

5 EMAs calculates and plots five Exponential Moving Averages derived from five configurable timeframes directly onto the main price chart. It also plots the high and low lines fetched from an additional custom timeframe, accompanied by a small on-screen table

Indicator v4 Moving averagesTrend Repaints
Updated 2 years ago · MIT GitHub repository of 5 EMAs
9 stars

Adaptive Supertrend is an overlay indicator that dynamically adjusts its Supertrend band width using a composite conviction score. Conviction is derived from ATR percentile ranking, trend force from EMA distance, and chop detection, narrowing the bands during

Indicator v6 TrendVolatility & bands
Updated yesterday · MIT GitHub repository of Adaptive Supertrend

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers