StockFetcher Forums · Filter Exchange · Smoothed Rate of Change (S-RoC) scripting<< >>Post Follow-up
glgene
613 posts
msg #102554
Ignore glgene
9/6/2011 9:57:25 PM

On pages 146-151 of 'Trading for a Living' by Dr. Alexander Elder he addresses the Smoothed Rate of Change. In essence, he says:

1) This oscillator...avoids the major flaw of RoC. It responds to each piece of data only once rather than twice. Smoothed Rate of Change (S-RoC) compares the value of an exponential moving average (EMA) instead of prices at two points in time. It gives fewer trading signals, and the quality of these signals is better.

2) To create this indicator, calculate a 13-day EMA of closing prices and apply a 21-day RoC to it. S-RoC usually flows in smooth waves whose crests and bottoms identify many important turning points. This indicator works especially well in the stock market, with stock groups as well as with individual stocks.

3) He then cites four conditions for buying and selling, using the S-RoC indicator, one of which is: Buy when S-RoC turns up from below its centerline.

So...I created this simple SF script (following example in SF manual, page 97):

Fetcher[
symlist (VTI)
add column smroc(13,21)
draw smroc(13,21)
]



The results of S-RoC are very tight from my test period of Aug. 1 thru Sept. 6, 2011. On Aug. 2 the S-RoC was 100.00. On Sept. 6 it was 99.91. In between those dates it barely budged from day to day. The low was 99.86.

Question 1: Did I write the script properly?

Question 2: Where is the centerline (see #3 above)?

Thanks in advance for any help.

Gene in OH

Kevin_in_GA
4,599 posts
msg #102556
Ignore Kevin_in_GA
9/6/2011 10:24:43 PM

Try this:

Fetcher[


symlist (VTI)

set{var1, smroc(13,21) - 100}
set{new_smroc, var1 * 100}
add column new_smroc
draw new_smroc line at 0

]



glgene
613 posts
msg #102557
Ignore glgene
9/6/2011 11:37:29 PM

Bingo, Kevin! You are so superb (and fast) with SF scripting. Nothing baffles you!

Here's some recent proof of your suggested script.

Dr. Elder's first two suggested rules (page 150 in his book) for buying and selling using Smoothed Rate of Change (S-Roc) is as follows:

1) Buy when S-RoC turns up from below its centerline (I think that would be the 0 line you suggest, Kevin. If not, let me know).

2) Sell when S-RoC stops rising and turns down. Sell short when S-RoC turns down from above its centerline.

Anyway, using your script, Kevin, VTI peaked at +2.62 on 7/26/2011. It turned down on 7/27/2011 at +2.45. If you look at your charts, that would have been an excellent time to sell in the current market. [VTI is -11.06% from 7/27/2011 thru 9/6/2011.] Coincidentally, on 7/27/2011 is when IBD changed from 'Market Under Pressure' to 'Market in Correction.'

On 9/6/2011, your S-RoC number is -9.11. Following Rule #1 above, you wouldn't buy again until S-RoC crosses above the 0 line.

I know that one time period is insufficient for a valid test, and that one should use more than one indicator. I just want to tell you, Kevin, that your script using S-RoC sure puts a smile on my face. You and Dr. Elder have something in common: smarts.

FYI: I'm using VTI (Vanguard Total Stock Market Index) as a proxy for an overall "get out of the market" (or get back in) signal.

Gene in OH



coolsf
21 posts
msg #103056
Ignore coolsf
10/22/2011 10:29:54 AM

1, How to use this filter to scan for all stocks, instead of only VTI?
2, When looking at VTI, I used a 2 year chart. Only 1 signal was effective which occurred in Oct 2010. But. that was from when everything else rose too.

jimvin
170 posts
msg #103058
Ignore jimvin
10/22/2011 12:59:38 PM

For all markets, eliminate the first line: "symlist (VTI) "

coolsf
21 posts
msg #103075
Ignore coolsf
10/23/2011 11:59:57 PM

Thank you, jimvin. But, that returned 10102 results which means we cannot remove that line.

jimvin
170 posts
msg #103084
Ignore jimvin
10/24/2011 10:32:42 PM

Simple ways to limit the returns (when the first line is lopped) are by price (and price > 3 or and close > 3) or by market (and market is...) or use my approach which is to cut out OTC and PINK sheets (and market is not otcbb), take the huge roster of hits and sort by % gain, then focus on the top 20 for further investigation.

StockFetcher Forums · Filter Exchange · Smoothed Rate of Change (S-RoC) scripting<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.