RSI settings: what changing the length does
By Oalgo · Last reviewed
The main setting of RSI is its length, the number of candles it looks back over. Oalgo's builder starts at 14. A shorter length makes RSI swing wider and cross the 70 and 30 levels more often. A longer length makes it move less. The two levels are the other setting people change.
What settings does RSI have?
#- Length: how many candles the averages of up moves and down moves cover. 14 is the usual length and the one the builder starts at.
- Levels: 70 and 30 are common markers. They are not part of the calculation, so a rule can use any numbers between 0 and 100, such as 80 and 20.
- The price it reads: RSI is calculated from the close of each candle.
What does a different length change?
#The table uses the 120 candles of the example prices. RSI with length 7 has a value from candle 7, length 14 from candle 14 and length 21 from candle 21.
| RSI length | Lowest value | Highest value | Candles with a value |
|---|---|---|---|
| 7 | 12.1 | 91.0 | 114 |
| 14 | 26.0 | 78.1 | 107 |
| 21 | 34.2 | 70.4 | 100 |
A shorter length reaches further towards 0 and 100. Next, how often each length crossed the usual levels. A cross above 70 means the candle before was at 70 or lower and this one is above it. A cross below 30 is the same the other way round.
| RSI length | Candles above 70 | Crossed above 70 | Candles below 30 | Crossed below 30 |
|---|---|---|---|---|
| 7 | 24 | 7 times | 22 | 4 times |
| 14 | 13 | 3 times | 9 | 3 times |
| 21 | 1 | 1 time | 0 | 0 times |
Length 21 never fell below 30 on these prices, so a rule that waits for that would never have started here. Length 7 crossed above 70 seven times.
What does moving the levels change?
#Levels change how often a rule acts too. This table keeps the length at 14 and moves the levels.
| Levels (upper, lower) | Candles above upper | Crossed above upper | Candles below lower | Crossed below lower |
|---|---|---|---|---|
| 80 and 20 | 0 | 0 times | 0 | 0 times |
| 70 and 30 | 13 | 3 times | 9 | 3 times |
| 60 and 40 | 38 | 5 times | 31 | 7 times |
With 80 and 20, RSI with length 14 never reached either level on these prices.
How do people use RSI settings in rules?
#- Start from 14 with 70 and 30, then change one setting at a time and test each version on past prices.
- A shorter length with wider levels, such as 7 with 80 and 20, to ask for a larger move before the rule acts. On the example prices, length 7 was above 80 on 14 candles and below 20 on 12.
- A longer length with closer levels, such as 21 with 60 and 40, because a longer RSI moves less. On the example prices, length 21 was above 60 on 30 candles and below 40 on 19.
- The same rule on a different timeframe, because the length counts candles, not hours.
What can RSI settings not tell you?
#No setting suits every market or every period. A length that fits one stretch of prices can do little on another, and trying many settings until one looks good is how a rule becomes overfitted. Change one thing at a time, test on more than one date range with a backtest, and read the number of trades before the end result.
In Oalgo you can tell Oalgo AI your RSI rule, with the length and levels you want, in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
Read next
- What is RSI? The RSI indicator explainedThe RSI indicator compares recent up moves with down moves on a scale from 0 to 100. Learn how it is calculated, how to read it, and how to test RSI rules.
- RSI strategy: oversold and overbought rules, explainedAn RSI strategy enters when RSI falls below a low level such as 30 and exits as it recovers. See the rules, their weakness in a trend, and how to test them.