KH MA Cross, 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © kurthennig18

import ZenAndTheArtOfTrading/ZenLibrary/5

//@version=5
indicator("MA Cross", overlay = true)

///GET MAs///
sma1 = ta.sma (close, 8)
sma2 = ta.sma (close, 21)
sma3 = ta.sma(close, 50)
//Draw MAs
plot(sma1, color = color.lime)//8//
plot(sma2, color = color.red)//21//
plot(sma3, color = color.black)//50//

//MA input//
short = input.int(8, minval = 1, title = "Short-Period")
medium = input.int(21, minval = 1, title = "Medium-Period")
long = input.int(50, minval = 1, title = "Long-Period")

//Get crosses//
maCrossOver1 = ta.crossover(sma1, sma2)
maCrossUnder2 = ta.crossunder(sma1, sma2)
/////////////////////////////////////////
maCrossOver3 = ta.crossover(sma2, sma3)
maCrossOver4 = ta.crossunder(sma2, sma3)

//Draw BG cross
bgcolor (maCrossOver1 ? color.new(color.lime, 90) : na, show_last = 100, title = "8/21 Bull")
bgcolor (maCrossUnder2 ? color.new(color.black, 90) : na, show_last = 100, title = "21/50 Bear")

bgcolor(maCrossOver3 ? color.new(color.red, 90) : na, show_last = 100,  title = "21/50 Bull ")
bgcolor(maCrossOver4 ? color.new(color.blue, 90) : na, show_last = 100,  title = "21/50 Bull ")

