
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Learn data-driven, theory-backed algorithmic stock trading and investing strategies with Python. Automate decisions via the API with Interactive Brokers and explore long-term investing, technical analysis, and price data.
Explore how to measure performance using the right benchmark across active and passive investing, with the role of algorithmic stock trading and Python in equity investing.
Discover seven tips to maximize your learning in this course, covering how to use the overview, prerequisites, course content, and practice with coding exercises, quizzes, and the AI assistant.
Explore algorithmic stock trading and equity investing with Python, loading stock data from the web, backtesting, portfolio optimization, and automated trading with the Interactive Brokers API.
Practice communication in algorithmic stock trading and equity investing through an AI-powered role play with a mentor, where you ask three questions and outline next steps.
Explore the basics of finance, asset classes, and data loading for stocks, then analyze returns and dividends, and learn API trading with Interactive Brokers to build Python trading algorithms.
Identify asset classes, with equities as the major class and fixed income, and learn how diversification across stocks, bonds, commodities, real estate, private equity, and cash manages risk and return.
Compare equities and fixed income across risk, return, volatility, and ownership structures. Explore how bondholders' fixed payments contrast with shareholders' upside and diversification benefits.
Identify how listed equities are segmented into sub asset classes by region, country, development status, sector, style, and size to reveal distinct risk and return profiles.
Explore top-down and bottom-up investing in equities, comparing macro-driven sector analysis to company-focused fundamentals, with US equities like Apple and Nike in developed markets.
Explore the difference between trading and investing, contrasting horizons, asset classes, and strategies, and learn how data-driven, systematic approaches guide long-term wealth versus short-term profits.
Explore two role plays: finding your fit stock spawns and teaching an intern the landscape of equities and strategies; share feedback on the q&a board to shape more role plays.
Install Python and Anaconda to manage packages, use Jupyter notebooks, and prepare your environment for Python-based stock trading; update Conda and remove other Python installations to avoid conflicts.
Install python and the data science ecosystem with Anaconda, a package manager that simplifies dependencies and supports Jupyter notebooks and multiple IDEs.
Open and explore the Anaconda Navigator, launch Jupyter Notebook or Jupyter Lab, and create your first notebook to run Python code with run cell actions like Shift-Enter and Alt-Enter.
Learn to use Jupyter notebooks as an interactive Python environment, including edit and command modes, running cells, code and markdown cells, headers, shortcuts, and kernel management.
Outline python basics and pandas skills for equity data analysis, and note a crash course in the appendix covering numpy, pandas, plot lib, time series methods, and object oriented programming.
Explore Yahoo Finance as a free data source. Load data into Python via the Yahoo Finance API and analyze Apple stock (AAPL) prices, volume, and financials.
Download and unzip the Part one materials zip, then open and run the four Jupyter notebooks from equity introduction to financial data analysis using Anaconda Navigator.
Install the VI Finance library to access Yahoo Finance data via the VI Finance API, using pip install we finance on Windows or macOS, and prepare for the next lecture.
Import yfinance and essential libraries, fetch Apple stock data (AAPL) via the API, and load historical open, high, low, close, adjusted close, and volume into pandas.
Keep pace with python package updates by using yfinance version 0.2.48+ and setting multi-level index to false to avoid multi-level indices when loading symbols, enabling simpler stock data frames.
Learn to analyze Apple historical data by selecting flexible analysis periods with pandas, using start and end dates or period parameters in the finance application programming interface.
Learn to download Apple stock historical data from Yahoo Finance with flexible frequency options—from one minute to monthly—and understand how intervals, periods, and start end parameters control granularity.
Explore dividends and stock splits and their impact on total return, using Apple as an example; learn dividend payout policy, quarterly payouts, and how dividends complement price gains.
Understand how the adjusted close price is computed from the close price and dividends. See how it improves stock performance analysis by reflecting dividend payments for total return.
Learn how backward adjusted prices from Yahoo! Finance remove the effects of stock splits and dividends, using a multiplier to convert adjusted to unadjusted prices and reveal true stock performance.
Learn to download historical price and volume data for non-US stocks by appending an exchange suffix, e.g., Reliance.NS or Lufthansa.D, noting data delays and real-time data for Nasdaq where applicable.
Load and manipulate historical data for multiple tickers with the VIE Finance library, using pandas multi-index columns (outer price category, inner ticker level) to swap levels and clean column names.
Learn to save and load stock data locally with csv files in Python using pandas, covering single and multi-symbol data, date time index, and reload workflows.
Load historical price, volume, and dividend data for Johnson & Johnson and Tesla; compare dividends, price growth, and dividend policy to identify Johnson & Johnson as the high dividend stock.
Master debugging skills to understand and fix errors quickly, leveraging trial and error, reading code, and common sense in Python.
Test your debugging skills by diagnosing and fixing common Python errors in a dataset of Olympic medalists, from key errors and type issues to pandas conversions.
Identify why errors occur by focusing on three categories, with code problems as the most likely cause. Later, review installation issues and factors, with examples of typos and input mistakes.
Spot common, simple Python errors in data tasks, from dictionary typos and reversed keys to missing quotes and wrong method names. Learn quick fixes for name errors and bracket mistakes.
Master common notebook pitfalls by omitting cells or changing sequence, using pandas to set the index, load players data, and resolve key and name errors through kernel restart.
Explore common index errors in pandas data frames and lists, using iloc to access unavailable rows or columns, out-of-bounds checks, and debugging by inspecting previous steps.
Learn to diagnose and fix Python indentation errors in notebooks, preventing unexpected indents or missing indents, and ensuring proper blocks in for loops and dictionary code.
Avoid misusing python keywords and built in function names, demonstrate how naming a variable list can overwrite the list function, and explain syntax errors when keywords are used as identifiers.
Understand type errors and value errors in Python. See why incompatible types raise errors and why values can be inappropriate for a type, with examples from integers, strings, and lists.
Learn to diagnose coding issues by reading error messages and using Stack Overflow and Google for fast, community-driven help, including a pandas example on positional and keyword arguments.
Learn how Python traceback helps locate errors quickly in complex code, using a backtesting example with pandas, numpy, and matplotlib to diagnose attribute errors and typos in annualized mean calculations.
Learn to diagnose Python installation problems, install missing libraries with conda or pip, and fix corrupted setups by reinstalling a clean Anaconda environment.
Identify external factors such as weak internet and server errors that disrupt API calls. Address authentication, firewall, and admin-right issues, and use troubleshooting and Q&A bot resources for debugging.
Identify how transcription errors and outdated code can affect Python-based trading tutorials, and learn to avoid them by using notebooks and writing your own code.
apply the debugging flowchart to diagnose and fix errors by reading the bottom error, inspecting code, restarting the kernel, and consulting the cost notebook and Q&A board.
Update yfinance or yahoo query to keep equity data reliable, and use ticker objects to access history and get_info or get_fast_info for key statistics, while monitoring api changes.
Learn to use the ticker object from Yahoo Finance in Python to fetch historical prices, dividends, and financials, and access detailed company metrics with get info.
Understand how share price, shares outstanding, and market capitalization relate. Reinforce that price alone is not meaningful; market cap equals shares outstanding times price and remains unchanged by stock splits.
Explore how price differs from intrinsic value, and how market efficiency explains when prices reflect information, with weak and strong forms, mispricing, and irrational behavior like GameStop.
Compute Apple's firm value by adding market value of equity and debt to show how equity remains a residual claim, typically near zero in distress and subordinated to debt.
Compare market value of equity with book value of equity, explain balance sheet basics, and show why intangible assets and depreciation create differences between market and book values.
Compare market value and book value by linking future profits to a forward price-to-earnings ratio and the price-to-book ratio, showing how expectations drive equity valuation.
Liquidation value captures the assets' worth if a company ceases operations and sells assets separately, not the balance sheet book value.
Compare Apple and General Motors’ price-to-book ratios to show market value diverging from book value. Don’t rely on a single metric; consider profitability, growth, asset intensity, outsourcing, and financing.
Load financial statements from Yahoo Finance using the Python API, including balance sheets, income statements, and cash flow statements. Retrieve annual and quarterly data, with figures scaled to millions.
Explore a keystone project that loads Dow Jones Industrial Average data from sources like Yahoo Finance, prepares it for analysis, and compares stocks by price performance, dividend yield, and ratios.
Load the Dow Jones 30 from Wikipedia with pandas read_html (and yfinance), then clean and rename headers, convert date to datetime, weights to float, and set the ticker as index.
Download historical price and volume data for 30 stocks from Yahoo Finance, compute total price increase since index reconstitution, and rank performance with Chevron top and Salesforce down 41%.
Load cross sectional stock data for 30 stocks from Yahoo Finance using the Y Finance ticker object and build a pandas DataFrame with 30 rows and 154–155 columns.
Explore loading, cleaning, and preparing data for stock analysis, then compare price to book ratio, dividend yield, and forward price to earnings ratio across major constituents.
Learn how to obtain complete ticker lists for US and worldwide markets using the Nasdaq screener, Wikipedia read_html, and interactive brokers, then load data into pandas.
Load all Indian stock market tickers from Interactive Brokers into Python using pandas, then download historical price and volume data from Yahoo Finance.
Learn to trade real stocks with Python using Interactive Brokers, featuring zero commissions for US stocks via the lite account and a broad product range, plus Traders Academy resources.
Create a paper trading account on Interactive Brokers during a free trial to practice with virtual 1 million dollars and learn to convert to a live account.
Install and start the IB Trader Workstation (TWS) desktop platform for reliable paper trading and API trading with Python, choosing the online version and launching from the desktop icon.
Log in to the trader workstation with a paper trading account to explore mosaic view, monitor a demo portfolio with delayed 15-minute market data, and view bid/ask prices for Apple.
Submit market orders to buy Microsoft stock at the best price, set the quantity, view the bid-ask spread, and transmit the trade to form a new position.
Trade only during regular trading hours, typically Monday to Friday, on the New York Stock Exchange from 9:30 a.m. to 4 p.m. Eastern Time for higher liquidity and tighter spreads.
Compare cash and margin accounts for stock trading, noting cash limitations on purchases and sales, whereas margin allows borrowing and short selling, with higher buying power and increased risk.
Discover fractional trading on Interactive Brokers, buying fractions of a share with dollars, using dollar-based quantities and market orders. Enable fractional trading in live accounts under trading permissions.
Analyze trading costs for US stocks, including fixed versus tiered commissions and visible versus hidden costs. Learn how bid-ask spreads and order size affect proportional costs.
Analyze hidden trading costs from the bid-ask spread on US exchange listed stocks and their impact on total costs, and learn to compute half spread and proportionate costs per trade.
Install ib async Python wrapper for Interactive Brokers, enable ActiveX and socket clients, disable read-only API, bypass precautions, and migrate from ib in sync to ib async for automated trading.
Connect to Interactive Brokers via the API wrapper, ensuring you are logged in to Trader Workstation, then connect and disconnect. Review current positions and contract details, and note API errors.
Connect to interactive brokers, define and find contract objects for forex and stocks, and use qualified contracts to retrieve contract IDs and exchange details for precise trading.
Identify the right contract in the Interactive Brokers API to access current market data for currencies, stocks, and ETFs, with live data requiring subscription and paper-trading data often delayed.
Stream market data for three instruments in parallel and print current prices every second, then build technical indicators to generate buy or sell signals.
Import the wrapper, connect, and search for contracts to handle unambiguous, unknown, and multiple results. Retrieve contract details with request_contract_details, view contract ID and symbol, and visualize with util.df.
Develop a Python workflow to fetch contract details for all 30 Dow Jones constituents, and assemble them into a data frame with corresponding details.
Learn to place market buy and sell orders using the Interactive Brokers API, handle trading hours, use contract and order objects, and track fills, trades, and paper trading account data.
Explore how the Interactive Brokers API pulls current portfolio positions and account values into Python dataframes, extracting symbol and contract ID, with euro and US dollar cash balances.
Explore loading historical ohlc data with the Interactive Brokers API, including contract setup and bar sizing. Note Yahoo Finance as the preferred source and address time zones and data permissions.
Explore a contrarian algorithmic trading approach that picks the three worst and three best Dow Jones stocks at day’s end, then holds or short-sells via the Interactive Brokers API.
Load Dow Jones 30 constituents into a data frame with pandas, extract symbols from the close column, and prepare a symbol list for paper trading with the interactive brokers wrapper.
Extract the most recent price and last close from Yahoo Finance to calculate the one-day performance, and use get fast info for faster, more reliable data.
Determine target positions using a contrarian strategy by buying one share for the three worst performing stocks and shorting one share for three best S&P 500 stocks. Backtesting not covered.
Fetch current positions from Interactive Brokers, convert them to a dataframe, and extract symbol and contract id to compare actual versus target positions, and include a conditional for empty positions.
Merge target and actual positions with pd.merge on symbol, fill missing with zero, then compute trades as target minus actual, generating buy or sell orders for nonzero differences.
Execute trades by iterating symbols to buy or sell toward target positions, using market orders and contract details, then compare current positions to targets.
Run the contrarian trader script in Python at the end of the trading day to automate trades, verify target positions, and transition from paper trading to live execution.
Welcome to the most comprehensive and complete course on (automated) Stock Trading and Equity Investing!
This course covers
Automated Stock Trading for Income Generation (Algo Trading, Day Trading & more)
Automated ETF & Equity Portfolio Investing for long-term Wealth Accumulation (passive, semi-active, and active Investing)
with Python and Interactive Brokers (IBKR).
At the end of the course, you´ll have mastered all four aspects required for long-term success:
Theory (Finance & Investing 101): What you really need to know before you trade/invest in stocks.
Data: Successful Investment and Trading Strategies are data-driven.
API Trading with Interactive Brokers: Automated Paper Trading and Live Trading with low Spreads and Commissions (no inactivity fees)
Python: The right tool that integrates Theory, Data, and API Trading. This course explains the code and covers everything you need to know in a Python Crash Course (for beginners).
Some Highlights:
Load and analyze Stock Market Data (historical prices, financial statements, ratios, valuation multiples) for thousands of stocks
Trade stocks on various exchanges and from various world regions (North America, Europe, India, Australia, etc.)
Fundamental Analysis, Equity Valuation Methods, Technical Indicators, and Optimization Techniques explained.
Trading Strategies with multiple Tickers/Instruments at once
Test and improve your skills in various Keystone Projects (new concept)
What else should you know about me and the course?
The course shows how to do things right. But equally important, it highlights the most commonly made mistakes in Trading & Investing. There is hardly any other business where beginners make so many mistakes. Why is that? A lack of skills, expertise, and experience. And: Overconfidence and overreliance on intuition. As a finance professional with an extensive academic background (MSc in Finance, CFA) my clear message is: For Trading and Investing, intuition and common sense are not your best friends. Very often, the most intuitive solution is not the correct solution!
This course is "not only" a Stock trading and Equity investing course but also an in-depth Python Course that goes beyond what you can typically see in other courses. Create hands-on Applications with Python and use it for your Trading & Investing Business!
What are you waiting for? Join now!
Thanks and looking forward to seeing you in the Course!