Quant Science Profile picture
Feb 23 8 tweets 3 min read Read on X
Machine Learning is the secret ingredient in my algorithmic trading.

Here are 5 steps to get started (with Python code): Image
1. Define the Problem and Gather Data

Start by deciding what you want to predict (e.g., stock price direction, volatility) and collect relevant data (e.g., historical prices, volume, economic indicators). Use APIs like yfinance or Alpha Vantage for financial data. Image
2. Preprocess and Feature Engineering

Clean the data (handle missing values and incorrect prices) and create features like moving averages, RSI, or lagged returns to give the model predictive power. Image
3. Choose and Train a Model

Pick an ML model for trading (e.g., regression for price prediction, classification for buy/sell signals). Split data into training and testing sets, then train the model. Image
4. Evaluate and Optimize

Test the model’s performance using metrics like accuracy, precision, or annualized returns. Tune hyperparameters to improve results and avoid overfitting. Image
5. Backtest and Deploy

Simulate the model’s performance on historical data to estimate profitability and risk. If successful, integrate it into a trading system with proper risk management. Image
Want to learn how to get started with algorithmic trading with Python?

Then join us on March 5th for a live webinar, how to Build Algorithmic Trading Strategies (that actually get results)

Register here (780+ registered): learn.quantscience.io/qs-registerImage
P.S. - Want Algorithmic Trading with Python tutorials every Sunday?

Register here to join our Sunday Quant Scientist Newsletter (it's free): learn.quantscience.io/quant-scientis…

• • •

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_

Sep 7
David Tepper has generated average annual returns of 28% since 1993.

But with Python, you can do it too.

This is how to make a David Tepper algorithm with Python: 🧵 Image
Here’s a “Tepper-inspired” macro risk-on / risk-off allocator in Python.

It leans on public, high-level principles often associated with David Tepper’s approach (credit spreads, macro regime, volatility)
1. Start with the Params class

This instantiates key signal settings like VIX moving average, crisis z-score, and credit spread settings. Image
Read 11 tweets
Sep 6
🚨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
Sep 3
Nothing beats the feeling of executing dozens of trades from Python via API.

All you need is:
1. Python
2. Interactive Brokers

Want to learn how? Image
🚨 LIVE 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
Read 4 tweets
Sep 2
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…
pandas-datareader

pandas-datareader used to be part of the pandas project. Now an independent project. Includes data for stocks, FX, economic indicators, Fama-French factors, and many others.

pandas-datareader.readthedocs.io/en/latest/
Read 17 tweets
Sep 1
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
Aug 31
The 5 things you need to start algo trading:

1. One trading strategy
2. A $500 computer
3. A broker with an API
4. An internet connection
5. The Python Quant Scientist Stack

That's it.

Want to learn how? Image
🚨 LIVE 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
Read 4 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!

:(