Quant Science Profile picture
Jan 25 8 tweets 3 min read Read on X
A 23-page research paper reveals the number 1 method Hedge Funds use to beat the market:

Time Series Momentum

This is how: 🧵 Image
1. What Is Time Series Momentum?

Time Series Momentum (TSMOM) bets on trends continuing. If a stock’s up, buy more; if down, sell. A 2011 study of 58 assets proved it works! Image
2. The Data Behind the Strategy

The TSMOM paper analyzed equities, currencies & more. T-stats showed consistent profits across 1-month lookbacks! Image
3. Coding TSMOM with Python

Code TSMOM in Python:
- Use yfinance to get data
- Then momentum = price[-1] / price[-20] - 1.

Positive? Buy
Negative? Sell Image
4. Real-World Performance

TSMOM outperforms passive investing.

We're using a modified version of TSMOM in our Hedge Fund.

One backtest shows 3500% return vs 450% S&P500. Image
We are using TSMOM in our hedge fund.

And we'd like to share exactly how it works.

Want to see how we built our hedge fund in Python?

Then join us for our free training:
🚨 FREE Python Algo Trading Workshop: Learn how we built our hedge fund

• QSConnect: Build your quant research database
• QSResearch: Research and run machine learning strategies
• Omega: Automate trade execution with Python

👉 Get the system: learn.quantscience.io/become-a-pro-q…Image
That's a wrap! Over the next 24 days, I'm sharing my top 24 algorithmic trading concepts to help you get started.

If you enjoyed this thread:

1. Follow me @quantscience_ for more of these
2. RT the tweet below to share this thread with your audience

• • •

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

Keep Current with Quant Science

Quant Science 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 @quantscience_

Jan 22
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
Step 2: Convert Prices to Returns

Using pandas code, we can get returns (just run this code): Image
Read 9 tweets
Jan 11
Python is wild for finance.

You can get FinViz in Python for free (this is how):

(a thread) Image
1. What is finvizfinance?

finvizfinance is a package that collects financial information from FinViz website. It has:

- Stock charts, fundamental & technical information
- Insider information
- Stock news
- Forex charts
- Crypto charts

Here's some examples of what you can do: Image
2. Stock Quotes, Charts & Fundamentals

Getting information (fundament, description, outer rating, stock news, inside trader) of an individual stock. Image
Read 10 tweets
Jan 8
Automate your trading strategies in Python

How to build your first trading bot:

(a thread) Image
1. What is a trading bot?

A trading bot is a software program that automates buying and selling financial assets like stocks and cryptocurrencies based on pre-defined strategies and rules.

These automated systems can manage portfolios without human intervention, operating 24/7.
2. Let's make a Bitcoin Trading bot

We'll use investing-algorithm-framework in Python Image
Read 11 tweets
Jan 7
🚨BREAKING: A new open-source multi-agent LLM trading framework in Python

It's called TradingAgents.

Here's what it does (and how to get it for FREE): 🧵 Image
1. What is TradingAgents

TradingAgents is a multi-agent trading framework that mirrors the dynamics of real-world hedge funds.
2. How it works

By deploying specialized LLM-powered agents: from fundamental analysts, sentiment experts, and technical analysts, to trader, risk management team, the platform collaboratively evaluates market conditions and informs trading decisions
Read 8 tweets
Jan 6
🚨 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:
1. Run machine learning models using scikit-learn and xgboost.

2. Create models for analyzing the markets with MarketFlow.

3. Predict sporting events with SportFlow.

4. Develop trading systems and analyze portfolios using MarketFlow and Quantopian’s pyfolio.
Read 12 tweets
Jan 4
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
The signals for when to go short, when to cover shorts, when to go long, and when to close longs are all linked to these recurring monthly cycles.

This periodic "flow" of signals—month-in, month-out—creates a systematic pattern. Image
Read 10 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!

:(