Quant Science Profile picture
Develop profitable trading strategies, build a systematic trading process, and trade your ideas with Python—even if you’ve never done it before.
11 subscribers
Jun 27 15 tweets 3 min read
How to create your own "mini" hedge fund with algorithmic trading and Python

A thread 🧵 Image 1. What is a Hedge Fund

Hedge funds pool money from wealthy individuals or institutions to seek higher, risk-adjusted returns across multiple markets.
Jun 22 6 tweets 3 min read
Mind-blowing tear sheets for your trading strategies.

1 line of Python code: Image QuantStats performs portfolio profiling for analytics and risk metrics.

Grab it here: github.com/ranaroussi/qua…Image
Jun 18 9 tweets 3 min read
How to use MACD for algorithmic trading Machine Learning.

Let's dive in. 🧵 Image MACD (Moving Average Convergence Divergence) is most commonly used in Technical Trading.

But, it can be used as part of a factor model.

Let's see how. Image
Jun 16 10 tweets 4 min read
How to make a simple algorithmic trading strategy with a 472% return using Python.

A thread. 🧵 Image This strategy takes advantage of "flow effects", which is how certain points in time influence the value of an asset.

This strategy uses a simple temporal shift to determine when trades should exit relative to their entry for monthly boundary conditions. Image
Jun 14 11 tweets 3 min read
🚨 BREAKING: I just stumbled upon this Machine Learning Python library for Algorithmic Trading that looks insane.

It's called AlphaPy.

This is what it does: Image AlphaPy is a machine learning framework for both speculators and data scientists.

It is written in Python with the scikit-learn and pandas libraries, as well as many other helpful libraries for feature engineering and visualization.

Here's some of what it does:
Jun 13 18 tweets 6 min read
Quants use principal component analysis to find alpha.

Blackrock uses it to manage $100s of billions in factor funds.

Northfield uses it to earn $10s of millions selling factors to investors.

Here’s how it’s done.

In a few lines of Python: Image By reading this thread, you’ll be able to:

1. Get stock data
2. Fit a PCA model
3. Visualize the components
4. Isolate the alpha factors

But first, a quick primer on PCA if you’re unfamiliar:
Jun 8 14 tweets 4 min read
🚨 Want to build your own quant hedge fund — but don’t have millions in capital or a team of engineers?

Here are the Top 10 Tools I used to go from idea → backtest → automation…

All on a budget using Python & open-source Python. Image 1. DuckDB

Think of DuckDB as SQLite for analytics.

Blazing-fast in-memory queries. No server required. Reads Parquet, CSV, or Pandas natively.

Perfect for time-series & backtests.

📦 pip install duckdb

duckdb.org
Jun 6 19 tweets 3 min read
Top 15 Algorithmic Trading Strategies (and how they work) 🧵 Image 1. Pairs Trading

Trades two correlated instruments simultaneously. It goes long on one asset and short on the other to profit from deviations from their historical relationship, expecting the correlation to eventually resume.
Jun 3 9 tweets 4 min read
In 1987, Jim Simons launched his flagship Medallion Fund.

Over the next 40 years, it would grow 2,103,217%.

His methods are a secret.

But this is how you can use his principles to compete with Hedge Funds and win: Image In the 1980s, the common perception on Wall Street was that power brokers like Gordon Gekko were the way to get rich.

Traders were instinctual predators.

But a change was brewing. Image
May 29 4 tweets 2 min read
JP Morgan's Python training.

Available 100% for free: Image Here's the link on GitHub: github.com/jpmorganchase/…Image
May 21 8 tweets 3 min read
According to Ray Dalio, the easiest way to adjust for risk is to seek uncorrelated returns.

Ray's made billions from a simple idea.

Here's how to do it in a few lines of Python code: Image Step 1: Collect Stock Data

Run this code to download free stock price data from Yahoo Finance Image
May 17 8 tweets 3 min read
🚨BREAKING: A new Python library for algorithmic trading.

Introducing TensorTrade: An open-source Python framework for trading using Reinforcement Learning (AI) Image TensorTrade is an open source Python framework for building, training, evaluating, and deploying robust trading algorithms using reinforcement learning leveraging:

- numpy
- pandas
- gym
- keras
- tensorflow
May 17 8 tweets 3 min read
Quant hedge funds have an unfair advantage.

That ends on May 29th.

This is what's coming: 🧵 Image Quant hedge funds have an unfair advantage. They have:

1. Faster tools
2. Better data
3. Automated execution

This advantage is unfair. And this is what we are doing about it. Image
May 16 6 tweets 2 min read
Financial Statement Analysis with Large Language Models (LLMs)

A 54-page PDF: Image The paper investigates whether an LLM can successfully perform financial statement analysis in a way similar to a professional human analyst. Image
May 15 17 tweets 5 min read
12 Python libraries for free market data everyone should know: Image yfinance

Data for stocks (historic, intraday, fundamental), FX, crypto, and options. Uses Yahoo Finance so any data available through Yahoo is available through yfinance.

github.com/ranaroussi/yfi…
May 7 9 tweets 3 min read
80% of algorithmic trading success is in universe selection.

Yet most aspiring traders screw it up (I know from experience).

This is how I do it: Image 🔍 Why Universe Selection Matters

The assets you choose define the playground for your strategy.

A well‑constructed universe ensures liquidity, data quality, and diversification from the start.
May 4 8 tweets 3 min read
Every algorithmic trader is using ChatGPT.

But 90% are missing the best feature.

Here's how to 10X your algorithmic trading with ChatGPT. 🧵 Image 1. ChatGPT has a superpower

It's called: Deep Research.

It's your personal PhD-level research assistant with access to the internet.

And it's amazing for trading research.

This is how I use it for trading ideas: Image
May 4 7 tweets 3 min read
ChatGPT unlocks the cheat code to algorithmic trading with Python! Now any

This is how I made a Money-Printing Momentum Strategy in under 14 seconds: 🧵 Image 1. Start with a Prompt

This is the prompt I used:

"Make a momentum strategy in Python that allows me to analyze momentum for the full list of 500 S&P 500 stocks and compare them to a benchmark." Image
May 1 9 tweets 3 min read
Finance in Python is insane.

Check out the ffn (financial functions for Python)

Let's dive in: 🧵 Image 1. Getting data

With ffn it's easy to load financial data and plot. Image
Apr 30 22 tweets 6 min read
These 17 Free Python Github repos will teach you more about algorithmic trading than MIT, Carnegie Mellon, & University of Chicago combined.

Without costing you $250,000

(17 is the best) 🧵 Image 1. finoptions

Complete python implementation of R package fOptions with partial implementation of fExoticOptions for pricing various options.

github.com/bbcho/finoptio…
Apr 28 10 tweets 4 min read
🚨BREAKING: A new Python library for algorithmic trading.

Introducing TensorTrade: An open-source Python framework for trading using Reinforcement Learning (AI) Image TensorTrade is an open source Python framework for building, training, evaluating, and deploying robust trading algorithms using reinforcement learning leveraging:

- numpy
- pandas
- gym
- keras
- tensorflow