The Quant's Playbook

The Quant's Playbook

Share this post

The Quant's Playbook
The Quant's Playbook
A Junior Quant's Guide to Generative AI (That Actually Works)
Copy link
Facebook
Email
Notes
More

A Junior Quant's Guide to Generative AI (That Actually Works)

If you're gonna use ChatGPT, you might as well do it right.

Quant Galore's avatar
Quant Galore
Jun 08, 2025
∙ Paid
10

Share this post

The Quant's Playbook
The Quant's Playbook
A Junior Quant's Guide to Generative AI (That Actually Works)
Copy link
Facebook
Email
Notes
More
2
Share

ChatGPT is a great thing — arguably one of mankind’s greatest creations since the Internet itself.

While it’s phenomenal at general tasks and high-level reasoning, when it comes to trading, things get a little bit more nuanced.

Most of the time, when a paper or strategy uses GPT, it’s riddled with lookback-bias, unrealistic assumptions, or just plain naivety.

However, it doesn’t have to be that way.

Today, we’re going to get our hands dirty and explore how to use these tools effectively for real-world, practical quantitative trading.

We’ll run the full gamut from actionable prompts that generate fresh insight, to solving some tricky data engineering problems, and ultimately integrating it all into a live, profitable quantitative trading strategy:

This one’s going to be exciting — and we promise you’ll walk away with something valuable.

So, without further ado, let’s get right into it.


Big shoutout to @quant_arb over at

The Quant Stack
— his Building an AI Agent Hedge Fund served as an inspiration for some of the ideas we’ll cover. Definitely worth checking out!


Just How Smart Is GPT, Really?

If you’re going to be frequently using generative AI tools, one thing is certain: you’ve got to do some of the groundwork yourself.

If you just ask it to “create a profitable strategy”, it’s likely to regurgitate the most upvoted comment from a Reddit thread — something that sounds clever but absolutely doesn’t work.

So instead, we’re going to start with a strategy that already works.

To do that, we’ll pull inspiration from our time series momentum strategy:

A Junior Quant's Guide to Time-Series Momentum

A Junior Quant's Guide to Time-Series Momentum

Quant Galore
·
May 18
Read full story

Prompt:

“We have the following quantitative trading strategy: every month, we first pull the stocks with liquid, weekly option listings. This basket is created to isolate the most actively traded and relevant names.

From this list, we create a momentum score to rank past performance characteristics into top-and-bottom deciles.

At the start of each month, we hold the top-decile for the duration of the month and then rebalance at the end of the month.”

This prompt simply stores it in GPT’s context window so that we don’t have to keep re-explaining it.

Now, this strategy already holds up well as-is. Just for reference, here’s how the top-decile performed out of sample in the month prior to this writing:

Again, we invite and encourage you to replicate this yourself and even verify it in real-time: Time Series Momentum GitHub | Quant Galore

That said, while the strategy already works well, we wanted to see if we could push it a bit further:

  • What if we didn’t have to wait 30 days to realize PnL?

    • Could we pivot to intraday exposure?

    • Could we flip weekly options instead?

  • Could we surface even better stock selections?

For our first experiment, we’ll give the intraday angle a shot. It’s definitely noisier, but by expanding our universe to the scrappier small-caps — names that may not have weekly options but can still move — we open ourselves up to way more optionality.

To kick things off, we’ll return to GPT. But just like before, we’re not expecting it to do all the work.

Here’s the simple intraday framework we’ll use:

  1. Instead of using 12-1 historical data (the past 12 months, excluding the most recent), we’ll just look at market open to noon.

  2. From there, we calculate a momentum score over that window.

  3. Then, we rank by those scores and go long the top 3 each day before selling at market close.

  4. Repeat.

Now, remember, while there are just a few hundred stocks with liquid weekly options, there are thousands of stocks without them.

Even after filtering for stocks with at least $5 million in notional volume on each historical day, we’re still left with around 2,500 U.S. stocks to process.

If we want to run this over just one year, that’s roughly 98,000 data points per stock (390 minutes × 252 trading days). Across 2,500 tickers, we’re talking about ~245 million rows — easily over 30GB. And with RAM usage scaling with disk size, unless you’ve got a machine packing 100+ GB of memory, good luck storing that all at once.

Thankfully, this is where GPT shines — tackling well-defined, closed-end problems. And data engineering like this is full of them.

So the question becomes: GPT, how can we work with this data without frying our entire machine?

Now, if you’re working with GPT a lot, you’re just not going to be typing out these well-structured long, descriptive prompts every single time.

Most of the time, it looks more like this:

Before using GPT, the original script for collecting this data had an estimated completion time of over 3 days, and it only got slower as RAM pressure increased.

However, after passing in the script and having GPT replace a few lines with saving to parquet and a few other RAM tricks, the estimated runtime dropped to just 22 minutes.

For closed-end problems like this (i.e., “how do I make the machine do X?”), GPT is a godsend.

So, we’ve got the data, the infrastructure, and the model — now let’s make our fortune.


If you’re already a paid subscriber, truly — thank you. ❤️ Your support powers better data, better tools, and better research.

If you’ve been enjoying the work and want to support what we’re building, consider becoming a paid subscriber. It means more than you think and helps us keep doing it right. 🫡


Keep reading with a 7-day free trial

Subscribe to The Quant's Playbook to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Quant Galore
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More