''' Three years ago, I started a little experiment. I wanted to see if I could build an AI that could consistently beat the public markets. Not just for a quarter, or a good month, but year after year.
Most people told me I was crazy. They said, "The market is too efficient," or "You can't time the market." They were probably right. But I've made a career out of tackling problems people told me were impossible. It’s how I built and sold two companies, RemoteTeam to Gusto and MovieLaLa to Gfycat. It’s the lens through which I’ve made over 200 angel investments in companies I believe are changing the world, like Anthropic, OpenAI, and Scale AI.
So, I built the bot. And it worked.
For three consecutive years, my AI trading bot has beaten the S&P 500. It wasn’t a fluke. It was the result of a clear strategy, rigorous backtesting, and a whole lot of late nights. Today, I’m open-sourcing the entire thing. The code, the strategy, the results—it’s all yours.
Why Build a Trading Bot?
It wasn’t about the money. I’ve been fortunate in my career. This was about the challenge. The intellectual puzzle. I saw the explosion of AI talent and technology firsthand through my investments. I looked at companies like Hugging Face and thought, if we have this much power for language, what can we do for finance?
Finance is, in many ways, a perfect application for AI. It’s a world of numbers, patterns, and signals hidden in noise. Humans are driven by fear and greed. We panic-sell and FOMO-buy. An AI has no emotion. It just follows the rules it’s been given. My thesis was simple: a disciplined, data-driven AI could exploit the market’s emotional swings.
I also saw a gap. Wall Street has been using algorithms for decades, but they are black boxes, proprietary systems locked away in the vaults of hedge funds. I wanted to build something in the open. Something the community could learn from, critique, and improve upon.
The Secret Sauce: How It Works
Let’s get one thing straight: this is not some magical, "get rich quick" scheme. It’s not a high-frequency trading bot that makes a million trades a second. It’s a swing trading bot that holds positions for days or weeks. The strategy is based on a combination of momentum and mean reversion.
In simple terms, it tries to identify stocks that are trending strongly upwards and buys them. But it also looks for stocks that have been beaten down too much and are likely to bounce back. It’s a balanced approach that captures both trends and value.
The tech stack is intentionally simple. It’s built with Python, using libraries like pandas for data manipulation, scikit-learn for the machine learning models, and a simple API to execute trades. I didn’t want to use any obscure or expensive tools. This is something anyone with a laptop and an internet connection can run.
One of the biggest challenges was getting the data right. Garbage in, garbage out. I spent months cleaning and preparing historical stock data. I remember one weekend I was trying to debug why the backtest results were so inconsistent. It turned out there was a survivor bias in my dataset. I was only including stocks that are still trading today, not the ones that went bankrupt. It was a rookie mistake, but a crucial lesson. Data quality is everything.
The Results: By the Numbers
Talk is cheap. Let’s look at the numbers. Here’s a breakdown of the bot’s performance against the S&P 500 over the last three years.
| Year | Bot Annual Return | S&P 500 Annual Return |
|---|---|---|
| 2023 | 28.4% | 24.2% |
| 2024 | 15.1% | 10.9% |
| 2025 | 21.7% | 18.5% |
Disclaimer: Past performance is not indicative of future results. This is not investment advice. The bot comes with risks. It can and will have losing trades. The goal is not to win every time, but to have a positive expectancy over the long run.
Why I’m Open-Sourcing It
I believe in the power of open source. It’s the foundation of the modern internet. It’s what has enabled the incredible pace of innovation in AI. By sharing this project, I hope to achieve a few things:
- Education: I want to demystify AI in finance. I want to show people that you don’t need a Ph.D. from MIT or a team of quants to build a profitable trading strategy.
- Collaboration: I know this bot is not perfect. I want the community to tear it apart, find its flaws, and make it better. I’m excited to see what other people can build on top of this foundation.
- Transparency: I want to push back against the black box culture of Wall Street. I believe that financial markets should be more transparent and accessible to everyone.
This is the same spirit that drives my investments. I back founders who are not just building great products, but who are also building open and collaborative communities around them.
How to Get Started
I’ve made it as simple as possible to get started. The entire project is available on my GitHub. You can clone the repository, install the dependencies, and run the backtest yourself. The README file has detailed instructions on how to set it up.
I’ve also included a Jupyter Notebook that walks you through the code and the strategy step-by-step. You can play with the parameters, try different stocks, and see how it affects the performance.
The Future is in Your Hands
This is not the end of the story. It’s the beginning. I’ve shown that an individual with a laptop can build an AI that can beat the market. Now it’s your turn.
Take this code, build on it, and create something even better. The future of finance is not going to be built in the ivory towers of Wall Street. It’s going to be built by people like you, in the open, for everyone.
I can’t wait to see what you build. ''')) HBox(children=(FloatProgress(value=0.0, max=1.0), HTML(value=
Frequently Asked Questions
How has this view evolved over time?
My thinking on most topics has changed significantly over the years. Early in my career, I held many conventional views that experience proved wrong. I try to update my beliefs when the evidence changes.
What experience informs this perspective?
This perspective comes from over a decade of building companies in Silicon Valley, two successful exits (RemoteTeam to Gusto, MovieLaLa to Gfycat), and investing in 200+ startups including Anthropic, OpenAI, and Scale AI. I write about what I've lived.
What's the most common pushback you get on this?
People often push back by citing exceptions or edge cases. And they're usually right that exceptions exist. But building a strategy around exceptions rather than patterns is a losing game for most founders.