# R&D Blog

# Relative Strength Index (RSI) Model | Trading Strategy (New Exits)

## I. Trading Strategy

**Developer: **Larry Connors (The 2-Period RSI Trading Strategy), Welles Wilder (The RSI Momentum Oscillator). **Source:** (i) Connors, L., Alvarez, C. (2009). *Short Term Trading Strategies That Work**.* Jersey City, NJ: Trading Markets; (ii) Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Greensboro: Trend Research. **Concept:** The long equity trading system based on the 2-Period RSI (Relative Strength Index). **Research Goal:** To benchmark the RSI exit strategy against the trend exit strategy based on moving averages. **Specification:** Table 1. **Results:** Figure 1-2. **Trade Filter:** The 2-Period RSI closes below RSI_Threshold (Default Value: RSI_Threshold = 5). **Portfolio:** Five equity futures markets (DJ, MD, NK, NQ, SP). **Data:** 36 years since 1980. **Testing Platform:** MATLAB®.

## II. Sensitivity Test

All 3-D charts are followed by 2-D contour charts for Profit Factor, Sharpe Ratio, Ulcer Performance Index, CAGR, Maximum Drawdown, Percent Profitable Trades, and Avg. Win / Avg. Loss Ratio. The final picture shows sensitivity of Equity Curve.

Tested Variables: RSI_Entry_Threshold & RSI_Exit_Threshold (Definitions: Table 1):

**Figure 1**| Portfolio Performance (Inputs: Table 1; Commission & Slippage: $0).

STRATEGY | SPECIFICATION | PARAMETERS |

Auxiliary Variables: | The 2-Period Relative Strength Index (RSI): The Relative Strength Index (RSI) is a momentum oscillator that compares the magnitude of recent gains to recent losses to determine overbought and oversold conditions.RSI(Close, RSI_Look_Back) is the Relative Strength Index of the close price over a period of RSI_Look_Back; Default Value: RSI_Look_Back = 2. Formula: We use an exponential smoothing. Up[i] = max(Close[i] − Close[i − 1], 0); Down[i] = max(Close[i − 1] − Close[i], 0); AvgUp[i] = (AvgUp[i − 1] * (RSI_Look_Back − 1) + Up[i]) / RSI_Look_Back; AvgDown[i] = (AvgDown[i − 1] * (RSI_Look_Back − 1) + Down[i]) / RSI_Look_Back; RS[i] = AvgUp[i] / AvgDown[i]; RSI[i] = 100 − 100/(1 + RS[i]); Index: i ~ Current Bar. Note: The first “AvgUp” (i.e. AvgUp[1] ) is calculated as a simple average of “Up” values over a period of RSI_Look_Back. The first “AvgDown” (i.e. AvgDown[1]) is calculated as a simple average of “Down” values over a period of RSI_Look_Back. | RSI_Look_Back = 2; |

Setup: | Long Setup: MA(Close, Setup_Look_Back) is a simple moving average of the close price over a period of Setup_Look_Back; Default Value: Setup_Look_Back = 200; Setup Rule: Close[i] > MA[i]; Index: i ~ Current Bar. | Setup_Look_Back = 200; |

Filter: | Long Filter: The RSI closes below RSI_Entry_Threshold; Default Value: RSI_Entry_Threshold = 5; Filter Rule: RSI[i] < RSI_Entry_Threshold; Index: i ~ Current Bar. | RSI_Entry_Threshold = [2, 30], Step = 1; |

Entry: | Long Entry: A buy at the open is placed after a bullish Setup/Filter. Note: In the original model, a buy at the close is placed on the same bar as a bullish Setup/Filter. | |

Exit: | RSI Exit: Long Exit: A sell at the open is placed if RSI[i − 1] > RSI_Exit_Threshold; Default Value: RSI_Exit_Threshold = 95;Index: i ~ Current Bar. Stop Loss Exit: ATR(ATR_Length) is the Average True Range over a period of ATR_Length. ATR_Stop is a multiple of ATR(ATR_Length). Long Stop: A sell stop is placed at [Entry − ATR(ATR_Length) * ATR_Stop]. | RSI_Exit_Threshold = [70, 98], Step = 1; ATR_Length = 20; ATR_Stop = 6; |

Sensitivity Test: | RSI_Entry_Threshold = [2, 30], Step = 1 RSI_Exit_Threshold = [70, 98], Step = 1 | |

Position Sizing: | Initial_Capital = $1,000,000 Fixed_Fractional = 1% Portfolio = 5 Equity Futures (DJ, MD, NK, NQ, SP) ATR_Stop = 6 (ATR ~ Average True Range) ATR_Length = 20 | |

Data: | Five equity futures markets (DJ, MD, NK, NQ, SP); 36 years (1980/01/01−2016/04/30) |

**Table 1** | Specification: Trading Strategy.

## III. Sensitivity Test with Commission & Slippage

Tested Variables: RSI_Entry_Threshold & RSI_Exit_Threshold (Definitions: Table 1):

**Figure 2**| Portfolio Performance (Inputs: Table 1; Commission & Slippage: $50 Round Turn).

## IV. Benchmarking

We benchmark the base case strategy (default parameters) against alternatives:

**Case #1:** RSI_Entry_Threshold = 5; RSI_Exit_Threshold = 95 (Base Case).

**Case #2:** RSI_Entry_Threshold = 5; RSI_Exit_Threshold = 75.

**Case #3:** RSI_Entry_Threshold = 10; RSI_Exit_Threshold = 75.

**Case #4:** RSI_Entry_Threshold = 15; RSI_Exit_Threshold = 75.

Fixed Fractional Sizing | Case #1 | Case #2 | Case #3 | Case #4 |

Net Profit ($) | 171,875 | 237,163 | 491,935 | 405,423 |

Sharpe Ratio | 0.21 | 0.43 | 0.57 | 0.42 |

Ulcer Performance Index (UPI) | 0.20 | 0.57 | 0.98 | 0.69 |

Profit Factor | 1.30 | 1.70 | 1.71 | 1.44 |

CAGR (%) | 0.48 | 0.65 | 1.21 | 1.03 |

Max. Drawdown (%) | (6.84) | (5.12) | (5.31) | (6.52) |

Percent Profitable Trades (%) | 69.35 | 74.37 | 73.97 | 71.10 |

Avg. Win / Avg. Loss Ratio | 0.58 | 0.59 | 0.60 | 0.58 |

**Table 2** | Inputs: Table 1; Fixed Fractional Sizing: 1%; Commission & Slippage: $50 Round Turn.

## V. Rating: Relative Strength Index (RSI) Model | Trading Strategy

A/B/**C**/D

## VI. Summary

The RSI exit strategy (Table 1) is not significantly better or worse than the base case strategy (i.e. the exit strategy based on moving averages).

**Related Entries:** Relative Strength Index (RSI) Model (Filter) | Long Equity Trading System (Filter & Exit) | 3-Bar Momentum Pattern (Filter & Exit) | Hikkake Pattern (Filter & Exit)

**Related Topics:** (Public) Trading Strategies

**Proprietary Strategies:**

ALPHA_{20}^{TM} Trading System

Robust Short-Term Patterns^{TM}

**CFTC RULE 4.41:** HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

**RISK DISCLOSURE: **U.S. GOVERNMENT REQUIRED DISCLAIMER | CFTC RULE 4.41

Codes: matlab/connors/rsi-2