Pine ScriptRSI settings

RSI settings for 1-minute charts

There is no universal best setting. Start by testing RSI 7 with 80/20 levels against the TradingView default, RSI 14 with 70/30 levels. Keep the same symbol, session, fees, and date range so the comparison is fair.

A useful starting point, not a trading promise

RSI 7 uses a larger gain/loss smoothing coefficient than RSI 14. With the RSI series held fixed, 80/20 levels select no more extreme observations than 70/30, but crossing counts need not be smaller. Measure the exact event you intend to test.

An RSI reading describes momentum. Pineify turns the rule you choose into executable TradingView Pine Script so you can test the rule before using it.

Settings table

Compare RSI 5, 7, 9, and 14

These are test candidates. The table describes how the lookback changes the indicator, not which setting will make money.

RSI settings to test on 1-minute charts
RSI lengthLevelsBehaviorTest use
580 / 20Gain/loss smoothing coefficient 1/5; largest coefficient in this table.A stress-test candidate for very short holding periods.
780 / 20Gain/loss smoothing coefficient 1/7; recursive history remains.A practical first test for 1-minute NQ or QQQ charts.
975 / 25Gain/loss smoothing coefficient 1/9; crossing count must be measured.A middle option when RSI 7 reacts too often.
1470 / 30TradingView default length; gain/loss smoothing coefficient 1/14.The control setting for every short-period test.

Keep the market fixed

Test NQ and QQQ separately. Their sessions and price series do not create identical one-minute bars.

Keep costs in the model

Commission and slippage matter more when a rule trades frequently and targets small moves.

Keep a holdout period

Pick settings on one date range, then test them on dates you did not use during selection.

Pine Script v6

Copy an RSI settings tester

Change the length and levels in TradingView without editing the formula. The script marks crosses back above the lower band and back below the upper band.

Pine Script v6
//@version=6
indicator("RSI Settings Tester", overlay = false)

rsiLength = input.int(7, "RSI length", minval = 2)
upperLevel = input.float(80.0, "Overbought level", minval = 50, maxval = 100)
lowerLevel = input.float(20.0, "Oversold level", minval = 0, maxval = 50)

rsiValue = ta.rsi(close, rsiLength)

plot(rsiValue, "RSI", color = color.rgb(37, 99, 235), linewidth = 2)
upperBand = hline(upperLevel, "Overbought", color = color.rgb(220, 38, 38))
middleBand = hline(50, "Midline", color = color.new(color.gray, 40))
lowerBand = hline(lowerLevel, "Oversold", color = color.rgb(22, 163, 74))
fill(upperBand, lowerBand, color = color.new(color.blue, 92))

bullishCross = ta.crossover(rsiValue, lowerLevel)
bearishCross = ta.crossunder(rsiValue, upperLevel)

plotshape(bullishCross, "Cross above oversold", shape.triangleup, location.bottom, color.green, size = size.tiny)
plotshape(bearishCross, "Cross below overbought", shape.triangledown, location.top, color.red, size = size.tiny)

alertcondition(bullishCross, "RSI crossed above oversold", "RSI crossed above the oversold level")
alertcondition(bearishCross, "RSI crossed below overbought", "RSI crossed below the overbought level")

The line, markers and alert conditions all evaluate on the developing bar; this code has no barstate.isconfirmed gate. Intrabar crosses can disappear before close. For closed-bar alerts, choose Once Per Bar Close when creating an alert, or request an explicitly gated adaptation and validate it. This indicator has no trade orders, exits or measured strategy results.

TradingView RSI chart with overbought, midline, and oversold reference levels

The preview uses a standard RSI pane. Your one-minute result will depend on the chart symbol, session, and selected inputs.

Signal rules

Read the crossover, not the label alone

Overbought and oversold describe recent momentum. They do not say that price must reverse on the next bar.

RSI crossover rules and limitations
EventPine conditionWhat it saysWhat it does not say
Cross above oversoldta.crossover(rsi, lower)RSI has moved back above the lower threshold.Price has not necessarily formed a durable bottom.
Cross below overboughtta.crossunder(rsi, upper)RSI has moved back below the upper threshold.Price has not necessarily formed a durable top.
Cross above 50ta.crossover(rsi, 50)Smoothed gains now outweigh smoothed losses.The next price bar is not guaranteed to close higher.

Start with one clear event, such as a cross above 20, and add a trend filter only after measuring the basic rule. Adding several filters at once makes it hard to tell which condition changed the result.

Testing method

Test a 1-minute RSI without fitting the answer

A short chart interval produces many observations. That makes it easy to find a setting that looks good by chance.

  1. 1

    Write one entry event

    Example: RSI 7 crosses above 20 while price is above the 200 EMA. Define the exit before running the test.

  2. 2

    Use the same data window

    Compare RSI 5, 7, 9, and 14 on the same NQ, QQQ, or SPY dates. Do not change the market halfway through.

  3. 3

    Include trading costs

    Add commission and a slippage assumption. A frequent one-minute rule can lose its apparent edge after costs.

  4. 4

    Reserve unseen dates

    Choose the candidate on one period and check it on a later period that was not used to select the settings.

  5. 5

    Compare stability, not one peak

    Reject a setting when small changes to fees, dates, or thresholds erase the result.

Compare NQ and QQQ as separate tests. Keep an RSI 14 baseline beside the shorter settings, and compare event counts, costs and outcomes under the same execution rules.

Count extreme bars and crossing events separately

Consider the hypothetical RSI sequence 75, 85, 75, 85, 75. There are two crosses back below 80, but no crosses below 70: every observation stays above 70. Wider levels reduce or preserve extreme-bar occupancy on the same series, not necessarily the number of return-cross events. This is a condition check, not a market backtest.

The paired settings in the table change both length and levels. To identify which choice matters, first compare lengths with levels fixed, then compare levels with length fixed. A one-minute chart changes the price observations; it does not make length 7 a seven-minute moving window with no earlier history.

For an arithmetic seed check, closes 100, 101, 100, 103 give three changes of +1, −1 and +3. At length 3, average gain is 4/3 and average loss is 1/3, giving RSI 80. A next close of 102 updates those averages to 8/9 and 5/9, giving RSI 61.538462. These synthetic values illustrate Wilder smoothing; they do not identify an optimal setting.

Indicator comparison

Stochastic vs RSI on short charts

Both indicators use a bounded scale, but their inputs differ. Use the one that matches the rule you want to test.

Comparison of RSI and Stochastic oscillator
QuestionRSIStochastic
What is measured?Smoothed gains compared with smoothed losses.Latest close compared with the recent high-low range.
Common default14, with 70 / 3014, 3, 3 with 80 / 20
Typical ruleThreshold, centerline, or divergence event.Percent K and percent D crossover or threshold event.
Main limitationRSI can remain at an extreme during a strong trend.Range-based readings can change quickly on short charts.

For a fuller comparison, read Stochastic Oscillator vs RSI.

FAQ

RSI settings questions

Each answer starts with the conclusion, then states the constraint that matters.

There is no universal best RSI setting for 1-minute scalping. Start by testing RSI 7 with 80/20 levels against RSI 14 with 70/30 levels on the same symbol, session, fees, and date range.

RSI 5 uses a gain/loss smoothing coefficient of 1/5 and RSI 7 uses 1/7. Both retain recursive history. Neither coefficient guarantees fewer crosses or better results; hold levels fixed when comparing lengths, then test on unseen data with costs.

For an unchanged RSI series, values beyond 80/20 are a subset of those beyond 70/30. The number of crossings need not decrease: an RSI can repeatedly cross 80 while staying above 70 throughout. Count events separately from time spent beyond a level.

RSI is a momentum oscillator that compares smoothed gains with smoothed losses on a scale from 0 to 100. TradingView uses 14 bars as the default length and 70/30 as common overbought and oversold reference levels.

An RSI crossover is an event where the RSI line moves through a chosen level. A common rule watches for RSI to cross back above the oversold level or back below the overbought level.

RSI compares the size of recent gains and losses, while Stochastic compares the latest close with the recent high-low range. Both are bounded oscillators, but they answer different questions.

No, AI cannot predict stock prices from RSI with certainty. AI can help write and test a rule, but RSI is derived from past prices and does not guarantee the next move.

RSI equals 100 minus 100 divided by 1 plus RS, where RS is the smoothed average gain divided by the smoothed average loss. Pine Script v6 calculates it with ta.rsi(source, length).

Risk note

This page is an information and testing tool, not investment advice. RSI cannot predict returns. Backtests can overstate a rule when they omit fees, slippage, changing market conditions, or out-of-sample testing.

Turn your RSI rule into Pine Script

Describe the length, levels, filters, and alerts. Pineify writes the TradingView code so you can inspect and test the rule.