Claude Opus 5 + MCP = New King of Algo Trading! — Transcript
Full transcript
- 0:00The Anthropic team just released Claude
- 0:02Opus 5, and this is huge, guys, because
- 0:05this model is beating Fable 5 while
- 0:08costing significantly less. In fact,
- 0:10even on a $200 max subscription of
- 0:13Anthropic, I was not really able to use
- 0:15Fable 5 as much as I needed. Whenever I
- 0:17ran a task for like 30 minutes to 1
- 0:20hour, it would drain my usage very
- 0:23quickly. But with Opus 5, I can get the
- 0:25same quality for a significantly cheaper
- 0:28price. And look at this benchmark. Like,
- 0:30it's beating it in agenting terminal
- 0:32coding, knowledge work, which is also
- 0:34important for us because imagine if you
- 0:36want to come up with some sort of
- 0:38trading strategy idea, this model is
- 0:40going to be able to help you better with
- 0:41that. It's also scoring 30% for novel
- 0:44problem solving, which is absolutely
- 0:46crazy because even GPT-5.1.6 solved,
- 0:49which was my favorite model until
- 0:51yesterday, is a scoring 7.8%. So, this
- 0:54is crazy, guys. So, in this video, as
- 0:57always, I'm going to be testing the
- 0:58model to see how good it is for writing
- 1:01strategies, running back tests,
- 1:03parameter optimizations, and Monte Carlo
- 1:05simulations to ensure not only it finds
- 1:07us good strategies, but also it ensures
- 1:10they are not overfit. Before I move on,
- 1:12I got to mention I am not a financial
- 1:14advisor, and this video is for
- 1:16educational purposes only. So, guys,
- 1:18let's get started. As always, I'll be
- 1:20using the Jesse framework for the algo
- 1:22trading side of things using Python.
- 1:24It's absolutely free to get started
- 1:26with, and you can follow the
- 1:27documentation to get it installed on
- 1:29your machine. And if you prefer videos,
- 1:31I also have those on my channel. So,
- 1:33just go ahead and get started with that.
- 1:35And assuming you've already done that,
- 1:37all I need to do to get started is to
- 1:39run the Jesse run command. There we go.
- 1:42This is the address for the dashboard,
- 1:43and this is the address for the MCP. So,
- 1:45let's copy this. Now, in order to run
- 1:48Claude code, we're going to have to run
- 1:49it inside another terminal. And because
- 1:51I'm on the Z editor, it allows us to do
- 1:54it right from here. Now, this is another
- 1:56terminal, very similar to this one, but
- 1:59it is on the sidebar. So, I could just
- 2:01run the Claude command in order to run
- 2:03Claude code on my terminal right now,
- 2:05but if you haven't added Jesse MCP into
- 2:08Claude, you need to do it using this
- 2:11command that is on the documentation of
- 2:13Jesse. And you notice the address that I
- 2:15copied was running on the port 9007. So,
- 2:18instead of 9002, I have to enter that.
- 2:20But for you, this is going to be the
- 2:22default value. So, just go ahead, copy
- 2:24this and run it here, and you should be
- 2:26good to go. I've already done this, so
- 2:28I'm not going to do that. I will just
- 2:29instead run the Claude command. There we
- 2:31go. Now, to ensure that I'm running on
- 2:34the Opus 5, I'm going to run the /model
- 2:37command, and here you can see that the
- 2:39default is now using Opus 5. And the
- 2:42effort is set to high, which I find it
- 2:44to be more than enough for my use case.
- 2:46All right, next we're going to have to
- 2:47feed the prompt to the model. And in
- 2:49case if you just want to copy and paste
- 2:51it, I'm going to put it on GitHub and
- 2:53link to the repository in the
- 2:54description of the video. So, let's get
- 2:56started. Hey there, I need you to do
- 2:59research and develop a trend following
- 3:01strategy for trading ETH USDT that
- 3:04enters on pullbacks within an
- 3:06established trend. Use supertrend as the
- 3:08primary indicator, supported by an
- 3:11EMA-based trend filter, and any other
- 3:13confirmation indicator you see fit. Use
- 3:16the 30-minute time frame as the main
- 3:18trading time frame, and the 4 hours as
- 3:20the anchor time frame. I need the
- 3:22results of it to be good since the
- 3:24beginning of the year until now. And
- 3:26when I say good, I mean a sharp ratio of
- 3:28at least 1.5. Risk 3% of the account per
- 3:32each trade. Every time you develop a
- 3:33strategy, validate the result using a
- 3:36statistical significance test before
- 3:38writing the full strategy to ensure the
- 3:40entry rules are not pure noise. Only
- 3:43proceed if the strategy's metrics
- 3:45demonstrate genuine statistical
- 3:46significance. Feel free to use
- 3:48optimization to improve the results. At
- 3:50the end, apply Monte Carlo simulations
- 3:53to ensure the results are not overfit.
- 3:55Continue until you find strategies that
- 3:58fully meet the criteria requested. Do
- 4:00not prompt me in the meanwhile. Good
- 4:02luck. There we go. Let's hit enter. This
- 4:05seems fine. And as you can see, it's
- 4:07started reading the
- 4:08agents.to.them.defile of the project,
- 4:10which is going to tell it to use J S MCP
- 4:13in order to write the strategy and do
- 4:15the research. So, let's go and come back
- 4:17a bit later. All right, so it did it
- 4:18everything that I needed to do and it
- 4:21performed it very quickly. So, I
- 4:22basically just went for lunch, I came
- 4:25back and it was ready. And as you can
- 4:26see, it's also very verbose. And this is
- 4:29helpful if you are a beginner. So, for
- 4:31example, you can see exactly the path
- 4:34that the AI is taking in order to
- 4:36develop the strategy. And especially for
- 4:39beginners, that is super helpful because
- 4:41you want to learn. So, the first thing
- 4:42that it did is that once it wrote the
- 4:44strategy, it ran an RST test, which is
- 4:48rule significance test, which it allows
- 4:50us to know whether the entry rules of
- 4:52the strategy were pure noise or luck or
- 4:55was there an actual edge in it. So, it
- 4:57does that before moving on with the rest
- 5:00of the strategy such as the position
- 5:02sizing, take profit and a stop loss.
- 5:04Because if the entry rules of the
- 5:05strategy don't have an actual edge, then
- 5:08everything else that we do is pointless.
- 5:09So, it did that to validate the results
- 5:12that it found and then it continued
- 5:14until it found a good strategy.
- 5:16Here we can see it says version four is
- 5:18profitable, which means it wrote four
- 5:20versions until this point. There's
- 5:22another V5. So, it tried out many
- 5:25different variations of the same
- 5:27strategy until at this point it was able
- 5:29to find the ending result that we
- 5:32wanted. So, a sharp ratio of 1.68, net
- 5:35profit of 30%, a max drawdown of minus
- 5:3717% and it executed 48 trades. So, this
- 5:41looks good and it gave me URLs for the
- 5:43final backtest, the RST test and the
- 5:46Monte Carlo so we can check it out. But,
- 5:48before I move on, I also asked the model
- 5:50to do something else. I needed to add
- 5:52charts to the strategy so that we can
- 5:54visualize it better. And that's
- 5:56literally what I told it. But, now that
- 5:58I'm thinking, it would probably be
- 5:59better if I added this to the prompt
- 6:01that I gave the model in the first
- 6:03place. So, let's just scroll down, and
- 6:05here's the backtest results for what we
- 6:08asked, and it also went ahead and tested
- 6:10with other periods, such as this one,
- 6:11which is for 2 and 1/2 year, and this
- 6:13one is for 5 and 1/2 years. And of
- 6:16course, these are super helpful if you
- 6:18want to use the strategy to go live with
- 6:20it. So, let's open this one first. Now,
- 6:23one problem I have with it is that this
- 6:25format that it is printing this, it
- 6:27doesn't work. Okay, if I click on this,
- 6:29we're going to get an error because this
- 6:30ID is not complete. We also need this
- 6:33one. So, let's ask it to fix this.
- 6:34Please give me new URLs for everything,
- 6:37not just the backtest, and also ensure
- 6:39the URLs are on one line so I can just
- 6:42click on it because the format that you
- 6:44just printed them in a table doesn't
- 6:46work. Now, while that's going, I want to
- 6:48quickly remind you guys about our
- 6:49Telegram. It's the fastest way to get
- 6:51notified about my future work, whether
- 6:53it's a new tutorial or a tool that I
- 6:55create. Also, don't forget to check out
- 6:56our free Discord, where more than 5,000
- 6:59members like you and I are hanging out
- 7:00there and helping out each other with
- 7:02algo trading so we can all succeed
- 7:04together. The links for both are down in
- 7:05the description. All right, there we go.
- 7:07So, let's open this one and also this
- 7:09one and this. So, there we go. This is
- 7:11the result of the backtest from the
- 7:14beginning of the year until this month.
- 7:16Now, if you see the dashboard being
- 7:17different, that's because I'm running
- 7:18version three of Jesse, which hasn't
- 7:20been released yet, but it is coming in
- 7:22the coming days. I have basically
- 7:24redesigned everything and made
- 7:25everything better. But anyways, here's
- 7:27the equity chart, and this indigo equity
- 7:30curve is the one for a strategy's
- 7:32performance, and this one in orange is
- 7:35the performance of ETH/USDT if you were
- 7:37just buying and holding the asset. And
- 7:40here's the chart for the worst five
- 7:42drawdown periods, and as you can see,
- 7:43it's not looking great. Like short, this
- 7:46is awesome, and so is this one, but we
- 7:48had a nasty drawdown period in here, and
- 7:50this is the monthly return chart. It
- 7:52executed 48 trades, the net profit is
- 7:5530%, the max drawdown is -17, the win
- 7:58rate is 31%, but the average win to loss
- 8:01is really huge, so it is 3.8. The
- 8:04average holding time is 38 hours, the
- 8:07Sharpe ratio is 1.68, which is way above
- 8:091.5 criteria that we set for the model.
- 8:12And the average trades per month is
- 8:14seven. So, overall, looking really good,
- 8:16and the model was kind enough to also
- 8:18execute it on other periods. So, this
- 8:20one is for 2 and 1/2 year, and it
- 8:22actually looks really good. So, here's
- 8:25the equity curve chart, and as you can
- 8:27see, it's going up nice and steady while
- 8:29the actual underlying asset, which is
- 8:31ETH, is in a range market. So, if you
- 8:33were just holding ETH, you would not
- 8:35have made a lot of money, but with this,
- 8:37it would have been much better. The max
- 8:39drawdown is still -17%, the win rate is
- 8:4227%, but the average win to loss ratio
- 8:45is 3.95.
- 8:47So, guys, a strategy like this is very
- 8:50difficult to trade mentally. So, from a
- 8:53psychology side, most of us are not
- 8:55going to be able to continue trading
- 8:57something like this, because basically
- 8:59every seven out of 10 trades that you
- 9:01take are going to be losing ones. And
- 9:02the Sharpe ratio is 1.35, which is still
- 9:05good. And the average trades per month
- 9:07is eight. So, overall, this is looking
- 9:09really good. And the chart for the worst
- 9:12five drawdown periods is also looking
- 9:14better now. So, you see, guys, zooming
- 9:16out is always the key, because in the
- 9:19end, we're not going to be trading just
- 9:20one strategy, right? So, even for this
- 9:22period, for example, which is multiple
- 9:24months, and the strategy wasn't doing
- 9:26fine, if you can develop another
- 9:28strategy which isn't super correlated to
- 9:31this one, and if that one was doing fine
- 9:33during this period, then we we have been
- 9:35fine, because the other strategy was
- 9:37making money while this one was in a
- 9:39range. And when you execute multiple
- 9:41strategies like this simultaneously,
- 9:42you're going to get a better sharp ratio
- 9:44and even a better max drawdown. So, that
- 9:47is something to remember that do not
- 9:49expect to just trade one strategy in the
- 9:51end. Anyways, moving on, here's the
- 9:53chart for the monthly returns of it and
- 9:56as you can see, every year it is
- 9:57profitable and in most months we are
- 10:00also green, but not in all of them. And
- 10:02we have months as bad as minus 11%. We
- 10:05also have good ones as good as 17%.
- 10:07Next, let's take a look at the results
- 10:09for the 5 and 1/2 years of backtest and
- 10:13as you can see, it still looks good even
- 10:15though there are periods such as this
- 10:17one where it was totally in a range. So,
- 10:19the strategy's results wasn't super
- 10:21awesome, but it wasn't that bad either.
- 10:23So, it's not like it was falling a lot.
- 10:25We also had a bad period here. So, even
- 10:27though the price was going up, the
- 10:28strategy wasn't performing well and we
- 10:31were actually in a loss. So, this is
- 10:32very important to remember that a
- 10:35strategy like this could even lose money
- 10:37in the short term even when the market
- 10:39is going up and that is going to be very
- 10:41difficult mentally. So, if I were
- 10:42trading this strategy at this period, I
- 10:45would have probably stopped and would
- 10:46have lost on these profits over the next
- 10:49few years. So, this is also really
- 10:51important and another reason for why you
- 10:53guys need a portfolio of strategies
- 10:56instead of just trading one because it's
- 10:58going to be a lot easier mentally if you
- 11:00had other strategies running in this
- 11:02period and you weren't allocating all of
- 11:04your capital to just one single
- 11:06strategy. Anyways, here's the drawdown
- 11:08chart and this one was not only the
- 11:11worst one, it was also the longest one.
- 11:14And in fact, we can actually see how
- 11:16long that was by taking a look at this.
- 11:18So, max underwater period was 205 days.
- 11:22So, close to a year. So, this was very
- 11:24brutal if you were trading it during
- 11:26that period. Anyways, so the max
- 11:28drawdown is minus 20% which is a good
- 11:30number. The total number of trades is
- 11:32541.
- 11:34The P&L would have been 607%.
- 11:37The win rate was 28%. The sharp ratio
- 11:40was 1.34. And the average trades per
- 11:43month was eight. So, overall, I really
- 11:45like this result. Even though so far I
- 11:47just spent like an hour developing it
- 11:49with this AI model. So, of course, I'm
- 11:52going to keep working on it. But even as
- 11:54it is, it does have a lot of potential.
- 11:56Now, one more thing I want to show you
- 11:57guys. Remember when I asked the model to
- 11:59add charts to it. So, because I did
- 12:01that, here I can click on the trade
- 12:04chart button here and it's going to show
- 12:06me an interactive chart which allows us
- 12:09to see every single trade that it took.
- 12:11So, for example, let's sort it based on
- 12:13the best ones. And this one presumably
- 12:16made 45%, right? So, let's click on it
- 12:19and zoom in a little bit. So, we can see
- 12:22exactly where it opened and where it
- 12:23closed, right? But these indicator
- 12:26values, these are the ones that we asked
- 12:27it to add. So, here we can see the
- 12:30regime, for example. So, when was it
- 12:32minus one? So, these were ready for a
- 12:34short position. And this was zero, so a
- 12:37neutral territory as you can also see
- 12:38the label here. But I want to minimize
- 12:40this one to have more place for this.
- 12:42And we also have the ADX, but I also
- 12:44want to minimize this one. And here we
- 12:47can see this blue line here is the
- 12:494-hour EMA 200, which is the strategy
- 12:51it's using. So, let's also toggle this.
- 12:54And this orange one is the super trend
- 12:56for the 4-hour time frame. So, let's
- 12:58toggle this one also. And this red line
- 13:01here is the stop loss. So, let's also
- 13:04toggle this one. So, that is only going
- 13:05to leave us with this purple line, which
- 13:07is the super trend value on the
- 13:1030-minutes time frame. So, let's zoom in
- 13:12a little bit. Next, I'm going to go
- 13:14click on here. So, now we can see it
- 13:16went short here. And let's zoom out a
- 13:19little bit. There we go. And if I hold
- 13:21the mouse here again, we can see exactly
- 13:24where where opened the trade and where
- 13:26it closed it. So, let's also click on
- 13:28this one, another one. Now, we can also
- 13:31sort it based on the worst ones. So,
- 13:33this one it lost 12%. Now, by the way,
- 13:36this isn't 12% of your entire capital,
- 13:38of course, because we were only risking
- 13:392% of the capital per each trade. So,
- 13:42this cannot be more than that, of
- 13:43course, but this is just based on the
- 13:46the price movement. So, I wouldn't
- 13:48really look at this or care about it a
- 13:50lot, but anyway, so let's just click
- 13:52here. So, here we can see a losing
- 13:54trade. So, let's zoom in. So, we went
- 13:56short here, but the price actually went
- 13:58up. Let's see another one and also
- 14:00another one. All right, going back to
- 14:02the terminal where we had the cloud
- 14:04code, we can also see the results for
- 14:06the significance test, for example. So,
- 14:08let's give this one a
- 14:10try. There we go. So, here's the chart.
- 14:12Because the P value is lower than this
- 14:14value here, we're going to say the entry
- 14:16rules of the strategy has statistical
- 14:18significance. So, I am a little bit over
- 14:20simplifying this because explaining how
- 14:23this algorithm works requires its own
- 14:25video, but basically, this is all you
- 14:28need. So, if the results is saying that
- 14:30it is significantly significant, that's
- 14:32it. Just move on to the other parts of
- 14:34the strategy. And last, but definitely
- 14:36not least, the Monte Carlo simulation is
- 14:38the most important piece of the puzzle
- 14:40because sure, we got these results and
- 14:43they were good, but you want to ensure
- 14:44that it isn't overfit. And as you can
- 14:46see in the chart, the orange line is the
- 14:49original backtest equity curve, and we
- 14:51can see that it is ending in right in
- 14:53the middle. And the simulations are way
- 14:55above it. So, this is a really good sign
- 14:57because if this one, for example, was
- 14:59just here, like way at the top, it would
- 15:02have been a clear sign that we were just
- 15:04being lucky during those backtests,
- 15:07which is not a good sign if you want to
- 15:08take the strategy live. And if you also
- 15:11read this table here, we can see the
- 15:12Sharpe ratio of the original was 1.62,
- 15:15but the median number is 1.93, and the
- 15:18best 5% is 4.36. So, usually, I want the
- 15:22original back test sharp ratio to be
- 15:25near median. So, something such as two
- 15:27or even 2.4 maybe, that would have been
- 15:30fine for me. So, I would have said that
- 15:31that is not overfit. But, as you can
- 15:33see, this case is even less than the
- 15:35median number. So, this is a very good
- 15:38sign and maybe, just maybe, this is also
- 15:41the same reason why it's performing so
- 15:42well during the bigger periods. Now, I'm
- 15:45going to move on, but if you guys want
- 15:47to take this strategy live, I also
- 15:49suggest try Monte Carlo simulations on
- 15:51these bigger periods. Now, we can also
- 15:53see that the agent wrote us a complete
- 15:56report file in the markdown format. So,
- 15:58we can see what was the strategy's name
- 16:01and what was the parameters that it
- 16:02used, what was the target that it
- 16:04achieved, and how it did it. It also
- 16:06gives us a pretty good summary of
- 16:08everything that just went on. Now, let's
- 16:10also take a look at the strategy's code.
- 16:12So, we can see a really huge section of
- 16:16the explanation. We can just skip all of
- 16:18it. Here's the percentage that it risk
- 16:20per each trade. It defined the anchor
- 16:23time frame, which is always a good idea
- 16:25for determining the bigger trend of the
- 16:27market and the ATR indicator. It also
- 16:29wrote some useful comments such as this
- 16:31one, data and signal. We can see the
- 16:33anchor regime, which I'm guessing is the
- 16:36bigger trend, and it is using the super
- 16:38trend, and it is passing the anchored
- 16:40candle. So, pretty standard stuff. It is
- 16:43also using the before method of Jesse in
- 16:46order to store some variables to use
- 16:49later. Now, I don't think this is
- 16:51exactly the best syntax. I think it
- 16:53wrote things a little bit more
- 16:54complicated than what I personally would
- 16:56have, but it is fine. So, moving on, it
- 16:59also defined another method called the
- 17:01entry signal, which is responsible to
- 17:04tell us whether we want to open a long
- 17:06or a short position. And then, inside
- 17:08the should long and should short methods
- 17:10of Jesse, it is simply returning the
- 17:13value of this signal. So, it's saying
- 17:15that if it's one, we want to go long. If
- 17:17it's minus one, we want to go short.
- 17:19However, this is actually a pretty good
- 17:21syntax because it is just making the
- 17:23decision if you want to open a long or
- 17:25short position, but it's not actually
- 17:27executing the orders. Next, inside the
- 17:30go long and go short methods of Jesse,
- 17:32we can see it's defining the entry
- 17:34order, which is being the current price,
- 17:36the stop loss order, and it is also
- 17:38storing the stop loss order so that we
- 17:41can use it later, and it is submitting
- 17:43the buy and the sell orders with this
- 17:45syntax. Now, because the results are
- 17:47good, I'm going to give it a pass, but
- 17:49in the actual prompt that we gave the
- 17:51agent, I did not want it to open the
- 17:54positions using market orders, and that
- 17:56is why I said that I want to go long
- 17:58during a pullback. So, what I meant by a
- 18:00pullback was entering via a limit order.
- 18:03Now, maybe I should have been more
- 18:05specific with it, but this isn't exactly
- 18:07what I had in mind. But anyways, moving
- 18:09on. So, once it opens the position, it
- 18:12is submitting the stop loss order, and
- 18:14that is was storing the sub price here.
- 18:17So, this is also good. And notice that
- 18:20it did not define a take profit order,
- 18:23and instead it's using the update
- 18:24position method of Jesse, which is
- 18:26executed after every single candle
- 18:29closes to keep updating the stop loss
- 18:32order, and also saying that if the
- 18:35regime is no longer with us, we want to
- 18:37liquidate the current position. So,
- 18:39basically, this is using a trailing a
- 18:41stop kind of take profit, which is
- 18:43pretty a standard if you want to take
- 18:45the most out of a trend. And I'm
- 18:48guessing this is why the average win to
- 18:50loss ratio of the strategy was so high
- 18:52while the win rate was low. And finally,
- 18:55we have the update chart method of
- 18:57Jesse, which is actually new inside the
- 19:00version three, which isn't released yet.
- 19:01Again, it's coming in the coming days.
- 19:03What it does is that it adds some
- 19:05indicators to the chart so we can view
- 19:07it inside the interactive chart. Now, we
- 19:10actually had this feature before, but
- 19:12this one is just the upgraded version of
- 19:14that and it also works during live
- 19:17trading. So, not just the back test,
- 19:18which is the limitation that we had
- 19:19before. But anyways, moving on, we also
- 19:21have the upper parameters, which is
- 19:23defined, such as the stop ATR, trailing
- 19:26ATR, the ADX mean, which is for the
- 19:28threshold of the ADX and things like
- 19:30that. So, this is the syntax that we use
- 19:32inside the JSE framework in order to run
- 19:35optimization to find the best
- 19:37parameters. As always, I did submit this
- 19:39strategy on our strategies index page on
- 19:41our website. So, if you want to check it
- 19:43out on other trading periods and see the
- 19:45metrics for those, you can check out
- 19:47this page and I'm going to link to it in
- 19:49the description of the video. You can
- 19:50also check out this page for other
- 19:52strategies submitted either by me or
- 19:54other members of our community. I forgot
- 19:57to mention you can also download the
- 19:58source code of the strategy by clicking
- 20:00here. Anyways, if you enjoyed the video,
- 20:02please make sure to give it a like and
- 20:04post a comment to let me know what you
- 20:05think. It helps me out a lot and don't
- 20:08forget to subscribe if you haven't
- 20:09already because I will be creating more
- 20:11videos just like this one in the future.
- 20:13Thank you so much for watching. I'll see
- 20:15you in the next one.
- 20:18>> [music]
About this transcript
This page contains the full transcript of Claude Opus 5 + MCP = New King of Algo Trading! by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 4,098 words across 557 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.