OPEN-SOURCE SCRIPT
Updated

SMA & EMA Combo (10/20/50/200)

59
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.
Release Notes
faster-responding EMAs for short-term trends (10/20) and smoother SMAs for longer-term trends (50/200)

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.