From the event: Mindstone London August AI MeetupHow can you use AI for Stock Markets
View event

How can you use AI for Stock Markets

Introduction

Hello everyone, I'm Sohail. I'm a machine learning engineer and I love to experiment and build systems with AI. And one such experiment that I've done recently is what I'm going to share with you today.

Alright, who here thought of making money with AI? I'm pretty sure most of us have thought once the AI has released, how can we make money with this? And if we can make money in our sleep, then it's great.

But I'm not selling anything, or this is not an investing advice at all. This is just the experiment that I ran.

The Experiment: Can AI Beat the NASDAQ?

Okay, so the whole premise is there is a lot of ways to make money with AI. So can we make money in the stock markets using AI is the whole premise. And the experiment is given $100 ,000 to AI, can it beat the benchmark NASDAQ? That's the whole point.

Beating the benchmark NASDAQ is very important. The reason being, if you conduct any kind of experiment in stock market, if it is not beating the index, that is S &P 500 or NASDAQ, then there is no point of running the experiment. You can just invest your money in the index, in ETFs, and just forget.

So the whole point is, the first thing is, can AI beat the benchmark, benchmarks written? And initially, I thought of running this experiment for 30 days. But it has been extended to 60 days.

And the other thing is, which AI to choose? There are a lot of frontier models out there.

Before that, I know what you're thinking, whether I've got $100 ,000, no. This is just a demo account that I've used, which is all paper money in simulated environments.

Paper Trading Setup and Ground Rules

Choosing the Models (and Making It a Competition)

Now, before selecting any AI, there are a lot of thousands of AI models out there, open open source to all closed frontier labs and frontier models. And I've narrowed down to three, which are most famous ones and which I think most of us know, which is ChatGPT, Cloud, and Gemini.

And instead of choosing just one, I went ahead and did a little competition between these three. Like I've given $100 ,000 to each of these AIs and created a similar environments exactly the same environments to all of these with the prompts etc like all the knowledge except the decision making capability everything in the environment is same so that they get level playing field so out of chat gpt gemini and claude who do you think think won or who do you think won the end of the experiment or made the most money?

Audience Poll: Who Will Win?

Can you guess? You can scan the QR code and you can vote. Okay.

We have got Claude, okay. Okay. So most of the Claude users are I think the room is filled with Claude users. I myself am a big fan of Claude. Use it on a daily basis. So I get that.

Probably maybe 10, 20 seconds more. Okay. Is everyone done? All right. I'll stop it right there. there. I think most of the room agrees that Claude might have won the experiment. I thought the same and I will show you the results.

I hope you guys can see this. I know.

Results Snapshot and What Not to Conclude

Gemini did really great for itself and Claude is not doing great. Claude is ranked last and And Gemini is the first, and Chargivity is the second.

I think returns is not something that you should take away from this.

So I'll explain the whole dashboard and setup, right?

Stock Universe and Decision Journal

The universe of stocks is just nine tech stocks, which is Apple, Microsoft, NVIDIA, Google, Amazon, Meta, Tesla, Broadcom, and Oracle.

and so AI takes decisions on basis of publicly available information, news, analyst ratings, etc. and I think these are the positions it has right now and the returns and each every day it it gives why it has taken a particular action.

For example, yesterday, I think ChatGPT sold NVIDIA because of these reasons. Claude just held on to its position. Gemini also held on to its positions.

So this is kind of a journal that it kind of gets appended on a daily basis on why it has taken a particular position, decision, et cetera.

System Architecture: Agents, Data, and Execution

Now, I know what you think on what basis it has taken these kind of decisions. So, we'll spend a bit more time on the architecture on how it is being built.

So, once the U .S. market opens, since all of it is U .S. stocks, a cron job runs which fetches data from Yahoo Finance, finance, all the price -related information, history, news, its financials, analyst ratings,

and it also has access to read its own trades and learn from its own mistakes. So there are two agents, which is one is research agent, which does all kind of research, and And it submits this research to a decision agent,

which then decides how much to buy, how much to sell, which is all AI, by the way. I do not even tell it to do or tell it all the information or what to buy or what to sell.

It is all AI. AI takes the decision, position sizing decisions, when to buy, when to sell, et cetera.

Risk Controls: The Validator and Position Limits

And validator, the reason for this validator is early in the experiment, I had a very interesting observation that is Gemini always wanted to buy Google, and given $100 ,000, it was going all in on Google, which is something that I'm pretty sceptical of.

And then I made this validator, which is just a bunch of rules, which is any stock should not have more than 20 % or 25 % of the positions. So given $100 ,000, any stock should not have more than $25 ,000 allocated.

Then, after this validator, it kind of decides, and AlpacaTrader is something that I've been using for APIs, et cetera, so you can set up your own demo account and connect it to APIs.

Dashboard, Deployment, and Workflow

This left side is all the dashboard, so the dashboard that you see, after the stock market ends, the cron job runs, and this dashboard renders. So that's the whole architecture, and it is all deployed in GitHub pages. So GitHub pages is free if you want to deploy.

So these are all tools, et cetera.

So all the research prompt, decision prompts, everything is the same for AIs, the tool access, the prompts are exactly the same. time, only the difference is their own decision -making capability on a given day.

Costs, Tools, and Model Versions

So this was the cost. I think there was no deploying cost or any other cost, and since 100 ,000 is not mine, so there is no cost in that as well. Sorry about that. All right.

So the only cost is API cost, which is it came around $20 each, and these are the models that I've been using. I should have used frontier models, but frontier models was spending a lot of time taking decisions, et cetera, and the API costs were bubbling up, so I didn't want that as well.

So for ChatGPT, it's GPT -5 Mini, Claude, it's Haiku, and Gemini, it's Flash 2 .5.

Key Observations About Each Model’s Trading Style

And these are the takeaways that I found out running this experiment.

I think ChatGPT reacts too much. It kind of trades a lot based on the news, and it reacts a lot.

And Claude, it analyzes too much rather than buying stuff. stuff, it analyses too much, and Gemini, it is just like a patient investor who just waits.

So this is the characteristics that I found out.

So again, the whole takeaway is you should not see or take away that returns that I've shown because you don't know me, I must have manipulated the numbers, et cetera.

Conclusion: Experiment Before You Invest

The whole takeaway is, with all the AIs, everything was built by cloud code. And with all the AIs that you have got, if you have got a strategy, I think you should experiment before putting your money anywhere. Because experimenting is really fast these days.

So I think that's the only takeaway that you should take from this talk.

Connect and Next Steps

experiment before deploying any kind of money so yeah um yeah we can connect linkedin instagram youtube i also host a podcast so if anyone wants to be my next guest you're most welcome

Finished reading?