HOW IT WORKS
With the default settings, the strategy buys when RSI reaches 30 and closes when RSI reaches 40 .
That’s it.
A simple, rule-based mean reversion strategy designed for higher timeframes , where market noise is lower and trading becomes easier to manage.
Core logic:
Long when RSI moves into oversold territory
Exit when RSI mean-reverts upward
Optional short trades from overbought levels
One position at a time (no pyramiding)
No filters.
No discretion.
Just clear, testable rules.
MARKETS & TIMEFRAMES
This strategy is intended for:
Indices (Nasdaq, S&P 500, DAX, etc.)
Liquid futures and CFDs
Higher timeframes: 2H, 4H and Daily
The published example is Nasdaq (NDX) on the 2-hour timeframe .
Higher timeframes are strongly recommended.
HOW TO USE IT
Apply the strategy on a higher timeframe
Adjust RSI levels per market if needed
Use TradingView alerts to avoid constant screen-watching
Focus on execution, risk control, and consistency
This strategy is meant to be a building block , not a complete trading business on its own.
For long-term consistency, it works best when combined with other uncorrelated, rule-based systems.
IMPORTANT
This is not financial advice
All results are historical and not indicative of future performance
Always forward-test and apply proper risk management
For additional notes, setups and related systems, visit my TradingView profile page .
![]()
//@version=6
strategy(
"Simple RSI [EdgeLab]",
overlay = true,
initial_capital = 100000,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 100,
pyramiding = 0,
process_orders_on_close = true,
margin_long = 0,
margin_short = 0)
//────────────────────
// Inputs (tooltips show as the little "i" icon)
//────────────────────
dir = input.string(
"Long",
"Trade Direction",
options = ["Long", "Short", "Both"],
tooltip = "Choose which trades the strategy is allowed to take:\n• Long = buy signals only\n• Short = sell signals only\n• Both = long and short signals",
group = "General")
len = input.int(
14,
"RSI Length",
minval = 1,
tooltip = "How many bars the RSI calculation uses.\nHigher = smoother/slower signals.\nLower = faster/more signals.",
group = "General")
src = input.source(
close,
"RSI Source",
tooltip = "Which price the RSI is calculated from.\nClose is the most common choice.",
group = "General")
// Long levels
entryL = input.int(
30,
"Long: Enter when RSI ≤",
minval = 1,
maxval = 99,
tooltip = "Long entry trigger.\nWhen RSI drops to this level or lower, the strategy opens a LONG.\nLower value = fewer entries (more 'oversold').",
group = "Long")
exitL = input.int(
40,
"Long: Exit when RSI ≥",
minval = 2,
maxval = 100,
tooltip = "Long exit trigger.\nWhen RSI rises to this level or higher, the strategy closes the LONG.\nHigher value = holds longer before exiting.",
group = "Long")
// Short levels
entryS = input.int(
70,
"Short: Enter when RSI ≥",
minval = 1,
maxval = 99,
tooltip = "Short entry trigger.\nWhen RSI rises to this level or higher, the strategy opens a SHORT.\nHigher value = fewer entries (more 'overbought').",
group = "Short")
exitS = input.int(
60,
"Short: Exit when RSI ≤",
minval = 1,
maxval = 99,
tooltip = "Short exit trigger.\nWhen RSI drops to this level or lower, the strategy closes the SHORT.\nLower value = holds longer before exiting.",
group = "Short")
// Direction flags
allowLong = dir == "Long" or dir == "Both"
allowShort = dir == "Short" or dir == "Both"
//────────────────────
// RSI
//────────────────────
r = ta.rsi(src, len)
//────────────────────
// Entry / exit conditions (enter only on first cross of level)
//────────────────────
// Long
enterLong = allowLong and ta.crossunder(r, entryL) and strategy.position_size == 0
exitLong = allowLong and ta.crossover(r, exitL) and strategy.position_size > 0
// Short
enterShort = allowShort and ta.crossover(r, entryS) and strategy.position_size == 0
exitShort = allowShort and ta.crossunder(r, exitS) and strategy.position_size < 0
//────────────────────
// Orders
//────────────────────
if enterLong
strategy.entry("Long", strategy.long)
if exitLong
strategy.close("Long")
if enterShort
strategy.entry("Short", strategy.short)
if exitShort
strategy.close("Short")
//────────────────────
// Alertconditions (for "Create Alert" dialog)
//────────────────────
alertcondition(enterLong, "Enter Long", "Enter LONG: RSI crossed down into the long entry level.")
alertcondition(exitLong, "Exit Long", "Exit LONG: RSI crossed up into the long exit level.")
alertcondition(enterShort, "Enter Short", "Enter SHORT: RSI crossed up into the short entry level.")
alertcondition(exitShort, "Exit Short", "Exit SHORT: RSI crossed down into the short exit level.")