Getting started
Welcome and Introduction
Did you know...? (a Sneak Preview on Crypto Investing)
How to get the best out of this course
Student FAQ
*** LEGAL DISCLAIMER (MUST READ!) ***
Course Overview
PART 1: Basics and Prerequisites
Introduction and Overview PART 1
Download Course Materials PART 1
Introduction to Cryptocurrency Investing/Trading
Investing vs. Trading
Asset Classes, Money and (Crypto-) Currencies
What is a Stable Coin?
Why Investing into Cryptocurrencies?
Crypto Exchanges/Markets - Overview
Introduction to Coingecko.com
Price, Volume and Charts
Market Capitalization and (Circulating) Supply
Cryptocurrency Exchanges
The Binance Exchange
Binance.com and Binance.US at a first glance
How to get a 10% Discount on Trading Commissions
Registration and Identity Verification
How to instantly buy your first Cryptos
Deposits and Withdrawals (Part 1)
Deposits and Withdrawals (Part 2)
The first Spot Trade (buy Bitcoin)
Trade Analysis and Trading Fees/Commissions
Another Spot Trade (sell Bitcoin)
Limit Orders vs. Market Orders
Take-Profit Orders
Stop-Loss Orders
The Order Book
Bid-Ask-Spread and Slippage
Total Costs of a Trade (visible vs. hidden Costs)
Alternative Exchanges (FTX, Kraken, etc.)
Introduction FTX.com and FTX.us
How to get a 5% Discount on Trading Commissions (FTX.com)
Creating accounts on FTX.com and FTX.us
Installing Python and Jupyter Notebooks
Introduction
Download and Install Anaconda
How to open Jupyter Notebooks
How to work with Jupyter Notebooks
Tips for python beginners
Excursus: How to avoid and debug Coding Errors (don´t skip!)
Introduction
Test your debugging skills!
Major reasons for Coding Errors
The most commonly made Errors at a glance
Omitting cells, changing the sequence and more
IndexErrors
Indentation Errors
Misuse of function names and keywords
TypeErrors and ValueErrors
Getting help on StackOverflow.com
How to traceback more complex Errors
Problems with the Python Installation
External Factors and Issues
Errors related to the course content (Transcription Errors)
Summary and Debugging Flow-Chart
Python Data Analysis: The Cryptocurrency Market at a glance
Introduction
Cross-Sectional Data, Time Series Data & Panel Data
Download Course Materials and how to load csv-files
[Article] Loading Data into Pandas - advanced topics
The full Crypto Market in one Dataset (Cross-Sectional)
Price, Market Capitalization, circulating Supply & more
Data Analysis & Presentation
The full Crypto Market in one Dataset (Panel Data)
Price Charts
Market Cap over time
Market_Share over time
Outlook
Loading the full Market Data from Coingecko
The Coingecko API - Introduction
Preparations & First Steps
Simple Calls
Coin Calls (Part 1)
Coin Calls (Part 2)
Exchanges Calls
How to load the Cross-Sectional Dataset (Part 1)
How to load the Cross-Sectional Dataset (Part 2)
How to load the Cross-Sectional Dataset (Part 3)
Getting all available Coins on Binance
Loading the Panel Dataset
Cleaning and preparing the Panel Dataset (Part 1)
Cleaning and preparing the Panel Dataset (Part 2)
Cleaning and preparing the Panel Dataset (Part 3)
PART 2: Crypto Portfolio Investing and Rebalancing with Python
Introduction and Overview PART 2
Download Course Materials PART 2
Crypto API Trading with CCXT - Introduction
Introduction
Preparations
First Steps with CCXT
General Exchange Information
The Public API
Loading Historical Data (Part 1)
Loading Historical Data (Part 2)
How to get Binance API Keys
The Private API
The Binance Spot Test Network
How to connect to Testnets (Sandbox mode)
Creating Orders and analyzing Trades (Spot)
Trading with CCXT and FTX
Error Handling: How to make your Code more stable and reliable
Introduction
Python Errors (Exceptions)
try and except
Catching specific Errors
The Exception class
try, except, else
finally
Try again (...until it works)
How to limit the number of retries
Waiting periods between re-tries
Object Oriented Programming (OOP): Creating a Finance Class
Introduction to OOP and examples for Classes
Installing required Libraries
The Financial Analysis Class live in action (Part 1)
The Financial Analysis Class live in action (Part 2)
The special method __init__()
The method get_data()
The method log_returns()
String representation and the special method __repr__()
The methods plot_prices() and plot_returns()
Encapsulation and protected Attributes
The method set_ticker()
Adding more methods and performance metrics
Inheritance
Inheritance and the super() Function
Adding meaningful Docstrings
Creating and Importing Python Modules (.py)
Coding Exercise: Create your own Class
The Portfolio Trading and Rebalancing Bot
The Portfolio Rebalancing Bot Live in Action
The Portfolio Rebalancing Bot explained (Part 1)
The Portfolio Rebalancing Bot explained (Part 2)
The Portfolio Rebalancing Bot explained (Part 3)
The Portfolio Rebalancing Bot explained (Part 4)
The Portfolio Rebalancing Bot explained (Part 5)
The Portfolio Rebalancing Bot explained (Part 6)
The Portfolio Rebalancing Bot explained (Part 7)
Changing Target Currencies
How to adjust to other Exchanges
How to run a Rebalancing Script
PART 3: Crypto Portfolio Management and Optimization
Introduction and Overview PART 3
Download Course Materials PART 3
Financial Data Analysis with Python and Pandas - a (deep) Introduction
Introduction and Overview
Installing and importing required Libraries/Packages
Loading Financial Data from the Web
Initial Inspection and Visualization
Normalizing Time Series to a Base Value (100)
Coding Challenge #1
Price changes and Financial Returns
Reward and Risk of Financial Instruments
Coding Challenge #2
Investment Multiple and CAGR
Compound Returns & Geometric Mean Return
Coding Challenge #3
Discrete Compounding
Continuous Compounding
Log Returns
Simple Returns vs Log Returns ( Part 1)
Simple Returns vs Log Returns ( Part 2)
Coding Challenge #4
Comparing the Performance of Financial Instruments
(Non-) Normality of Financial Returns
Annualizing Return and Risk
Resampling / Smoothing of Financial Data
Rolling Statistics
Coding Challenge #5
Short Selling and Short Position Returns (Part 1)
Introduction to Currencies (Forex) and Trading
Short Selling and Short Position Returns (Part 2)
Short Selling and Short Position Returns (Part 3)
Coding Challenge #6
Covariance and Correlation
Portfolios and Portfolio Returns
Margin Trading and Levered Returns (Part 1)
Margin Trading and Levered Returns (Part 2)
Coding Challenge #7
Performance Analysis Cryptocurrencies - Homework Challenge
Getting started & Assignments
Solutions
How to create a Cryptocurrency Index/Benchmark
Introduction
Financial Indexes - an Overview
Getting started
Value-weighted Index (Theory)
Creating a Value-weighted Crypto Index
Price-weighted Index (Theory)
Creating a Price-weighted Crypto Index
Equally-weighted Index (Theory)
Creating an Equally-weighted Crypto Index
Analysis and Comparison (Part 1)
Analysis and Comparison (Part 2)
Creating and Analysing Cryptocurrency Portfolios
Getting started
Creating Random Portfolios (Part 1)
Creating Random Portfolios (Part 2)
Performance Measurement: Risk-adjusted Return
Portfolio Optimization (Part 1)
Portfolio Optimization (Part 2)
The Efficient Frontier
Adding (daily) Rebalancing
The Effects of Rebalancing
Rebalancing and Trading Costs
Asset Allocation - Rules of Thumb & naive Diversification
Overview
Portfolio Theory
Two-Asset-Case
The importance of Correlation
Three-Asset-Case
Forward-looking Portfolio Optimization & its Pitfalls
Overview
Reverse Optimization and the Black-Litterman model
Overview
APPENDIX: Python Crash Course
Introduction and Overview
Appendix Downloads
Appendix 1: Python (& Finance) Basics
Intro to the Time Value of Money (TVM) Concept (Theory)
Calculate Future Values (FV) with Python / Compounding
Calculate Present Values (PV) with Python / Discounting
Interest Rates and Returns (Theory)
Calculate Interest Rates and Returns with Python
Introduction to Variables
Excursus: How to add inline comments
Variables and Memory (Theory)
More on Variables and Memory
Variables - Dos, Don´ts and Conventions
The print() Function
Coding Exercise 1
TVM Problems with many Cashflows
Intro to Python Lists
Zero-based Indexing and negative Indexing in Python (Theory)
Indexing Lists
For Loops - Iterating over Lists
The range Object - another Iterable
Calculate FV and PV for many Cashflows
The Net Present Value - NPV (Theory)
Calculate an Investment Project´s NPV
Coding Exercise 2
Data Types in Action
The Data Type Hierarchy (Theory)
Excursus: Dynamic Typing in Python
Build-in Functions
Integers
Floats
How to round Floats (and Integers) with round()
More on Lists
Lists and Element-wise Operations
Slicing Lists
Slicing Cheat Sheet
Changing Elements in Lists
Sorting and Reversing Lists
Adding and removing Elements from/to Lists
Mutable vs. immutable Objects (Part 1)
Mutable vs. immutable Objects (Part 2)
Coding Exercise 3
Tuples
Dictionaries
Intro to Strings
String Replacement
Booleans
Operators (Theory)
Comparison, Logical and Membership Operators in Action
Coding Exercise 4
Conditional Statements
Keywords pass, continue and break
Calculate a Project´s Payback Period
Introduction to while loops
Coding Exercise 5
Appendix 2: User-defined Functions
Defining your first user-defined Function
What´s the difference between Positional Arguments vs. Keyword Arguments?
How to work with Default Arguments
The Default Argument None
How to unpack Iterables
Sequences as arguments and *args
How to return many results
Scope - easily explained
Coding Exercise 6
Appendix 3: Numpy, Pandas, Matplotlib and Seaborn Crash Course
Modules, Packages and Libraries - No need to reinvent the Wheel
Numpy Arrays
Indexing and Slicing Numpy Arrays
Vectorized Operations with Numpy Arrays
Changing Elements in Numpy Arrays & Mutability
View vs. copy - potential Pitfalls when slicing Numpy Arrays
Numpy Array Methods and Attributes
Numpy Universal Functions
Boolean Arrays and Conditional Filtering
Advanced Filtering & Bitwise Operators
Determining a Project´s Payback Period with np.where()
Creating Numpy Arrays from Scratch
Coding Exercise 7
How to work with nested Lists
2-dimensional Numpy Arrays
How to slice 2-dim Numpy Arrays (Part 1)
How to slice 2-dim Numpy Arrays (Part 2)
Recap: Changing Elements in a Numpy Array / slice
How to perform row-wise and column-wise Operations
Coding Exercise 8
Intro to Tabular Data / Pandas
Create your very first Pandas DataFrame (from csv)
Pandas Display Options and the methods head() & tail()
First Data Inspection
Coding Exercise 9
Selecting Columns
Selecting one Column with the "dot notation"
Zero-based Indexing and Negative Indexing
Selecting Rows with iloc (position-based indexing)
Slicing Rows and Columns with iloc (position-based indexing)
Position-based Indexing Cheat Sheets
Selecting Rows with loc (label-based indexing)
Slicing Rows and Columns with loc (label-based indexing)
Label-based Indexing Cheat Sheets
Summary, Best Practices and Outlook
Coding Exercise 10
First Steps with Pandas Series
Analyzing Numerical Series with unique(), nunique() and value_counts()
Analyzing non-numerical Series with unique(), nunique(), value_counts()
The copy() method
Sorting of Series and Introduction to the inplace - parameter
First Steps with Pandas Index Objects
Changing Row Index with set_index() and reset_index()
Changing Column Labels
Renaming Index & Column Labels with rename()
Filtering DataFrames (one Condition)
Filtering DataFrames by many Conditions (AND)
Filtering DataFrames by many Conditions (OR)
Advanced Filtering with between(), isin() and ~
Intro to NA Values / missing Values
Handling NA Values / missing Values
Exporting DataFrames to csv
Summary Statistics and Accumulations
Visualization with Matplotlib (Intro)
Customization of Plots
Histogramms (Part 1)
Histogramms (Part 2)
Scatterplots
First Steps with Seaborn
Categorical Seaborn Plots
Seaborn Regression Plots
Seaborn Heatmaps
Removing Columns
Introduction to GroupBy Operations
Understanding the GroupBy Object
Splitting with many Keys
split-apply-combine
Appendix 4: Advanced Pandas Time Series Topics
Helpful DatetimeIndex Attributes and Methods
Filling NA Values with bfill, ffill and interpolation
Timezones and Converting (Part 1)
Timezones and Converting (Part 2)
What´s next? (outlook and additional resources)
Bonus Lecture