
Install and set up Anaconda, register Python 3.9, launch Navigator, and create a new Jupyter notebook to start writing Python code for finance and data science.
Explore Jupyter notebook basics, including ipynb extension, creating and running cells with the run button, adding and deleting cells, and shortcuts for command (blue) and edit (green) modes.
Cover Python fundamentals and pandas basics, then explore financial data science with portfolio analysis, backtesting, momentum trading, dashboards, and machine learning on stock data.
Read the disclaimer to understand that this course teaches Python for finance and data science for educational purposes, not financial investment or trading advice.
Code along with demonstrations, complete the practice tasks to deepen your understanding, and use the message function to connect with me when you need help.
Reach out with questions or problems, if anything is unclear or you feel stuck, and expect a prompt response to ensure your satisfaction in Python for finance and data science.
Learn how to define and assign variables in python, print their values, and identify data types (int, float, string, bool), while noting comments, case sensitivity, and top-to-bottom execution.
Transform values between Python types without overwriting the built-in int function, and learn how to restore defaults by restarting the kernel after common beginner mistakes.
Master typecasting between int, float, string, and bool in Python, including truncation and numeric conversion rules, and learn how user input via input() is captured as strings.
Practice a Python program that reads user input, casts it to float, and adds ten. Print the result, for example input ten yields 20.0, illustrating input handling and type casting.
Explore arithmetic operators, including addition, subtraction, multiplication, division, exponentiation, and the modulus operator, with examples like five to the power of five and using modulus to check even numbers.
Learn comparison operators such as equals, not equals, greater than, less than, and use and/or to combine conditions, x = 5 with x > 2 and x < 6.
Master indentation defines code blocks and use if, elif, and else to handle price-based decisions with outputs like price is high, price is fair, or price is low.
practice time: write a python program that reads two inputs, casts to float, and prints which user provided the larger number or if they are equal using if, elif, else.
Explore Python lists, a versatile data type that stores multiple values of different types with square brackets, and learn to use append and index with dot notation and zero-based indexing.
Explore list indexing and slicing in Python, including zero-based and negative indices and start-stop rules, with practical examples using a presidents list.
Compare lists and tuples by mutability: lists allow item reassignment, while tuples do not. Define a tuple with parentheses and understand why item assignments raise errors.
Learn how dictionaries store data as key-value pairs using curly braces, access values by key in brackets, and mutate values, such as updating Martin’s owed amount.
Use for loops to iterate over lists and ranges, print elements, and create an even numbers list by testing i % 2 == 0 and appending.
Discover how Python list comprehension replaces loop append with a single line that generates 1 to 10 using range, and learn to filter even numbers with an if condition.
Demonstrate the while loop by incrementing x from five to ten, printing each value, and stopping once the condition becomes false.
Write a Python program that builds a shopping list by prompting for items until three entries are reached, using while loop, for loop, and list comprehension with the input function.
Explore the fizzbuzz problem in Python by looping 1 to 20, checking divisibility by 3 and 5 in order, and printing fizz, buzz, fizzbuzz, or the number.
Define reusable code with def, pass arguments, and return values; call functions to produce outputs, and distinguish local from global variables when storing results.
Import pandas, create a list, convert it to a dataframe with the DataFrame function, and inspect its columns attribute, data type, and range index starting at zero.
Learn to add and initialize dataframe columns efficiently using dictionaries, creating columns like number and person, and understand how to access them as pandas series with index and values.
Explore pandas fundamentals by calculating position value as price times quantity for Apple, Microsoft, and Tesla, then add a position value column and filter to show stock and value.
Master position-based data selection in pandas using iloc to pick rows, columns, or ranges from a dataframe. Understand that iloc uses positional indexing, independent of the dataframe's index.
Master label-based data selection with the loc function, choosing by row names like zero, selecting by column names such as stock, and using ranges to filter rows and columns.
Apply boolean indexing in pandas to filter data frames with boolean masks, using conditions like price > 170 and quantity > 10, combined with and/or and parentheses.
Pull stock prices from the internet using the finance library, and download Apple data starting in 2010, producing a data frame with open, high, low, close, adjusted close and volume.
Learn the latest yfinance 0.2.51 changes, including a multiindex column redesign and automatic adjustment of open, high, low, close, and volume for splits and dividends.
Filter Apple stock price data from 2023 in a time-indexed data frame using the log function and loc, then extract the adjusted close as a series or dataframe.
Explore the Pandas shift function to compute daily returns by dividing current prices by the shifted previous values, subtracting one, and compare it to the built-in pct_change method.
Learn how to use pandas diff to compute row differences, clean NaN values with drop, and apply rolling to compute a ten day moving average on daily finance data.
Explore how pandas axis=0 and axis=1 control row-wise and column-wise operations, using drop, dropna, and df.shift on a dataframe with a daily changes column and a red column.
Learn how to use nlargest and nsmallest in pandas to extract top or bottom n values from a series or dataframe, including the Apple close values and dates.
Combine two dataframes with pandas concat by pd.concat, and explore axis=0 or axis=1, column names, index, and nan values.
Use pandas pd.concat to merge time series data on axis 0, handle overlapping dates with drop_duplicates, then compare Apple and Tesla prices side by side on axis 1.
Resample daily stock data in a data frame to a monthly view, summing volumes and taking monthly maximum highs, then perform quick quality checks on the results.
Resample OHLC data monthly by applying open as first, high as max, low as min, and close as last, with volume summed, using a dictionary of aggregations.
Learn to plot with pandas using Apple stock data since 2020, creating line charts for open and close prices, a histogram of daily returns, and bar charts of monthly volumes.
Learn to iterate over a dataframe with iterrows and access row values, such as high and close. Explore max-high example in a for loop and note when vectorization is preferable.
Compare iterrows to vectorization with Pandas, and measure performance using the time library. The largest function runs dramatically faster—up to 40x, with variability up to 60x—so avoid iterations when possible.
Explore how to calculate stock returns from price changes, accumulate them using products, and compare with log returns, demonstrated with Python and pandas.
Plot the yearly returns of the S&P 500 since 2010 using resampling, and learn the required libraries, the ticker symbol, and the starting date for the task.
Learn two approaches to plot yearly S&P 500 returns: cumulate daily returns with a yearly product and bar plot, or compute yearly changes from the last close each year.
Explore portfolio analysis as a quantitative study of asset return and risk, and apply metrics in Python to compare stocks and optimize a real portfolio.
Explore mean, variance (sample vs population), standard deviation, covariance, and correlation, with step-by-step calculations and an example showing how these measures reveal relationship direction and strength.
Compute the portfolio's expected return by weighting each asset's mean return, and measure portfolio risk with variance and covariance in two-asset and three-asset formulas to obtain the standard deviation.
We calculate the portfolio expected return from the means of assets A and B using pandas. We determine portfolio variance and standard deviation from the covariance matrix with the weights.
Compute the portfolio's expected return via the weights dot product with returns, then derive variance by dotting the covariance matrix with weights, demonstrated in Python.
Analyze an equal weighted three asset portfolio of Microsoft, Coca-Cola, and Tesla in Python using pandas and numpy, computing daily returns, portfolio return and risk from 2015 onward.
Explore the efficient frontier and minimum variance portfolio using real stock data, and identify dominant portfolios with maximum Sharpe ratio while computing weights that sum to one.
Explore backtesting to confirm or reject a trading strategy by testing past performance, using a simple rule: buy when close is above the 100-day moving average and sell when below.
Learn to build a backtested trading strategy using pandas and yfinance, calculating a 100-day moving average, generating buy and sell signals, and evaluating profits with fees.
Learn vectorized backtesting in python by replacing loops with array operations, using boolean masks and diff on a 100-day moving average to locate the first buy signal and compute profits.
Build a momentum trading strategy on the S&P 500 with Python by buying the top performers from the past 12 months and holding for one month, while addressing survivorship bias.
Build and backtest a momentum strategy on the S&P 500. Select the top five performers from 12 months, hold for one month, and compare to the benchmark, noting survivorship bias.
Explore time series momentum trading in Python by backtesting a strategy across stocks, cryptos, and forex. Learn to compute log returns, rolling windows, and define positions with a one-day shift.
Backtest a JP Morgan volatility strategy that buys when the VIX exceeds 1.5 times its 30-day moving average and measures six-month S&P 500 returns using Python.
Develop an interactive finance dashboard with Streamlit to compare cumulative returns of assets, including stocks and cryptocurrencies, in the Python for Finance and Data Science course, using a multi-select dropdown.
Build an interactive streamlit portfolio analysis dashboard with an assets input, equal weights, and a pie chart, comparing cumulative returns and risk to the S&P 500 benchmark.
Explore a Streamlit dashboard that tracks the top and worst S&P 500 index performers over a chosen period, with interactive winners and losers and accompanying time-series charts.
Build Real Algorithmic Trading Strategies with Python — From Data to Backtesting and Optimization
This course teaches you how to design, implement, and evaluate real trading strategies using Python.
Instead of learning isolated concepts, you’ll work through complete, practical workflows used in quantitative finance — from pulling market data to building and optimizing trading systems.
By the end of this course, you will be able to:
• Build and backtest momentum and volatility-based trading strategies
• Work with real financial time series data using Pandas
• Create fully vectorized backtests (fast and scalable)
• Apply machine learning models to financial data
• Optimize portfolios using modern risk/return techniques
• Build interactive dashboards to analyze performance
• Store and manage financial data using SQL
What Makes This Course Different?
Most courses teach Python concepts in isolation. This course teaches you how to apply them in a consistent, real-world framework:
→ Data → Signal → Strategy → Backtest → Optimization
Every project builds on this pipeline, so you don’t just learn tools — you learn how to combine them into complete systems.
Real Projects You’ll Build:
• Cross-sectional and time-series momentum strategies
• A VIX-based trading strategy inspired by institutional research
• A machine learning model for market prediction
• Portfolio optimization using the Sharpe Ratio
• A Streamlit dashboard for analyzing market performance
• A financial database using Python and SQL
Who This Course Is For:
• Beginners who want to learn Python with a clear, practical goal
• Aspiring quants and analysts
• Traders who want to automate and backtest strategies
• Anyone interested in applying data science to financial markets
No fluff, no toy examples — just practical, real-world projects that show you how algorithmic trading and quantitative analysis actually work.
Start building your own trading strategies with Python today.