Strategy · Pine Script v5 · On the chart

RSI MA Scalp Strategy

by g-moe· code credited to goodgains

A momentum scalping strategy designed for 5-minute charts that combines the Relative Strength Index (RSI) with fast and slow Simple Moving Averages (SMA).

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code35
Settings0inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago27 May 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

35 lines of Pine Script v5 from Tradingview/rsi-ma-scalp-strategy.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

rsi-ma-scalp-strategy.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains


//@version=5
strategy("RSI MA Scalp Strategy", overlay = true)

// @keywords: rsi-overbought-entry, rsi-oversold-entry, fast-slow-sma, five-minute-scalp, long-on-rsi70, short-on-rsi30, dual-ma-confirmation, strategy-overlay-plots, momentum-scalp-rules, rsi14-default, sma5-sma20, simple-entry-logic, rsi-ma-confluence, scalp-strategy-backtest, ma-trend-alignment, intraday-scalp-setup, rsi-threshold-gates, strategy-long-short, no-exit-rules, basic-rsi-strategy


// This script is for scalp trading on a 5-minute time frame

// Define the time frame and the RSI period
timeframe = "5"
rsiPeriod = 14

// Get the close price and the RSI value
rsiValue = ta.rsi(close, rsiPeriod)

// Define the moving averages
fastMA = ta.sma(close, 5)
slowMA = ta.sma(close, 20)

// Buy signal: RSI above 70 and fast MA crosses above slow MA
if rsiValue > 70 and fastMA > slowMA
    strategy.entry("Long", strategy.long)

// Sell signal: RSI below 30 and fast MA crosses below slow MA
if rsiValue < 30 and fastMA < slowMA
    strategy.entry("Short", strategy.short)

// Plot the RSI and moving averages
plot(rsiValue, title="RSI")
plot(fastMA, title="Fast MA")
plot(slowMA, title="Slow MA")

Overview

RSI MA Scalp Strategy triggers long entries when the 14-period RSI exceeds 70 while the 5-period SMA is above the 20-period SMA. Short entries occur when RSI falls below 30 while the fast SMA is below the slow SMA. All indicator values are plotted on the main chart pane. The strategy includes no exit rules, stop loss, or take profit targets.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Moving averages, Scalping

Markets

Any symbol

Timeframes

M1-M5

Risk Notes

  • The strategy enters trades without a stop loss
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

5 Minute Scalp

by hasnocool
106 stars

This strategy overlays three exponential moving averages on the price chart, with periods of 9, 50, and 200. It calculates a MACD histogram from a 1-minute timeframe, applies Bollinger Bands to the histogram, and tracks two RSI oscillators of different lengths

Strategy v5 ScalpingMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5 Minute Scalp
53 stars

This strategy trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of EUR/USD EMA9-21 + RSI Scalping Strategy
13 stars

This strategy plots on the price chart and enters from a moving-average filter, ADX and Gann colours. Price above a 200-period EMA allows only longs; price below allows only shorts. A Gann aqua colour with ADX above a key level opens a long, and a Gann brown c

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard TradingZone ADX Gann
10 stars

The Reverse RSI Strategy is a scalping system designed for forex pairs during specific trading sessions. It combines a smoothed RSI indicator with five Exponential Moving Averages to identify mean-reversion trade opportunities. Position sizing dynamically adju

Strategy v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of Strategy - Reverse RSI

Scalping 3EMA

by rodrigo-brito
9 stars

This long-only strategy calculates three exponential moving averages with lengths of 50, 100, and 150 periods, plotting them directly on the price chart. It also calculates a 14-period RSI and MACD. The strategy opens long positions when the moving averages al

Strategy v4 TrendOscillators & momentum
Updated 5 years ago · MIT GitHub repository of Scalping 3EMA

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