stefcom

Stefan Krecher: Jeddingen Divergence

The main idea is to identify a divergence between momentum and price movement. E.g. if the momentum is rising but price is going down - this is what we call a divergence. The divergence will be calculated by comparing the direction of the linear regression curve of the price with the linear regression curve of momentum .
A bearish divergence can be identified by a thick red line, a bullish divergence by a green line.
When there is a divergence, it is likeley that the current trend will change it's direction.
Looking at the chart, there are three divergences that need to get interpreted:
1) bearish divergence, RSI is overbought but MACD does not clearly indicate a trend change. Right after the divergence, price and momentum are going up. No clear signal for a sell trade
2) bearish divergence, RSI still overbought, MACD histogram peaked, MACD crossed the signal line, price and momentum are going down. Very clear constellation for a sell trade.
3) two bullish diverences, RSI is oversold, MACD crossover near the end of the second divergence, price and momentum started rising. Good constellation for a buy trade. Could act as exit signal for the beforementioned sell trade.
More information on the Jeddingen Divergence is available here: www.forexpython.com/strategy
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title="Stefan Krecher: Jeddingen Divergence", shorttitle="Jeddingen Divergence", overlay=true)
candles = input(title="Number of candles that need to diverge", type=integer, defval=5, minval=3, maxval=10)
linregPrice = input(title="price related linear regression length", type=integer, defval=20, minval=5, maxval=50)
momLength = input(title="momentum length", type=integer, defval=10, minval=2, maxval=50)

jeddingen(series) => ((falling(series, candles)) and (rising(mom(series, momLength),candles))) or ((rising(series, candles)) and (falling(mom(series, momLength),candles)))

srcDiv = close
lrDiv = linreg(srcDiv, linregPrice, 0)

lrDivColor =if(jeddingen(lrDiv) == true)
    rising(lrDiv, candles) ? red:green
else
    na
plot(lrDiv)
plot(lrDiv, color=lrDivColor, linewidth=4)
cristian.d
9 months ago
Thanks for examples!
Reply
cristian.d
9 months ago
What settings do you recommend for stocks?
Reply
stefcom PRO cristian.d
9 months ago
@christian.d I think it depends on the stock and it's volatility and on the timeframe you would like to use - do you have any special stocks in mind? I could play around with some setups. Would love to do more trading with stocks
Reply
cristian.d stefcom
9 months ago
I day (5 min or 1 min TF) trade high optionable stocks/indices, but mainly SPY, AAPL and FB. SPY is the one that I would like to try your indicator on. It looks good overall, just was curious how can I improve settings. As you can see, half of the signals were goo, half, not so good. Besides your recommended momentum indicators, is here something that can be changed in settings? You help is much appreciated. Danke :)
snapshot
Reply
stefcom PRO cristian.d
9 months ago
I have a TradingView strategy script that uses the Jeddingen Divergence algorithm, maybe I'll release this is the near future. I use RSI and MACD as confirmation, e.g. if there is a divergence AND RSI is above a certain level AND the MACD histogram is above a certain level AND the MACD histogram has peaked - then a trade can be executed,
To adapt the strategy to a special asset/ TF I would play with the RSI and MACD histogram levels, and maybe with the properties that relate to the divergence (e.g. how long must price and momentum diverge?).
I'll come back to SPY later this week. Schönen Abend noch ;-)
Reply
stefcom PRO cristian.d
9 months ago
Hi Christian, I revisited your SPY example and came up with a simple solution: In case of a bullish divergence you draw a trendline above price, in case of a bearish divergence you need to draw it under the price. A buy/ sell signal will be triggered only when price breaks the trendline.
I draw some very basic trendlines with an online drawing program - have a look at it here:
https://www.dropbox.com/s/l7n2npn1ya0iqla/spy-with-trendlines.png?dl=0
This is based upon Rob Bookers Trifecta system looking at trendline breaks after a Knoxville Divergence.
Reply
cristian.d stefcom
9 months ago
Vielen dank Stef ! Also some of the buy signals came on obvious tops, so yeah.. Again thank you!
Reply
cristian.d stefcom
9 months ago
How do you draw with dropbox? Is it automatically drawn?
Reply
stefcom PRO cristian.d
9 months ago
I just downloaded your chart as an image file and edited it with an online image manipulation tool. I just draw some lines on it, only to illustrate the idea of trendline breaks after a Jeddingen Divergence. Then saved the image and shared it via Dropbox - no automagic ...
Reply
cristian.d stefcom
9 months ago
Thank you! Do you think Knoxville divergence can be created in TV like it shows in the video ? http://tfl365.com/t3/the-trifecta-indicators/
Reply
stefcom PRO cristian.d
9 months ago
The Knoxville Divergence indicator is offered in the TV marketplace (iirc about 19$/ per month). The Jeddingen Divergence indicator tries to identify the same kind of divergences but it is been done in another way. I'm using linear regressions. Results are sometimes identical, sometimes they differ ...
Reply
cristian.d stefcom
9 months ago
Thank you Stef
Reply
stefcom PRO
a month ago
Hi - I just released a new version of this script, that basically does the same calculations but adds the possibility to create alerts based on the divergences:
Stefan Krecher: Jeddingen Divergence v2
Reply
cristian.d stefcom
9 days ago
@stefcom, Thanks for sharing Stef
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out