Indicator · Pine Script v5 · On the chart

RSIScreener A003

by ruckard

RSIScreener A003 is an indicator that plots RSI oscillator values on the price chart for multiple monitored symbols.

View on GitHub

GitHub stars13on the repository
Pine versionv5runs as is
Lines of code181
Settings16inputs
LicenceNone statedfile: MPL-2.0
Last update1 year ago2 Mar 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

181 lines of Pine Script v5 from indicators/rsi_screener/rsi_screener_a_classic.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

rsi_screener_a_classic.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ruckard

//@version=5

// Current version: v20230312 ( A003 )
// Tradingview Public description - BEGIN
//
// This is a template for Ruckard strategies that interact with Zignaly.
// Template sections are not supposed to be modified and are similar to:
// Template foo - BEGIN
// (...)
// Template foo - END
//
// This will be a quick-and-dirty repurpose of this strategy template as an indicator template.
//
// Sections meant to be added with your own strategy logic are similar to:
// ImplementedIndicator foo - BEGIN
// (...)
// ImplementedIndicator foo - END
//
// ImplementedIndicator explanation - BEGIN
// This is an screener for many pairs.
// It triggers an alert each time one of the RSI levels is reached for every one of the monitored pairs.
// ImplementedIndicator explanation - END
//
// ImplementedIndicator suggested pair and timeframe - BEGIN
// It was originally tested at BTCUSDT pair and 1H timeframe.
// ImplementedIndicator suggested pair and timeframe - END
//
// Template public description - BEGIN
//
// [B]SETTINGS[/B]
// [B]__ SETTINGS - Category1[/B]
// [LIST]
// [*]
// [*]
// [/LIST]
//
// [B]DEFAULT SETTINGS[/B]

// [B] ALERTS SETUP[/B]
//

// ImplementedIndicator public description - BEGIN
// ImplementedIndicator public description - END

// Tradingview Public description - END

indicator('RSIScreener A003', overlay=true, max_bars_back=5000, max_lines_count=500)

// IMPORTS - BEGIN
// IMPORTS - END

// INPUTS - BEGIN

// Template inputs - BEGIN

// HigherTimeframe subindicator Inputs - BEGIN
i_higherTimeframeTrendMaEnforce = input.bool(false, title='Use {False}', group='Enforce Higher Timeframe Trend', inline='HTTimeframeUseShow')
i_showHigherTimeframeTrendMa = input.bool(false, title='Show {False}', group='Enforce Higher Timeframe Trend', inline='HTTimeframeUseShow')

i_higherTimeframeTrendMaTimeframe = input.timeframe('60', title='Timeframe/Offset {1 hour/0 bars}', group='Enforce Higher Timeframe Trend', inline='HTTimeframeOffset')

i_higherTimeframeTrendMaOffset = input.int(0, title='', group='Enforce Higher Timeframe Trend', inline='HTTimeframeOffset')

i_higherTimeframeTrendFastMaType = input.string(defval = 'VWMA', options = ['SMA', 'EMA', 'VWMA', 'RMA', 'WMA'], title = 'Fast MA {EMA/10/close}', group='Enforce Higher Timeframe Trend', inline='HTFastMa')
i_higherTimeframeTrendFastMaLength = input.int(10, minval = 1,  title = '', group='Enforce Higher Timeframe Trend', inline='HTFastMa')
i_higherTimeframeTrendFastMaSource = input.source(close, title = '', group='Enforce Higher Timeframe Trend', inline='HTFastMa')

i_higherTimeframeTrendSlowMaType = input.string(defval = 'VWMA', options = ['SMA', 'EMA', 'VWMA', 'RMA', 'WMA'], title = 'Slow MA {EMA/55/close}', group='Enforce Higher Timeframe Trend', inline='HTSlowMa')
i_higherTimeframeTrendSlowMaLength = input.int(55, minval = 1,  title = '', group='Enforce Higher Timeframe Trend', inline='HTSlowMa')
i_higherTimeframeTrendSlowMaSource = input.source(close, title = '', group='Enforce Higher Timeframe Trend', inline='HTSlowMa')
// HigherTimeframe subindicator Inputs - END

// Template inputs - END

// ImplementedIndicator inputs - BEGIN

i_RSILength = input.int(7, minval=1, title='RSI', group='RSI', inline='RSI')
i_RSISource = input.source(close, title='', group='RSI', inline='RSI')
i_RSIOverSold = input.int(30, minval=1, title='', group='RSI', inline='RSI')
i_RSIOverBought = input.int(80, minval=1, title='', group='RSI', inline='RSI', tooltip='Defaults:\nLength: 7.\n Source: close.\n OverSold: 30.\n OverBought: 80.')

symbol01 = input.symbol("XRPUSDT", group='Symbols', inline='s01', tooltip='Default: XRPUSDT.\n')
symbol02 = input.symbol("BTCUSDT",  group = 'Symbols', inline = 's02', tooltip='Default: BTCUSDT.\n')

// ImplementedIndicator inputs - END

// Strategy - INIT - BEGIN
// Strategy - INIT - END

// Template functions - BEGIN

// MTF - functions - BEGIN
// Taken from `security()` revisited [PineCoders] article.
f_secureSecurity(_symbol, _res, _src) => request.security(_symbol, _res, _src[1], lookahead = barmerge.lookahead_on)
// MTF - functions - END

// MA - Functions - BEGIN
f_Ma (_maType, _maSource, _maLength) =>
    _maType == "SMA" ? ta.sma(_maSource, _maLength) : _maType == "EMA" ? ta.ema(_maSource, _maLength) : _maType == "VWMA" ? ta.vwma(_maSource, _maLength) : _maType == "RMA" ? ta.rma(_maSource, _maLength) : _maType == "WMA" ? ta.wma(_maSource, _maLength) : _maType == "HMA" ? ta.hma(_maSource, _maLength) : _maSource
// MA - Functions - END

getTrend (_fastMaType, _fastMaLength, _fastMaSource, _slowMaType, _slowMaLength, _slowMaSource, _offset) =>
    _fastMa = f_Ma (_fastMaType, _fastMaSource, _fastMaLength)
    _slowMa = f_Ma (_slowMaType, _slowMaSource, _slowMaLength)
    _trend = _fastMa >= _slowMa

    _trendOffset = _trend[_offset]
    _trendOffset

// Template functions - END

// ImplementedIndicator functions - BEGIN

screener_func() =>
    // RSI
    _rsi = ta.rsi(i_RSISource, i_RSILength)
    _rsiOverSoldTrigger = ta.crossunder(_rsi, i_RSIOverSold)
    _rsiOverBoughtTrigger = ta.crossover(_rsi, i_RSIOverBought)

    [_rsiOverSoldTrigger, _rsiOverBoughtTrigger]

// ImplementedIndicator functions - END

// Strategy Body - BEGIN
// Template subindicators - BEGIN
// Higher Timeframe Trend subindicator

higherTimeframeTrend = request.security(syminfo.tickerid, i_higherTimeframeTrendMaTimeframe, getTrend (i_higherTimeframeTrendFastMaType, i_higherTimeframeTrendFastMaLength, i_higherTimeframeTrendFastMaSource, i_higherTimeframeTrendSlowMaType, i_higherTimeframeTrendSlowMaLength, i_higherTimeframeTrendSlowMaSource, i_higherTimeframeTrendMaOffset))

int higherTimeframeTrendMaBarIndex = request.security (syminfo.tickerid, i_higherTimeframeTrendMaTimeframe, bar_index)
bool newHigherTimeframeTrendMaBar = higherTimeframeTrendMaBarIndex[1] != higherTimeframeTrendMaBarIndex[0]

var higherTimeframeTrendMaLong = higherTimeframeTrend
var higherTimeframeTrendMaShort = (not higherTimeframeTrend)

if newHigherTimeframeTrendMaBar
    higherTimeframeTrendMaLong := higherTimeframeTrend
    higherTimeframeTrendMaShort := (not higherTimeframeTrend)

// Template subindicators - END

// ImplementedIndicator subindicators - BEGIN

// RSI Screener subindicator - BEGIN

[rsiOverSoldTrigger01, rsiOverBoughtTrigger01] = request.security(symbol01, timeframe.period, screener_func())
[rsiOverSoldTrigger02, rsiOverBoughtTrigger02] = request.security(symbol02, timeframe.period, screener_func())

if (rsiOverSoldTrigger01)
    alert ('Oversold:' + ' ' + symbol01, alert.freq_once_per_bar_close)

if (rsiOverSoldTrigger02)
    alert ('Oversold:' + ' ' + symbol02, alert.freq_once_per_bar_close)

if (rsiOverBoughtTrigger01)
    alert ('Overbought:' + ' ' + symbol01, alert.freq_once_per_bar_close)

if (rsiOverBoughtTrigger02)
    alert ('Overbought:' + ' ' + symbol02, alert.freq_once_per_bar_close)

// RSI Screener subindicator - END

// ImplementedIndicator subindicators - END

// Higher Timeframe Trend - Plot - BEGIN
higherTimeframeTrendMaLongColor = i_showHigherTimeframeTrendMa ? color.new(#00c3ff, transp=0) : na
higherTimeframeTrendMaShortColor = i_showHigherTimeframeTrendMa ? color.new(#ff0062, transp=0) : na
plotshape(higherTimeframeTrendMaLong, title='SideMA Up', style=shape.arrowup, color=higherTimeframeTrendMaLongColor, location=location.top)
plotshape(higherTimeframeTrendMaShort, title='SideMA Down', style=shape.arrowdown, color=higherTimeframeTrendMaShortColor, location=location.top)
// Higher Timeframe Trend - Plot - END

// ImplementedIndicator - Plot - BEGIN

// ImplementedIndicator - Plot - END

// Alerts - BEGIN
// WARN: This might be usually empty because I prefer to write strategies for handling alerts.
// Alerts - END

Overview

RSIScreener A003 calculates RSI with user-defined length and source, along with customizable overbought and oversold levels. The script can enforce a higher timeframe trend filter using fast and slow moving averages of types including EMA, VWMA, and others. It signals by triggering alerts whenever RSI crosses the set levels on each pair. Main settings allow adjustment of RSI parameters, MA lengths, and higher timeframe options. The indicator draws directly on the price chart and supports max bars back of 5000 for historical data viewing.

Details

Published by

ruckard on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Support & resistance

Markets

Crypto

Timeframes

M15-H1

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
Use {False}boolfalsei_higherTimeframeTrendMaEnforce
Show {False}boolfalsei_showHigherTimeframeTrendMa
Timeframe/Offset {1 hour/0 bars}timeframe60i_higherTimeframeTrendMaTimeframe
i_higherTimeframeTrendMaOffsetint0i_higherTimeframeTrendMaOffset
Fast MA {EMA/10/close}stringVWMAi_higherTimeframeTrendFastMaType
i_higherTimeframeTrendFastMaLengthint10i_higherTimeframeTrendFastMaLength
i_higherTimeframeTrendFastMaSourcesourceclosei_higherTimeframeTrendFastMaSource
Slow MA {EMA/55/close}stringVWMAi_higherTimeframeTrendSlowMaType
i_higherTimeframeTrendSlowMaLengthint55i_higherTimeframeTrendSlowMaLength
i_higherTimeframeTrendSlowMaSourcesourceclosei_higherTimeframeTrendSlowMaSource
RSIint7i_RSILength
i_RSISourcesourceclosei_RSISource
Show all 16 settings
SettingTypeDefaultVariable
i_RSIOverSoldint30i_RSIOverSold
i_RSIOverBoughtint80i_RSIOverBought
symbol01symbolXRPUSDTsymbol01
symbol02symbolBTCUSDTsymbol02
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

PivotHighLow

by Alorse
330 stars

This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition

Indicator v4 Support & resistanceOscillators & momentum Repaints
Updated 2 months ago · None stated GitHub repository of PivotHighLow
114 stars

This indicator calculates key support and resistance levels by analyzing the first and second momentum derivatives of a Double Exponential Moving Average (DEMA). When the second derivative (momentum of momentum) crosses zero, it identifies local turning points

Indicator v4 Support & resistanceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Support and Resistance Levels

Moon Dev Lunar Sniper

by moondevonyt
92 stars

Moon Dev Lunar Sniper is a multi-indicator overlay that scores confluence across fast and slow EMAs, RSI, MACD, DMI, and BB width to fire signals only when score meets the minimum threshold. It plots buy and sell signals on the price chart, highlights cosmic b

Indicator v6 TrendOscillators & momentum Repaints
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev Lunar Sniper
23 stars

This indicator collection calculates and plots previous daily high and low price levels on the chart to identify potential supply and demand zones. It includes real-time intraday high and low calculations, RSI divergence detection across a customizable period

Indicator v4 Support & resistanceDivergence
Updated 3 years ago · None stated GitHub repository of Daily High and Low Strategy
14 stars

Self-Aware Trend System calculates volatility-adaptive ATR trailing bands using a Trend Quality Index engine that evaluates market efficiency, momentum persistence, and structural pivots. It plots adaptive trend bands and character-flip trend signals directly

Indicator v6 TrendVolatility & bands
Updated 2 weeks ago · MIT GitHub repository of Self-Aware Trend System [WillyAlgoTrader]

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