OPEN-SOURCE SCRIPT
Updated SMA & EMA Combo (10/20/50/200)

How This Works
Inputs: Four separate input fields let you adjust each moving average’s period from the indicator’s settings panel.
Calculation: Uses ta.sma for SMAs and ta.ema for EMAs, both calculated on the close price.
Plotting: Each moving average is plotted with a distinct color and label for clarity.
How to Use
Open TradingView, go to the Pine Script editor.
Paste the code above.
Add the script to your chart.
You’ll see four lines: 10 SMA (purple), 20 SMA (green), 50 EMA (red), 200 EMA (blue). You can adjust the periods in the indicator’s settings.
Inputs: Four separate input fields let you adjust each moving average’s period from the indicator’s settings panel.
Calculation: Uses ta.sma for SMAs and ta.ema for EMAs, both calculated on the close price.
Plotting: Each moving average is plotted with a distinct color and label for clarity.
How to Use
Open TradingView, go to the Pine Script editor.
Paste the code above.
Add the script to your chart.
You’ll see four lines: 10 SMA (purple), 20 SMA (green), 50 EMA (red), 200 EMA (blue). You can adjust the periods in the indicator’s settings.
Release Notes
faster-responding EMAs for short-term trends (10/20) and smoother SMAs for longer-term trends (50/200)Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.