Strategy · Pine Script v5 · On the chart

RSI2 Optimized STEPFUN

by eltonaguiar

This strategy draws on the price chart and trades a two-period RSI.

View on GitHub

GitHub stars4on the repository
Pine versionv5runs as is
Lines of code196
Settings14inputs
LicenceNone stated
Last update2 days ago28 Oct 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

RSI2 Optimized STEPFUN enters long when RSI crosses above the oversold level and short when RSI crosses below the overbought level. An optional SMA trend filter, volume confirmation, and cooldown can block entries. The default exit mode is a trailing stop; other modes exit at a fixed RSI level or at percentage take-profit and stop-loss. Position size is a percentage of equity, and pyramiding is disabled.

Details

Published by

eltonaguiar on GitHub

Draws

On the price chart

Markets

Crypto

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.

Settings

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

SettingTypeDefaultVariable
RSI Lengthint2rsi_length
Oversold Levelint30oversold
Overbought Levelint70overbought
Use Trend Filterbooltrueuse_trend_filter
Trend Filter SMA Periodint200trend_filter_period
Volume Confirmationbooltrueuse_volume_confirm
Volume Multiplierfloat1.5volume_multiplier
Exit ModestringTrailingexit_mode
Trailing Offset %float1.0trail_offset_pct
Take Profit %float3.0tp_percent
Stop Loss %float1.5sl_percent
Position Size %float100.0position_size_pct
Show all 14 settings
SettingTypeDefaultVariable
Use Cooldown Periodbooltrueuse_cooldown
Cooldown Barsint3cooldown_bars
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

106 stars

This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average. It enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is b

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced OutSide Forex strategy

CombinedBinHAndClucV8

by viktors1982
36 stars

This strategy trades on the price chart using multiple indicators. It enters long positions when price dips meet conditions on Bollinger Bands 40 and 20, RSI, MFI, volume and other thresholds. It exits at custom ROI profit levels based on RSI or after timeout

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of CombinedBinHAndClucV8
12 stars

This strategy enters long when a fast EMA crosses above a slow EMA and RSI, ADX, and volume all clear their thresholds. It sizes the order from a percentage of equity and an ATR stop distance, then sets a partial profit target at a multiple of that risk. After

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of BTC 4H Institutional Trend

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy
3 stars

This strategy plots long and short markers on the price chart. It builds a composite index from RSI change and a short RSI average, then requires that index, a one-minute cumulative volume delta, and a relative volatility index to agree. EMA, SMA, and VWAP rel

Strategy v5 Oscillators & momentumVolume Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Composite RVI CVD Strategy

CryptoSwarmStrategy

by aegntic
3 stars

CryptoSwarmStrategy is a chart overlay strategy that enters long when a fast EMA crosses above a slow EMA, RSI is below the oversold level, and volume exceeds its 20-bar average. It enters short on the opposite EMA cross with RSI above overbought and the same

Strategy v5 Moving averagesOscillators & momentum
Updated 6 months ago · MIT GitHub repository of CryptoSwarmStrategy

More Oscillators & momentum scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers