Back to Community
First strategy tested: RSI Weighted Mean Crossover

Hey everyone, my name is Brian. I just joined Quantopian a few weeks and absolutely love the tools provided to backtest your trading strategies and ideas. Hopefully I will be able to implement this algorithm with my TD Ameritrade account.

This is my first algorithm I have created based on the RSI indicator. Basically I calculate the most recent RSI value and it's exponentially weighted mean based on the window length selected. When the actual RSI value is above the exponentially weighted mean RSI value, I am going long, and vice versa for going short on a stock (RSI value below exponentially weighted mean RSI value). I tested this algorithm on $RMTI since the beginning of the year with $5,000 starting capital. Not too bad for my first run.

Just thought I would share my results thus far. If anyone has any feedback on how to make this algorithm better by modifiying the original code or including other technical indicators to complement the RSI indicator, please don't hesitate to comment.

Clone Algorithm
411
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 578bc7f4669bc20f8e3bde51
There was a runtime error.
3 responses

Hi Brian

Thanks for sharing.
Pls would you mind giving some details on whats the window length for the moving average
also what length are you using for RSI
Thanks!

Karl,

For both the exponential moving average and RSI calculations, I used a window length of 9 days. I noticed that this strategy is sensitive to the initial capital invested, RSI and moving average window length, the stock being back tested and date range.

I think RSI mean crossover by itself works a bit better than just using RSI to identify when a stock is oversold or overbought to initiate a long or short position. In the future I would like to combine RSI with either MACD or Stochastics.

Let me know if you have anymore questions!

Brian

Hey Brian, thanks for posting this. Could you explain a bit more about how your window for RSI relates to years tested? I tried going back a few years, and it would not let me go past 2014.