원문 보기
What if you could build an AI trading bot which trades like one of the most famous investors of all time, Warren Buffett, who's worth 142 billion dollars? What if you could take the entire investing framework that he used to grow Berkshire Hathaway and condense it into an AI model that you could then trade with?
And then what if you gave it a hundred thousand dollars to see what it could do with your money? Well, the good news is today you're going to find out because now this is genuinely possible. Right here I have the code to make Claude behave Warren Buffett based on the entire internet, thousands of articles, his investing style, what he said in interviews, what we can see through official Berkshire Hathaway reporting transactions, how he made decisions at the time based on the market.
The entire history of Warren Buffett condensed into a system that we can run on Claude to both researching positions for fundamental analysis to full execution in the style of Berkshire Hathaway. Now, before we get into it, I want to caveat the video by saying, of course this isn't the real Warren Buffett.
We don't know exactly what he would do. This is trained to behave like he would behave, but at the end of the day it's not going to be one-to-one. So, please don't put your life savings into a bot like this and you know assume it's going to be perfect. The whole point of this is to experiment and see how it behaves and see whether it can actually make money.
Now, the entire experiment starts with a GitHub repo which is free called AI hedge fund. This has 63.7 thousand stars and it's essentially an AI hedge fund team. The original contributor is Virat, the founder of Financial Data Sets, which enables you to connect your agent to the stock market. So, it's powered with all the financial data needed to make decisions from congressional reports, inside trading, earnings, and live market data.
Currently, this contains the logic to analyze positions. It contains a variety of analysts. So, you've got Warren Buffett, Charlie Munger, Benjamin Graham, some of the most famous analysts of all time. But, they're slowly adding more analysts and soon they're adding an always-on mode. So, a persistent mode.
So, you could literally have a hedge fund in your pocket. Right now, if you want persistence, you would need to run it on a VPS, and you would need to schedule certain tasks like portfolio reviews and market analysis and alerts, which is possible, but this is evolving over time. So, we're still at the early stages of this.
So, what I did is I downloaded the GitHub. I'll leave a link in the description below my free school community. All the resources from these videos go there. So, you can just take the dot md file and drag it into Claude. It'll automatically set up the hedge fund with instructions. So, I've installed the AI hedge fund repo onto Claude code.
Now, I'm going to ask Warren Buffett a question. So, I said, "Get Warren Buffett on the line. Run only his signal from the AI hedge fund on Apple as of today. Give me his answer in his own voice, the verdict, confidence, and why." This is tapping into the Buffett agent JSON profile and the instructions that are part of the repo.
Now, it automatically defaulted to Opus 5, so I just told the model to use Fable 5.1 because I want the smartest model when it comes to analyzing financial stuff. Just keep in mind, it's going to be a little bit more expensive. So, if you are running automated scheduling, analyzing lots of stocks, it's going to cost you way too much running Fable the entire time.
So, you might want to drop down the model if that's the case, but I want to use the smartest model for the example of this video. So, Warren Buffett has just given me his Apple analysis. Verdict, neutral. Confidence, 60%. In his words, "This is a finer business as I have ever owned. Returns on equity above 100%.
Gross margins widening towards 49%. Free cash flow per share running ahead of reported earnings and revenue growth re-accelerating to 14%. The moat of the ecosystem and the pricing power are plainly visible in the numbers, and management keep shrinking the share count sensibly. My hesitation is entirely the price.
At 35 times earning and a $4.5 trillion market cap, the market is already paying for many years of continued excellence, leaving little margin of safety if growth reverts to the mid single digits we saw a year ago. I would happily hold what I own for another decade, but I would not be a buyer at this level.
A wonderful company at a full price earns a hold, not a purchase." All right, that's his opinion on Apple. Now, I'd like his opinion on Nvidia. Warren has a slightly lower confidence score for Nvidia versus Apple. And this is because he thinks that history suggests that the margins they're operating on rarely survive a full cycle.
I cannot tell you with confidence what this business earns in 2036. And when I can't see 10 years out, I sit on my hands rather than pay $5.4 trillion for what may be peak earnings. Different objection from Apple. There it was price, here it's whether the margins are durable. He concedes the multiple is reasonable and still won't touch it because he can't see a decade out.
Okay, so that's individual stock analysis. But what we can also do is give him a variety of tickers and populate his response into a table. So, now I'm going to ask him to analyze a variety of stocks at once. So, you can see he's rated every single ticker with a confidence level. And no surprise, Coca-Cola number one, one of his best trades of all time, confidence level of 68%.
A wonderful business at a fair price beats waiting for a discount that may never come. Meta he's bullish on, a toll bridge on human attention at 22 times earnings if the CapEx eventually shows up as cash. Then he's got Apple, Palantir, and interestingly the most bearish ones are Tesla at 82%. 364 times earnings for a business earning 5% on equity.
He buys earnings not stories. And MicroStrategy, not a software business anymore, book value collapsed from $195 to $80 a share and the price rests on hope. So, if you're interested, you could literally take your portfolio or stocks you're interested in and get the opinion of Buffett. So, now we're going to give Warren Buffett a $100,000 fund to run.
He's the only investor in it, so he needs to decide the allocation. And he can select any stock from the S&P 500. We're going to run this first, then we're going to run a backtest. So, we're going to see retroactively based on a snapshot how he would have performed over the past couple of years. And then lastly, I'm going to show you how to automate this and connect it to a real trading account if you wanted to run a real experiment.
And I'm actually going to set it up for myself. So, let's get into it. So, Warren Buffett looked at the top 100 stocks, six had too few filings because I need to upgrade my data plan to the paid plan if you want to go back more years in terms of historical data. So, he could analyze 93 of those stocks.
He said yes to 24, no to 10, and nice, but not at this price to 59. So, these are the 24 that he invested in. Microsoft at the biggest waiting, price fell while the business got better. That's what a patient owner hopes for. MA, AXP, TJX, PGR, some of the bigger names, Netflix, Meta, Procter & Gamble, IBM with the smallest waiting, but still on the list.
And then there are a few businesses he said were great businesses, but at the wrong price. And then a few businesses that he said weren't his kind of business. He's actually holding a smaller percent of cash, only 3%, which is slightly contradicting his current positioning in the market, although he has been deploying a little bit more recently.
And that entire run cost around $4 on Fable. It would have been a lot cheaper if we did it on Opers, and that's what I'd recommend if you guys want to experiment with this stuff. So, now for the penultimate prompt, we're going to ask him to do a back test to see how he would have performed with a snapshot from the 1st of September in 2024 until today.
So, he doesn't have access to what happened since. He has to look at the snapshot, see how he would have allocated, and we could see based on $100,000 what that would be worth now, and how that would compare to just buying and holding the S&P. And then what we're going to do is we are going to get him to define a strategy for the next 2 years, and we're going to put that into a real trading environment.
And I'm going to show you how you can connect analysis like this to create an executable trading plan that can be automated on your behalf if you would like to do so. Because I want the most accurate data possible, I'm going to upgrade the plan here so I can run a full back test. So, I just spent 200 bucks for you guys to actually test this out.
I'm going to leave a link in the description to FMP, which is another data set provider that you can use. They actually have a discount code for that you could plug in to the same JSON if you didn't want to use financial data sets, or you just want to a discount on another data provider. All right, so that took a while.
We have the full backtesting results, but I'm actually asking Claude to turn it into an HTML dashboard so we can actually track his performance versus the S&P 500. So, here we go. Here are the final results. Warren Buffett over the past 2 years, can he beat the S&P 500? We can see Buffett's fund is here in the green.
The S&P 500 is in the blue and it did a total return of 39.2% versus the S&P at 34.8%. So, if you were following Buffett's AI hedge fund, you would have beat the S&P 500. And annualized, this is at an 18.3% return versus a 16.3% return. Max drawdown, this is actually really where it gets interesting that the risk-adjusted returns were better.
Max drawdown 5.8% S&P 8% and he only held 26 stocks out of the top 100. So, here is the final list that he picked. He had American Express as his top position and the most bullish next to Microsoft. The majority of money was actually made on his Google position. So, his best call was Alphabet plus $5,000, 114% return.
And his worst call was only minus $2,000. His verdict, 2 years in we beat the index by about four points with a shallower drawdown and we did it owning payment networks, insurers, banks, and a few franchises anyone could explain to a child whilst passing on Nvidia and Tesla every single month and sleeping well.
My mistakes were the ones I always make, paying a fair price for a business whose growth had already gone quiet as with Accenture and I'd rather have that error than the one where you pay any price for a story. I would change nothing about the method, but I might trade less. 500 orders in 2 years is more shuffling than a patient owner needs and the results came from 20 names I barely touched, not the trimming around them.
Very, very interesting and you can see we can actually click month by month and see the growth of his portfolio versus the S&P. But now, let's say going forward, we actually wanted to automatically execute his trades on an exchange. Then I could say something like, "Could you turn Warren Buffett's strategy from now onwards into an executable strategy that I can run in Alpaca with Warren Buffett as the brain being powered by Claude Fable 5.1.
So, what I've got Buffett to do is read my Alpaca account, my current positions where I have Microsoft, Apple, and Meta. This is on a paper account, obviously. I could toggle it over to real if I wanted on Alpaca, but I want to use paper for the example of this video. So, if I say, "Yes, make the changes," he will now make changes to my portfolio based on how he would run it.
And what I could do is I could set a schedule that runs on a particular cadence. So, let's say once every 24 hours or once every 2 days, he would review my portfolio and make changes on his own accord. And the way I would do this is setting it up through a VPS. So, either an always-on computer that I have or a server, so a computer that is always-on.
So, if I close this computer, it can actually do the scheduled runs. And I would just give the Claude session access to my Alpaca account API and it would be executing on a loop. So, if I ask it to execute the changes, then you'll actually see my account being edited in real time as well. So, if I refresh my Alpaca account, you can see that all of the orders have been adjusted to rebalance into the portfolio that Warren Buffett would like.
And you can see that my existing positions have been adjusted as well. So, I find the concept of this stuff really, really cool. Now, obviously, I'm not going to give my real portfolio over to a JSON version of Warren Buffett. You would still want to use discretionary nous. You would likely still want to execute your own strategy unless you did want to run this as an experiment.
I think it's a great example that we have the intelligence of almost an AI fund given the fact that you have all of these data sources you can plug into AI now AI now and you have inference and execution now being automatable by AI. We're really in a new era and this stuff is really fun to play around with.
So, if you want to check out the repo in my free school, I've got the MD file you can install into Claude if you want want it out and try it out. And I recommend just experimenting with the stuff on a paper account. Maybe you don't burn through so many tokens like I did today on Fair Value 5.1. Maybe use a cheaper model for your experimentation and check out and and see what it can do.
And the next phase, and something I'll be teaching on the channel, is bringing automated execution to your real exchange accounts. But that's only something that you can really do once you have developed a strategy and once you have experienced what it's like to trade paper. So, today's video was really fun.
Really enjoyed making it. I'll see you guys in the next one. Subscribe if you enjoy content like this. Peace out.

Comments 0