If this indicator have helped you in your trading or you plan to use the code in one of your script,
please donate to following with a message to specify the money as Donation.
SKRILL : email@example.com
Donated money will go to Plan Canada (Save a Girl) and other charities around the world.
LETS PAY THE TAXES FROM OUR TRADING PROFITS TO NATURE, COMMUNITY AND GOOD CAUSES :)
Likes will help promote the script and is appreciable. (wink wink). :)
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
study(title="Kay_MA", shorttitle="Colored MA", overlay=true)
len = input(5, minval=1, title="MA")
src = input(hl2, title="Source")
cc = input(true, title="Change Color")
out = sma(src, len)
col = cc ? (change(out) > 0 ? green : red) : red
plot(out, title="MA", color=col, transp=0, linewidth=2)