I Turned Claude Into a 24/7 Trader — Transcript
Full transcript
- 0:00So, Claude Opus 4.6 is finally here, and
- 0:02it got me thinking because as I was
- 0:03scrolling down and I started looking at
- 0:04the benchmarks, I noticed right here we
- 0:06have a genetic financial analysis, and
- 0:08we have about a 4% jump from Opus 4.6.
- 0:11And about a week ago, I dropped this
- 0:12video where me and Simon traded stocks
- 0:15for 30 days with our open Claude agents,
- 0:18and my open Claude agent was set up with
- 0:20Opus 4.6, and I was able to beat the S&P
- 0:22by about 8% as you can see right here.
- 0:24This green line is my chart, and this
- 0:26gray line is the S&P. So, if you guys
- 0:28want to check out this full video, I
- 0:29will link that right up here. So, after
- 0:30this challenge, I wanted to keep my
- 0:32agent running to see if it could keep
- 0:33beating the S&P, but now I want to
- 0:35upgrade it to 4.7 instead of 4.6. So,
- 0:38that's exactly what I want to cover with
- 0:39you guys today. How do we build a 24/7
- 0:41AI trading agent with Opus 4.6 inside of
- 0:44Claude code? We're not even going to
- 0:45touch open Claude or Hermes agent. We're
- 0:47going to just do this with Claude code.
- 0:49And this is all going to be thanks to
- 0:50another feature that we just got from
- 0:51the Anthropic team called routines. If
- 0:53you don't know what that is, I'm going
- 0:54to break it down in this video, but I
- 0:55also made a full one if you want to
- 0:56check that out, also right up here. So,
- 0:58basically, this is the unlock. 4.7 plus
- 1:01routines means you can have a 24/7 AI
- 1:03agent, and 4.7 was built for full
- 1:05throttle agentic work, judgment over
- 1:07ambiguity, and self-verifying outputs.
- 1:10So, it's perfect for these types of
- 1:11routines, and that's how I'm going to
- 1:12set up my 24/7 trading agent with Claude
- 1:15code routines. So, if you follow along
- 1:17with this video, you'll be able to
- 1:18pretty much duplicate my exact setup and
- 1:20have yourself a working agent and start
- 1:23trading with it. So, let's go ahead and
- 1:25get started. What are we building? We're
- 1:26going to create a Claude code project
- 1:28that runs on a schedule, something like
- 1:30a pre-market cron, a market open, a
- 1:32midday, and a close. It's going to
- 1:34research the market. It's going to place
- 1:35trades via the Alpaca API. It's going to
- 1:38journal and make sure that it's writing
- 1:40context into the file so it can learn.
- 1:42And then it's going to send me every
- 1:43day, every day of the week, an
- 1:44end-of-day summary to my ClickUp. The
- 1:46goal, obviously, is just to beat the
- 1:48S&P. We're not looking to do any crazy
- 1:49crypto or crazy day trading stuff. I'm
- 1:52just kind of doing this as a fun
- 1:53long-term investment. Just beat the S&P
- 1:55challenge. Like I said, in my first 30
- 1:57days I gave Opus $10,000 and we were
- 2:00able to beat the S&P by about 8%, which
- 2:02is really good, especially in such a
- 2:04short amount of time. So, what is the
- 2:06tech stack? We're going to be using
- 2:07Cloud Code Routines, that's kind of our
- 2:08scheduler. For the AI model, we're going
- 2:10to use Opus 4.7. For the skills, we're
- 2:12going to be using just kind of like
- 2:14building our own as we go. It'll be
- 2:15stuff like how the agent does research
- 2:17or how it makes decisions or how it
- 2:19places trades or, you know, makes logs,
- 2:21things like that. We're going to use the
- 2:22Alpaca API as our brokerage. We're going
- 2:25to use the Perplexity API for research.
- 2:27You could also just use the native web
- 2:28fetch and web search, but I'm going to
- 2:30use Perplexity here. And then I'm going
- 2:32to get my notifications in ClickUp this
- 2:34time rather than Telegram, just cuz I
- 2:36live in ClickUp a lot more. So,
- 2:37obviously some of these things can be
- 2:38interchangeable for you, but if you want
- 2:39to just copy my exact setup in this
- 2:41video, then feel free. Okay, so how to
- 2:43get started with these different tools
- 2:44that we need for this video? The first
- 2:46one is going to be Alpaca. So, go to
- 2:48alpaca.markets.
- 2:49You can see up at the top we even see
- 2:50want to trade using AI. We launched an
- 2:52Alpaca's MCP server to help you trade
- 2:54with natural language. So, you could use
- 2:55that. I'm just using the endpoints. I
- 2:57honestly like to use endpoints a lot
- 2:58more. But anyways, you're going to sign
- 3:00up right here and you'll click on
- 3:01trading API. Now, once you get in there,
- 3:04you will have basically a paper trading
- 3:05account and right here you can see I've
- 3:07got a paper trading account with 100k.
- 3:08You could also open up a new account
- 3:10right here and that's how you could put
- 3:11real money in. You might, like I said
- 3:13though, have to just verify your
- 3:14account, which could take a couple days.
- 3:16And then they're both the same as far as
- 3:18the credentials. You basically scroll
- 3:19down and on the right-hand side you have
- 3:21your API keys right here. You get an
- 3:22endpoint and you get a key, but you also
- 3:24need like a secret key. So, you have
- 3:25like a secret key and then you need like
- 3:26an ID. So, you'd hit regenerate,
- 3:28generate new keys, and this is where you
- 3:30get your key and your secret. And
- 3:33once you copy and paste this, just make
- 3:35sure to save it because then it's going
- 3:37to go away and you'll only be able to
- 3:38see the key, but you need both of them.
- 3:40Next up I have ClickUp. This is where I
- 3:41want to get my notifications. You don't
- 3:43have to use ClickUp, you can use Slack,
- 3:44you could use, you know, whatever,
- 3:46Telegram, WhatsApp. I would go up here
- 3:48and go to my settings, and then I scroll
- 3:50down and find ClickUp API, and then I
- 3:52would just copy this token right here.
- 3:54And then similarly with perplexity, I
- 3:55would go down here and I would click on
- 3:58all settings, I think. And then in here
- 4:00I can see API platform and this is where
- 4:02I would be able to go find my actual API
- 4:04key. If I went down to right here API
- 4:06keys, I can make a new one or copy an
- 4:08old one. But basically, the way it works
- 4:09is every platform has typically API
- 4:11keys. You just have to find them in the
- 4:13settings somewhere. If you can't find
- 4:14them, just do a quick perplexity or
- 4:15Google search or even ask Cloud Code and
- 4:17it should be able to help you get to
- 4:19your API keys. And now that you know how
- 4:20to get these keys, just hold on to them.
- 4:22We're going to actually plug them in
- 4:23later in the video. And then the final
- 4:25piece of the puzzle is going to be the
- 4:26Cloud desktop app. You can see here you
- 4:28can have Cloud chat, you can have Cloud
- 4:29co-work, or you can be in Cloud Code.
- 4:31And this is where we're going to set up
- 4:33these actual routines where now if I go
- 4:35to my calendar, you can see every single
- 4:37day I've got Bull, which is my trading
- 4:38agent, waking up at 6:00, 8:30, um noon,
- 4:433:00 p.m. And then on certain days like
- 4:45on Fridays, he's doing a weekly review.
- 4:46So this is the way I currently have mine
- 4:47set up and we're able to manage
- 4:49everything right from here inside of the
- 4:50Cloud desktop app because of this whole
- 4:53routine feature. So all you need to do
- 4:55to use the Cloud desktop app is just
- 4:56type in Cloud desktop app download and
- 4:58you should be able to install it right
- 4:59here. You go to the downloads page and
- 5:01then you just have to choose the Cloud
- 5:03desktop for your operating system. And
- 5:05then the only other thing you need to do
- 5:06is make sure that you are on an actual
- 5:08subscription. So it has to be a paid
- 5:10either 20 bucks a month plan or the max
- 5:12plans. Now in this video, you might also
- 5:14see me use Cloud Code inside of
- 5:15something that looks like this, which is
- 5:17the VS Code IDE and then we use Cloud
- 5:20Code extension inside of it. It's not
- 5:21mandatory, but that is where I typically
- 5:23prefer to use Cloud Code because I can
- 5:25see all of my files over here. So if you
- 5:27want to do that, just type in VS Code in
- 5:28your browser, open this up. It's
- 5:30completely free to download and then go
- 5:31ahead and download it and connect your
- 5:33Cloud Code account. So that is pretty
- 5:35much the text stack that we're going to
- 5:36be using today to get all of this set up
- 5:38and let's get back to the video. Okay,
- 5:40so before we get into the actual
- 5:41step-by-step kind of build, we are going
- 5:44to need to talk about the mental model.
- 5:46So understand this before you write
- 5:48anything. The trading strategy is a
- 5:50piece of the work, but the memory
- 5:51architecture that you're going to use is
- 5:53going to be huge.
- 5:54So, every time a routine fires at 7:00
- 5:56a.m., Claude code basically wakes up
- 5:58essentially stateless. It doesn't really
- 6:00know anything. So, how do you make a
- 6:01stateless agent act disciplined and
- 6:03remember rules and learn over time? You
- 6:05do that with files and with context. So,
- 6:08every routine basically wakes up, reads
- 6:11files,
- 6:12does the job, and then writes back any
- 6:15important lessons or anything in like
- 6:16that the next agent when it wakes up
- 6:18needs to know, it just writes that down.
- 6:20And that's kind of at a very high level
- 6:21the type of framework that we're going
- 6:23to be using here. So,
- 6:24the final thing I wanted to talk about
- 6:25before we get into this is the context
- 6:27budget. So, treat tokens like money,
- 6:30obviously. Every file that you ask the
- 6:31agent to read it's going to cost you.
- 6:33Each routine gets about 200,000 tokens
- 6:34to work with. I mean, we do have the a
- 6:36million token context window models now,
- 6:38but I don't really like to think of it
- 6:40like I have a million tokens to play
- 6:41with because context rot. So, system
- 6:44instructions will take some up, strategy
- 6:45files, your trade log, your API, your
- 6:47research. Every run is going to take a
- 6:49different amount of tokens, but just
- 6:50keep that in mind. And the reason here
- 6:52that we're using, if I go back to the
- 6:54stack, Claude code instead of just using
- 6:56something like, you know, the agent's
- 6:58SDK or I mean, I guess that could work,
- 6:59but rather than just using like a
- 7:01standard automation, is because if we do
- 7:03this with routines, we basically get the
- 7:06full autonomy of us working with Claude
- 7:09code manually because it goes through
- 7:11that whole agentic earnest loop of
- 7:13figuring things out. And especially with
- 7:14Opus for that 7, it's apparently going
- 7:16to be really, really good.
- 7:18Whereas, if you just had like an
- 7:19automation that would do research and
- 7:20then, you know, make a trade, you're not
- 7:22getting that super variability that you
- 7:24probably want with something that could
- 7:26be very volatile like trading. All
- 7:29right, so now that we got all of that
- 7:30stuff out of the way, let's get into the
- 7:31strategy. So, step one,
- 7:34think of this like you're teaching a kid
- 7:35to ride a bike. You have to explain how
- 7:38to balance before you go. You have to
- 7:40explain to the kid that he's going to
- 7:42steer with his hands and he's going to
- 7:43pedal with his feet. And even once you
- 7:45put him on the bike, you're not just
- 7:47going to let him go. You're going to
- 7:48hold the handlebars, you're going to put
- 7:49your hand on his back, and you're going
- 7:50to walk with him until he gets a little
- 7:52more comfortable. And then slowly you
- 7:53might take off, you know, you might stop
- 7:55steering, but you might just run behind
- 7:56him. And then slowly you'll put on some
- 7:58training wheels. And like you just keep
- 8:00bumping it up in phases. You can't
- 8:01expect to just throw a kid on a bike and
- 8:03it's instantly going to be magic. So
- 8:05maybe you want to start with paper
- 8:06trading. This is obviously not financial
- 8:08advice and I'm not, you know,
- 8:09recommending that you go put all of your
- 8:10life savings in here and expect to make
- 8:12money and then get mad at me. This is an
- 8:14experiment for me and I'm trying to show
- 8:16you guys what's possible. So just keep
- 8:17that in mind. Start with paper trading
- 8:19first if you're not comfortable. But
- 8:20anyways, the idea is you need a
- 8:22strategy. So for me, what I'm going to
- 8:24do is I'm basically going to extract all
- 8:26of the strategy that we've been using
- 8:27from my Open Claw agent, and I'm just
- 8:29going to say, "Hey, let's take this over
- 8:31to Cloud Code." So for me it's a little
- 8:32easier. But for you, if you actually are
- 8:34like a manual trader and every day you
- 8:36think about things and you do research
- 8:37and you place trades or you sell things,
- 8:39then just write down your strategy. How
- 8:41often are you checking the news? What
- 8:43are the signals that make you realize
- 8:44I'm going to buy this or I'm going to
- 8:45sell this? As much of your gut intuition
- 8:48and your routine about trading that you
- 8:50can get into this Cloud Code project,
- 8:52the better. And then I will over time
- 8:53you're going to help it learn from its
- 8:55mistakes, you're going to iterate, and
- 8:57it's going to get better and better
- 8:58every time you use it. But if you're
- 8:59starting completely fresh, which in my
- 9:02case of the Open Claw trading challenge,
- 9:04I literally just said, "Hey, I'm doing a
- 9:0730-day challenge. I'm trying to compete
- 9:08against my friend Salmon. Go to
- 9:10research. Spin up a team of sub agents.
- 9:11You're my wealth advisor. Try to beat
- 9:13the S&P. Figure out the best plan
- 9:15possible." And that's like genuinely all
- 9:17that I said to it, which I think is
- 9:18pretty cool. And it went off and it did
- 9:20a bunch of research. It figured out a
- 9:21strategy for me. And then for the next
- 9:2330 days it just did that. And I barely
- 9:24had to touch it at all.
- 9:26So if you want to start off by playing
- 9:27around with some research like that,
- 9:28then certainly do that. But if you guys
- 9:30remember at the beginning of this video,
- 9:31I kind of alluded to this benchmark
- 9:33here. So in the official release, and by
- 9:36the way, I just dropped a full video on
- 9:38this new release. I'll tag that up here.
- 9:39So, in the official release of Claude
- 9:41Opus 4.7, they always drop the
- 9:42benchmarks and they compare it to other
- 9:44models that are kind of leading in the
- 9:46industry as well. And so, this is the
- 9:48one I wanted to talk about in this case.
- 9:49We have a genetic financial analysis
- 9:5164.4%.
- 9:53We also have stuff like gradual level
- 9:55reasoning and you know, just the ability
- 9:56to think really well. Um genetic search
- 9:58actually is worse than Opus 4.6, which
- 10:00is interesting. But yeah, genetic
- 10:02financial analysis. So, what does that
- 10:03actually mean? This basically means that
- 10:05it is really good at analyzing a
- 10:07company. But it's not basically a signal
- 10:10or a benchmark for how good this model
- 10:13is at trading and specifically day
- 10:15trading. Like this doesn't mean that
- 10:16it's going to be able to look at like a
- 10:17technical analysis and look at the
- 10:18candlesticks and the MACD and figure out
- 10:21the exact best moment to buy and then
- 10:22the exact moment to sell. I'm not going
- 10:24to try to day trade with these agents. I
- 10:26just don't know enough about it to do
- 10:27it. But that's not what this metric is
- 10:29saying. This benchmark rewards models
- 10:31that can digest filings and write
- 10:32coherent fundamentals-driven theses or
- 10:35thesis, I guess. And that maps to
- 10:37long-term or swing or
- 10:39fundamentals-driven strategies, not day
- 10:41trading. So, that's why once again,
- 10:42we're just going to be trying to beat
- 10:43the S&P here. Okay, so that is the
- 10:45overall strategy. Let's talk about the
- 10:47scaffold. So, what you need to do to
- 10:49spin up the Claude code project in about
- 10:5160 seconds is you're going to open up a
- 10:53new folder and we're going to open up
- 10:54Claude code. So, let me hop over to my
- 10:56project right here. This is a new
- 10:58folder. It's called trading I think
- 11:00trading routine. This is basically just
- 11:02a settings file. There's hardly anything
- 11:03in there. The Claude doesn't D is blank
- 11:05and then we have a read me just because
- 11:07I turned this into a GitHub repo so I
- 11:08can pull it into a routine later. If you
- 11:10haven't done that yet, it's fine. We'll
- 11:12talk about that in a sec. The reason why
- 11:14we're starting here in VS Code is
- 11:15because I want to get started in a place
- 11:17where I can see all of my files on this
- 11:18left-hand side. Because if you're in the
- 11:20desktop app, which we will move over to
- 11:22here later, you don't get to see all
- 11:23your files open on the left-hand side.
- 11:25On the left-hand side, you see your
- 11:26routines and your other sessions, which
- 11:28is great, but when we're first getting
- 11:30set up, I like to be able to see
- 11:31everything in one spot. So, we're going
- 11:33to start here in the VS Code um either
- 11:35terminal or the Cloud Code extension.
- 11:38So, let me show you guys what I did.
- 11:39This is my Telegram chat with Bull, my
- 11:41trading bot, and I said, "Hey, I want to
- 11:43completely migrate you to a different AI
- 11:45agent setup. I need you to break down
- 11:46the strategy, the cron jobs, what are
- 11:48you looking for when you're doing your
- 11:49research, what type of sub agents do you
- 11:51have, what are the different signals,
- 11:53give me the full breakdown, all of your
- 11:55learnings." And so, it gave me all this
- 11:57stuff. And so, what I'm going to do is
- 11:59I'm just going to basically migrate over
- 12:00this strategy into my Cloud Code
- 12:02project. You can see we have all of
- 12:04these sell signals, we have all of these
- 12:06key learnings, and these kind of main
- 12:07frameworks, and we have our current
- 12:09portfolio. Real quick, guys, when it
- 12:11comes time for you to get set up, I have
- 12:13this free resource for you. It's a
- 12:1513-page PDF, and I am assuming if you
- 12:17dropped this thing into Cloud Code and
- 12:19then started to brainstorm with it, it
- 12:20would help you out a lot as far as the
- 12:22infrastructure and the folder structure
- 12:24and the way you want to get things set
- 12:25up and the way you want to create your
- 12:26routines and things like that. So, it
- 12:28should be very helpful. This you can
- 12:29download for completely free in my free
- 12:31school community. The link for that is
- 12:32down in the description. Once you get in
- 12:34there, just head over to the classroom,
- 12:35click on YouTube resources, and you'll
- 12:36be able to find it right in there. So,
- 12:39let's get back to the video. So, if I
- 12:40pull that up real quick, you can see
- 12:41here's today. We had a bit of a a jump,
- 12:43and then we came back down today. Here
- 12:45is the past month, so this is where we
- 12:47were with the um open cloud agent. But
- 12:49you guys are going to want to go to
- 12:50Alpaca and make an account, especially
- 12:52if you want to put real money in. You
- 12:53might have to take a few days for your
- 12:55account to get approved. So, head over
- 12:56there and get an account. Then I also
- 12:58told it to give me a technical cheat
- 13:00sheet as far as like the different API
- 13:01end points it uses and how it makes
- 13:02those requests, as you can see, just
- 13:04because it already has all this
- 13:05knowledge. So, why waste time trying to
- 13:07train a new agent if we could just
- 13:08migrate over all of these memories and
- 13:11knowledge to this new agent. And then at
- 13:13the end of that, it even gave me an
- 13:15export of all of these important files,
- 13:17like the agent instructions, the trading
- 13:18strategy, the trade log, the research
- 13:20log, the weekly review. And I'm just
- 13:22basically going to migrate all this
- 13:23over. So, let me show you what that's
- 13:24going to look like. So, you can see that
- 13:26it gave me this zip file of all of those
- 13:29seven files and I'm just basically going
- 13:30to extract those into this project right
- 13:32here. So I'm choosing the trading
- 13:34routine project, select folder and then
- 13:36extract and we should see all those
- 13:37files just popped up right over here on
- 13:39this left-hand side. Now what I'm going
- 13:40to do is just talk to my Claude. I'm
- 13:42going to switch over here to plan mode
- 13:43and I'm just going to start talking. All
- 13:45right, so I am creating you as a 24/7 AI
- 13:49agent trade bot for me. I had a project
- 13:51set up with open Claude and
- 13:54we were trading, you know, $10,000 using
- 13:56Alpaca for the past 30 days and we were
- 13:58doing pretty well, but now I want to
- 14:00move it over here so we can set you up
- 14:02as a Claude code routine. So I just
- 14:04dropped in a ton of context for you.
- 14:05There's a ton of files in this project.
- 14:07Um if you want to just take a second to
- 14:09get sort of like
- 14:11acclimated to what I dropped in there.
- 14:12There's going to be a lot of
- 14:13information, but basically
- 14:15that's like all of the knowledge and all
- 14:17of the strategies and all of the signals
- 14:18that our open Claude agent had and how
- 14:20it was able to be successful and I just
- 14:23want to migrate that over here to you so
- 14:24that we're not losing any of our
- 14:26knowledge. I'm also going to paste in
- 14:27some of the key things that it told me
- 14:29that you should make sure to know. So
- 14:31I'm going to drop in that stuff right
- 14:33below. Now some of this stuff you can
- 14:34take with a grain of salt because it
- 14:35might have been set up and optimized for
- 14:37an open Claude agent harness, but you're
- 14:40Claude code. You understand the best way
- 14:42to set up your projects and to do
- 14:44things. So what's really important is
- 14:45that you're ingesting this information
- 14:47and you're understanding it and then
- 14:49you're helping yourself organize this
- 14:50project in a way that makes the most
- 14:52sense to you. Okay, so I know that that
- 14:54is a ton of information that I just
- 14:56chucked into there and you guys might be
- 14:57sitting there like, okay, well I don't
- 14:58have all these files. What do I do? This
- 15:00is where you just start to brainstorm.
- 15:01Literally treat this thing as if it is
- 15:03your best friend who is the best trader
- 15:05in the world and you are just trying to
- 15:06give it your strategy now. So if we
- 15:08think back to earlier in step one where
- 15:09I talked about the strategy, when you
- 15:11open up a piece of paper or sorry, you
- 15:13take out a piece of paper, you open up a
- 15:14Google Doc and you just start writing
- 15:16down. How do you actually trade? What's
- 15:19your approach? Once you write down all
- 15:21this stuff and you basically just brain
- 15:22dump about how you want to do it, then
- 15:24you plug it into the Claude code, and
- 15:25that's where you see how I set up this
- 15:27project here. I'm just helping it get
- 15:29situated with what we want to do right
- 15:30now. And honestly, the more context and
- 15:32details that you give it right now, the
- 15:34more it asks you questions, the better.
- 15:36As you can see, I'm using the
- 15:37brainstorming skill from Superpowers,
- 15:39and it's going to start off by asking me
- 15:40some questions. Okay, so I just answered
- 15:42some questions, and I did want to show
- 15:43you guys this. So, it alerted me about
- 15:45something with security inside of this
- 15:47template that Open Claude gave me, it
- 15:50had my live Alpaca key in there. So, I'm
- 15:53going to go ahead and rotate those
- 15:54before we actually push this new one
- 15:56into production, but just something to
- 15:58be thinking about when you're migrating
- 15:59stuff or when you're feeding in API keys
- 16:02directly to a chat. Just be careful of
- 16:03that kind of stuff. And I'm going to
- 16:04show you how we get our API keys set up
- 16:06in routines because you don't want to
- 16:07put them straight into a GitHub repo.
- 16:09You're going to have to set them up in
- 16:10the environment variables, so I will
- 16:11show you guys that as well. Okay, so
- 16:13this point it's come back with a plan.
- 16:15So, Nate ran a live money Alpaca trading
- 16:17bot called Bull on the Open Claude
- 16:19harness for 30 days, and now we have all
- 16:21these context files with strategy, with
- 16:23trade history, with research notes, blah
- 16:25blah blah. The goal of this migration is
- 16:26to make Claude code a first-class home
- 16:28for this bot. So, we will set up the
- 16:29cron scheduling, the notifications.
- 16:31We're getting rid of that agent mail
- 16:32step, so me and Solomon were having our
- 16:34agents trash talk each other. We're
- 16:36going to rotate our credentials, of
- 16:37course. And then it's proposing a layout
- 16:39for the way that the files should be set
- 16:41up. So, you can see, it's going to put
- 16:42the files in here into the memory, and
- 16:45then we're going to be able to prompt
- 16:46our routines to always check the memory
- 16:48first and update the memory. So, this is
- 16:50where it will really help for you guys
- 16:51to brainstorm with how the project
- 16:52should be set up. Oh, one other thing
- 16:54that I forgot to give it here is that I
- 16:55want it to use Perplexity for research.
- 16:57So, I'm going to come down here to the
- 16:58bottom of the plan, and I'm going to
- 17:00say,
- 17:01"Yeah, this all looks pretty much good
- 17:03to go, but one thing I forgot to tell
- 17:04you is that we want to use Perplexity
- 17:06for research rather than just the native
- 17:08Claude code web search and web fetch
- 17:10function. So, add in that Perplexity
- 17:12will be used for web search, and once
- 17:13again, once we set up up routine, that's
- 17:15when I'll give you the Perplexity API
- 17:17key. Okay, so after this change has been
- 17:18made, we should be ready to start
- 17:20migrating over to setting up the
- 17:22routines. All right, so the new plan has
- 17:24come back. So, here's the end-to-end
- 17:26check. Secrets, Alpaca, memory file
- 17:29commands, dry run, ClickUp, Perplexity,
- 17:32nice. We're going to go ahead and accept
- 17:34these changes. And you also notice that
- 17:36we have auto mode on. So, I think with
- 17:38this new update with Opus 4.7, when you
- 17:40auto-accept a plan, it turns on auto
- 17:42mode, which means it lets Cloud handle
- 17:43permission prompts automatically. Now,
- 17:46you will have to be careful though
- 17:47because doing this is a little bit more
- 17:48expensive. So, if you don't want it to
- 17:49be auto mode, then you can just switch
- 17:51it right off of auto mode, of course.
- 17:53But, um yeah, just something I wanted to
- 17:54point out. All right, so while all of
- 17:56that's still getting set up, let's talk
- 17:57about step three, which is guardrails.
- 18:00So, before you start working in the
- 18:01trading logic, think about this kind of
- 18:03stuff. I obviously talked about how you
- 18:04could start with paper mode, and then
- 18:06you toggle on real trading and put in
- 18:08money when you feel comfortable. You
- 18:10could do things like, "Hey, max 5% of my
- 18:12portfolio per position." You can have a
- 18:14daily loss cap. You can tell the agent
- 18:16not to do, like only buy three new
- 18:17positions per week, or no options ever,
- 18:19or don't do this, or always do this.
- 18:21Because the agent is going to be
- 18:23autonomous, it's going to be eager, and
- 18:24if you don't give it guardrails, it
- 18:25might just kind of start to, you know,
- 18:27go off the rails. But like I said, even
- 18:29though I'm migrating a system over, I
- 18:30know it's not going to be perfect. So,
- 18:32I'm going to watch every single run, and
- 18:33I'm going to read through the
- 18:35conversation history of every run, and
- 18:36I'm going to see if there's things that
- 18:37I need to tweak in the prompt, or things
- 18:39that I need to tweak in the project
- 18:41settings, or the context files. And like
- 18:43I said, just kind of keep building the
- 18:44plan as we're flying it here. And then,
- 18:46that's where we also start to develop
- 18:48skills. Because right now we have skills
- 18:50maybe for like a research skill, or for
- 18:52a trade skill. But we're going to make
- 18:53sure that we're getting them actually
- 18:55explicitly invoked, and we're going to
- 18:56be making sure that that increases the
- 18:58consistency, and we're going to make
- 19:00sure that the agent is able to give us
- 19:02insights every day of, "Hey, here is
- 19:04what worked well, and here's what I
- 19:05noticed, and hey, here's where I think
- 19:06that maybe we should update these skills
- 19:08X, Y, and Z, you you whatever." So, a
- 19:11combination of thinking about the
- 19:12guardrails and thinking about skills is
- 19:14how you can continuously make this thing
- 19:16better over time. And now that we've
- 19:17talked about all that, we will get to
- 19:18the routines and the deployment. Let's
- 19:20check in on our
- 19:22guy right here. And because I turned it
- 19:23off auto mode, it was sitting and
- 19:25waiting for me to do a permission. All
- 19:27right, so everything has been migrated.
- 19:29We're looking good, but we're getting a
- 19:31little bit to the point where I like to
- 19:32reset the context. So, before we move
- 19:34on, I'm going to say, "Hey, give me a
- 19:36summary of what we've done." And then
- 19:37I'm going to clear the context and we'll
- 19:38get started again. All right, so here's
- 19:40the session summary that it gave me.
- 19:42Copy that.
- 19:44Do a slash clear.
- 19:46Paste that in, hit enter, and now we're
- 19:47basically right back at the beginning
- 19:49with a fresh window of context. So, this
- 19:52is where it gets pretty cool. You can
- 19:53see on the left-hand side it has
- 19:54reorganized things. We have our scripts,
- 19:56we have our memory files, we even have
- 19:58some commands in here, and it built all
- 19:59of that just because I told it that I
- 20:01was trying to migrate stuff over. It
- 20:02also updated this Claude.md file because
- 20:05now we have Bull back in all of his
- 20:08glory, and we have our Claude.md file
- 20:09that is about 156 lines. So, now it's
- 20:12time to start planning out step five,
- 20:14which is the routines. So, we basically
- 20:16need to figure out what are the
- 20:17different daily triggers that we
- 20:18actually want. And we also don't maybe
- 20:20want them every day because the market's
- 20:21only open five days a week. So, this is
- 20:23kind of like a baseline. This is kind of
- 20:24how it worked with my Bull trading
- 20:26agent. But I'm actually just going to
- 20:28come into VS Code and we're just going
- 20:30to brainstorm once again. So, I'm going
- 20:31to go on plan mode and I'm just going to
- 20:33start asking. All right, so now that you
- 20:34know everything about this project and
- 20:36you understand what we did with Open
- 20:38Claude, I want you to help me figure out
- 20:40what is the best way that we should be
- 20:41setting up these Claude code routines to
- 20:44basically simulate that exact same type
- 20:46of environment. So, we have those cron
- 20:48jobs, but each one is kind of doing a
- 20:50bit of a different thing. You know, the
- 20:51pre-market one does a bit of a different
- 20:52job than the mid-market one. And the the
- 20:55day close one does a bit of a different
- 20:57job. So, you have a better idea of all
- 20:59of our memory files and our skills, and
- 21:02you understand the structure of every
- 21:04time the agent wakes up and the routine
- 21:06is triggered, they need to read the
- 21:08files first to, you know, kind of get it
- 21:09acclimated with the environment, do what
- 21:11they need to do, research, potentially
- 21:13make a trade, potentially sell
- 21:15something, you know, whatever it is
- 21:16based on their best judgment, and then
- 21:18update all of the memory files so that
- 21:20next time the next agent wakes up, they
- 21:22understand what's going on. So, what I
- 21:23want you to do is help me figure out
- 21:25what are the right structure for these
- 21:28um
- 21:29cron jobs, and
- 21:31most likely we only want them during the
- 21:32week when the market's actually open.
- 21:34And just like that, I'm able to brain
- 21:36dump and Claude's going to do the heavy
- 21:37lifting for me and propose some ideas.
- 21:40Okay, let's see the plan that it came up
- 21:41with. So, stand up five recurring Claude
- 21:44code schedule triggers, and we've got
- 21:46these different slash commands that it's
- 21:48going to be able to utilize. So, all
- 21:50five triggers will run on the weekdays
- 21:51only except for the weekly review, which
- 21:53is Friday only. So, we have a
- 21:54pre-market, which is for research
- 21:56catalysts and draft trade ideas. It
- 21:58won't message me unless it's urgent. We
- 22:00have a market open, which is going to
- 22:01execute the planned trades and set 10%
- 22:04trailing stops that'll go to the trade
- 22:06log. Only if a trade is placed will I
- 22:08get a notification. We have midday,
- 22:10which will cut minus 7% losers and
- 22:12tighten stops on winners, also going to
- 22:14trade log. So, here you guys can see
- 22:15basically it was able to analyze
- 22:17our strategy and analyze what we have
- 22:19access to and then build me a plan. And
- 22:21now what I want to do is basically just
- 22:22have it create those prompts for me so
- 22:24that I can go ahead and go set up those
- 22:26routines in Claude code. All right, so
- 22:28those crons look great. So, I don't need
- 22:31you to actually create them. What I need
- 22:33you to create for me is the prompts. As
- 22:35if I was going to run one of those
- 22:37commands into a fresh Claude code
- 22:38session and I wanted it to do all the
- 22:40right stuff, what is the exact prompt
- 22:42that I would enter into that session?
- 22:44And the one thing that you need to keep
- 22:45in mind here is reminding it to
- 22:47obviously um read the files before it
- 22:49does anything, and update the files at
- 22:51the end, and then also when it needs to
- 22:53use an API like Perplexity or ClickUp or
- 22:55Alpaca, that it should be grabbing those
- 22:58keys from the environment variables of
- 23:00that environment, not inside a .env
- 23:03file. All right, and now with that
- 23:05feedback, it should be able to give us
- 23:06those prompts, and then we should be
- 23:07able to just set up the routines and go
- 23:09ahead and test them out. Okay, so while
- 23:11this is writing up, there is one more
- 23:12thing that I wanted to show you guys
- 23:13that is very important. So, in the Cloud
- 23:15Code desktop app, when you go to
- 23:17routines and you go to create a new one,
- 23:18you can see that you can create them
- 23:20locally or remote. So, if you create
- 23:22them locally like some of these I have,
- 23:24this just basically means that it lives
- 23:26in your local directory. It can still
- 23:27talk to the internet and do all those
- 23:28things, but it lives in your machine
- 23:31essentially. And that means if you
- 23:33closed out of this desktop app, that
- 23:35local
- 23:36routine would not fire off. And that's
- 23:38why these remote routines are so cool
- 23:40because your computer can be off, but
- 23:41they're still running because they run
- 23:43in the cloud. But what that means is
- 23:45when you do a remote run, you have to
- 23:47have a GitHub repository to have this
- 23:50run in, which is why I have this trading
- 23:51routine repo set up.
- 23:53And so, when they run via a cloud, you
- 23:56know, routine, it basically clones that
- 23:59repo in the cloud. It spins up a copy.
- 24:01It works out of it. It does what it
- 24:02needs to do, and then it basically like
- 24:04destroys that cloud environment. So, if
- 24:05you want them to run remotely and you
- 24:07want those files to persist every
- 24:09session, you just have to talk to Cloud
- 24:10Code and say, "Hey, make sure, you know,
- 24:12because we're doing a routine, make sure
- 24:14that all of these files that it's
- 24:15actually updating, it's able to push
- 24:17back and commit back to that main actual
- 24:21branch, back to that main." And we just
- 24:22got a notification from my trading bot
- 24:24because it was market close. But
- 24:27anyways, I was saying, make sure that
- 24:29it's able to push those changes back to
- 24:31the main repo. Otherwise, the next
- 24:32agent's not going to pick it up, and
- 24:33then what's even the point? So, you can
- 24:35start local if you want, and then you
- 24:36can
- 24:37sort of graduate to the cloud if you
- 24:39want, but I definitely just wanted to
- 24:40make sure you guys understood that
- 24:42difference there. Okay, so that's done.
- 24:44You can see it created this new folder
- 24:45right here called routines, and this is
- 24:47basically the prompt that we'd be
- 24:48feeding into each of the different
- 24:50routines that we make in order to make
- 24:52sure that Bull actually understands what
- 24:54to do. And the last thing we need to do
- 24:56is actually push all of these new
- 24:57changes to this GitHub repo because
- 25:00right now here is my trading routine
- 25:01private repo. All that's in there is a
- 25:03readme and I don't think there's
- 25:04anything in here. So, we need to get all
- 25:05of these files that we just created, you
- 25:07know, these commands, these scripts,
- 25:09these memory files. We can just have to
- 25:10get all of this into that repo so that
- 25:12our routine can actually access it. So,
- 25:13all I have to do is say, "Hey,
- 25:15push all of these changes, commit
- 25:16everything to the repo." By the way, if
- 25:18you've never done that before, it's
- 25:19super super simple. You go to
- 25:21github.com, create an account. It's free
- 25:22to create an account. And GitHub is
- 25:24really just like
- 25:25um it's like working on um a Microsoft
- 25:28Word on your computer and that's like
- 25:30local. And if you wanted to share it
- 25:32with someone, you would have to put it
- 25:33into like the shared drive or, you know,
- 25:35a a Google Drive or something. It just
- 25:37means that you could grab a code base
- 25:39from a different machine because you've
- 25:41uploaded it somewhere on the cloud. So,
- 25:43that's kind of why we're doing this
- 25:44whole thing with the routines in the
- 25:45cloud. So, when you get to GitHub, you
- 25:47come here, you create a new repository
- 25:48or
- 25:49the easiest way to do it is you just
- 25:51come to your Cloud Code and you say,
- 25:52"Hey, help me turn this into a GitHub
- 25:54repo." And it will say, "Okay, I need to
- 25:56authenticate you. Can I use the CLI?"
- 25:58And you say, "Yes, go ahead and do
- 25:59that." And then it will basically open
- 26:01up a tab and it will say, "Hey, can you
- 26:03sign in with your GitHub?" You sign in
- 26:05and now your Cloud Code just has your
- 26:06GitHub credentials. And whenever you
- 26:08need to push changes or clone a repo or
- 26:11whatever you need to do with GitHub, it
- 26:12can just take care of it because
- 26:14GitHub's been around for a long time, so
- 26:16it knows it way better than you probably
- 26:17do. It knows it way better than I do.
- 26:19So,
- 26:20when in doubt, just ask Cloud Code. All
- 26:22right, so if I give this puppy a
- 26:23refresh, we should see that we now have
- 26:25all of these files popped in here. We've
- 26:27got bull trading routine. Awesome. So,
- 26:29let's head over to the Cloud Desktop app
- 26:31now and start getting set up. So, what
- 26:33you're going to do is you're going to
- 26:34click on new session and you want to
- 26:35open up the local projects right here of
- 26:38whichever thing you just set up there.
- 26:40So, right here you can see that I'm in
- 26:41the folder called trading routine, which
- 26:43we were just working in in VS Code. And
- 26:45if you guys remember, in VS Code, we had
- 26:47these five different routine prompts.
- 26:49And inside of each of these, they had
- 26:50the cron, they had the actual like
- 26:53steps, and then they had like any of the
- 26:55skills or commands that they need to
- 26:56run. And this is in a folder once again
- 26:58called routines. So, before we start
- 27:00talking to our new project, we need to
- 27:02set up an actual environment for this.
- 27:04So, if I go to new routine and I go to
- 27:05remote and I go over here to my um cloud
- 27:09environments, you can see that you can
- 27:10add one. And so, just add one and I'm
- 27:13going to pull up my trading one so you
- 27:14guys can see. But here, this is where we
- 27:16set up things like our API keys and our
- 27:17network access. So, I called mine
- 27:19trading. I gave it full network and this
- 27:22is where I'm going to put in my API keys
- 27:23for Alpaca and for Perplexity and for
- 27:25ClickUp.
- 27:27And then you basically just go ahead and
- 27:28save the changes of that environment and
- 27:30this is the one that you want your
- 27:32actual routines to be scheduled inside
- 27:35of. I am going to basically just talk to
- 27:37it right here to help us get these
- 27:39remote routines set up. Look inside the
- 27:42routines folder inside of this project
- 27:45and help me set up all of these
- 27:46different scheduled routine runs. They
- 27:49should all have a cron job in there.
- 27:50They should all have a prompt in there
- 27:52already and we will be working out of
- 27:54this GitHub repo and scheduling off
- 27:56these routines. So, let me know if you
- 27:57have any questions. Do not exit the
- 27:59planning phase until you're 95%
- 28:01confident that you know exactly what to
- 28:03do and exactly what I'm looking for.
- 28:05So, now I'll shoot that off and it
- 28:06should be able to come back with a plan
- 28:07to actually go create all of those cron
- 28:09jobs for us. Okay, now you can see it's
- 28:11coming back and asking us some
- 28:12questions. So, the first one is which
- 28:13cloud environment should they run in?
- 28:15We're going to do trading. That's the
- 28:16one you guys saw me set up. We want to
- 28:17use Cloud Opus 4.7 and we're going to
- 28:20use this GitHub repo. Yes, trading
- 28:22routine. All right, so it's set up all
- 28:24of those routines for us. You see that
- 28:26all I had to do was talk to it. It set
- 28:27up these crons cuz I don't know what
- 28:29exactly this means, but basically that
- 28:30means 6:00 a.m. Monday through Friday
- 28:32for all of these. Monday through Friday
- 28:348:30 a.m., noon, 3:00 p.m. and then this
- 28:36one is just 4:00 p.m. on Friday. So, if
- 28:38I go over here to my routines and I
- 28:40scroll down, you can see that we have
- 28:41these new five routines for bull and
- 28:43these are all remote. If I click in this
- 28:45one for example says every Friday at
- 28:474:00 p.m. Central, we're in the right
- 28:49repo. If I click into here, we should
- 28:51see we see this entire prompt, which is
- 28:53correct, and we're in the right
- 28:55environment, which is my trading cloud
- 28:56environment. And then one other
- 28:58important thing that you have to do is
- 28:59inside of your actual um routine, what
- 29:02you want to do is go to permissions, and
- 29:03you want to turn on allow unrestricted
- 29:06branch pushes. This removes the branch
- 29:08push restrictions, and Claude will be
- 29:10able to actually push to any branch, not
- 29:11just the Claude {slash} branches. So,
- 29:14turn that on for all five of these
- 29:15routines here. So, I'm going to turn
- 29:16that on for all five of these routines
- 29:18here. So, let's just pretend that it is
- 29:20Friday. I'm going to do a run now to see
- 29:22if this is able to actually work. And
- 29:23when you run these, you can actually
- 29:25click right here, and you can watch them
- 29:26actually work in real time. And best
- 29:28practice with routines is that every
- 29:30single time you build a new one, you
- 29:31should always do a run now at least a
- 29:33few times to make sure that they are
- 29:34working as expected. And exactly why we
- 29:36test out, you can see what happened is
- 29:38when it tried to hit Alpaca, it wasn't
- 29:40able to find the API key because for
- 29:41some reason, once again, it thought it
- 29:43was going to be in a {dot} env, but as
- 29:44you guys know, we don't have a {dot} env
- 29:46because we don't put that in the GitHub.
- 29:47So, I'm coming back into this session
- 29:49that set up these five, and I'm just
- 29:50going to say, "Hey, remember, all of the
- 29:52API keys are going to be stored in the
- 29:53environment variables. So, all of the
- 29:54prompts must explicitly state that."
- 29:56Okay, so the issue was they weren't
- 29:58spelled exactly word for word, letter
- 30:00for letter. So, I fixed that, and you
- 30:02can even see, for example, this one,
- 30:04they're all now coming through, but for
- 30:05example, in this one, I have the word
- 30:07API right here between Alpaca and
- 30:09secret. So, they have to be matching one
- 30:12for one, otherwise it will think that
- 30:13they're not there. But anyways, now that
- 30:15that has been figured out, it's actually
- 30:17able to look through all of these
- 30:18things, it's able to look through the
- 30:19memory, and it's going to execute our
- 30:21weekly review here. And there we go,
- 30:22just like that, the weekly review has
- 30:24been ran. I also told it that I fixed
- 30:25the Alpaca secret key, so now all of
- 30:27that's been updated. And if you go over
- 30:29to my GitHub, you can see that it was
- 30:31able to push these actual commits to
- 30:33this repo. This one was just a test one
- 30:35that it was running on the background as
- 30:37well, but it was able to actually give
- 30:39us the weekly review, and you can see it
- 30:40was committed by Claude, and it made
- 30:42changes to this actual MD file. So now,
- 30:45the next time it actually will be able
- 30:46to pick it up and we have our stuff all
- 30:48synced up. And alongside that weekly
- 30:49review, you can see that in my internal
- 30:51automations channel, sandwiched between
- 30:53two YouTube notifications, we have the
- 30:56weekly review that the run just sent us.
- 30:58We have our portfolio, we have versus
- 31:00the S&P, and we have any trades that we
- 31:02were making, and then, you know, some
- 31:03best and worst, and also it graded
- 31:06itself a C for the week. So, we'll see
- 31:08how this is able to improve. So, I just
- 31:10spun up this test so you guys could see
- 31:11that we are able to talk to Alpaca right
- 31:13now. You can see that we're able to get
- 31:15the current balance. And if I go into
- 31:17here, we should see 9859. And back in
- 31:20Claude Desktop, where it pulled it,
- 31:229859. And just like that, we have set up
- 31:24a 24/7 AI agent trade system with Opus
- 31:274.7. We've got our 6:00 a.m., our 8:30
- 31:29a.m., we've got our noon, and our 3:00
- 31:31p.m. And then on Fridays, we have our
- 31:33actual weekly review as well. Now, of
- 31:35course, like I talked about earlier, it
- 31:37is on you to now keep testing, keep
- 31:39iterating, making sure that everything's
- 31:40working, and upgrading your strategy as
- 31:42you go. And maybe you want to add some
- 31:43more crons in. Maybe you want to take
- 31:44some away. Maybe you want to add one on
- 31:46just like a Sunday night to do some more
- 31:48research to prep for the week. However,
- 31:49you would actually want to set up your
- 31:51trading strategy if you were doing it
- 31:53manually. Now, I know you guys are
- 31:54thinking like I have four automations
- 31:56per day basically plugged in now with
- 31:58Claude routines, and that's going to eat
- 32:00away at my session limits, right? I
- 32:02mean, yes and no. I'm definitely going
- 32:03to be watching it, obviously. But keep
- 32:05in mind, when I did this with my open
- 32:06Claude agent for 30 days, I was also
- 32:08plugged in my Claude subscription, and I
- 32:10was still doing my own workflows, and I
- 32:12was never really hitting my limits. It's
- 32:14all about managing your context. And I'm
- 32:16going to have a full video dropping
- 32:17about that, another one coming out soon.
- 32:19But I can tell you for certain that if I
- 32:21were to set up all of these crons and
- 32:22have the same sort of autonomy and
- 32:24agentic workflow-ness, and I was just
- 32:27doing this via API, then that would 100%
- 32:29be way more expensive than what I've got
- 32:32set up here. We have now deployed, and
- 32:33now we just go ahead and track. And what
- 32:35is the hidden lesson here? The hidden
- 32:36lesson is that files aren't just memory,
- 32:38but they're essentially the agent's full
- 32:39personality and discipline. Like with
- 32:41Open Claw, you set up your soul.md file
- 32:43and you've got your agents.md file and
- 32:45you got all these different files. So,
- 32:46it's really about how do you make sure
- 32:48that you orchestrate this in the right
- 32:49way so that it can access the right ones
- 32:51when it needs to. So, anyways, I hope by
- 32:53the end of this video you guys are able
- 32:54to follow along and set this up. I'm
- 32:56going to be giving away this document
- 32:57and it's going to have way more
- 32:58information in there basically about
- 32:59everything that we've gone over today
- 33:01and I'll drop that in my free school
- 33:02community. The link for that is down in
- 33:04the description. Once again, completely
- 33:06free. But, that is going to do it for
- 33:07today. So, if you enjoyed the video or
- 33:08you learned something new, please give
- 33:09it a like. It helps me out a ton. And as
- 33:11always, I appreciate you guys making it
- 33:12to the end and I'll see you in the next
- 33:13one.
- 33:14Thanks, everyone.
About this transcript
This page contains the full transcript of I Turned Claude Into a 24/7 Trader by Nate Herk | AI Automation, generated from the public captions YouTube serves with the video. The transcript has 8,434 words across 1,137 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.