Strategy · Pine Script v5 · On the chart

MTF RSI

by Alorse

This strategy enters long when price is above a long moving average and the RSI falls below an oversold level.

View on GitHub

GitHub stars330on the repository
Pine versionv5runs as is
Lines of code23
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

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

MTF 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("MTF RSI", overlay=true, overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, initial_capital=1000, default_qty_value=20, commission_type=strategy.commission.percent, commission_value=0.01)

// RSI
rsiGroup = 'RSI'
lenRSI = input.int(14, title='Length', minval=1, group=rsiGroup)
rsi_overbought = input(70, title='RSI Overbought Level', group=rsiGroup)
rsi_oversold = input(30, title='RSI Overbought Level', group=rsiGroup)
RSI = ta.rsi(close, lenRSI)

maGroup = "Moving Average"
ma_type = input.string(title='Type', defval='EMA', options=['SMA', 'EMA'], group=maGroup, inline='ma')
ma_length = input.int(title='Length', defval=900, group=maGroup, inline='ma')
ma = ma_type == 'SMA' ? ta.sma(close, ma_length) : ta.ema(close, ma_length)

longEntry = close > ma and RSI < rsi_oversold
longExit = RSI > rsi_overbought or close < ma

strategy.entry('Long', strategy.long, when=longEntry)
strategy.close('Long', when=longExit)

Overview

MTF RSI closes the long position when the RSI rises above an overbought level or price drops below the moving average. The RSI length, oversold and overbought thresholds, and the moving-average type and length are user inputs. Entries and exits appear on the price chart. It trades long only, sizes positions as a percentage of equity, and has no stop loss.

Details

Published by

Alorse on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Moving averages, Mean reversion

Markets

Any symbol

Timeframes

Any timeframe

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
Lengthint14lenRSI
RSI Overbought Levelint70rsi_overbought
RSI Overbought Levelint30rsi_oversold
TypestringEMAma_type
Lengthint900ma_length
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

This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,

Strategy v5 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Indicator Strategy (StochRSI, MFI & EMA) With Safety Orders
53 stars

This strategy implements Larry Connors' 2-period RSI mean-reversion algorithm overlaid on the price chart. It filters trades using a long-term Simple Moving Average (SMA), entering long positions when the price trades above the SMA and the short-term RSI drops

Strategy v6 Oscillators & momentumMean reversion
Updated 2 months ago · MPL-2.0 GitHub repository of Larry Connors 2-Period RSI Strategy

FVG RSI Strategy (Optimized)

by skywalker0803r
42 stars

This strategy plots on the price chart and trades fair value gaps filtered by RSI and two EMAs. It opens a long when a bullish gap, a rising candle, RSI below the oversold level, and price under both EMAs align, and a short on the opposite conditions. Each tra

Strategy v5 SMC / ICT / price actionOscillators & momentum
Updated 2 months ago · None stated GitHub repository of FVG RSI Strategy (Optimized)

Burgle Bounce

by benso87
24 stars

Burgle Bounce is a price-chart strategy that treats a move toward one of up to four simple or exponential moving averages as a test when price comes within a user-set percentage of ATR, then exits toward a target average under a separate error margin. Longs an

Strategy v5 Moving averagesOscillators & momentum Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Burgle Bounce
7 stars

This strategy plots a simple moving average basis and upper and lower Bollinger bands on the price chart, with a fill between the bands. It also calculates RSI. It opens one long trade when RSI is above 25, price is at or below the lower band, and no position

Strategy v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy

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