Plotting Multiple Stock Market Indicators on One Graph - Five Minute Python Scripts

Plotting Multiple Stock Market Indicators on One Graph - Five Minute Python Scripts


Full Code From This Example:

YouTube Description:

In this one we'll cover how we can plot two technical indicator series in the same plot using alpha vantage api, python, and matplotlib. We'll work with a simple moving average and a relative strength index in this video. #Python #StockMarket #tutorial Here's a repo that has more alpha vantage examples to try out: Thanks so much for the continued support! 4550+ Subscribers at the time of writing this. Beyond thankful for you all. Join The Socials -- Picking Shoutouts Across YouTube, Insta, FB, and Twitter! FB - Insta - Twitter - LinkedIn - GitHub - ***************************************************************** Full code from the video: import pandas as pd from alpha_vantage.techindicators import TechIndicators import matplotlib.pyplot as plt api_key = 'RNZPXZ6Q9FEFMEHM' period = 60 ti = TechIndicators(key=api_key, output_format='pandas') data_ti, meta_data_ti = ti.get_rsi(symbol='MSFT', interval='1min', time_period=period, series_type='close') data_sma, meta_data_sma = ti.get_sma(symbol='MSFT', interval='1min', time_period=period, series_type='close') df1 = data_sma.iloc[1::] df2 = data_ti df1.index = df2.index fig, ax1 = plt.subplots() ax1.plot(df1, 'b-') ax2 = ax1.twinx() ax2.plot(df2, 'r.') plt.title("SMA & RSI graph") Packages (& Versions) used in this video: Python 3.7 pandas == 0.25.0 alpha vantage matplotlib ***************************************************************** Code from this tutorial and all my others can be found on my GitHub: Check out my website: 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!