Madrid

Madrid Moving Average Ribbon

This plots a moving average ribbon, either exponential or standard. It provides an easy and fast way to determine the trend direction and possible reversals.
Lime : Uptrend. Long trading
Maroon : Reentry (buy the dip) or downtrend reversal warning
Red : Downtrend. Short trading
Green : Short Reentry (sell the peak) or uptrend reversal warning

To best determine if this is a reentry point or a trend reversal the MMARB (Madrid Moving Average Ribbon Bar) study is used. This is the bar located at the bottom. This bar signals when a current trend reentry is found (partially filled with opposite dark color) or when a trend reversal is ahead (completely filled with opposite dark color).

This study requires no parameters, and it can be used on any time frame.

I hope this effort can help you in your trading.
Remove from Favorite Scripts Add to Favorite Scripts
//
// Madrid : 17/OCT/2014 22:51M: Moving Average Ribbon : 2.0 : MMAR
// http://madridjourneyonws.blogspot.com/
//
// This plots a moving average ribbon, either exponential or standard.
// This study is best viewed with a dark background.  It provides an easy
// and fast way to determine the trend direction and possible reversals.
//
// Lime : Uptrend. Long trading
// Green : Reentry (buy the dip) or downtrend reversal warning
// Red : Downtrend. Short trading
// Maroon : Short Reentry (sell the peak) or uptrend reversal warning
// 
// To best determine if this is a reentry point or a trend reversal
// the MMARB (Madrid Moving Average Ribbon Bar) study is used. 
// This is the bar located at the bottom.  This bar signals when a
// current trend reentry is found (partially filled with opposite dark color)
// or when a trend reversal is ahead (completely filled with opposite dark color).
//

study(title="Madrid Moving Average Ribbon", shorttitle="MMAR", overlay=true)
exponential = input(true, title="Exponential MA")

src = close

ma05 = exponential ? ema(src, 05) : sma(src, 05)
ma10 = exponential ? ema(src, 10) : sma(src, 10)
ma15 = exponential ? ema(src, 15) : sma(src, 15)
ma20 = exponential ? ema(src, 20) : sma(src, 20)
ma25 = exponential ? ema(src, 25) : sma(src, 25)
ma30 = exponential ? ema(src, 30) : sma(src, 30)
ma35 = exponential ? ema(src, 35) : sma(src, 35)
ma40 = exponential ? ema(src, 40) : sma(src, 40)
ma45 = exponential ? ema(src, 45) : sma(src, 45)
ma50 = exponential ? ema(src, 50) : sma(src, 50)
ma55 = exponential ? ema(src, 55) : sma(src, 55)
ma60 = exponential ? ema(src, 60) : sma(src, 60)
ma65 = exponential ? ema(src, 65) : sma(src, 65)
ma70 = exponential ? ema(src, 70) : sma(src, 70)
ma75 = exponential ? ema(src, 75) : sma(src, 75)
ma80 = exponential ? ema(src, 80) : sma(src, 80)
ma85 = exponential ? ema(src, 85) : sma(src, 85)
ma90 = exponential ? ema(src, 90) : sma(src, 90)
ma100 = exponential ? ema(src, 100) : sma(src, 100)

leadMAColor = change(ma05)>=0 and ma05>ma100 ? lime
            : change(ma05)<0  and ma05>ma100 ? maroon
            : change(ma05)<=0 and ma05<ma100 ? red
            : change(ma05)>=0 and ma05<ma100 ? green
            : gray
maColor(ma, maRef) => 
              change(ma)>=0 and ma05>maRef ? lime
            : change(ma)<0  and ma05>maRef ? maroon
            : change(ma)<=0 and ma05<maRef ? red
            : change(ma)>=0 and ma05<maRef ? green
            : gray
            
plot( ma05, color=leadMAColor, style=line, title="MMA05", linewidth=3)
plot( ma10, color=maColor(ma10,ma100), style=line, title="MMA10", linewidth=1)
plot( ma15, color=maColor(ma15,ma100), style=line, title="MMA15", linewidth=1)
plot( ma20, color=maColor(ma20,ma100), style=line, title="MMA20", linewidth=1)
plot( ma25, color=maColor(ma25,ma100), style=line, title="MMA25", linewidth=1)
plot( ma30, color=maColor(ma30,ma100), style=line, title="MMA30", linewidth=1)
plot( ma35, color=maColor(ma35,ma100), style=line, title="MMA35", linewidth=1)
plot( ma40, color=maColor(ma40,ma100), style=line, title="MMA40", linewidth=1)
plot( ma45, color=maColor(ma45,ma100), style=line, title="MMA45", linewidth=1)
plot( ma50, color=maColor(ma50,ma100), style=line, title="MMA50", linewidth=1)
plot( ma55, color=maColor(ma55,ma100), style=line, title="MMA55", linewidth=1)
plot( ma60, color=maColor(ma60,ma100), style=line, title="MMA60", linewidth=1)
plot( ma65, color=maColor(ma65,ma100), style=line, title="MMA65", linewidth=1)
plot( ma70, color=maColor(ma70,ma100), style=line, title="MMA70", linewidth=1)
plot( ma75, color=maColor(ma75,ma100), style=line, title="MMA75", linewidth=1)
plot( ma80, color=maColor(ma80,ma100), style=line, title="MMA80", linewidth=1)
plot( ma85, color=maColor(ma85,ma100), style=line, title="MMA85", linewidth=1)
plot( ma90, color=maColor(ma90,ma100), style=line, title="MMA90", linewidth=3)


This is awesome!
Reply
Thank you very much for this compelling study.

However, I may be misunderstanding you, but shouldn't the descriptions of green and maroon be reversed? In other words, isn't green a short reentry (and warning of an impending trend change) signal and maroon a long rentry (and ... ) signal?

Again, thank you.

Alex
Reply
Madrid PRO Algyros
Yes, I updated the comment section. Thank you for the remark. :)
Reply
This looks cool, but can you, or anyone tell me how to install it, get it on the chart??
+1 Reply
This video explain it how to use custom indicators. Hope it will help you
+6 Reply
virgotopia PRO virgotopia
And the link, of course :)
http://blog.tradingview.com/?p=265
Reply
Hello

How can I install the bottom bar?
+4 Reply
Madrid PRO 400golpes
Look for the MMARB (Madrid Moving Average Ribbon Bar) companion study in the public library
Madrid MA Ribbon Bar
+3 Reply
Sorry, but where is this public library?
Reply
MarxBabu Madrid
Reply
Thanks Madrid. You're an amazing man.
Reply
There's no Madrid "Moving Average Ribbon Bar" for me when I copy paste the code :(
Reply
Crit_Nasty Crit_Nasty
Nvm, I just saw your link to the bar :D
Reply
ElanaLuckett Crit_Nasty
hey how do i load up this indicator on my chart
Reply
can i used it in mt4?
Reply
@hftj, https://www.mql5.com/en/market/product/7781
Reply
Showing syntax error in amibroker ..
Reply
This is amazing. Honestly the best thing I've found during my trail subscription to TV and likely the reason I'll keep it. Thank you!
Reply
AnneSmith FacebookStock
how is it different from a simple 100EMA?
besides, the same set of movings will be working for another instrument
Reply
very very nice!
Reply
really good!!
best thing is you close positions a little late but can compensate with a short position instead.
Best of all strategies. Thanks
Have any updates???
Reply
malagasy PRO pablohcura
@pablohcura, Habe you done any backtesting with your strategy? What's the results?
Reply
Madrid, it is really good. Thank you very much.
Reply
Surerrrrr)
Reply
how do i get the mmarb?
Reply
I like this indication can I used this code transfer to TOS
Reply
Hi is there anyway of being able to add an Alert for when it changes Lime : Uptrend. "Long trading" and "Red : Downtrend. Short trading"
Reply
missing the 100EMA from the plot... line 76?
add the 200EMA also.
Reply
Bottom bar is not appear? how can i install it.
+1 Reply
This might be the best thing I've found. Why not add ma95 and ma100 also?
Reply
Hi Madrid, this looks awesome! How do I use it for NinjaTrader 8? Thank you. ANN
Reply
also known as RainbowMoving (Kourosh Davallou)
https://www.mql5.com/en/market/product/7781
Reply
Good one buddy...
Little prob
1. Can we use it with renko?
2. The bottom indicator is missing...
Reply
SumitJain PRO SumitJain
problem 2 solved...waiting for 1, any expert comments?
Reply
wow, this is fantastic. Thanks Madrid. I'm definitely having a closer look at this. Has anyone done any backtesting on this? What's the optimal use (pairs? volatility? timeframe?). I'd be curious to see how effective this is once implemented in trading.
Reply
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder 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 Account and Billing Sign Out