SMA 10/20/50 by Bull Bear Investing Baby
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Vinvest2020

//@version=4

// Pine Script v4
// @author V Invest

// study(title, shortitle, overlay, format, precision)
// https://www.tradingview.com/pine-script-docs/en/v4/annotations/study_annoation.html
study(shorttitle="SMA 10/20/50 by BBA Baby", title="SMA 10/20/50 by Bull Bear Investing Baby", overlay=true)

// MAPeriod is a variable used to stor the indicator lookback period. In this case, from the input
// input - https://www.tradingview.com/pine-script-docs/en/v4/annotations/Script_inputs.html
MA1Period = input(10, title="1MA")
MA2Period = input(20, title="2MA")
MA3Period = input(50, title="3MA")


// MA is a variable used to store the actual moving average value. In this case, from the sma() buil-in function
// sma - https://www.tradingview.com/pine-script-reference/v4/#fun_sma
MA1 = sma(close, MA1Period)
MA2 = sma(close, MA2Period)
MA3 = sma(close, MA3Period)

// plot - This will draw the information on the chart
// plot - https://www.tradingview.com/pine-script-docs/en/v4/annotations/plot_autotion.html
plot(MA1, color=#66ff00, linewidth=1)
plot(MA2, color=#FF0000, linewidth=1)
plot(MA3, color=#0000FF, linewidth=1)