Strategy · Pine Script v5 · On the chart

RSI + 1200 Strategy [Alose]

by Alorse

This strategy plots a multi-timeframe exponential moving average on the price chart while evaluating momentum using the Relative Strength Index.

View on GitHub

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

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

RSI + 1200.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("RSI + 1200 Strategy [Alose]", overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, initial_capital=100000, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.01)

// RSI
rsiGroup = 'RSI'
src = input(title='Source', defval=close, group=rsiGroup)
lenRSI = input.int(14, title='Length', minval=1, group=rsiGroup)
RSI = ta.rsi(src, lenRSI)
RSIoverbought = input.int(72, title='Overbought', minval=1, group=rsiGroup, tooltip='The trade will close when the RSI crosses up this point.')
RSIoversold = input.int(28, title='Oversold', minval=1, group=rsiGroup, tooltip='The trade will close when the RSI crosses below this point.')

// MTF EMA
maGroup = "MTF Moving Average"
emaLen = input(title='MA Periods', defval=150, group=maGroup)
res = input.timeframe(title="Multi Timeframe", defval="120")
ema = request.security(syminfo.tickerid, res, ta.ema(close, emaLen))
plot(ema, title="Moving Average", linewidth=1, color=color.yellow)

// Strategy Conditions
stratGroup = 'Strategy'
showLong = input.bool(true, title='Long entries', group=stratGroup)
showShort = input.bool(true, title='Short entries', group=stratGroup)
SL = input.int(title="Stop Loss %", defval=10, group=stratGroup) * 0.01

secureLong = strategy.position_avg_price * (1 + 0.002)
secureShort = strategy.position_avg_price * (1 - 0.002)

// Determine trail stop loss prices
longStopPrice = strategy.position_avg_price * (1 - SL)
shortStopPrice = strategy.position_avg_price * (1 + SL)

slackLongPercent = close > ema * 1.01 // +1%
slackShortPercent = close < ema * 0.99 // -1%

fiveLong = close > ema and close < ema * 1.02 and close < open and close[1] < open[1] and close[2] < open[2] //and close[3] < open[3] and close[4] < open[4]
fiveShort = close < ema and close > ema * 0.99 and close > open and close[1] > open[1] and close[2] > open[2] //and close[3] > open[3] and close[4] > open[4]

entryLong = close > ema and ta.crossover(RSI, RSIoversold) and slackLongPercent
exitLong = RSI > RSIoverbought or fiveLong

entryShort = close < ema and ta.crossunder(RSI, RSIoverbought) and slackShortPercent
exitShort = RSI < RSIoversold or fiveShort

if showLong
    strategy.entry("Long", strategy.long, when=entryLong)
    strategy.exit("Exit", "Long", stop=longStopPrice)
    strategy.close("Long", when=exitLong)

if showShort
    strategy.entry("Short", strategy.short, when=entryShort)
    strategy.exit("Exit", "Short", stop=shortStopPrice)
    strategy.close("Short", when=exitShort)

Overview

RSI + 1200 Strategy [Alose] enters long positions when price exceeds the moving average by at least one percent and RSI crosses above the oversold level. Short trades execute when price trades one percent below the moving average and RSI crosses under overbought levels. Positions close when RSI reaches the opposite extreme, after three consecutive opposing candles near the moving average, or via a percentage stop loss. User settings control RSI thresholds, moving average timeframe, and stop loss.

Details

Published by

Alorse on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Moving averages, Trend

Markets

Any symbol

Timeframes

Any timeframe

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.

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
Sourcesourceclosesrc
Lengthint14lenRSI
Overboughtint72RSIoverbought
Oversoldint28RSIoversold
MA Periodsint150emaLen
Multi Timeframetimeframe120res
Long entriesbooltrueshowLong
Short entriesbooltrueshowShort
Stop Loss %int10SL
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

This strategy combines Arnaud Legoux Moving Average percentage price change calculations with an adaptive Gaussian Moving Average to generate trend-following signals. Long and short entries are triggered when the ALMA change calculation crosses above or below

Strategy v5 Moving averagesOscillators & momentum
Updated 6 weeks ago · None stated GitHub repository of ESM2024 - ALMA Smoothed Gaussian Moving Average
218 stars

This strategy generates trading signals based on a selectable momentum engine, supporting MACD, RSI, Stochastic, or Rate of Change. Entries trigger on signal crosses, zero-line crosses, or threshold crosses, with an optional moving average trend filter. Risk m

Strategy v6 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Momentum Strategy Template

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

SMA RSI Strategy

by PythonForForex
64 stars

This strategy evaluates simple moving averages and the Relative Strength Index to generate trading signals. It calculates a 10-period SMA, a 30-period SMA, and a 14-period RSI. Long positions are entered when the fast SMA crosses above the slow SMA while RSI i

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of SMA RSI Strategy

Momentum Rider DAILY FINAL

by greenpeas007
58 stars

This strategy combines exponential moving averages (EMA 9, 21, 50), RSI, MACD, and Supertrend indicators to enter long positions. It triggers trades using six dynamic setups based on momentum breakouts, EMA crossovers, and pullbacks. Position sizing is compute

Strategy v6 TrendOscillators & momentum Repaints
Updated 4 months ago · Custom licence GitHub repository of Momentum Rider DAILY FINAL

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