RSI Crossover Strategy with Compounding (Monthly)
Oct 4, 2024

The RSI Crossover Strategy with Compounding (Monthly) tool is a long-only trend-following strategy designed to capture macro-level momentum by identifying RSI crossovers on the monthly timeframe while utilizing a compounding capital management system.
Usage
The strategy is primarily used for long-term position trading or investing. It identifies entries and exits based on the relationship between the Relative Strength Index (RSI) and its Simple Moving Average (SMA) calculated on a monthly basis.
- Entry: A long position is initiated when the Monthly RSI crosses above its Monthly SMA, provided there is no existing position. The script automatically calculates the maximum quantity of shares possible based on the current available capital.
- Exit: The position is closed when the Monthly RSI falls below its Monthly SMA.
- Compounding: Upon closing a trade, the strategy updates the total capital by adding the net profit to the previous balance, allowing subsequent trades to utilize a larger position size if the strategy is profitable.
The visual output includes the monthly RSI and its SMA on the chart (as an oscillator-style plot) and triggers alerts when crossovers occur.
Details
The script leverages the request.security() function to ensure that the RSI calculations are strictly tied to the monthly interval ("M"), regardless of the timeframe of the chart it is applied to. This provides a "big picture" filter for entries.
The compounding logic is handled through a manual capital tracking variable. Unlike standard backtesting that might use a fixed percentage of equity, this script tracks the absolute capital value starting from an initial base (100,000 units). When a trade is closed, the strategy.netprofit is used to update the available capital for the next trade.
Settings
- RSI Length: Determines the lookback period used for the Relative Strength Index calculation and its corresponding Simple Moving Average. Increasing this value will make the strategy less sensitive to price fluctuations, while decreasing it will generate more frequent signals.
FAQ
How do I use the RSI Crossover Strategy with Compounding (Monthly) on my chart?
You can search for the script name in the TradingView Indicators & Strategies search bar and add it to your chart. Ensure you are viewing an instrument with sufficient historical monthly data for accurate results.
Can I change the starting capital?
The current version uses a predefined initial capital of 100,000. To adjust this, you would modify the initialCapital variable within the script source code.
Where can I find more tools like this?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.