FantasticFox

MACD Divergence MultiTimeFrame [FantasticFox]

This is a MACD divergence on 3 time-frames, 1h, 4h and 1D.
Please insert the indicator into a 1h chart, otherwise change the lengths' inputs.

you will see H1,H2, H3, R1, R2 and R3 in green and maroon colors.
H means hidden divergence, 1 regards to 1h, 2 to 4h, and 3 to 1D. If the color is green, its bullish , and if its maroon the divergence is bearish .

Gray circles on 4h macd is for those traders who want to check the confirmation on Elliott wave changes.

*Thanks to RicardoSantos MACD divergence.
从常用的脚本中删除 添加到常用的脚本
study(title='MACD Divergence MultiTimeFrame [FantasticFox]', shorttitle='MACD Div MTF')
source = input(close)

f_top_indy(_source)=>_source[4] < _source[2] and _source[3] < _source[2] and _source[2] > _source[1] and _source[2] > _source[0]
f_bot_indy(_source)=>_source[4] > _source[2] and _source[3] > _source[2] and _source[2] < _source[1] and _source[2] < _source[0]
f_indyize(_source)=>f_top_indy(_source) ? 1 : f_bot_indy(_source) ? -1 : 0

fastLength1 = input(12, minval=1), slowLength1=input(26,minval=1)
fastMA1 = ema(source, fastLength1)
slowMA1 = ema(source, slowLength1)
macd1 = fastMA1 - slowMA1 
plot(macd1, color=aqua, linewidth=1)


indy_top1 = f_indyize(macd1) > 0 ? macd1[2] : na
indy_bot1 = f_indyize(macd1) < 0 ? macd1[2] : na

high_prev1 = valuewhen(indy_top1, macd1[2], 1) 
high_price1 = valuewhen(indy_top1, high[2], 1)
low_prev1 = valuewhen(indy_bot1, macd1[2], 1) 
low_price1 = valuewhen(indy_bot1, low[2], 1)

regular_bearish_div1 = indy_top1 and high[2] > high_price1 and macd1[2] < high_prev1
hidden_bearish_div1 = indy_top1 and high[2] < high_price1 and macd1[2] > high_prev1
regular_bullish_div1 = indy_bot1 and low[2] < low_price1 and macd1[2] > low_prev1
hidden_bullish_div1 = indy_bot1 and low[2] > low_price1 and macd1[2] < low_prev1


plotshape(title='+RD', series=regular_bearish_div1 ? macd1[2] : na, text='R1', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='+HD', series=hidden_bearish_div1 ? macd1[2] : na, text='H1', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='-RD', series=regular_bullish_div1 ? macd1[2] : na, text='R1', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
plotshape(title='-HD', series=hidden_bullish_div1 ? macd1[2] : na, text='H1', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)

/////// 4h

fastLength2 = input(48, minval=1), slowLength2=input(104,minval=1)
fastMA2 = ema(source, fastLength2)
slowMA2 = ema(source, slowLength2)
macd2 = fastMA2 - slowMA2
plot(macd2, color=aqua, linewidth=1)


indy_top2 = f_indyize(macd2) > 0 ? macd2[2] : na
indy_bot2 = f_indyize(macd2) < 0 ? macd2[2] : na

high_prev2 = valuewhen(indy_top2, macd2[2], 1) 
high_price2 = valuewhen(indy_top2, high[2], 1)
low_prev2 = valuewhen(indy_bot2, macd2[2], 1) 
low_price2 = valuewhen(indy_bot2, low[2], 1)

regular_bearish_div2 = indy_top2 and high[2] > high_price2 and macd2[2] < high_prev2
hidden_bearish_div2 = indy_top2 and high[2] < high_price2 and macd2[2] > high_prev2
regular_bullish_div2 = indy_bot2 and low[2] < low_price2 and macd2[2] > low_prev2
hidden_bullish_div2 = indy_bot2 and low[2] > low_price2 and macd2[2] < low_prev2


plotshape(title='+RD', series=regular_bearish_div2 ? macd2[2] : na, text='R2', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='+HD', series=hidden_bearish_div2 ? macd2[2] : na, text='H2', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='-RD', series=regular_bullish_div2 ? macd2[2] : na, text='R2', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
plotshape(title='-HD', series=hidden_bullish_div2 ? macd2[2] : na, text='H2', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)

////////// 1D

fastLength3 = input(288, minval=1), slowLength3=input(624,minval=1)
fastMA3 = ema(source, fastLength3)
slowMA3 = ema(source, slowLength3)
macd3 = fastMA3 - slowMA3
plot(macd3, color=aqua, linewidth=1)


indy_top3 = f_indyize(macd3) > 0 ? macd3[2] : na
indy_bot3 = f_indyize(macd3) < 0 ? macd3[2] : na

high_prev3 = valuewhen(indy_top3, macd3[2], 1) 
high_price3 = valuewhen(indy_top3, high[2], 1)
low_prev3 = valuewhen(indy_bot3, macd3[2], 1) 
low_price3 = valuewhen(indy_bot3, low[2], 1)

regular_bearish_div3 = indy_top3 and high[2] > high_price3 and macd3[2] < high_prev3
hidden_bearish_div3 = indy_top3 and high[2] < high_price3 and macd3[2] > high_prev3
regular_bullish_div3 = indy_bot3 and low[2] < low_price3 and macd3[2] > low_prev3
hidden_bullish_div3 = indy_bot3 and low[2] > low_price3 and macd3[2] < low_prev3


plotshape(title='+RD', series=regular_bearish_div3 ? macd3[2] : na, text='R3', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='+HD', series=hidden_bearish_div3 ? macd3[2] : na, text='H3', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
plotshape(title='-RD', series=regular_bullish_div3 ? macd3[2] : na, text='R3', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
plotshape(title='-HD', series=hidden_bullish_div3 ? macd3[2] : na, text='H3', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
///////////////

plot(title='H D', series=indy_top2, style=circles, color=regular_bearish_div2 or hidden_bearish_div2 ? maroon : gray, linewidth=3, offset=-2)
plot(title='L D', series=indy_bot2, style=circles, color=regular_bullish_div2 or hidden_bullish_div2 ? green : gray, linewidth=3, offset=-2)

thank you sir!
回复
Thanks for this awesome indicator, can you please explain more regarding "Gray circles on 4h macd is for those traders who want to check the confirmation on Elliott wave changes" ?
Thanks
+6 回复
how to set an alert? please help.
+10 回复
Signals are very late...
+3 回复
You have done wonderful job. Can you please explain where do I change this setting? "lease insert the indicator into a 1h chart, otherwise change the lengths' inputs."
回复
"Please insert the indicator into a 1h chart, otherwise change the lengths' inputs"
where I change it, please? Which line?
thank you
+4 回复
VishalDesai Najjar-Nidhal
@Najjar-Nidhal, Did you find? where to change setting to 4h
回复
Thank you it's good !!
"H means hidden divergence, 1 regards to 1h, 2 to 4h, and 3 to 1D. If the color is green, its bullish , and if its maroon the divergence is bearish ." but also it works at 1,2,5,30 min so what's means there 1,2,3 plz?
回复
does it repaint? redraw ? does the signals come late ? what are the flaws
+7 回复
@djmc, Totally agree.. they are late
回复
首页 股票筛选器 外汇筛选器 加密货币筛选器 财经日历 节目 如何运作 图表功能 价格 网站规则 版主 网站 & 经纪商解决方案 插件 图表解决方案 轻量图表库 帮助中心 推荐朋友 功能请求 博客 & 新闻 常见问题 维基百科 Twitter
概述 个人资料设置 账号和账单 推荐朋友 我的客服工单 帮助中心 已发表观点 粉丝 正在关注 私人消息 聊天 退出