UPDATE
//Weekly Moving Average
diary=input(true,title="Weekly EMA 9 and SMA 21")
ma21 = security(tickerid, 'W', sma(close, 21))
ma09 = security(tickerid, 'W', ema(close, 9))
plot( ma21, color=diary==true?orange:na, style=circles, title="Weekly SMA 21", linewidth=2)
plot( ma09, color=diary==true?purple:na, style=circles, title="Weekly EMA 9", linewidth=2)