The RSI Three Strikes and You’re Out Play
Author: sedelstein
Creation Date: 8/12/2014 4:27 PM
profile picture

sedelstein

#1
I read about this setup here http://jayonthemarkets.com/ but I'm finding it tricky to code.

Anyone here care to take a look?




The RSI Three Strikes and You’re Out Play

So we will use the 3-day RSI indicator as a trigger to alert of a potential top. Note the use of the phrase “potential top.” Note also that nowhere do the words, “pinpoint”, “market” or “timing” appear. So here is how it works:

1. (Day x) Price and 3-day RSI make a new high for a given move.

2. (Day y) After at least one intervening down day, price makes a higher close than on Day x BUT 3-day RSI stands below its level on Day x.

3. (Day z) After at least one intervening down day, price makes a higher close than on Day y, BUT 3-day RSI stands below its level on Day y.

4. After Day z the entry trigger occurs the next time price drops below the 3 day low.

To put it another way, after Day x price makes two higher closing peaks (with at least one down day between these peaks), while RSI on Day y is below RSI on Day x and RSI on Day z is below RSI on Day y. OK, that’s as clear as mud.
profile picture

Eugene

#2
It looks quite easy to code if you follow the design pattern on programming setups, triggers, delays, and timeouts.

Since it's not positioned as a complete strategy, I added a time-based exit. Takes multiple positions. Also makes good sense to introduce a timeout to avoid spanning many months from day x to day y/z.

Author's rules are not always clear so feel free to modify. In particular, how you define a down day (see isDownDay() ):

CODE:
Please log in to see this code.
profile picture

sedelstein

#3
Thanks for modelling this up Eugene. I hope it proves useful for the community. The author's webpage is worth checking now and again as well. It's often easy to find candidates worth buying. I hope this setup is worthwhile for establishing shorts

Steve
profile picture

LenMoz

#4
Sedelstein,

QUOTE:
Anyone here care to take a look?

I took a look, and found some interesting things.
1. Per the web site and post #1, "So we will use the 3-day RSI indicator as a trigger to alert of a potential top." - with the author suggesting the pattern signals a potential time to buy puts. I didn't realize this at first - more on that later.

So, starting with Eugene's code, I "embellished" it.
1. For the "Day X" signal, rather than a single day drop, I used the PeakBar indicator with the percentage drop as a parameter
2. I modified Eugene's IsDownDay function to compare Close rather than High and to compare to the prior bar, not the "Day X" bar
At this point, I "Optimized" it, running a 10-year backtest on the S&P 500 portfolio.

Result? APR=22.36%(BH 13.72%) S&P 500, 1Jan2004, 5% equity {3.1,10,49,37} - a fair amount better than buy-and-hold.

That's when I realized that it was backwards, and should be taking short, not long, positions, to simulate buying puts.

3. I changed BuyAtMarket to ShortAtMarket and SellAtMarket to CoverAtMarket and optimized again

Surprisingly(?), the results were far worse, APR barely 1%, barely able to produce a positive result.

4. Seeing this, I made one more change, adding a Boolean (SHORTING) near the top of the code so the long or short side can be tested.

Code is below. Do you think the author would be interested in this test result?

Len
CODE:
Please log in to see this code.





profile picture

sedelstein

#5
Thanks Eugene

Please trash the old thread.

I must be getting old. Didnt realize I had asked before.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).