Let’s build a new Tradestation Connors RSI strategy in EasyLanguage.

Today we present the excellent 2-period Connors RSI method devised by Larry Connors. We apply it to the US index using the *SPDR S&P 500 Exchange Traded Fund (ETF) SPY*.

First, **What is the Relative Strength Index (RSI)**?

From Investopedia is “The RSI is *a momentum indicator that measures the magnitude of recent price changes to evaluate overbought or oversold conditions in the price of a stock or other asset*“.

Classic Relative Strength Index and Connors RSI:

We have many strategies with RSI Indicator. This is our custom indicator that shows also the direction:

## The original Connors RSI strategy

**BUY**: When the Relative Strength Index indicator is oversold below the 5 levels.

**EXIT**: When the price closes above the simple 5-period moving average on PriceClose.

Connors also uses a trend filter through a 200-period moving average to determine the big trend.

Today we will change the original strategy. We using an oversold level of 10 and we will not use the trend filter.

However, the system will only go long on a daily time frame. Caution: The system does not have adequate position sizing and buys $ 10,000 with an initial capital of $ 30,000 and has a huge stop loss of $ 2,000.

**EasyLanguage Code for TradeStation and MultiCharts **

There are many strategies that you could code in EasyLanguage for TradeStation.

This is only one alternative version.

Let’s start with declaring the inputs:

**Input:**

**RSI_Period(2),**

**RSI_OverBought(10),**

**MA_Exit_Period(5);**

Then we declare the variables:

**Variables:**

**RSI_Value(0),**

**Exit_MA(0),**

**Max_Risk(000);**

Then we code the RSI calculations for the entry signal and the moving average for the exit:

**RSI_Value = RSI(Close,RSI_Period);**

**Exit_MA = Average(Close, MA_Exit_Period);**

Finally, we insert the code to send the order and manages the exit:

**If ( RSI_Value <= RSI_OverBought ) Then buy(“Buy”) this bar at close;**

**If ( MarketPosition <> 0 ) And ( Close > Exit_MA ) Then sell(“Exit”) this bar at close;**

**If ( Max_Risk > 0 ) Then SetStopLoss( Max_Risk );**

This is the Trading System’s **equity line and results**:

## Conclusions

We coded the **Larry Connors RSI 2** strategy in EasyLanguage for TradeStation and we like it!

The results of our trading operation utilizing strategy: 22trades with an average profit of $44 per trade, with a very good percent of profitable trades at 70%.

We can improve it by adding a trend filter with position sizing rules. The size of the position must depend on implicit or historical volatility.

**Tradestation and MultiCharts** Strategy RSI Connors – Easylanguage final code:

## More from Finance Strategy System

STATE STREET SPDR: *SPDR S&P 500 ETF SPY*

WIKIPEDIA: Larry Connors

STOCK TRADING SYSTEM BENCHMARK INDICATOR

How to calculate the Relative Strength in the Stock Market

RSI oscillator (Relative Strength Index) | Essential Tutorial

The TRIX || Triple Exponential Average Indicator || Tutorial

The McClellan Summation Index || Technical Analysis

EasyLanguage Tutorial & PowerLanguage Tutorial – Part 01Connors