Building a Profitable Strategy w/ Claude - Day 30: Automating the ORB Strategy — Transcript
Full transcript
- 0:00Hello guys and welcome back to a new
- 0:01video in the series of me trying to
- 0:03build a profitable trading algorithm
- 0:06using AI. [music] So our first real
- 0:08attempt to find something profitable
- 0:11failed and honestly that's expected.
- 0:13Finding something that works on the very
- 0:15first try in the world of quant or
- 0:18building trading algorithms is extremely
- 0:21unlikely. All right, that's completely
- 0:24normal. So quick recap of the idea what
- 0:27we tested for our first attempt
- 0:30hypothesis was the regime detector.
- 0:33Something that reads a market and
- 0:34decides whether we are in a range or a
- 0:37trend. If we are trending it fires a
- 0:39simple trend following strategy. If we
- 0:41are ranging it switches to a mean
- 0:43reversion one. So good idea on paper but
- 0:46it just didn't work. So today we're
- 0:49trying something different. And today
- 0:50we're going to take one specific
- 0:52well-known strategy and see if we can
- 0:54turn it into a fully automated system.
- 0:58So the opening range breakout. [music]
- 1:01Now one of the reasons the previous
- 1:03trend following attempt failed is that
- 1:05we were trying to sculp in tiny time
- 1:08frames. [music] The 1 minute, the
- 1:1030cond, the 15c for couple of points on
- 1:13NQ [music]
- 1:14and that just doesn't work. Okay?
- 1:16Because NQ intraday, it loves to chop.
- 1:20Okay, it's not a clean expansion from
- 1:22the open at 9:30 all the way to the
- 1:25close at 4 or 5 p.m. There's a ton of
- 1:28range and noise in between. So, we kept
- 1:31getting chopped out trying to sculp it
- 1:33and the regime kept flipping on us. All
- 1:36right, so the opening range breakout is
- 1:38a completely different animal. Okay,
- 1:41it's one of the most famous day trading
- 1:43strategies out there right now. And a
- 1:46lot of traders trade it, but mostly
- 1:48manually by hand. But today, we're going
- 1:51to try to automate it. So, we're going
- 1:53to remove um the psychology element of
- 1:58it and the human error element and we're
- 2:01going to try to make it automated,
- 2:03optimize it, and fine-tune it and see
- 2:05how that works. Okay? And
- 2:10to be honest with you, I'm quite
- 2:11optimistic because this one actually
- 2:14makes complete sense and we're going to
- 2:17see. So before we start, make sure to
- 2:19check uh the current discount bonus is
- 2:21running. One of the best and most
- 2:23reliable futures
- 2:25pro firms out there. You can use the
- 2:26coupon code stranger to get a nice
- 2:29discount or just click on the link
- 2:31below. Now let's continue. I want to
- 2:34start from the beginning. Okay. where
- 2:36where does this strategy even come from?
- 2:39So I think talking about its uh origin
- 2:42actually matters. Um I don't I don't
- 2:45want to just blind test strategies. So
- 2:49um this one came from stocks originally.
- 2:51It wasn't built for futures or US or the
- 2:55S&P um index. [music] And the author
- 2:58isn't some guru on YouTube. Okay. His
- 3:01name is Carlo something. I don't want to
- 3:04butcher his last name but is a quant
- 3:08researcher who actually published proper
- 3:10research on it but he used a five minute
- 3:13opening range. Okay. [music] So the idea
- 3:15is simple right here. The market opens
- 3:17you wait for the first 5 minute to to
- 3:20pass and you mark the high and the low
- 3:22of that 5 minute window and that's your
- 3:25opening range and then you trade
- 3:27whichever side breaks [music] first. If
- 3:29price breaks to the top after those five
- 3:31minutes, you go long with a stop um
- 3:33somewhere below. If if it breaks to the
- 3:36bottom, you go short. That's it. And
- 3:38what I love about this one is that it's
- 3:40visual. Okay, you can actually see it.
- 3:42You can understand it in a few seconds.
- 3:46So, here's the whole process. Okay,
- 3:48first of all, you wait for the opening
- 3:49range again to form. Price breaks on
- 3:53top, you go long. Um price goes or
- 3:56breaks on the bottom, you go short.
- 3:58Okay. And the most important part right
- 4:01here is that you don't cut it short.
- 4:04Okay. You're not sculping few points.
- 4:05You're trying to catch the whole day
- 4:07move. The whole day's move. Okay. That's
- 4:12the edge right here of this strategy.
- 4:14Okay. That's the point. All right. So,
- 4:17naturally, when we put it to the test,
- 4:19the first thing that I did, I I wanted
- 4:22to test the original version of it.
- 4:24Okay. The 5m minute range. Now on NQ
- 4:28right now and how ENQ moves, we already
- 4:32suspect that the five minute might be
- 4:33too short um for NQ because the open
- 4:37here can chop for 15 or even 20 minutes.
- 4:40I can you can all agree on that. That's
- 4:43just a guess, but I believe that's the
- 4:45truth. But it doesn't matter what we
- 4:47suspect. We're going to test the
- 4:49baseline first to get the metrics
- 4:51because we want to compare other uh
- 4:54ranges like the 15 and the 30 minute and
- 4:57so on. And this is really important uh
- 5:01concept when you're building strategies.
- 5:03You don't start optimizing and inventing
- 5:05variations right away. You run the
- 5:07original. Okay, that's the honest
- 5:10baseline and then you see where it
- 5:12stands and then you can start building
- 5:14on top of it. Okay, you don't want to
- 5:16optimize an optimized version. You want
- 5:18to optimize the baseline. Okay, so the
- 5:21five minute rings on NQ this where are
- 5:24the metrics basic metrics. I can show
- 5:27you other metrics but right now this is
- 5:30um uh what we need. Okay, simplistic
- 5:33simplicity. The win rate is 31%.
- 5:37And the profit factor is 115.
- 5:40[clears throat]
- 5:42So it doesn't work as we suspected.
- 5:46You're b you're basically getting
- 5:47chopped out to pieces in the open. So
- 5:51again profit factor also of 115 is
- 5:53basically untradeable with that win rate
- 5:56and it was what we expected. Those first
- 5:595 minute are pure noise. You're going to
- 6:02mark a really tiny range and
- 6:07usually the first 5 minute it doesn't
- 6:09dictate the whole day. Okay, I think we
- 6:11can all agree on that. Okay, so now
- 6:15we're going to optimize it and try other
- 6:17variations or other uh parameters. So,
- 6:21we're going to test bigger ranges to see
- 6:23how they hold up. And I'm going to test
- 6:26or and I tested the 15-minut range. So,
- 6:29the first 15 minute from 9:30 to 9:45.
- 6:33And also, I tested the the 30 minute
- 6:35range. So, we can compare them side by
- 6:37side. And [music]
- 6:38as you can see the metrics right here.
- 6:42So the 15-minut got better win rate 41%
- 6:45and the profit factor uh barely moved
- 6:48but again the win rate went nicely up
- 6:51from 31 all the way to 41 and the 30
- 6:54minutes the win rate jumps all the way
- 6:57to 47% and the profit factor to 1 to
- 7:01121.
- 7:03And a quick um explainer or recap for
- 7:06what profit factor. It just means that
- 7:08for every dollar you lose, you're going
- 7:10to make $121
- 7:14in this example right here. And that's
- 7:16it. So, we're going to stick with the 30
- 7:19minute race. It gives the best results
- 7:21and that's logical. And this is just a
- 7:23simple optimization, guys. We still
- 7:25didn't fine-tune it. Okay.
- 7:29So, we proved that at 30 minute range
- 7:31from 9:30 all the way to 10, it can
- 7:33dictate the whole day. Okay, it give us
- 7:36the cleanest moves. And here's something
- 7:39interesting. Okay, it's worth
- 7:42mentioning. Even though that we found
- 7:43that the 30 minute window uh just by
- 7:47testing that it has the best um metrics
- 7:50out of the three, we didn't actually
- 7:53invent anything. Okay? Because the first
- 7:5530 minute of the session, it actually
- 7:57has a name. It's called the initial
- 7:59balance. It's where the market figures
- 8:02out its range for the day. Okay. So,
- 8:04this is a well-known concept in the
- 8:06market out there. Uh which makes total
- 8:09sense. Okay. You give the market 30
- 8:10minute to settle and you get a real
- 8:13level that we can we can base uh the
- 8:15trade and the stop loss and so on. So,
- 8:17when price breaks the 30 minute range,
- 8:20that break actually means something.
- 8:22Okay? It's not just noise anymore. Uh
- 8:24one more thing to mention technically
- 8:26this trades both ways okay so long and
- 8:29short but here's what's interesting uh
- 8:32NQ most of the time it's going up okay
- 8:35so we if you go to the daily time frame
- 8:37you can see that it is [music] uh long
- 8:39biased asset okay it just wants to grind
- 8:43higher over time so just from that I can
- 8:46already make a guess
- 8:48like maybe if we removed shorts entirely
- 8:51and only took longs maybe the win rate
- 8:54and the profit factor would get better.
- 8:57For now, this is just a guess, but we
- 8:59will throw that uh at the engine later
- 9:01and we can actually get the decisive
- 9:04results. Okay, now let's take a look at
- 9:08the full picture for the 30 minute
- 9:10version. And remember, I split my data
- 9:13into two parts, the in sample and the
- 9:16out of sample. So after we chose that
- 9:18the 30 minute has the better metric on
- 9:21the in sample, it's time to fire it on
- 9:23the out of sample. [music] So out of
- 9:26sample is a data set that we didn't um
- 9:31that we don't touch, we don't optimize
- 9:33on it. And as you can see, the in sample
- 9:35if is from 2021 all the way to 2024. And
- 9:39the out of sample is from 2025
- 9:42all the way to 2026. So uh one uh a year
- 9:47and a half. So in sample it took almost
- 9:50700 trades. Uh 49% win rate, profit
- 9:54factor of 130 made about 158,000 doesn't
- 9:58matter and a sharp of 165.
- 10:02the out of sample fewer trades of course
- 10:05obviously the the data set is uh smaller
- 10:10because
- 10:11it's only a year and a half and the win
- 10:14rate stays basically the same but the
- 10:16profit factor it drops from 130 to 117
- 10:20that's not a tiny decrease okay some
- 10:23drop from the in sample to out to to the
- 10:25out of sample is normal you almost uh
- 10:28always lose a little going out of sample
- 10:32But uh that's a real hit worth paying
- 10:34attention to. And the sharp drops too as
- 10:37you can see tremendously like from 165
- 10:40all the way to below one. And what is
- 10:44the sharp ratio? Uh in simple terms the
- 10:47sharp ratio is um it measures how smooth
- 10:50your returns are. Okay, how much profit
- 10:53you get compared of how much stress or
- 10:55draw down. Okay, how many ups and downs
- 10:59you're going [music] to go through to
- 11:00get it. So a high sharp means that it's
- 11:03calm. It's steady equity curve. A low
- 11:06sharp means u the road or the right is a
- 11:09bit [music] bumpy. A full of the down
- 11:12and stress. So when it drops from 165
- 11:15all the way to below one, it's telling
- 11:17us that the out of sample right got a
- 11:19lot tougher. Okay, for the same kind of
- 11:21money and you can actually see it on the
- 11:23curve as you can see equity curve. The
- 11:25in sample it's a nice steady climb
- 11:27smooth positive every single year. Not
- 11:30one lucky year like it happened in the
- 11:33previous strategy in the mean reversion
- 11:35one. Um
- 11:38but this is an honest edge. But the out
- 11:40of sample there's a problem. It's still
- 11:42profitable. Yeah, which is great. But it
- 11:45got really thin and modest. And when an
- 11:49edge is that thin in practice, it means
- 11:51that it's going to take forever to make
- 11:53real money. And we can we can't actually
- 11:55use it as a standalone strategy. Maybe
- 11:58we can add it to a book which is um a
- 12:01group of strategies acting like a big
- 12:03system, one system, but we can trade
- 12:06this as um a standalone strategy, but
- 12:11still room to
- 12:13to actually optimize. But here's the
- 12:15thing, the objective is passing a prompt
- 12:18challenge. Okay, I need to hit that
- 12:20profit target without hitting a drawdown
- 12:22limit. And I'm also paying a monthly
- 12:24subscription for that account. and I
- 12:27don't want to spend a year to buy that
- 12:30account. So 117 is just too slow and too
- 12:33fragile for that. So the strategy works
- 12:37for now, but it's not good enough. But
- 12:40again, there is ton of uh optim
- 12:43fine-tuning because we only did one
- 12:45thing.
- 12:47But we need to pay attention to the trap
- 12:49of overfitting.
- 12:51Now remember what overfitting is. Think
- 12:54of it like uh you have a strategy or you
- 12:57have a back test and it doesn't look
- 12:58that good. So you keep adding little
- 13:01rules to that back test to address each
- 13:04drawdowns. Like I have a draw down right
- 13:07now. Like for example, I have draw down
- 13:09on the month of Feb. So let me go
- 13:11through that month and let's invent a
- 13:13filter that's going to eliminate some
- 13:15losers. And now that draw down um is
- 13:19gone. Uh, let me find another draw down
- 13:22and let me add a rule to that so it goes
- 13:25away. And now I'm patching like um holes
- 13:29in the ship like going through periods
- 13:31of drawdowns and inventing a rule. And
- 13:34that's what overfitting is. It will
- 13:35never work in real markets. It's either
- 13:39you're going to create one rule that's
- 13:41going to make the system better as a
- 13:44whole. You can't just create hundreds of
- 13:47rules, hundreds of mini rules and
- 13:50trying to put makeup on your garbage
- 13:54strategy and put a perfume on that
- 13:56strategy of yours. So basically to know
- 13:59whether you overfitted the strategy or
- 14:01not is basically um testing that
- 14:04strategy on a on a data set that has
- 14:07never seen before. Okay. Okay. With that
- 14:10in mind, I went back and looked at the
- 14:12losers and most of them had one thing in
- 14:15common. They were trades going against
- 14:18the bigger trend. So, NQ on the daily is
- 14:21usually trending up, right? But every
- 14:23now and then, you get a correction, a
- 14:25pullback day. Okay? On those days, the
- 14:29opening range breaks to the downside
- 14:32which triggers a short. But a lot of
- 14:34time, that bearish open is just the
- 14:36morning pullback. So, price dips in the
- 14:39A.M. p.m. and then the reverses and
- 14:42continue the bigger trend in the PM
- 14:44session. So the short gets stopped and
- 14:47the day actually closes green. So the
- 14:50short never had a chance. It was
- 14:52fighting the trend overall trend. So how
- 14:55do we cut those out without overfitting?
- 14:57We add one simple common sense rule.
- 15:01Only take the breakout if it agrees with
- 15:03the bigger trend. So think of it like a
- 15:05daily bias or a higher time frame
- 15:07alignment. Okay? And the filter itself
- 15:10is very simple, a moving average, the
- 15:12simple moving average or the SMA. And we
- 15:16picked 20 and we're going to apply it on
- 15:17the daily time frame. Now, why 20? And
- 15:20why didn't I test the whole bunch of
- 15:22values like 18, 22, 25 to find the best
- 15:26one? Because this isn't really a
- 15:31fine-tuning um area. I'm using it on the
- 15:34higher time frame just to get the bigger
- 15:36picture direction. Okay, the overall
- 15:38bias. So 20 gives me that and the other
- 15:42values it's going to give me the same
- 15:43thing. All right, so testing uh
- 15:45different parameters here, it's not
- 15:47really going to give us anything. So the
- 15:50rule is simple. If price above the 20
- 15:54SMA,
- 15:55that means that the bigger trend is up
- 15:57and I only take longs. And even if the
- 16:00opening range breaks to the downside and
- 16:02it give us a short signal, if we are
- 16:04above the SMA 20, I skip that chart.
- 16:07Okay? And if price is below the SMA 20,
- 16:11not just a small pullback, that tells me
- 16:13that NQ is actually trending down like
- 16:16NQ did last month, then I only take
- 16:19shorts. So everything trend, I skip it.
- 16:23Okay. Now, now here are the metrics. I
- 16:26want you to look at this. The filter cut
- 16:29the trades almost in half. Okay, from
- 16:32600 almost 700 down to 360. So fewer
- 16:36trades obviously, but look at the
- 16:38quality. The win rate went from 49 to
- 16:4153. And the profit factor went from 130
- 16:45all the way to 150. This is in the in
- 16:47sample. And the out of sample, the
- 16:50surprising part, it went up
- 16:53162. The out of sample profit factor was
- 16:56actually higher than the in sample and
- 16:59the sharp nearly doubled. So 258 in the
- 17:03in sample and even better in the out of
- 17:06sample. So look at that equity curve.
- 17:08You can see it's really beautiful and it
- 17:11reflects the sharp. Now um something
- 17:15more to mention why the out of sample
- 17:17looked better. It's basically landed in
- 17:21a favorable regime. Okay, so that's
- 17:22worth mentioning. the regime does matter
- 17:26but it still held up. I mean we have 5
- 17:29years of data and it actually got
- 17:32stronger. So right now we can
- 17:34successfully say that we took a famous
- 17:36strategy one that a lot of people trade
- 17:38by hand and mess it up because they cut
- 17:41winners early. They sit snobs too tight.
- 17:43They don't trust it. They let emotions
- 17:46around the trade [music] and we use it
- 17:48on NQ. I added one simple common sense
- 17:51filter and now and now I have a strategy
- 17:54that made money on data it had never
- 17:57seen and actually got stronger. That
- 18:01doesn't happen that often. Okay, not
- 18:03never, but it's actually rare. So, at
- 18:07this point, we have got something that
- 18:09looks really, really solid. Something
- 18:11that was positive every single year from
- 18:132021 all the way to 2026. And guys, this
- 18:17is not easy, okay? Positive every year
- 18:21sounds boring and normal, but it's not.
- 18:24Believe me, this industry is so fake on
- 18:27YouTube and Instagram. Everyone showing
- 18:30you fake 99% winner strategies. So, a
- 18:34strategy that's simply green every year
- 18:36sounds unimpressive
- 18:38next to that. So believe me, one day you
- 18:42will find out um that having a solid
- 18:45that is positive every year is actually
- 18:49really really impressive.
- 18:52So that's for this video guys. I'm going
- 18:54to stop right here. Next one I'm going
- 18:57to test it on other um assets. I'm going
- 19:00to see the results. We're going to run
- 19:03some um more [music] um tests on it,
- 19:06cheat test and so on. So, we know it's
- 19:09not cheating or something. Look ahead
- 19:10bias, uh, placebo and
- 19:14couple of things that we need to go
- 19:16through. And we also I'm going to test
- 19:19something. It's going to be a really
- 19:21exciting video, the next one. So, if you
- 19:23have any other questions, guys, leave
- 19:25them down in the comments or DM in my
- 19:28Twitter account and [music] I'll answer
- 19:30you as soon as I can. Now, happy trading
- 19:33and good luck.
About this transcript
This page contains the full transcript of Building a Profitable Strategy w/ Claude - Day 30: Automating the ORB Strategy by Strange ICT, generated from the public captions YouTube serves with the video. The transcript has 3,158 words across 437 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.