Strategy · Pine Script v5 · On the chart

Double RSI [Alorse]

by Alorse

Double RSI is a momentum strategy that calculates RSI on the current bar and a multi-timeframe RSI.

View on GitHub

GitHub stars330on the repository
Pine versionv5runs as is
Lines of code30
Settings5inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago25 Aug 2026

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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

30 lines of Pine Script v5 from strategies/momentum/Double RSI.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

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

//@version=5
strategy(title='Double RSI [Alorse]', overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, initial_capital=1000, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.01)

rsiGroup = 'RSI'
len = input.int(14, minval=1, title='Length', group=rsiGroup)
src = input.source(close, 'Source', group=rsiGroup)
rsi = ta.rsi(src, len)

multiGroup = 'Multi Timeframe RSI'
resA = input.timeframe(title='Timeframe', defval='15', group=multiGroup)
mRsi = request.security(syminfo.tickerid, resA, ta.rsi(src, len))

tpGroup = 'Take Profit'
useTP = input.bool(false, title='╔══════   Enable   ══════╗', group=tpGroup)
TPPercent = input.float(1.2, step=0.1, title='Percent', group=tpGroup) * 0.01

longTP = strategy.position_avg_price * (1 + TPPercent)
shortTP = strategy.position_avg_price * (1 - TPPercent)

// Strategy
buy = ta.crossover(rsi, 30) and mRsi < 35
sell = ta.crossunder(rsi, 70) and mRsi > 65
strategy.entry('Long', strategy.long, when=buy)
strategy.exit('Exit', 'Long', stop=na, limit=longTP)

strategy.entry('Short', strategy.short, when=sell)
strategy.exit('Exit', 'Short', stop=na, limit=shortTP)

Overview

Long entries trigger on RSI crossover above 30 when multi-timeframe RSI is below 35. Short entries trigger on RSI crossover below 70 when multi-timeframe RSI is above 65. Positions enter on the price chart with take-profit exits set to a percentage of average price. No stop loss applies by default. Settings allow changes to RSI length, source, multi-timeframe, take-profit enable, and percentage. It draws signals directly on the price chart.

Details

Published by

Alorse on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

pinescriptpinescript-indicatorspinescript-strategiestrading-strategiestradingviewtradingview-alerttradingview-strategy

Settings

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

SettingTypeDefaultVariable
Lengthint14len
Sourcesourceclosesrc
Timeframetimeframe15resA
╔══════   Enable   ══════╗boolfalseuseTP
Percentfloat1.2TPPercent
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

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy

MACD Strategy

by TradersPost
218 stars

This overlay strategy is built around MACD inputs for a fast average, a slow average, and a signal line. Comments say the script keeps MACD values available and can draw a histogram and zero line in a separate pane, with an optional overlay on price. Settings

Strategy v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of MACD Strategy

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy
105 stars

This overlay strategy looks for gold scalps from break of structure and change of character. It enters long when a bullish break, a bullish character change, and an optional volume filter align, and short on the opposite set. Optional RSI levels can block trad

Strategy v6 SMC / ICT / price actionOscillators & momentum Repaints

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers