Fading Moving Average
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © barnabygraham
//@version=5
indicator("Fading Moving Average",overlay=true)
length = input.int(50,'Length')
colour = input.color(color.new(color.yellow,0),'Color')
plot(ta.sma(close,length),color=color.new(colour,(100/length)*(last_bar_index - bar_index)))