Simple and Exponential Moving Averages

This script graphs 5 SMAs (20, 50, 100, 150, 200) and 5 EMAs (20, 50, 100, 150, 200). The first group uses blue and orange colors whereas the second one uses green and red. When a bar closes below a moving average, either orange or red will be used depending on which type of moving average and which period. In bullish mode, we show blue and green. Moving average periods are configurable, and you can hide the MAs you don't want.