MACD/RSI divergence
Forums › ProRealTime English forum › ProBuilder support › MACD/RSI divergence
- This topic has 8 replies, 3 voices, and was last updated 6 years ago by Nicolas.
Tagged: divergences, Macd, macd zerolag, zerolag
-
-
10/31/2016 at 11:14 PM #1579611/03/2016 at 10:07 AM #1589609/27/2018 at 7:48 PM #81490
>> Please update your country flag in your profile. Thank you <<
Not possible with version 10.2, but It would be something possible with the new graphical possibilities of the version 10.3 of prorealtime.
would this be possible now nicolas? Would you be able to help me with it? 🙂
09/28/2018 at 8:15 AM #8151409/28/2018 at 4:50 PM #81561If I understood right, this will please you 😉
Hi Nicolas?
There is a problem though when I use it in weekly; there is a slipage of the line rightwise that I compensated, but I do not really understand why this happens; do you have any clue?
09/28/2018 at 11:55 PM #81586Sure, would you point me in the right direction and with the code/indicator you are mentioning?
Ofc, macd lines, not histogram, see pic below.
1 user thanked author for this post.
10/01/2018 at 9:38 AM #81654Ok, I changed the original MACD ZeroLag divergence indicator to add lines that identified the 2 tops or bottoms that create that divergences.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109// DIVERGENCES ZeroLag MACD adapted from HK-LISSE RSI divergences code//MACD periodsshort = 12long = 26signal = 9//-----------EMAshort1 = exponentialaverage[short](close)EMAshort2 = exponentialaverage[short](EMAshort1)DifferenceShort = EMAshort1 - EMAshort2ZeroLagShort = EMAshort1 + DifferenceShortEMAlong1 = exponentialaverage[long](close)EMAlong2 = exponentialaverage[long](EMAlong1)DifferenceLong = EMAlong1 - EMAlong2ZeroLagLong = EMAlong1 + DifferenceLongZeroLagMACD = ZeroLagShort - ZeroLagLongsignal1=ExponentialAverage[signal](ZEROLAGMACD)signal2=ExponentialAverage[signal](signal1)DIFFERENCE2=signal1-signal2SignalMACD=signal1+DIFFERENCE2x = ZeroLagMACDy = SignalMACD// BEARISH DIVERGENCES MACDhi=max(hi,x)hico=max(hico,max(high,high[1]))if x crosses under y thensto2b=sto1bsto1b=hihi=0p3b=p1bp2b=max(p1b,hico1)p1b=max(highest[3](high),hico)if p2b=p1b thenp2b=max(p3b,p4b)endifhico=0hico1=0endifif x<y thenp4b=hico1hico1=max(hico1,high)endifif p1b>p2b and sto1b<sto2b and x crosses under y and x<x[1] then//signB= -2//drawtext("0",barindex,y,dialog,bold,22)drawarrowdown(barindex,y) coloured(255,0,0)for i = 1 to 100 doif(sto1b[i]<>sto1b[i+1]) then//drawtext("0",barindex[i],y[i],dialog,bold,22) coloured(255,0,0)drawsegment(barindex[i],y[i],barindex,y) coloured(255,0,0)breakendifnextelse//signB= 0endif// BULLISH MACD DIVERGENCESlo=min(lo,x)lowco=min(lowco,min(low,low[1]))if x CROSSES OVER y thensto2h=sto1hsto1h=lolo=100p3h=p1hp2h=min(p1h,lowco1)p1h=min(lowest[3](low),lowco)if p2h=p1h thenp2h=min(p3h,p4h)endiflowco=100000lowco1=100000endifif x>y thenp4h=lowco1lowco1=min(lowco1,low)endifif p1h<p2h and sto1h > sto2h and x crosses over y and x>x[1] then//signH= 2drawarrowup(barindex,y) coloured(0,255,0)for i = 1 to 100 doif(sto1h[i]<>sto1h[i+1]) thendrawsegment(barindex[i],y[i],barindex,y) coloured(0,255,0)breakendifnextelse//signH= 0endif////////////////////////////////////////////////RETURN x coloured by x style(histogram,1) as "MACD", y style(line,2) as "MACD signal line"//,signH as "Bullish MACD Divergence", signB as "Bearish MACD Divergence" , 0 as " zero "1 user thanked author for this post.
10/01/2018 at 6:41 PM #8168910/02/2018 at 7:36 AM #81731You’ll find a screener made of this MACD zerolag indicator in this thread: Screener Divergence MACD
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on