Where finance practitioners get started with Python for quant finance, algorithmic trading, and data analysis | Tweets & threads with free Python code & tools.
39 subscribers
Aug 2 • 13 tweets • 2 min read
Every piece of trading advice I could think of after 20+ years trading, 20+ years writing code, and 15+ years as a quant:
1. Bulls make money. Bears make money. Pigs go to slaughter. (Thanks Dad.)
2. Never add to a losing trade. 3. The best way to burn out learning Python is to learn stuff you can't actually use. 4. Fight on the winning side and be willing to change sides when one side has gained the upper hand.
Jul 19 • 9 tweets • 3 min read
RenTec uses Hidden Markov Models in trading.
The technique generated 60% returns per year over 30 years.
One of the co-founders of RenTec's name is in the algorithm!
Here's how it works:
A Hidden Markov Model (HMM) is a statistical model used to represent systems that evolve over time with unobservable (hidden) states.
It is widely applied in areas such as natural language processing, speech recognition, and bioinformatics.
And in trading:
Jul 10 • 14 tweets • 5 min read
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.
Jul 7 • 8 tweets • 3 min read
This Jane Street trader literally explains edge in this book.
Here's what's inside:
The author starts by explaining how the professionals and hedge funds think about trading.
Jul 1 • 13 tweets • 6 min read
10 free Python PDF ebooks for download:
Think Python
OpenBB dropped the $0 cost financial AI agent workstation.
You can get 405 free data sources (and an AI Copilot).
Here's what you missed (in 90-seconds):
In case you're unfamiliar:
OpenBB is the first AI financial workstation that combines data with an AI agent to transform investment research.
• Private (your data is not shared)
• 100s of free data sources
• Custom data backends
• Advanced AI Copilot
How it works:
Jun 17 • 12 tweets • 4 min read
My master's degree completely failed to teach me how to test trading strategies.
So I spent 40 hours looking for Python backtesting libraries.
Then I started using the best ones.
But unlike my quant finance degree, these won't cost you $90,000.
Here they are for free.
Zipline
From Quantopian (acquired by Robinhood) the first to democratize quant trading, comes Zipline. It's a robust, fully-featured backtesting library which features slippage models, robust data handing and rich metrics.
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.
May 13 • 11 tweets • 4 min read
My master's degree completely failed to teach me Python for quant finance (they taught me MATLAB).
And Octave (WTF?)
So I watched 200 YouTube videos.
And the truth is, 96% of them were a complete waste of time.
But these 8 taught me more than all my PhD professors combined:
Algorithmic Trading Using Python (4.5 hours)
Learn how to perform algorithmic trading using Python in this complete course. Algorithmic trading means using computers to make investment decisions.
May 10 • 11 tweets • 4 min read
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:
Algorithmic Trading Using Python (4.5 hours)
Learn how to perform algorithmic trading using Python in this complete course. Algorithmic trading means using computers to make investment decisions.
May 4 • 24 tweets • 6 min read
The 21 cognitive biases that will sabotage your trading (and how to beat them to improve your results):
Put your ego aside and attribute early trading success to luck.
May 1 • 11 tweets • 4 min read
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):
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?
Apr 29 • 14 tweets • 3 min read
Myth:
AI bots are taking over the markets.
Truth:
Most shops still run Excel '97.
Some shops use machine learning.
10 ways to use machine learning in trading (with the Python library):
Reinforcement Learning
Optimizing portfolio management using rewards.
Uses agent-based rewards for dynamic portfolio management. It learns to balance risk and reward by trading different stocks over time.
Use: Stable Baselines3's A2C model
Apr 15 • 10 tweets • 3 min read
This is Edward Thorp.
The genius mathematician who returned 20%+ over 30 years.
He traded for 19 years, with his worst loss being 1%.
He beat Vegas dealers at blackjack.
His top 7 trading strategies (and how they work): 1. Statistical Arbitrage
He used mathematical models to identify price discrepancies between different markets or securities, buying undervalued assets and selling overvalued ones.
Apr 12 • 21 tweets • 4 min read
I'm 43.
If you're still in your 20s (or 30s), read this:
1. The compounding effect of doing the same thing over and over for a long period of time is a force of nature. Learn how to compound.
2. Learn how to be comfortable with being uncomfortable. Wealth doesn't accrue to people solving easy problems.
Apr 1 • 16 tweets • 5 min read
12 Python libraries for free market data everyone should know:
yfinance
Data for stocks (historic, intraday, fundamental), FX, crypto, and options. Uses Yahoo Finance so any data available through Yahoo is available through yfinance.