RSI > 95 for 5 consecutive days
Author: rmpwealth
Creation Date: 9/20/2010 3:37 PM
profile picture

rmpwealth

#1
Someone recommended a strategy that I'd like to play with, but I cannot seem to build it using Rules, and am not a programmer at all. Would any of you programmers care to give it a shot?

Here is the strategy:

BUY @ Market when RSI (2-day) is above 95 for 5-consecutive days.

SELL @ Market 1-month after Buy.

Thanks.

profile picture

Cone

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

Eugene

#3
QUOTE:
but we'll need to add an overload for SeriesIsAbove a Value.

Wilco, thanks for the heads-up.

P.S. Adding an overload itself isn't enough. Overloads are great unless you have a companion IndicatorHelper class with static constructor. So to properly support rule-based strategies and drag-n-drop indicator usage, it seems like a new Indicator (SeriesIsAboveValue/SeriesIsBelowValue) is required.
profile picture

Eugene

#4
2 rmpwealth: here's an idea worth exploring. Rather than buying after the prices have risen (RSI considerably oversold for n consecutive days), perhaps it could be more profitable to wait for a pullback:

ActiveTrader 2010-05 | Oscillator Pullback System
profile picture

rmpwealth

#5
Thanks. You guys are really fast!

I copied/pasted the code, and it worked. Two questions, though.

1. Last night there was a second code posted, by Eugene, I believe, but it no longer is posted. What happened to it -- was it combined w/Cone's code?

2. When I build a strategy w/Rules, I normally play around with Optimizing, and would like to optimize various parameters of the above code. However, the procedure for optimizing in code is apparantly different than when using Rules. Using Rules, I click the slider box adjacent to the parameter, and the box turns red; when I click on Optimize in the above code, the dialogue box appears to be asking me to select the parameters to be optimized -- how do I indicate the parameters to be optimized when working with code.

Thanks also for the alternative suggested strategy -- I'll try it.
profile picture

Cone

#6
1. I made a comment that Eugene replied to, but before he did, I thought about it and knew it wasn't the right way to go about it, so I deleted it.

2. Your requirements were very specific. If you had specified a range, that would have been easy to implement. But you can do this yourself... See the WealthScript Programming Guide: Programming Trading Strategies > Strategy Parameters > How to: Add Strategy Parameters. If you use Method 2, you'll probably need to close a re-open the script for the changes to take effect. This bug will be fixed in 6.1.
profile picture

Eugene

#7
SeriesIsAboveValue & SeriesIsBelowValue added to Community Indicators 2010.10.
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).