In today’s article, we will explore another approach to buying stocks. This strategy involves purchasing when the price returns to its normal range, speculating that it will rebound and continue to rise. It is one of several methods that can enrich our portfolio.
This time, we will use a simple indicator to identify the optimal moments for buying. Specifically, we will use the RSI oscillator. The RSI works by oscillating between values of 0 and 100. The logic is simple: when the value is low, it signals a buying opportunity.
RS indicator with a value of 2 – orange boxes are buying areas
We will buy when the RSI indicator drops below the 20 level.
RSI(C, 2) < 20
Enrollment in AC:
For today’s demonstration, we’ll buy at the end of the trading day, right as markets close. To achieve this, we’ll leave the entry trigger set to OnBarClose.
Last time, we focused on breakout strategies with S&P 500 stocks. For a more diversified portfolio, we will now target stocks from the Russell 1000 index.
For demonstration purposes, we’ll maintain a maximum of 10 open positions and select stocks with the largest RSI drop. Since the AC position score selects stocks based on the highest value, we will need to modify the code slightly.
In the second variant, we will again use the RSI indicator. If low RSI values signal entry points, we will use high RSI values for exits. Specifically, we will exit when the RSI value exceeds 80:
RSI(C, 2) > 80