• Allows quick data cleaning and preprocessing
• Provides DataFrame structure for time-series data
• Enables complex data operations with simple syntax
Use it for:
Manipulating and transforming financial market data.
NumPy
• Advanced statistical functions for analysis
• Efficient vectorized operations for large datasets
• Powerful random number generators for simulations
Use it for:
Fast and versatile scientific computing.
SciPy
• Advanced stats and hypothesis testing
• Linear algebra for portfolio optimization
• Efficient numerical routines and model calibration
Use it for:
Optimization and calibration.
Matplotlib
• Integrates with pandas
• Plot financial time series data
• Generate histogram, scatter plots
Use it for:
Fast plotting of market data and summary statistics.
Statsmodels
• Hypothesis testing to test trading strategy efficacy
• Regression analysis for factor analysis and hedging
• Time series analysis with ARIMA and VAR models for forecasting
Use it for:
Regression and statistical analysis.
vectorbt
• High performance to run millions of simulations
• Flexible using NumPy and pandas under the hood
• Easy to use once to get up and running fast
Use it for:
Prototyping trading strategies and optimizing parameters.
Zipline Reloaded
• Create custom data pipelines
• Backtest strategies with realistic data
• Access a vast array of trading algorithms
Use it for:
A realistic market simulation for backtesting.
PyFolio Reloaded
• Detailed portfolio risk analysis
• Integrates with Zipline for backtesting
• Supports custom tear sheets for personalized analytics
• Access financial market data from one place
• Fast Terminal environment for investment research
• SDK for programmatic access to all OpenBB functions
Use it for:
Research and data acquisition.
RiskFolio-Lib
• Optimize asset allocation with 20+ risk measures
• Perform scenario, stress testing, and backtesting
• Tools for risk budgeting and risk contribution
Use it for:
Advanced portfolio optimization and risk management.
This is a long, in-depth thread.
The best way to come back to it?
Click the link here, hop to the top tweet, and retweet it!
So don't be the only one stuck with 1,048,576 rows.
6 links to help you quickly get started with Python now:
The Ultimate Beginner’s Guide to NumPy
What you'll learn: NumPy is the foundation for all data-driven libraries in Python. Understanding the basics will help you learn other libraries like Pandas and get an edge on your peers.
Options traders are well-informed. Their expectations of future stock price moves are often priced into options. We can use options prices to extract the options market’s expectations of stock price moves.
My PhD professors taught me MATLAB during my master's degree.
So I watched 200 YouTube videos to learn Python
96% of them were a complete waste of time.
But these 8 taught me more than all my PhD professors combined:
Setting up Interactive Brokers API with Python
This video shows how to use Python with the Interactive Brokers API to automate a first strategy—cutting through its complexity in one clear walkthrough.
1,000,000 backtest simulations in 20 seconds with vectorbt
The video explains how parameter tweaking on random noise ruins backtests and shows how vectorbt enables proper walk-forward optimization for pairs trading.