OPEN-SOURCE SCRIPT
Updated Simple Moving Averages

In Pine Script v6, the standard method for plotting indicators is still the plot function, and it should be recognized. However, if you are getting an "Undeclared identifier 'plot'" error, double-check these points:
Make sure your script is still using indicator() (not study()) at the top.
The script must not use indentation or syntax errors that break context.
Confirm Pine Script version is set correctly with //version=6.
Here is a fully corrected Pine Script v6 template for your moving averages scenario using
Make sure your script is still using indicator() (not study()) at the top.
The script must not use indentation or syntax errors that break context.
Confirm Pine Script version is set correctly with //version=6.
Here is a fully corrected Pine Script v6 template for your moving averages scenario using
Release Notes
Make sure your script is still using indicator() (not study()) at the top.The script must not use indentation or syntax errors that break context.
Confirm Pine Script version is set correctly with //version=6.
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.