Strategy · Pine Script v5 · On the chart

MEMA + BB + RSI [Alorse]

by Alorse

This mean-reversion strategy combines multi-timeframe exponential moving averages, Bollinger Bands, and the Relative Strength Index.

View on GitHub

GitHub stars330on the repository
Pine versionv5runs as is
Lines of code109
Settings20inputs
LicenceNone stated
Last update2 months ago25 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

MEMA + BB + RSI [Alorse] generates long and optional short trade signals when price interacts with the Bollinger Bands alongside RSI threshold confirmations and moving average alignments. The strategy plots Bollinger Bands directly on the price chart. Users can configure timeframes and lengths for both EMAs, Bollinger Band parameters, RSI thresholds, and toggle percentage-based stop-loss, take-profit, or bar-count exits. Stop loss and take profit are disabled by default.

Details

Published by

Alorse on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Mean reversion, Moving averages, Volatility & bands, Oscillators & momentum

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
VersionstringtxtVerversion
Sourcesourceclosesrc
Periodsint10ma1
Timeframetimeframe1Dres1
Periodsint55ma2
Timeframetimeframe1Dres2
╔═════ Show Bollinger Bands ═════╗booltrueisBB
Lengthint20length
StdDevfloat2.0mult
Offsetint0offset
Lengthint14lenRSI
Oversoldint71oversold
Show all 20 settings
SettingTypeDefaultVariable
Long entriesbooltrueshowLong
Short entriesboolfalseshowShort
Close after X # barsboolfalsecloseAfterXBars
# barsint12xBars
╔══════   Enable   ══════╗boolfalseuseSL
Percentfloat10SLPercent
╔══════   Enable   ══════╗boolfalseuseTP
Percentfloat10TPPercent
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

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy combines Bollinger Bands, Bollinger Band Width, and the Relative Strength Index (RSI) for mean-reversion trades. It enters long when price crosses below the lower band with oversold RSI, or when band width contracts under low volatility. Short en

Strategy v4 Mean reversionOscillators & momentum
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy
218 stars

The Mean Reversion Strategy Template calculates a baseline mean using SMA, EMA, or VWAP alongside upper and lower deviation bands based on standard deviation, ATR, or percentage offsets. It generates long and short entries when price touches, bounces from, or

Strategy v6 Mean reversionMoving averages
Updated 3 months ago · None stated GitHub repository of Mean Reversion Strategy Template
106 stars

This strategy identifies trend-following entries using a triple exponential moving average alignment and ATR-based exits on the main price chart. Long signals trigger when the fast EMA is above the medium EMA and medium is above slow, accompanied by a close ab

Strategy v4 Moving averagesVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3 EMA + Stochastic RSI + ATR

Bollinger Bands Strategy

by cklose2000
105 stars

This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po

Strategy v5 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Strategy
104 stars

This strategy combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at

Strategy v5 Oscillators & momentumVolatility & bands
Updated 3 years ago · MIT GitHub repository of Bollinger Bands and RSI Strategy

Take Profits & Stop Losses

by PythonForForex
64 stars

This educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro

Strategy v5 Moving averagesOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Take Profits & Stop Losses

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