Code Library / Moving Average
Pine Script MA Ribbon
Moving average ribbon with 8 EMAs for trend strength visualization.
Language: Pine Script · Category: Moving Average · Tags: MA ribbon, EMA, Pine Script, trend strength, visualization
Source code
//@version=5
indicator("MA Ribbon",overlay=true)
e1=ta.ema(close,5); e8=ta.ema(close,40)
bull=e1>e8
p1=plot(e1,"EMA5",color.new(bull?color.green:color.red,0))
p8=plot(e8,"EMA40",color.new(bull?color.green:color.red,85))
fill(p1,p8,color=color.new(bull?color.green:color.red,92))How to use this snippet
This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.