How To Build A Self-Improving AI Trading Agent (Insanely Cool) — Transcript
Full transcript
- 0:00The holy grail for AI trading agents is
- 0:03having an agent that's able to learn
- 0:05from its mistakes and make improvements
- 0:08on the strategy or with the vision of
- 0:10becoming more profitable. The thing is
- 0:12is that most AIs that you interact with,
- 0:14they are very simple. You give [music] a
- 0:16prompt, they give an output. But what
- 0:18we're going to do today is use an
- 0:19extremely powerful AI that automatically
- 0:22learns from all the engagements that you
- 0:24have with it and I want to see if I can
- 0:26apply that self-learning behavior to a
- 0:28trading strategy. So instead of it being
- 0:30prompt outcome, instead, we're going to
- 0:33produce a prompt that creates a strategy
- 0:36that creates an outcome it can learn
- 0:37from and therefore creates a new prompt
- 0:40to build into the strategy again. What
- 0:42we have is a self-improving trading
- 0:44agent. You're going to have it running
- 0:4624/7 and I've even made it so you can
- 0:48just simply copy and paste one single
- 0:50prompt, put it into your AI and it will
- 0:52set this whole thing up for you. And the
- 0:54AI itself that we're using today is
- 0:56completely free. It does this
- 0:58self-teaching process, this
- 1:00self-improvement process for free. So
- 1:02right after you subscribe,
- 1:04let's get into it. Now I've been doing
- 1:06this a little while and I know that
- 1:08whenever you want to create a
- 1:10self-learning or a self-improving
- 1:12process with Claude, for example, you
- 1:14have to describe how it's supposed to
- 1:16improve itself. And so it's it can get a
- 1:19little bit laborious. It's very boring
- 1:21and it's very frustrating because the AI
- 1:23doesn't quite understand it. However,
- 1:25there's a new tool that has come out
- 1:26over the last couple of months that's
- 1:28been really lingering in the background
- 1:29and today I've just seen the massive use
- 1:31case for it in trading and it's called
- 1:33Hermes agent. have heard of like open
- 1:35Claude, this fully autonomous
- 1:37thing that's just took the world by
- 1:39storm. Well, Hermes in the background is
- 1:41being touted as even better than open
- 1:43Claude because of this self-learning
- 1:45process. But Hermes agent on its own
- 1:47isn't going to do all the work. We
- 1:48actually have to put some smarts into
- 1:50this and this is what I do. I architect
- 1:52agents to do exactly the thing I want
- 1:54them to do. And so there were four
- 1:56criteria that I came up with with
- 1:57regards to what makes a good trading
- 2:00agent. And I came up with these four.
- 2:03So, number one, it has to be accurate.
- 2:05Number two, it has to be reliable.
- 2:07Number three, it needs to have a very
- 2:09well-defined goal. And number four, it
- 2:11needs to be self-improving.
- 2:13It needs to learn from its mistakes.
- 2:14>> [music]
- 2:14>> Now, let's first talk about the accuracy
- 2:16element because when I say accurate, I
- 2:18mean is the data that's coming in
- 2:20accurate in the first place? Are we able
- 2:22to take that information in reliably and
- 2:24consistently over time? And when we feed
- 2:26that information to Hermes agent, is the
- 2:28information actually accurate? Over the
- 2:30last couple of weeks, I tested every
- 2:31single AI that is in existence. And I
- 2:34tested them on their ability to do
- 2:35trading. And one of the most shocking
- 2:37results from that is the inaccuracy in
- 2:39the data. They're all supposed to be
- 2:41pulling information from the same place,
- 2:43but some AIs just don't do it properly.
- 2:46And so, there is inherently an accuracy
- 2:48issue. So, we need to make sure that
- 2:49that is resolved, and we will resolve it
- 2:51in this build. So, when we're trying to
- 2:52get accurate data through, we need to
- 2:54make sure that the API connections are
- 2:56very strong and reliable. We also need
- 2:58to make sure that if we're pulling in
- 2:59information from news feeds, for
- 3:01example, that that information is also
- 3:03accurate because the AI can sometimes
- 3:05interpret text in different ways. If you
- 3:07give the same article to multiple
- 3:09different agents, they might have
- 3:10different things to say and different
- 3:12conclusions. So, we need to make sure
- 3:13that there are rules in place so that
- 3:15the conclusions are accurate and ideally
- 3:18accurate and objective. And that brings
- 3:20me on to the reliability section. We
- 3:22need this agent to be reliable. So, what
- 3:24do I mean by reliable? I would say that
- 3:26reliable is it's always operating 24/7.
- 3:29And even if our computer goes down or
- 3:31turns off or closes, and it's still
- 3:33executing on the system that we're going
- 3:35to build today. We have also solved that
- 3:37issue in the one-shot prompt. Now, it's
- 3:38incredibly important that we move on to
- 3:40number three, and that is that we have
- 3:42to make sure that the agent has a
- 3:43well-defined goal. So, let's talk about
- 3:46goals a little bit deeper because it'll
- 3:47make all the sense in the world to you
- 3:48in just a second. So, we need to define
- 3:51in terms of a goal, obviously there is a
- 3:52destination. Most people, I'd say 90% of
- 3:55people right now, if you're creating a
- 3:57trading strategy, don't have a
- 3:59destination, don't have a definition of
- 4:01what achieving the goal actually looks
- 4:02like. And so, in light of being thorough
- 4:05and actually accurate and actually
- 4:06having a good agent, so we need to
- 4:08define what is success and what is
- 4:11failure. Now, it might sound a bit
- 4:12abstract, but in fact, we need this
- 4:14information. What is success in the
- 4:16strategy? Is success making $10 a month?
- 4:20Is success making a million dollars a
- 4:21month? Obviously, you have to operate in
- 4:23the in the realms of what's possible. An
- 4:25example of something that would be
- 4:26impossible would be like saying I want
- 4:28to make a million dollars a month and
- 4:29here's $10 to start with. So, what is
- 4:32success? And the more details you can
- 4:33give here, the better. Like, if you know
- 4:35anything about sharp scores, which is
- 4:37essentially
- 4:38a score that relates to the
- 4:40profitability of a trading strategy, you
- 4:42would might want to put a specific sharp
- 4:44score into the agent as a goal, right?
- 4:47We want to work towards this goal. Cuz
- 4:49if you think about it, this agent's
- 4:50going to be doing a thing, getting
- 4:52feedback, and then improving the thing
- 4:53to do it again. And it's going to do
- 4:55that over and over and over again until
- 4:57that goal is achieved. And so, we need
- 4:59to define the goal, right? But we also
- 5:00need to determine what is failure, what
- 5:02does failure look like? And what So,
- 5:04what the agent will be able to do in the
- 5:05end is almost like look look at where it
- 5:08is in its current results and say,
- 5:10"Okay, anything in this direction is
- 5:12towards the goal and this is good, and
- 5:14anything in the wrong direction, away
- 5:16from the goal, closer to failure, is
- 5:19bad." [music] And it's with that goal in
- 5:21mind that number four comes in. And that
- 5:23is that it needs to be self-improving.
- 5:26So, it needs to be able to assemble and
- 5:28organize information properly. It needs
- 5:30to learn from the outcomes. It needs to
- 5:33analyze [music] the outcomes. Were they
- 5:34towards the goal or away from the goal?
- 5:36It then needs to form its own hypothesis
- 5:39about [music] why the result was the way
- 5:41it was based on the information it had.
- 5:43And then it needs to make a second
- 5:44hypothesis about what it should do next.
- 5:47[music] So, then, it should take that
- 5:49information and that learning, apply it
- 5:50to a updated strategy, and this updated
- 5:54strategy, I think, should follow the
- 5:55scientific model, which if you don't
- 5:57know what the scientific method is, it's
- 5:59essentially changing only one variable
- 6:01and then seeing the outcome. Because if
- 6:03you change a load of variables and you
- 6:04went more profitable, you wouldn't know
- 6:06which variable was responsible for that
- 6:08trade going well. And so, you only
- 6:10change one variable at a time and you
- 6:12run a series of tests. Every time you
- 6:14get one better, that is now the new
- 6:15baseline, and then you make iterations
- 6:17on that new baseline. And it needs to do
- 6:19this inherently. And so, all four of
- 6:21those things make up what I think is a
- 6:24good agent. So, now's the time that
- 6:25we're going to start creating this. I'm
- 6:27going to demo it for you from start to
- 6:29finish. The setup of this thing, the
- 6:31prompt, everything is completely free
- 6:33for you to use. I'm going to give you
- 6:34everything that you need to copy and
- 6:35paste and get this agent up and running
- 6:38with Hermes. Okay, so as always, every
- 6:40single prompt is freely available for
- 6:42you to copy and paste, and I hold them
- 6:44all in 01 Systems. It's my own free
- 6:47community that you can join right now.
- 6:49The link is in the top line of this of
- 6:50the description, and anytime I post any
- 6:52prompts in any future videos, the links
- 6:55and the prompts will all be in 01
- 6:57Systems. You'll come here to start with,
- 6:59you'll click classroom at the top, then
- 7:00we're going to click this big YouTube
- 7:02button. This is for all the YouTube
- 7:03video prompts, and you'll come across
- 7:05something titled something similar to
- 7:07this, self-improving trading agent,
- 7:09Hermes self-improving trading agent. The
- 7:11video will also be in here cuz you can
- 7:12see uh this is how I post it when it's
- 7:14live. And we'll open that up, and we're
- 7:16going to take this beautiful one-shot
- 7:19prompt. It is so nice. And by the way,
- 7:23all of the one-shot prompts that I give
- 7:25in my videos, they improve over time as
- 7:27well because we get feedback, people
- 7:28have certain issues, and then we improve
- 7:30them. So, the version that you're
- 7:32downloading right now or that you get in
- 7:3301 Systems will be the most up-to-date
- 7:35and the best one we've had so far, and
- 7:37it's only getting better. It's so cool.
- 7:40Okay. So, what we're going to do is
- 7:42we're going to come over to our
- 7:44terminal.
- 7:45And this is me in my terminal. I'm just
- 7:47going to increase the size so you can
- 7:48see it. Uh we're going to start a new
- 7:50session,
- 7:52which I do with dangerously skip
- 7:55permissions because I'm an absolute
- 7:57savage.
- 7:58Okay, and then here we are. We're going
- 8:01to we're in Claude and we're just going
- 8:02to paste in our one-shot prompt. So, get
- 8:05ready because the journey begins for
- 8:07your self-learning, self-improving agent
- 8:11that's going to run on Hermes. So, as we
- 8:13go through this process, we're going to
- 8:14do a series of phases, which you'll see
- 8:16on the screen right now. So, phase one
- 8:18was an environment check. What this
- 8:20does, it's really cool, is it makes sure
- 8:22uh it [music] knows which system you're
- 8:24on. Are you on a Mac or on a Windows?
- 8:26And depending on which one you choose,
- 8:27then it will take you on a different
- 8:28journey because there's different
- 8:29instructions for both. So, it said,
- 8:31"Okay, we can see that you're on a Mac
- 8:34and you've got Node.js installed and
- 8:35Claude on Claude code. Great. Step two
- 8:37of seven in phase two, which is defining
- 8:40the strategy, we're going to build your
- 8:41trading strategy now. Specifically, what
- 8:44success and failures look like. The The
- 8:46agent uses this file to score every
- 8:47trade." just vibes, it's just numbers.
- 8:50So, we have to now decide which asset
- 8:52are we going to be trading? Now, this is
- 8:53the moment where if you already have a
- 8:55strategy, you come down to number four
- 8:57and you actually you actually would say
- 8:59something along the lines of this, "Hey,
- 9:00I've actually already got a strategy and
- 9:03it's called the Wacko Alpha strategy.
- 9:06So, could you look for that in my
- 9:07computer and, you know, use that as part
- 9:11of this system?" Or alternatively, you
- 9:13could say, "I don't have a strategy. Can
- 9:15you just make me a basic one?" And it
- 9:17will make you a basic one. Uh like a a
- 9:19basic solid one that everyone kind of
- 9:21starts with and then you can let the
- 9:22agent improve it over time rather than
- 9:24you. Alternatively, you can build the
- 9:26strategy in this system. The onboarding
- 9:29agent will work with you to create a
- 9:31strategy, too. So, you could choose
- 9:33Solana or USD or Ethereum or Bitcoin or
- 9:35any asset. Uh but for now, I'm just
- 9:38going to say number four, I've actually
- 9:39already got a strategy. It's going to
- 9:41call in to my information about that
- 9:43strategy that I already have, and it's
- 9:44going to build out my documentation
- 9:46based on that, which I think is so cool.
- 9:48So, let's let this work for a little
- 9:50while. We're going to go on to phase
- 9:52three after it's found my Wacko Alpha
- 9:55strategy. You can see it actually has
- 9:56found it right here. And what's
- 9:57wonderful is I've created this strategy
- 10:00already, and it's got over a million and
- 10:02a half data points that it's analyzed.
- 10:04I've been running it for like six to
- 10:06eight weeks, just learning from the
- 10:08information. And I did that all
- 10:09manually, like instructing how to learn
- 10:12this stuff. But the Hermes agent will
- 10:14just learn it itself. So, it says what
- 10:16I'm seeing on the disk. I've got Wacko
- 10:18Alpha, the D Tau momentum and yield
- 10:21strategy. How do I How do you want me to
- 10:23incorporate Wacko Alpha into this Hermes
- 10:25deploy? Yeah, let's actually point it at
- 10:27the strategy. Like let's actually This
- 10:29is real money that's being traded, by
- 10:30the way. So, maybe this is maybe a bit
- 10:32of a mistake, but By the way, you can
- 10:33see the progress of my 50,000 pounds to
- 10:36500,000 pounds in a year challenge that
- 10:38I'm doing. I'll call it the the 10x
- 10:39challenge. You can see that the
- 10:41dashboard is linked below. You can see
- 10:42my progress. The frustration is for me
- 10:45is that I haven't been able to put as
- 10:46much money in as I wanted to. I haven't
- 10:48had the dips in the market that I wanted
- 10:49to make my purchases. So, that's kind of
- 10:52been a little bit difficult. Okay, so
- 10:53now it's actually pulled out the goals,
- 10:56and it said the maximum return 30 days
- 10:58is this much, 10x in 6 months,
- 11:0140 It's defining all my stuff, my my
- 11:03minimum sharp score, my max drawdown, my
- 11:05failure below reflection every certain
- 11:07amount of days. It's got all of this
- 11:09built in, so that's wonderful. And it
- 11:11says, "Do you want to confirm the Hermes
- 11:13and Wacko Alpha setup?" Yes, so I'm
- 11:14going to have lock in as proposed.
- 11:16That's what I'm going to go for. Cuz
- 11:17this is actually real money.
- 11:20But I want you to know that I trust this
- 11:22system and the way that it learns
- 11:24sufficiently to put my real money on the
- 11:26line. That's what we're doing here, and
- 11:27let's move on to the next phase. Okay,
- 11:29so phase three is now scaffolding the
- 11:32Hermes side state. So, scaffolding all
- 11:34the folders and files to be properly
- 11:37analyzed by Hermes when we actually come
- 11:40to install Hermes. Okay, now we're on
- 11:41phase four, which has skipped actually
- 11:44because the Wako alpha is already
- 11:45deployed. If you hadn't got a strategy
- 11:47already, it would start to deploy that
- 11:48strategy to make it live. You might have
- 11:50to connect in like APIs or whatever to
- 11:52make it trade for you, but I've got a
- 11:54video on how to actually make things
- 11:56trade. It's like cloud code with trading
- 11:58view that actually trades. You can also
- 12:00find that in zero one systems by the
- 12:02way. The whole prompt for that is there.
- 12:03So, I'm having a little bit of an issue
- 12:04logging in to railway, which is going to
- 12:06be the place where we host this 24/7, so
- 12:09it can run regardless of whether the
- 12:11computer is on or not. It's saying it
- 12:13can't run interactive logins from inside
- 12:15this session. Please run this in the
- 12:17prompt yourself. So, all I'm going to do
- 12:19is going to come over here in my cursor,
- 12:22split this terminal so I can start a new
- 12:24terminal session, and I'm just pasting
- 12:26in this. So, I'm going to paste that in.
- 12:28It should then open up railway for me to
- 12:30get me to log in, and it's a success, so
- 12:32I can close the page. Boom, that's done.
- 12:34I can now close that, and I'm now logged
- 12:37in. So, I can say done continuing.
- 12:39I love these one-shot prompts because I
- 12:41built them so that opens up these
- 12:43browsers for you. So, if you don't have
- 12:45a railway account by the way, what would
- 12:47have happened just then is that it would
- 12:49have opened up railway, and you just
- 12:50make an account, right? And then you
- 12:52come back and say, "Hey, I've just made
- 12:53an account." And it's free for so much
- 12:55usage. Like, I've only just now started
- 12:57having to pay for railway because I and
- 12:59like 50 projects on there running 24/7,
- 13:02right? So, it's now using the CLI it's
- 13:06called to integrate with railway. So,
- 13:08anytime you publish a new strategy, or
- 13:10you make a change, it will update on the
- 13:1224/7 server, and just that's it. Just
- 13:15kind of works like that. So, that's
- 13:17what's great about railway cuz it works
- 13:18in this way with your terminal. Any
- 13:20project that you're doing is just kind
- 13:22of updating. It's now just seen 24 gain
- 13:25trades and 22 loss trades, and it's
- 13:28converting those into a Hermes readable
- 13:30ledger. So, it's now converting
- 13:32everything to be perfectly primed and
- 13:34ready for Hermes to take a look at it.
- 13:36Something else has just happened here.
- 13:38Oh, yes. These new documents have just
- 13:40come up. Sorry about my desktop. Let's
- 13:42hide all the clutter. So, my strategy
- 13:44document has now been populated. It's
- 13:47also opening them in my cursor as well.
- 13:49That's really helpful. It's got my
- 13:51strategy. This is my strategy. The
- 13:52maximum amount of positions I'm going to
- 13:54hold is 12. My slippage tolerance is
- 13:56this. My gas reserve is this. The scorer
- 13:58weights everything. This is all pulled
- 14:00from my actual strategy. It's also
- 14:02defined my goals, right? My target
- 14:04return over 30 days is 4.7, which is 47%
- 14:09by the way. That's my target return for
- 14:11every 30 days. So, it's going to be
- 14:12working until it achieves these goals.
- 14:14These are all the trades that have taken
- 14:16place as well. How cool is that? So,
- 14:18it's just organizing all these files now
- 14:20so Hermes can have a look at it and and
- 14:22learn from it. So, right now we're in
- 14:23the handoff to Hermes phase. Like just
- 14:25like that. So, I hope you if you're
- 14:27following along, I think it's about time
- 14:28to subscribe, don't you? Anyway, so it's
- 14:31basically looking at it's what what Oh
- 14:34my goodness, it already installed
- 14:35Hermes. It already did it.
- 14:38It already installed Hermes. That is
- 14:40insane actually. I didn't realize that
- 14:42would just happen so quickly. Okay, so
- 14:44Hermes is now being installed. I can now
- 14:45type in Hermes in this terminal or any
- 14:49other terminal. So, let's go over to the
- 14:51split terminal again and I'm just going
- 14:52to type Hermes in here just to see if it
- 14:55is in fact I can't cuz I can't quite
- 14:56believe that it did install. It did. And
- 14:58now I fully have Hermes just up and
- 15:00running. That was just so quick. We
- 15:02could do a whole video on Hermes by the
- 15:03way. It's unbelievable. But what it's
- 15:06done right now is it has outlined
- 15:08everything that it's doing. So, now that
- 15:10we know Hermes is actually installed, we
- 15:11can come back to that later. So, let's
- 15:13have a look at everything. So, final
- 15:15confirmation. We have a self-improving
- 15:17trading agent which is deployed right
- 15:19now and adapted for my Wacko Alpha
- 15:21strategy which trades real money, by the
- 15:22way. It's working on Railway 24/7, and
- 15:26its strategy is using the Bittensor
- 15:28subnets. We're looking for that return.
- 15:31We're looking for that as a max
- 15:32drawdown, uh minimum sharp of one. The
- 15:34brain is Hermes. It's going to be
- 15:36watching the live service on weekly
- 15:37cadence. Hermes owns the portfolio
- 15:39mechanics and scorer weights, and
- 15:41Cornelius, who's another agent of mine,
- 15:43owns the filter thresholds. The first
- 15:45cycle is read-only and review-only. It's
- 15:47going to flip the strategy.
- 15:49YAML mode to live when it's ready. So,
- 15:52it's actually not trading yet, and when
- 15:54it's ready, Hermes will decide it's time
- 15:56to go, baby, and then we'll start making
- 15:58some money. Okay, so what happens from
- 16:00here? My strategy will keep firing every
- 16:0230 minutes on Railway, which it does
- 16:04already. It does a daily reshuffle and a
- 16:0630-minute reshuffle. Cornelius, my other
- 16:08agent, is going to keep tuning the
- 16:10learned parameters JSON every week. That
- 16:13means he's like looking at all the data
- 16:15that comes in, those 1.5 million data
- 16:16points that we have right now, and kind
- 16:18of learning from those. So, but
- 16:19Cornelius and Hermes now are just kind
- 16:21of together. Hermes reviews the trades
- 16:23weekly, but he has a 3-day offset from
- 16:25Cornelius, interesting. The first Hermes
- 16:27cycle will produce a markdown review
- 16:29with no actual writing. I will approve
- 16:31by setting mode, so I can come here and
- 16:34just like approve the strategy from
- 16:35there. And a day after check-in, I can
- 16:38do any of the check-ins that I want
- 16:39using these commands. To go live, not
- 16:41today, is to edit the Hermes trading
- 16:44strategy, and Hermes will start writing
- 16:46on the next weekly cycle. Hermes is
- 16:48watching. Close this terminal that agent
- 16:50is running. Kablam! Kaboom! There we go.
- 16:54What about that, then?
- 16:57So cool. Okay, so I really want to hear
- 17:00your stories about this when you've
- 17:01installed. The best place to come and do
- 17:03that is to come into the classroom.
- 17:05There's another person that's joined,
- 17:06who's actually taking on the 60-day
- 17:08challenge. Come into the YouTube video
- 17:09prompts. Take your prompt here. Come
- 17:12over to the community once you've done
- 17:13it, and tell us all about it, how how it
- 17:15was, and that it that it works
- 17:16wonderfully. The response of the last
- 17:19video regarding the Markov
- 17:23method strategy. People have absolutely,
- 17:26you can see like no one has any issues
- 17:29with this thing. They loved it and
- 17:30they're using it and people are very
- 17:32excited about it. But let's see the
- 17:33response of this one. So we'll have a
- 17:34similar post like that on the community
- 17:36when you come in. Anyway, I want to
- 17:38thank you for being here. This is so
- 17:39much fun, right? Click like and if you
- 17:42can, there's actually a capability of
- 17:44you to do something called a hype. So if
- 17:46you got this far in the video, hype the
- 17:47video. On the on the phone you can kind
- 17:49of like scroll across. If you click
- 17:51like, the hype button will appear below.
- 17:53I think it really helps viewership. So
- 17:55give it a go. You can also hype on a
- 17:56computer, but I don't know where it is.
- 17:58So anyway, that's all.
- 18:00Have fun with it. Bye.
About this transcript
This page contains the full transcript of How To Build A Self-Improving AI Trading Agent (Insanely Cool) by Lewis Jackson, generated from the public captions YouTube serves with the video. The transcript has 3,873 words across 545 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.