Calculate the Relative Strength Index (RSI) in Excel with RTI_RSI
The RTI_RSI function in MarketXLS allows you to calculate the Relative Strength Index (RSI) for any stock symbol in real time, directly in Excel. Whether you are monitoring short-term price action or analyzing longer lookback windows, RTI_RSI helps you rapidly gain insight into market momentum without leaving your spreadsheet.
Why Use This Function?
- Get real-time RSI calculations in Excel for high-frequency trading or intraday strategies.
- Customize the interval (in minutes) to measure momentum over different timeframes.
- Adjust the lookback (number of periods) to fine-tune the sensitivity of the RSI.
- Use different fields (e.g., “Last,” “Close,” “Open,” etc.) to capture the specific data stream you need.
- Automatically updates in real time from your connected data seller (e.g., Zerodha or AngelOne).
- Ideal for creating dynamic dashboards, scanning watchlists, or combining RSI with other technical indicators like EMA, SMA, etc.
How to Use in Excel
=RTI_RSI(symbol, [interval], [lookback], [field], [index])
• Enter the function in any cell.
• Provide a valid stock symbol (e.g., "AAPL") as the first argument.
• (Optional) Specify an interval in minutes to calculate RSI for that time series (1, 5, 15, 60, etc.). If omitted or 0, the function defaults to 5 minutes.
• (Optional) Provide a lookback period (number of candles) for the RSI calculation. If omitted or 0, the function defaults to 50, and cannot exceed 200.
• (Optional) Choose which field to base the RSI on, such as “Last,” “Close,” “Open,” or “High.” The default is “Last.”
• (Optional) Provide an index to shift the data points. 0 represents the most recent bar or candle, 1 would be the previous bar, and so on.
Parameters Explained
Parameter | Description | Example Values | Notes |
---|---|---|---|
symbol | Ticker symbol for the security. | "AAPL", "MSFT" | Required. Use the official exchange symbol. |
interval | Time interval in minutes. | 1, 5, 15, 60 | Optional. Defaults to 5 if 0 or omitted. |
lookback | Number of periods to use in RSI computation. | 14, 20, 50 | Optional. Defaults to 50 if 0 or omitted. Cannot exceed 200. |
field | The field used for RSI (e.g., "Last"). | "Open", "High", "Last" | Optional. Defaults to "Last". Different fields can produce slightly different RSI values |
index | The index offset for historical bars (0 = the latest bar, 1 = the previous) | 0, 1, 2 | Optional. Defaults to 0. Useful for referencing older data points. |
Example Usage
Basic Examples
-
Calculate RSI for AAPL on a 5-minute interval with a 20-period lookback, using the "Last" price for the most recent bar:
=RTI_RSI("AAPL", 5, 20, "Last", 0) -
Request RSI for Apple with a shorter 1-minute interval while keeping the same 20-period lookback:
=RTI_RSI("AAPL", 1, 20, "Last", 0) -
Use a longer insight window with a 50-period lookback on a 15-minute interval:
=RTI_RSI("AAPL", 15, 50, "Last", 0)
Advanced Scenarios
• Multiple RSI Fields:
=RTI_RSI("AAPL", 1, 14, "Close", 0)
This calculates a 14-period RSI on AAPL’s close prices at a 1-minute frequency, suitable for scalping strategies.
• Historic Bar Reference:
=RTI_RSI("AAPL", 5, 20, "Last", 5)
Retrieves the RSI value for five bars ago, which can help compare historical and current RSI levels side by side.
• Larger Intraday Windows:
=RTI_RSI("MSFT", 60, 14, "Last", 0)
This calculates a 14-period RSI on hourly intervals, letting you observe broader momentum shifts.
• Combining with Other Functions:
=IF(RTI_RSI("AAPL", 5, 20, "Close", 0)>70, "Overbought", "Not Overbought")
Example of embedding RTI_RSI within an Excel formula to highlight if RSI is above a typical overbought threshold.
Common Questions and Troubleshooting
-
Why am I getting “Number of periods cannot be more than 200”?
? You may have specified a lookback value exceeding 200. Try reducing your lookback to 200 or below. -
What happens if I pass 0 for interval or lookback?
? The function defaults to 5 minutes for interval and 50 for lookback to ensure a workable RSI calculation. -
“No Data Seller Is Configured” message?
? This indicates you haven’t set up a real-time data seller account (e.g., Zerodha or AngelOne) in MarketXLS settings. Configure one to pull real-time data. -
Can I request RSI using “Open,” “High,” or “Low” fields?
? Yes. Simply specify the field in the fourth parameter; e.g., "Open" to calculate RSI from the opening prices. -
Why do I see “Insufficient parameters”?
? Ensure you have enough arguments in your formula, especially symbol, interval, and lookback. You must at least provide “symbol” and let other parameters fall back to their defaults.
By leveraging the RTI_RSI function along with your own Excel formulas and dashboards, you can dynamically monitor an asset’s strength or weakness over customizable intraday windows. This enables faster decision-making and more flexible trading strategies—all within your existing Excel workflow.