JinNJ46 22 posts msg #103659 - Ignore JinNJ46 |
12/7/2011 7:28:41 AM
Folks,
I'm a newbie with both SF and Technical Analysis. I'm studying RSI and am currently drilling down on divergences. For this bearish divergence scenario, the filter (should) produces candidates for trade. The trade is bear call spread with short strike > 1 STDEV OTM. The system is explained in a webcast on www,cboe.com. The index of interest in the webcast is Russell 2000; the filter below doesn't restrict the security type. The filter is a start but it doesn't capture the spririt of the trade premise. I'm looking for more dynamics and not a fixed 3 week timeframe for analysis.
Trade Premise
The underlying index makes higher highs while the RSI fails to make higher highs. The trade entry is a an down close once the divergence condition exists.
My global filter: price > 5, AV > 50000, optionable
Also, backtesting will help determine if 14 days is best but suggestions based on your experience is welcome. All coments and assistance is greatly appreciated. Many thanks.
/*CHECK TIME SPENT IN OVERBOUGHT TERRITORY*/
SET {WAS_OVERBOUGHT, COUNT(RSI(14) IS ABOVE 70, 15)}
SET {RSI_PERIOD_HIGH, RSI(14) 15 DAY HIGH}
/* HIGH PRICE REACHED A NEW HIGH THEN CLOSES DOWN*/
AND HIGH REACHED A NEW 3 WEEK HIGH 1 DAY AGO
AND CLOSE IS BELOW CLOSE 1 DAY AGO
/* RSI DID NOT MAKE A NEW HIGH*/
AND RSI(14) 1 DAY AGO IS BELOW RSI_PERIOD_HIGH
/* AND SECURITY WAS OVERBOUGHT SOMETIME DURING THE 3 WEEK PERIOD*/
AND WAS_OVERBOUGHT IS GREATER THAN 1
/*AND RSI(14) 1 DAY AGO CROSSED ABOVE 70 WITHIN THE LAST 15 DAYS*/
/* RSI IS OUT OF OVERBOUGHT TERRITORY*/
AND RSI(14) IS BELOW 70
ADD COLUMN RSI(14)
ADD COLUMN RSI_PERIOD_HIGH
ADD COLUMN WAS_OVERBOUGHT
|
reels 29 posts msg #103671 - Ignore reels |
12/7/2011 1:43:04 PM
|
Eman93 4,750 posts msg #103757 - Ignore Eman93 |
12/13/2011 10:34:06 PM
You mean like CREE today? lower low but RSI is higher...
|
JinNJ46 22 posts msg #103766 - Ignore JinNJ46 |
12/14/2011 7:32:24 AM
Yes, that is the premise. However, I am having trouble coding "lower lows" or "higher highs". For the time being I have settled on fixed timeframes of 10 days. Here is the snippet:
I have backtested this for 2007-2008 which is the test period from the CBOE. This picks up most of the entries but not all so perhaps someone can help me uncover the reasons. The backtest did not pick up the entry on 1/16/2007. A subset of the data from YAHOO (the RSI is calculated in my spreadsheet) is below. The close price condition is met but the RSI condition is not met, According to the data below it should be. This raises a the question of data integrity. How do you people vet and prove the validity of the content. The again, the likely culprit is likely my code! Please review and help out if you can. Many thanks.
The RSI(14) on 1/12/2007 should meet the condition in the code above
Date Open High Low Close Volume RSI
12/18/06 79.06 79.21 77.63 77.91 47013800 58.70
12/19/06 77.45 78.11 77.1 77.86 54066400 49.10
12/20/06 77.62 78.26 77.62 77.98 43288200 48.64
12/21/06 77.99 78.35 77.31 77.62 49951400 52.66
12/22/06 77.59 77.75 77.05 77.11 31230400 49.29
12/26/06 77.33 78.22 77.3 78.21 21798200 44.93
12/27/06 78.37 79.17 78.35 79.14 39294000 54.36
12/28/06 79.03 79.28 78.65 78.78 28257400 60.51
12/29/06 78.66 78.99 77.99 78.03 30795200 57.30
1/3/07 78.68 79.12 77.22 78.16 54095400 51.18
1/4/07 77.89 78.59 77.28 78.37 45577600 52.11
1/5/07 78.02 78.37 76.7 76.73 57486800 53.70
1/8/07 76.95 77.3 76.23 76.43 46117200 42.08
1/9/07 77.12 77.31 76.19 77.15 62791800 40.38
1/10/07 76.76 77.75 76.57 77.75 49239300 46.07
1/11/07 77.46 78.54 77.4 78.23 49188300 50.36
1/12/07 78.26 79.05 78.13 78.98 28392800 53.50
1/16/07 79.21 79.36 78.3 78.45 33914700 58.01
|
TheRumpledOne 6,411 posts msg #103768 - Ignore TheRumpledOne |
12/14/2011 7:39:56 AM
4/6/2011 2:11:54 AM
You may be able to adapt this filter.
|
TheRumpledOne 6,411 posts msg #103769 - Ignore TheRumpledOne |
12/14/2011 7:41:52 AM
You find this filter useful, too.
|
JinNJ46 22 posts msg #103772 - Ignore JinNJ46 |
12/14/2011 8:39:51 AM
Thanks TheRumpledOne for your assistance. Your code is a bit difficult for me to follow but I'll give it a go. Any comments on my code snippet and why the 1/15/2007 RSI condition is not picked up by SF?!
|
Eman93 4,750 posts msg #103862 - Ignore Eman93 |
12/19/2011 8:10:03 PM
|
JinNJ46 22 posts msg #103908 - Ignore JinNJ46 |
12/21/2011 8:04:13 AM
Eman93,
Thanks so much for sharing. I see you filter screens for:
1. Stocks reahing a new low
2. An uptrending RSI for the period of 10 weeks ago - 3 weeks ago
This would represent a divergence of sorts. However, I do not see the correlation of RSI between today and 3 or 10 weeks in the past. I only see #2 above. Perhaps you meant to incude that analysis but didn't since the variable rmda seems to be an orphan
/***
set{rmda, rslo - rstoday}
***/
Is it a coincidence that today's RSI continues the uptrend?!
many thanks.
|
coolsf 21 posts msg #103911 - Ignore coolsf |
12/21/2011 8:55:29 AM
Stockfetcher is not so good with the weekly indicators.
|