Algorithmic Trading Using Python – Full Course
August 17, 2024 2024-08-17 10:59Algorithmic Trading Using Python – Full Course
Learn how to perform algorithmic trading using Python in this complete course. Algorithmic trading means using computers to make investment decisions. Computer algorithms can make trades at a speed and frequency that is not possible by a human.
After learning the basics of algorithmic trading, you will learn how to build three algorithmic trading projects.
💻 Code: https://github.com/nickmccullum/algorithmic-trading-python
✏️ Course developed by Nick McCullum. Learn more about Nick here: https://nickmccullum.com/
⭐️ Course Contents ⭐️
⌨️ (0:00:00) Algorithmic Trading Fundamentals & API Basics
⌨️ (0:17:20) Building An Equal-Weight S&P 500 Index Fund
⌨️ (1:38:44) Building A Quantitative Momentum Investing Strategy
⌨️ (2:54:02) Building A Quantitative Value Investing Strategy
Note that this course is meant for educational purposes only. The data and information presented in this video is not investment advice. One benefit of this course is that you get access to unlimited scrambled test data (rather than live production data), so that you can experiment as much as you want without risking any money or paying any fees.
This course is original content created by freeCodeCamp. This content was created using data and a grant provided by IEX Cloud. You can learn more about IEX Cloud here: https://iexcloud.io/
Any opinions or assertions contained herein do not represent the opinions or beliefs of IEX Cloud, its third-party data providers, or any of its affiliates or employees.
source
Comments (47)
@ryz177
This is great content! I hope Freecodecamp does more about Algorithmic Trading for other languages (Rust, C++).
@kchikwete
16:22
@Fluker_xD
The API no longer works. I dont really understand if what I am saying makes sense, but IEX Cloud is shutting down apparently. Could you please suggest a workaround?
Just FYI, what this means is that the access to the API token provided in the video is restricted.
@kushyglowy8409
Niceee
@risheapps
Really helpful! Thank you👍
@VardhanHegde
Before you guys start . The API token is deprecated so stuck at 42min. !!!!
@lemon-bf4lq
which linux distro is he using?
@DrKnowsMore
Audio sucks
@OrchidMacro
Could you do a course about vectorbtpro?
@galinaleonov7401
Hello. I have no coding experience in Python. Could you please direct me to the freeCodeCamp course on Python, of which there are a few, that would prepare me best for taking your course on algorithmic trading? Thanks.
@Xavier-gl3cj
The API token is not valid anymore, kindly correct it or suggest any other token that we can use
@hiteshjain7919
It's June 2024 and it is giving the error "Sandbox environment is disabled for this subscription tier." , API key may have expired. Can you please update the key!
@eee_inn2658
totally left out section 2, regarding how to set up and get started, that would be really useful to have…
@piyushshah5109
What we can learn next? Can we have some resources where we can learn more.
@elimso
19:35
@pranavchandrav6071
Hey I'm getting a JSON Decode Error while using batch calls, what do I do?
@priyanshpatro4548
after running again all the codes it shows the same error
@ElCidPhysics90
Halfway through and think this is very cool. However, I wish you didn't have the pip. It covers almost 25% of the window and obscures some important parts of the screen.
@ElectHonestMLAsandMPs
in Tamilnadu almost all politicians and govt servants are against the Tamil. bribe, corruption, no justice, no respect, discrimination all done here itself. But the life outside India we get all these in countries like Singapore, USA,uae ETC
@tejasmandre3212
link to buy your keyboard please 🙏
@jackhammer4773
The section on Parsing our API Call simply does not work using current versions of code (https://youtu.be/xfzGZB4HhEE?t=2727). Has anyone found an up to date solution (May 2024)?
@W-HealthPianoExercises
However, in real life we do not use Python for algorithmic trading 🙂
@saarthjhaveri1016
To all those who are referring the course in 2024, following might help :
instead of IEX we can use yfinance library
import yfinance as yf
tickerSymbol = 'AAPL'
tickerData = yf.Ticker(tickerSymbol)
# Get the historical prices for this ticker
tickerDf = tickerData.history(period='1d', start='2024-05-09', end='2024-05-10')
marketCap= tickerData.info['marketCap']
price= tickerDf['Open']
and also these prices are the live market value prices.
@armaugh
Well said. Well reasoned. I have been doing the carnivore diet for more than a year now. I am super pleased with the results.
@dicksonlee9254
wondering if anyone knows what are the dependencies to be installed mentioned at ~17:25, please?
@vesperannstas
When making the api call I got a JSON decoder error. Wrapped it in a try-except block and got a 403 Client Error: Sandbox environment is disabled for this subscription tier.
@vesperannstas
"Rewind back to the last section and install all of the dependencies." Is that section really in this video? What's the timestamp?
@varun_.
Are there any pre- requsites for this tutorial?
@AC-tn4it
💀
@anangelsdiaries
There were a few questions I had while watching (I am a noob so sorry if any of them sound dumb):
– How do you deploy that? I imagine you wouldn't want it running in Jupyter Notebook.
– Is the accuracy-loss of floats safe to ignore?
– While the concept of high-quality vs low-quality momentum makes sense, why is momentum a good metric? Isn't it likely that since you rely on data from a year ago, your model identify stocks that have already seen their growth and won't grow more? (Like making you buy at high, instead of low)
– Would it be sensible instead of calculating a score to sort all the columns based on different return_percentiles?
– Also, when do you know to sell? I know the premise was that we have a team of traders to whom we send our excel files, but while they'd be able to know how many stocks to buy based on our position and the filtering we did, how do they know when to sell?
@anangelsdiaries
"Let's do something more reasonanle, like a **milion dollars**"… hahaha, I am learning algotrading to get there. But we're not there yet.
@friendlyskiespodcast
Thank you!
@stevemilo6935
How much money has this guy lost in the market so far?
LOL.
@dan.franco
Incredible course. Thank you very much!
@t3qiro
"how to loose money in 3 steps – full course"
@JeffreyHardin-bk9ns
run in Chat GPT in 12 seconds
# Define the stock symbol and date range
stock_symbol = 'SPY' # Example: SPDR S&P 500 ETF Trust
start_date = '2020-01-01'
end_date = '2024-03-18'
# Download historical stock data
stock_data = yf.download(stock_symbol, start=start_date, end=end_date)
# Calculate moving averages
stock_data['50_MA'] = stock_data['Close'].rolling(window=50).mean()
stock_data['200_MA'] = stock_data['Close'].rolling(window=200).mean()
# Generate buy/sell signals based on Golden Cross
stock_data['Signal'] = 0
stock_data.loc[stock_data['50_MA'] > stock_data['200_MA'], 'Signal'] = 1 # Buy signal
stock_data.loc[stock_data['50_MA'] < stock_data['200_MA'], 'Signal'] = -1 # Sell signal
# Execute trades based on signals
position = 0 # 0: No position, 1: Long, -1: Short
for index, row in stock_data.iterrows():
if row['Signal'] == 1 and position == 0:
print(f"Buy {stock_symbol} at {row['Close']:.2f}")
position = 1
elif row['Signal'] == -1 and position == 1:
print(f"Sell {stock_symbol} at {row['Close']:.2f}")
position = 0
# Optional: Visualize moving averages
stock_data[['Close', '50_MA', '200_MA']].plot(figsize=(10, 6))
@omrajput9115
helped greatly in my final project
@pankhurichaturvedi8484
Hey, I just started this course and I am encountering error in the first project while importing the data using sandbox. Instead of response 200 i am getting 403 which i am unable to debug. If I am not wrong sandbox has been deprecated right?
@ChinosWorldx
GOAT
@waynelast1685
4:40 I can't make out what you said.
@krishna_ms
I'm finding issues with API pull as it returns code 403. Can anyone please help?
Thanks
@ishaanchandak4774
18:02 how to get these i am not getting these
@Maximus18.6
Honesty you are an amazing professional. Thank you so much for your teaching, this video is gold and opens the door to unbelievable trading strategies using Python and quantitative methods
@aegontargaryen7115
did this work very well? what were the results like before I start trying this?
@jackmccourt7624
Where is the section on installing the dependencies?
@Tientran01
Hello everyone, I am newbie. Could you please advise which foundational knowledge I should learn before staring to follow this video? Thanks a lot and have a nice day!
@hemantsinsinwar3486
cant download the secrets.py file. need help.