RSI Strategy


RSI Strategy is build to gain profit on buying / selling shares in a specific market conditions. RSI Strategy calculates two values:

  • Average gain – weighted average of gains
  • Average loss – weighted average of loses

This two values are used to compute a Relative Strength Index (RSI):

\text{RSI} = 100 - \frac{100}{1 + \frac{\text{avgGain}}{\text{avgLoss}}}

Moreover, there are two RSI values given: overbought (normally around 70) and oversold (normally around 30) which are used in a process of making a decision if a strategy should sell or buy an asset. In a process of computing both averages we use some number of last price values (= Number of Periods; normally around 20). Consider a price of the last trade p_l and the previous one p_{l-1}. Gain has positive value when p_l > p_{l-1}” />, otherwise it is equal to zero. Loss can be defined in a similar way. It has positive value when <img decoding=, otherwise it is equal to zero.

Gain = \begin{cases} p_l - p_{l-1} & p_l - p_{l-1} > 0 \\ 0 & p_l – p_{l-1} \leq 0 \end{cases}” /></div>
<div class=

Loss = \begin{cases} |p_l - p_{l-1}| & p_l - p_{l-1} < 0 \\ 0 & p_l - p_{l-1} \geq 0 \end{cases}

RSI strategy starts decision rule, if orders should be sent after receiving Number of Periods trades.

Market Data

  • Last trade


Number of Periods Number of last ‘last trades’ events taken into account in a computation of the Avg~GainAvg~Loss Yes
Oversold Level Upper boundary of the RSI values area where market is oversold Yes
Overbought Level Lower boundary of the RSI values area where market is overbought Yes


Open position

Side Buy or Sell
Amount One asset per order
Price Last market price
Type Price limit

If Overbought Level is crossed by the counted RSI from the top side then sell order is sent. Similarly, when the Oversold Level is crossed from the bottom side by the counted RSI the buy order is sent.

Close position

There is no closing position condition.


There is no strategy termination condition.

Time frame

Strategy bases on some initial Number of periods of data collection without trading and is designed to enable adjusting both: period of data collection and its trading time span from hours to whole weeks.

Further information & source