Horizontal Line At Daily Moving Averages
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © davidtammari

//@version=3
study("Horizontal Line At Daily Moving Averages", overlay = true)

EMA9 = security(tickerid, "D", ema(close, 9))
MA20 = security(tickerid, "D", sma(close, 20))
MA50 = security(tickerid, "D", sma(close, 50))
MA100 = security(tickerid, "D", sma(close, 100))
MA200 = security(tickerid, "D", sma(close, 200))

plot(EMA9, trackprice = true, linewidth = 2, color = red, offset = -9999, title = "9 EMA")
plot(MA20, trackprice = true, linewidth = 2, color = navy, offset = -9999, title = "20 MA")
plot(MA50, trackprice = true, linewidth = 2, color = green, offset = -9999, title = "50 MA")
plot(MA100, trackprice = true, linewidth = 2, color = blue, offset = -9999, title = "100 MA")
plot(MA200, trackprice = true, linewidth = 2, color = purple, offset = -9999, title = "200 MA")
