Back to Community
WTI Crude Oil Future Strategy -- RSI / 100-Day Moving Average

Hello,

My name is Mark im still a college student catching up on most this stuff. I'm still a little new to the indicator / quantitative style of trading.

BUY SIGNAL:
My algo uses the 7 day RSI to check when the WTI Crude Futures Contract was under bought ( when ever its below 20 ). It also makes sure the current prices are above the 100-Day Moving Average ( to catch the price momentum ).

SELL SIGNAL:
When the current price are equal to or less then the 100-Day Moving Average then it'll sell.

The strategy did not make any trades at all ( Really not sure why ). After doing a little bit more research i changed the 7 - RSI value to anything bigger then 75 ( currentPrices > 75 ). At one point It did make some profit, but overall it was loosing 1%.

Can i get some advice / ideas from the Quantopian community about adding more quantitative value to this strategy. Maybe something other then indicators i can add that'll help out ( mean reversion's -- really not sure ).

When i looked at the charts, it seemed like this strategy would work.

Thank you so much for your time

-Mark

Clone Algorithm
12
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: 593ec56efdf2996980e369d5
There was a runtime error.
2 responses

Hi Mark (great name ;-)

I tried modifying your algorithm with some print log statements to ensure the buys went long under the criteria that CL RSI7 < 20 (BTW your code shows RSI7 < 25), CL 100SMA > 100. And closed out the long when CL Price < CL SMA100. I also recorded the variables: CL Price, CL RSI 7, CL 100SMA to visually check that the trades were executed under the correct conditions.

In addition I changed the default allocation to $1,000,000 and expanded the time period.

I believe the algorithm performs poorly in general due to the criteria that the CL price be above the 100SMA and RSI 7 < 20. Almost all the times that CL RSI 7 is < 20 it will also be < 100 SMA.

Hope that helps. Not sure if this was just to get your feet wet or what the intended purpose of this algo was but play around with it (i.e. shorting, different MA's, different RSI's).

Clone Algorithm
11
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: 5940737e73c20251bb8979b4
There was a runtime error.

Mark,

Thank you so much for helping me out. I'll defiantly mess around with trying to short /CL. Record Vars () is something i'll defiantly be using a lot from now on.

Thanks again