1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
23 lines of Pine Script v5 from strategies/ai-rsi.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
ai-rsi.pine
// Source: TradingView Built-in Indicator (RSI)
// Attribution: Standard RSI implementation matching TradingView's built-in indicator
// Used as input for AI-powered strategy conversion
//@version=5
indicator("RSI", overlay=false)
rsiLength = input.int(14, "RSI Length", minval=1)
smaLength = input.int(200, "SMA Length", minval=1)
overbought = input.int(70, "Overbought Level")
oversold = input.int(30, "Oversold Level")
rsiValue = ta.rsi(close, rsiLength)
smaValue = ta.sma(close, smaLength)
plot(rsiValue, color=color.purple, title="RSI")
hline(overbought, "Overbought", color=color.red, linestyle=hline.style_dotted)
hline(oversold, "Oversold", color=color.green, linestyle=hline.style_dotted)
Additional instructions:
- This strategy uses RSI as a mean-reversion signal FILTERED by trend direction. Only buy oversold dips in an uptrend.
- The 200-period SMA acts as a trend filter — no entries when price is below it.
- The strategy enters/exits on the next candle open after the condition is met.
Overview
RSI plots the RSI oscillator line alongside horizontal reference levels for overbought and oversold thresholds in a separate pane below the main price chart. Configurable inputs allow adjustments to the RSI calculation period, SMA length, and threshold levels. As a pure indicator implementation designed for conversion into automated strategies, it does not display the calculated moving average, generate trade signals, or include position management rules.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Length
int
14
rsiLength
SMA Length
int
200
smaLength
Overbought Level
int
70
overbought
Oversold Level
int
30
oversold
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.
Calculates normalized reversal metrics across up to ten Forex currency pairs using user-selected moving average methods, including HarmonicMA, EMA, SMA, or WMA. The indicator identifies overbought, oversold, and mean-crossing conditions using a configurable th
This indicator combines MACD and RSI to generate pullback signals on forex pairs. It plots MACD line, signal line and histogram alongside RSI and Wave Trend oscillator. Higher-timeframe MACD provides trend bias while RSI identifies overbought and oversold zone
This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre
Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a
Antigravity Elite is an overlay indicator that screens price with seven selectable components: Mercury Fear, Connors RSI-2, volatility-spike reversal, EMA stack, Supertrend, multi-sigma bands, and an optional funding proxy. Auto-Detect chooses one method, whil
RSI Bounce calculates custom Relative Strength Index levels scaled back onto price, creating nine price-equivalent RSI band series centered around a median RSI baseline. It combines short-term RSI extreme checks with customized MACD signal line crossovers to i