PyQuant News 🐍 Profile picture
Jul 10 14 tweets 5 min read Read on X
There are 137,000 Python libraries.

But you only need 11 for quant finance:
pandas

• 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. Image
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. Image
SciPy

• Advanced stats and hypothesis testing
• Linear algebra for portfolio optimization
• Efficient numerical routines and model calibration

Use it for:

Optimization and calibration. Image
Matplotlib

• Integrates with pandas
• Plot financial time series data
• Generate histogram, scatter plots

Use it for:

Fast plotting of market data and summary statistics. Image
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. Image
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. Image
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. Image
PyFolio Reloaded

• Detailed portfolio risk analysis
• Integrates with Zipline for backtesting
• Supports custom tear sheets for personalized analytics

Use it for:

Risk and performance metrics. Image
AlphaLens Reloaded

• Visualizes key metrics effectively
• Robust statistical analysis of factors' long-term trends
• Streamlines performance analysis of predictive alpha factors

Use it for:

Alpha factor analysis. Image
OpenBB

• 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. Image
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. Image
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!
Looking to start using Python for quant finance?

Here's a free Crash Course with everything you need to get started.

Join the 1,000s of people who finally started with Python after reading it:

pyquantnews.com/free-course

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with PyQuant News 🐍

PyQuant News 🐍 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @pyquantnews

Sep 6
In the age of AI, Jupyter Notebook is the most powerful tool Python developers have.

But most people don’t know the hidden features.

Need a quick web app?

Or create REST APIs?

Here are the 6 ways to use Jupyter Notebook (you never knew existed): The notebook to rule them all.
Jupyter Notebook is a web app for creating and sharing computational documents.

When I say powerful, here's what I mean:

• It supports 40 languages
• Produces rich, interactive output
• Leverages big data tools like Spark

So, what else can we do with Jupyter Notebook?
Package Development

nbdev let's you develop and publish Python packages right from Jupyter Notebook.

It generates documentation and publishes on GitHub Pages. You can also write tests and setup CI with GitHub Actions.

github.com/fastai/nbdev
Read 11 tweets
Aug 31
Myth:

You need a computer science degree to get started with Python, NumPy, and pandas.

Reality:

You need these 8 YouTube videos:
"Python Pandas" by Corey Schafer

Learn the basics of creating and manipulating data frames, indexing and selecting data, and cleaning and manipulating data in Pandas.

"NumPy Array Basics" by sentdex

This video covers the basics of working with NumPy arrays, including creating arrays, indexing and slicing, and performing arithmetic operations.

Read 12 tweets
Aug 24
Statistical arbitrage is scary sh*t.

That's what I used to think until I spent 25 hours studying pairs trading.

Now I realize it's a great way to get started with algorithmic trading.

Here’s how to build a pairs trading strategy in Python.

Step by step:
By replicating this framework, you’ll be able to:

1. Get stock price data
2. Find cointegrated pairs
3. Model the spread
4. Trade the strategy

What is pairs trading anyway?
Pairs trading is a way of trading an economic relationship between two stocks.

Two companieswith the same supply chain will be impacted by the same economic forces.

Pairs trading tries to model that relationship and make money when the relationship temporarily breaks down.
Read 13 tweets
Aug 20
Python is the new Excel.

So don't be the only one stuck with 1,048,576 rows.

6 links to help you quickly get started with Python now: Image
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.

towardsdatascience.com/the-ultimate-b…
Random Forests for Complete Beginners

What you'll learn: A thorough walkthrough of building and using decision trees and random forest machine learning techniques in Python.

victorzhou.com/blog/intro-to-…
Read 10 tweets
Aug 18
You can use options to predict stock price moves.

Here’s how: Image
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.

If we know where to look…
First, download earnings data. Image
Read 8 tweets
Aug 12
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.

Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(