How to Trade Simple Moving Averages - Python Automation Tutorial

preview_player
Показать описание
Learn How to trade stocks using simple moving averages and Python programming! #Python #AlphaVantage #Tutorial

Kite helps fund the channel, thanks for checking them out and supporting me --

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:

More AlphaVantage Examples:

Install Pandas:

Install AlphaVantage:

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!
*****************************************************************
Full code from the video:

import pandas as pd

api_key = 'RNZPXZ6Q9FEFMEHM'

ts = TimeSeries(key=api_key, output_format='pandas')

period = 60

ti = TechIndicators(key=api_key, output_format='pandas')
time_period=period, series_type='close')

df1 = data_ti
df2 = data_ts['4. close'].iloc[period-1::]

print(total_df)

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:

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!
Рекомендации по теме
Комментарии
Автор

Derrick. Thank you for these videos. Ive been working for the past 2 weeks on an algo, and greatly appreciate being able to rely on these vids

kingscreed
Автор

The SMA and the intraday series were inversed on my end, I removed df2.index = df1.index and that fixed the issue if anyone else runs into that issue.

outlaw
Автор

00:04:56 To see all the data in the Time Series print total_df ( which is line 23 in the code ). If the Jupyter Notebook crashes ( as it sometimes notoriously does ) you may have to reinstall as follows:
!pip install alpha_vantage.

William_sJazzLoft
Автор

Great stuff man and very down to earth !

Derffie
Автор

any idea how to code in python: how "respected" is as example the sma50? how much does it act as support/resistance with a measured and reliable number?

valueray
Автор

This is motivating me to look at your videos on numpy and pandas ☺😊😎

William_sJazzLoft
Автор

Thanks for this video. Got me up and running in no time!

MrJYII
Автор

Hi, how i turn my api key to some ticker symbol?

prod_djack
Автор

You are uniquely qualified to provide exceptional content on youtube. Congrats and I hope wherever you are you are paid top in field.

mattwarrensocal
Автор

I was expecting a MA cross but he's trying to do Bollinger Bands without the Bands. Odd strat but useful information.

DeViceCrimsin_
Автор

I keep getting yesterday's data. Is there a way where I can get the current stock data?

ryankrueger
Автор

Thanks dude... You are a national treasure!

wkowalski
Автор

Thanks a million for you invaluable content... it's just wonderful

amirmoezi
Автор

Nice video. Where can I get the background for my video camera?

JosueLopezXIX
Автор

It's a very valuable information, Thank you so mach!!! Just I'm noob at Python

ilyakazakov
Автор

I love this, can you do more trading video!

cliffkwok
Автор

Can you explain why their is a meta_data variable set to the data frame. If I remove that unused variable, the code doesn't work. Thanks

ravichosun
Автор

Hey can you show us how you managed to ignore flat lines during closing hours? If so that would be great!

CptSuperiors
Автор

how to do i do it with crypto currencies?

VSPuzzler
Автор

thanks for your video, can I ask where can I take the API key. I wanna to connect MT4 with Python, is your way works for it

quangkhainguyenhung