StockFetcher Forums · Filter Exchange · Apple divergence - how can we scan for this?<< >>Post Follow-up
voidcomp
23 posts
msg #108324
Ignore voidcomp
10/9/2012 4:34:49 PM

Check out the bearish divergence between price and RSI 14 - http://imageshack.us/a/img405/6782/aapldivg.jpg

What would be a decent scan formula to capture this, not only for bearish but bullish also? Thanks.

mahkoh
1,065 posts
msg #108325
Ignore mahkoh
modified
10/9/2012 5:20:50 PM

How about this?

Fetcher[

*CODING FOR DIVERGENCE BETWEEN MA(3) AND THE RSI INDICATOR*/
s&p 500
SET{RSI14down, COUNT(RSI(14) below RSI(10) 12 days ago,1)}
SET{RSI14down3, COUNT(RSI(14) DROPPED MORE THAN 3% OVER THE LAST 12 DAYS,1)}

SET{MA3UP8, COUNT(MA(3) above MA(3) 12 days ago,1)}
SET{MA3UP8_1, COUNT(MA(3) gained MORE THAN 3% OVER THE LAST 12 DAYS,1)}

SET{DIV1H, RSI14down * MA3UP8}
SET{DIV2H, RSI14DOWN3 + MA3UP8_1}
SET{DIV3H, COUNT(DIV2H ABOVE 0.5,1)}
SET{RSI14DIV, DIV1H * DIV3H}

ADD COLUMN RSI14DIV

RSI14DIV above 0.5

draw rsi(14)
]



voidcomp
23 posts
msg #108326
Ignore voidcomp
10/9/2012 7:22:55 PM

Thanks for the quick response. If the formula basically says there's a big divergence in linear slope between price and RSI(14) over the past month then yes. I've found that divergences over shorter time frames lead to more whipsaw trades.

Rock Sexton
111 posts
msg #108327
Ignore Rock Sexton
10/9/2012 11:15:44 PM

Mahkoh, do you by chance have the inverse of this filter coded for divergent bottoms?

mahkoh
1,065 posts
msg #108330
Ignore mahkoh
10/10/2012 7:28:07 AM

You could use larger values for MA and "day period" to cover longer timeframes. For rsi you may want to create a custom moving average of rsi(14) and require the slope to be above or below 0, something like

set{x,cma(rsi(14),20)}
20 day slope of x above 0 do not draw 20 day slope of x

For an inverse version simply change "dropped" to "gained" and "below" to "above"

voidcomp
23 posts
msg #108331
Ignore voidcomp
10/10/2012 9:09:23 AM

What's a more simple expression that says:

- the 20 day slope of price is > 0 and the 20 day slope of rsi(14) is < 0 (no moving average smoothing)
- express the difference between price slope and rsi slope

Thanks.

jackmack
334 posts
msg #112487
Ignore jackmack
modified
3/28/2013 8:47:13 AM

mahkoh

Quick question for you - I changed this around by adding below and it looks great BUT how do I get it to kick out only those that triggered in just the last day and not those that have been triggered over the last several days or longer?

set{x,cma(rsi(14),20)}
20 day slope of x above 0 do not draw 20 day slope of x

Thanks
Cheers

Never mind - got it - nice filter
Cheers

StockFetcher Forums · Filter Exchange · Apple divergence - how can we scan for this?<< >>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.