How to Trade Simple Moving Averages - Python Automation Tutorial


How to Trade Simple Moving Averages - Python Automation Tutorial

*

Full Code From This Example:


YouTube Description:

Learn How to trade stocks using simple moving averages and Python programming! #Python #AlphaVantage #Tutorial The end result will be a Python script we can use to get real time simple moving averages and closing prices. Then we can take this data and create a plot that helps us identify trends and times to purchase and sell. AlphaVantage API key request: https://www.alphavantage.co/support/#api-key More AlphaVantage Examples: https://github.com/Derrick-Sherrill/alpha-vantage-examples Install Pandas: https://pandas.pydata.org/pandas-docs/stable/install.html Install AlphaVantage: https://alpha-vantage.readthedocs.io/en/latest/ Thanks so much for the continued support! 4500+ Subscribers at the time of writing! How awesome. The channel is really picking up and some really cool things are in the works. It wouldn't be possible without each of you. Thank so much for letting me make content and supporting me. Join The Socials -- Picking Shoutouts Across YouTube, Insta, FB, and Twitter! FB - https://www.facebook.com/CodeWithDerrick/ Insta - https://www.instagram.com/codewithderrick/ Twitter - https://twitter.com/codewithderrick LinkedIn - https://www.linkedin.com/in/derricksherrill/ GitHub - https://github.com/Derrick-Sherrill ***************************************************************** Full code from the video: import pandas as pd from alpha_vantage.timeseries import TimeSeries from alpha_vantage.techindicators import TechIndicators import matplotlib.pyplot as plt api_key = 'RNZPXZ6Q9FEFMEHM' ts = TimeSeries(key=api_key, output_format='pandas') data_ts, meta_data_ts = ts.get_intraday(symbol='MSFT', interval='1min', outputsize='full') period = 60 ti = TechIndicators(key=api_key, output_format='pandas') data_ti, meta_data_ti = ti.get_sma(symbol='MSFT', interval='1min', time_period=period, series_type='close') df1 = data_ti df2 = data_ts['4. close'].iloc[period-1::] df2.index = df1.index total_df = pd.concat([df1, df2], axis=1) print(total_df) total_df.plot() plt.show() Packages (& Versions) used in this video: Pandas == 0.25.0 alpha_vantage matplotlib ***************************************************************** Code from this tutorial and all my others can be found on my GitHub: https://github.com/Derrick-Sherrill/DerrickSherrill.com Check out my website: https://www.derricksherrill.com/ If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!! Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!

Enjoy this content? Consider Subbing to the Youtube channel





Derrick Sherrill

By: Derrick Sherrill

Thanks for visiting my page! I'm working hard to make the best content I can for you. I love watching people learn and teaching others. Happy Coding!

Become a Patreon!