YouTube2Text

Building a Profitable Strategy w/ Claude - Day 30: Automating the ORB Strategy — Transcript

by Strange ICT · 3,158 words · 437 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hello guys and welcome back to a new
  2. 0:01video in the series of me trying to
  3. 0:03build a profitable trading algorithm
  4. 0:06using AI. [music] So our first real
  5. 0:08attempt to find something profitable
  6. 0:11failed and honestly that's expected.
  7. 0:13Finding something that works on the very
  8. 0:15first try in the world of quant or
  9. 0:18building trading algorithms is extremely
  10. 0:21unlikely. All right, that's completely
  11. 0:24normal. So quick recap of the idea what
  12. 0:27we tested for our first attempt
  13. 0:30hypothesis was the regime detector.
  14. 0:33Something that reads a market and
  15. 0:34decides whether we are in a range or a
  16. 0:37trend. If we are trending it fires a
  17. 0:39simple trend following strategy. If we
  18. 0:41are ranging it switches to a mean
  19. 0:43reversion one. So good idea on paper but
  20. 0:46it just didn't work. So today we're
  21. 0:49trying something different. And today
  22. 0:50we're going to take one specific
  23. 0:52well-known strategy and see if we can
  24. 0:54turn it into a fully automated system.
  25. 0:58So the opening range breakout. [music]
  26. 1:01Now one of the reasons the previous
  27. 1:03trend following attempt failed is that
  28. 1:05we were trying to sculp in tiny time
  29. 1:08frames. [music] The 1 minute, the
  30. 1:1030cond, the 15c for couple of points on
  31. 1:13NQ [music]
  32. 1:14and that just doesn't work. Okay?
  33. 1:16Because NQ intraday, it loves to chop.
  34. 1:20Okay, it's not a clean expansion from
  35. 1:22the open at 9:30 all the way to the
  36. 1:25close at 4 or 5 p.m. There's a ton of
  37. 1:28range and noise in between. So, we kept
  38. 1:31getting chopped out trying to sculp it
  39. 1:33and the regime kept flipping on us. All
  40. 1:36right, so the opening range breakout is
  41. 1:38a completely different animal. Okay,
  42. 1:41it's one of the most famous day trading
  43. 1:43strategies out there right now. And a
  44. 1:46lot of traders trade it, but mostly
  45. 1:48manually by hand. But today, we're going
  46. 1:51to try to automate it. So, we're going
  47. 1:53to remove um the psychology element of
  48. 1:58it and the human error element and we're
  49. 2:01going to try to make it automated,
  50. 2:03optimize it, and fine-tune it and see
  51. 2:05how that works. Okay? And
  52. 2:10to be honest with you, I'm quite
  53. 2:11optimistic because this one actually
  54. 2:14makes complete sense and we're going to
  55. 2:17see. So before we start, make sure to
  56. 2:19check uh the current discount bonus is
  57. 2:21running. One of the best and most
  58. 2:23reliable futures
  59. 2:25pro firms out there. You can use the
  60. 2:26coupon code stranger to get a nice
  61. 2:29discount or just click on the link
  62. 2:31below. Now let's continue. I want to
  63. 2:34start from the beginning. Okay. where
  64. 2:36where does this strategy even come from?
  65. 2:39So I think talking about its uh origin
  66. 2:42actually matters. Um I don't I don't
  67. 2:45want to just blind test strategies. So
  68. 2:49um this one came from stocks originally.
  69. 2:51It wasn't built for futures or US or the
  70. 2:55S&P um index. [music] And the author
  71. 2:58isn't some guru on YouTube. Okay. His
  72. 3:01name is Carlo something. I don't want to
  73. 3:04butcher his last name but is a quant
  74. 3:08researcher who actually published proper
  75. 3:10research on it but he used a five minute
  76. 3:13opening range. Okay. [music] So the idea
  77. 3:15is simple right here. The market opens
  78. 3:17you wait for the first 5 minute to to
  79. 3:20pass and you mark the high and the low
  80. 3:22of that 5 minute window and that's your
  81. 3:25opening range and then you trade
  82. 3:27whichever side breaks [music] first. If
  83. 3:29price breaks to the top after those five
  84. 3:31minutes, you go long with a stop um
  85. 3:33somewhere below. If if it breaks to the
  86. 3:36bottom, you go short. That's it. And
  87. 3:38what I love about this one is that it's
  88. 3:40visual. Okay, you can actually see it.
  89. 3:42You can understand it in a few seconds.
  90. 3:46So, here's the whole process. Okay,
  91. 3:48first of all, you wait for the opening
  92. 3:49range again to form. Price breaks on
  93. 3:53top, you go long. Um price goes or
  94. 3:56breaks on the bottom, you go short.
  95. 3:58Okay. And the most important part right
  96. 4:01here is that you don't cut it short.
  97. 4:04Okay. You're not sculping few points.
  98. 4:05You're trying to catch the whole day
  99. 4:07move. The whole day's move. Okay. That's
  100. 4:12the edge right here of this strategy.
  101. 4:14Okay. That's the point. All right. So,
  102. 4:17naturally, when we put it to the test,
  103. 4:19the first thing that I did, I I wanted
  104. 4:22to test the original version of it.
  105. 4:24Okay. The 5m minute range. Now on NQ
  106. 4:28right now and how ENQ moves, we already
  107. 4:32suspect that the five minute might be
  108. 4:33too short um for NQ because the open
  109. 4:37here can chop for 15 or even 20 minutes.
  110. 4:40I can you can all agree on that. That's
  111. 4:43just a guess, but I believe that's the
  112. 4:45truth. But it doesn't matter what we
  113. 4:47suspect. We're going to test the
  114. 4:49baseline first to get the metrics
  115. 4:51because we want to compare other uh
  116. 4:54ranges like the 15 and the 30 minute and
  117. 4:57so on. And this is really important uh
  118. 5:01concept when you're building strategies.
  119. 5:03You don't start optimizing and inventing
  120. 5:05variations right away. You run the
  121. 5:07original. Okay, that's the honest
  122. 5:10baseline and then you see where it
  123. 5:12stands and then you can start building
  124. 5:14on top of it. Okay, you don't want to
  125. 5:16optimize an optimized version. You want
  126. 5:18to optimize the baseline. Okay, so the
  127. 5:21five minute rings on NQ this where are
  128. 5:24the metrics basic metrics. I can show
  129. 5:27you other metrics but right now this is
  130. 5:30um uh what we need. Okay, simplistic
  131. 5:33simplicity. The win rate is 31%.
  132. 5:37And the profit factor is 115.
  133. 5:40[clears throat]
  134. 5:42So it doesn't work as we suspected.
  135. 5:46You're b you're basically getting
  136. 5:47chopped out to pieces in the open. So
  137. 5:51again profit factor also of 115 is
  138. 5:53basically untradeable with that win rate
  139. 5:56and it was what we expected. Those first
  140. 5:595 minute are pure noise. You're going to
  141. 6:02mark a really tiny range and
  142. 6:07usually the first 5 minute it doesn't
  143. 6:09dictate the whole day. Okay, I think we
  144. 6:11can all agree on that. Okay, so now
  145. 6:15we're going to optimize it and try other
  146. 6:17variations or other uh parameters. So,
  147. 6:21we're going to test bigger ranges to see
  148. 6:23how they hold up. And I'm going to test
  149. 6:26or and I tested the 15-minut range. So,
  150. 6:29the first 15 minute from 9:30 to 9:45.
  151. 6:33And also, I tested the the 30 minute
  152. 6:35range. So, we can compare them side by
  153. 6:37side. And [music]
  154. 6:38as you can see the metrics right here.
  155. 6:42So the 15-minut got better win rate 41%
  156. 6:45and the profit factor uh barely moved
  157. 6:48but again the win rate went nicely up
  158. 6:51from 31 all the way to 41 and the 30
  159. 6:54minutes the win rate jumps all the way
  160. 6:57to 47% and the profit factor to 1 to
  161. 7:01121.
  162. 7:03And a quick um explainer or recap for
  163. 7:06what profit factor. It just means that
  164. 7:08for every dollar you lose, you're going
  165. 7:10to make $121
  166. 7:14in this example right here. And that's
  167. 7:16it. So, we're going to stick with the 30
  168. 7:19minute race. It gives the best results
  169. 7:21and that's logical. And this is just a
  170. 7:23simple optimization, guys. We still
  171. 7:25didn't fine-tune it. Okay.
  172. 7:29So, we proved that at 30 minute range
  173. 7:31from 9:30 all the way to 10, it can
  174. 7:33dictate the whole day. Okay, it give us
  175. 7:36the cleanest moves. And here's something
  176. 7:39interesting. Okay, it's worth
  177. 7:42mentioning. Even though that we found
  178. 7:43that the 30 minute window uh just by
  179. 7:47testing that it has the best um metrics
  180. 7:50out of the three, we didn't actually
  181. 7:53invent anything. Okay? Because the first
  182. 7:5530 minute of the session, it actually
  183. 7:57has a name. It's called the initial
  184. 7:59balance. It's where the market figures
  185. 8:02out its range for the day. Okay. So,
  186. 8:04this is a well-known concept in the
  187. 8:06market out there. Uh which makes total
  188. 8:09sense. Okay. You give the market 30
  189. 8:10minute to settle and you get a real
  190. 8:13level that we can we can base uh the
  191. 8:15trade and the stop loss and so on. So,
  192. 8:17when price breaks the 30 minute range,
  193. 8:20that break actually means something.
  194. 8:22Okay? It's not just noise anymore. Uh
  195. 8:24one more thing to mention technically
  196. 8:26this trades both ways okay so long and
  197. 8:29short but here's what's interesting uh
  198. 8:32NQ most of the time it's going up okay
  199. 8:35so we if you go to the daily time frame
  200. 8:37you can see that it is [music] uh long
  201. 8:39biased asset okay it just wants to grind
  202. 8:43higher over time so just from that I can
  203. 8:46already make a guess
  204. 8:48like maybe if we removed shorts entirely
  205. 8:51and only took longs maybe the win rate
  206. 8:54and the profit factor would get better.
  207. 8:57For now, this is just a guess, but we
  208. 8:59will throw that uh at the engine later
  209. 9:01and we can actually get the decisive
  210. 9:04results. Okay, now let's take a look at
  211. 9:08the full picture for the 30 minute
  212. 9:10version. And remember, I split my data
  213. 9:13into two parts, the in sample and the
  214. 9:16out of sample. So after we chose that
  215. 9:18the 30 minute has the better metric on
  216. 9:21the in sample, it's time to fire it on
  217. 9:23the out of sample. [music] So out of
  218. 9:26sample is a data set that we didn't um
  219. 9:31that we don't touch, we don't optimize
  220. 9:33on it. And as you can see, the in sample
  221. 9:35if is from 2021 all the way to 2024. And
  222. 9:39the out of sample is from 2025
  223. 9:42all the way to 2026. So uh one uh a year
  224. 9:47and a half. So in sample it took almost
  225. 9:50700 trades. Uh 49% win rate, profit
  226. 9:54factor of 130 made about 158,000 doesn't
  227. 9:58matter and a sharp of 165.
  228. 10:02the out of sample fewer trades of course
  229. 10:05obviously the the data set is uh smaller
  230. 10:10because
  231. 10:11it's only a year and a half and the win
  232. 10:14rate stays basically the same but the
  233. 10:16profit factor it drops from 130 to 117
  234. 10:20that's not a tiny decrease okay some
  235. 10:23drop from the in sample to out to to the
  236. 10:25out of sample is normal you almost uh
  237. 10:28always lose a little going out of sample
  238. 10:32But uh that's a real hit worth paying
  239. 10:34attention to. And the sharp drops too as
  240. 10:37you can see tremendously like from 165
  241. 10:40all the way to below one. And what is
  242. 10:44the sharp ratio? Uh in simple terms the
  243. 10:47sharp ratio is um it measures how smooth
  244. 10:50your returns are. Okay, how much profit
  245. 10:53you get compared of how much stress or
  246. 10:55draw down. Okay, how many ups and downs
  247. 10:59you're going [music] to go through to
  248. 11:00get it. So a high sharp means that it's
  249. 11:03calm. It's steady equity curve. A low
  250. 11:06sharp means u the road or the right is a
  251. 11:09bit [music] bumpy. A full of the down
  252. 11:12and stress. So when it drops from 165
  253. 11:15all the way to below one, it's telling
  254. 11:17us that the out of sample right got a
  255. 11:19lot tougher. Okay, for the same kind of
  256. 11:21money and you can actually see it on the
  257. 11:23curve as you can see equity curve. The
  258. 11:25in sample it's a nice steady climb
  259. 11:27smooth positive every single year. Not
  260. 11:30one lucky year like it happened in the
  261. 11:33previous strategy in the mean reversion
  262. 11:35one. Um
  263. 11:38but this is an honest edge. But the out
  264. 11:40of sample there's a problem. It's still
  265. 11:42profitable. Yeah, which is great. But it
  266. 11:45got really thin and modest. And when an
  267. 11:49edge is that thin in practice, it means
  268. 11:51that it's going to take forever to make
  269. 11:53real money. And we can we can't actually
  270. 11:55use it as a standalone strategy. Maybe
  271. 11:58we can add it to a book which is um a
  272. 12:01group of strategies acting like a big
  273. 12:03system, one system, but we can trade
  274. 12:06this as um a standalone strategy, but
  275. 12:11still room to
  276. 12:13to actually optimize. But here's the
  277. 12:15thing, the objective is passing a prompt
  278. 12:18challenge. Okay, I need to hit that
  279. 12:20profit target without hitting a drawdown
  280. 12:22limit. And I'm also paying a monthly
  281. 12:24subscription for that account. and I
  282. 12:27don't want to spend a year to buy that
  283. 12:30account. So 117 is just too slow and too
  284. 12:33fragile for that. So the strategy works
  285. 12:37for now, but it's not good enough. But
  286. 12:40again, there is ton of uh optim
  287. 12:43fine-tuning because we only did one
  288. 12:45thing.
  289. 12:47But we need to pay attention to the trap
  290. 12:49of overfitting.
  291. 12:51Now remember what overfitting is. Think
  292. 12:54of it like uh you have a strategy or you
  293. 12:57have a back test and it doesn't look
  294. 12:58that good. So you keep adding little
  295. 13:01rules to that back test to address each
  296. 13:04drawdowns. Like I have a draw down right
  297. 13:07now. Like for example, I have draw down
  298. 13:09on the month of Feb. So let me go
  299. 13:11through that month and let's invent a
  300. 13:13filter that's going to eliminate some
  301. 13:15losers. And now that draw down um is
  302. 13:19gone. Uh, let me find another draw down
  303. 13:22and let me add a rule to that so it goes
  304. 13:25away. And now I'm patching like um holes
  305. 13:29in the ship like going through periods
  306. 13:31of drawdowns and inventing a rule. And
  307. 13:34that's what overfitting is. It will
  308. 13:35never work in real markets. It's either
  309. 13:39you're going to create one rule that's
  310. 13:41going to make the system better as a
  311. 13:44whole. You can't just create hundreds of
  312. 13:47rules, hundreds of mini rules and
  313. 13:50trying to put makeup on your garbage
  314. 13:54strategy and put a perfume on that
  315. 13:56strategy of yours. So basically to know
  316. 13:59whether you overfitted the strategy or
  317. 14:01not is basically um testing that
  318. 14:04strategy on a on a data set that has
  319. 14:07never seen before. Okay. Okay. With that
  320. 14:10in mind, I went back and looked at the
  321. 14:12losers and most of them had one thing in
  322. 14:15common. They were trades going against
  323. 14:18the bigger trend. So, NQ on the daily is
  324. 14:21usually trending up, right? But every
  325. 14:23now and then, you get a correction, a
  326. 14:25pullback day. Okay? On those days, the
  327. 14:29opening range breaks to the downside
  328. 14:32which triggers a short. But a lot of
  329. 14:34time, that bearish open is just the
  330. 14:36morning pullback. So, price dips in the
  331. 14:39A.M. p.m. and then the reverses and
  332. 14:42continue the bigger trend in the PM
  333. 14:44session. So the short gets stopped and
  334. 14:47the day actually closes green. So the
  335. 14:50short never had a chance. It was
  336. 14:52fighting the trend overall trend. So how
  337. 14:55do we cut those out without overfitting?
  338. 14:57We add one simple common sense rule.
  339. 15:01Only take the breakout if it agrees with
  340. 15:03the bigger trend. So think of it like a
  341. 15:05daily bias or a higher time frame
  342. 15:07alignment. Okay? And the filter itself
  343. 15:10is very simple, a moving average, the
  344. 15:12simple moving average or the SMA. And we
  345. 15:16picked 20 and we're going to apply it on
  346. 15:17the daily time frame. Now, why 20? And
  347. 15:20why didn't I test the whole bunch of
  348. 15:22values like 18, 22, 25 to find the best
  349. 15:26one? Because this isn't really a
  350. 15:31fine-tuning um area. I'm using it on the
  351. 15:34higher time frame just to get the bigger
  352. 15:36picture direction. Okay, the overall
  353. 15:38bias. So 20 gives me that and the other
  354. 15:42values it's going to give me the same
  355. 15:43thing. All right, so testing uh
  356. 15:45different parameters here, it's not
  357. 15:47really going to give us anything. So the
  358. 15:50rule is simple. If price above the 20
  359. 15:54SMA,
  360. 15:55that means that the bigger trend is up
  361. 15:57and I only take longs. And even if the
  362. 16:00opening range breaks to the downside and
  363. 16:02it give us a short signal, if we are
  364. 16:04above the SMA 20, I skip that chart.
  365. 16:07Okay? And if price is below the SMA 20,
  366. 16:11not just a small pullback, that tells me
  367. 16:13that NQ is actually trending down like
  368. 16:16NQ did last month, then I only take
  369. 16:19shorts. So everything trend, I skip it.
  370. 16:23Okay. Now, now here are the metrics. I
  371. 16:26want you to look at this. The filter cut
  372. 16:29the trades almost in half. Okay, from
  373. 16:32600 almost 700 down to 360. So fewer
  374. 16:36trades obviously, but look at the
  375. 16:38quality. The win rate went from 49 to
  376. 16:4153. And the profit factor went from 130
  377. 16:45all the way to 150. This is in the in
  378. 16:47sample. And the out of sample, the
  379. 16:50surprising part, it went up
  380. 16:53162. The out of sample profit factor was
  381. 16:56actually higher than the in sample and
  382. 16:59the sharp nearly doubled. So 258 in the
  383. 17:03in sample and even better in the out of
  384. 17:06sample. So look at that equity curve.
  385. 17:08You can see it's really beautiful and it
  386. 17:11reflects the sharp. Now um something
  387. 17:15more to mention why the out of sample
  388. 17:17looked better. It's basically landed in
  389. 17:21a favorable regime. Okay, so that's
  390. 17:22worth mentioning. the regime does matter
  391. 17:26but it still held up. I mean we have 5
  392. 17:29years of data and it actually got
  393. 17:32stronger. So right now we can
  394. 17:34successfully say that we took a famous
  395. 17:36strategy one that a lot of people trade
  396. 17:38by hand and mess it up because they cut
  397. 17:41winners early. They sit snobs too tight.
  398. 17:43They don't trust it. They let emotions
  399. 17:46around the trade [music] and we use it
  400. 17:48on NQ. I added one simple common sense
  401. 17:51filter and now and now I have a strategy
  402. 17:54that made money on data it had never
  403. 17:57seen and actually got stronger. That
  404. 18:01doesn't happen that often. Okay, not
  405. 18:03never, but it's actually rare. So, at
  406. 18:07this point, we have got something that
  407. 18:09looks really, really solid. Something
  408. 18:11that was positive every single year from
  409. 18:132021 all the way to 2026. And guys, this
  410. 18:17is not easy, okay? Positive every year
  411. 18:21sounds boring and normal, but it's not.
  412. 18:24Believe me, this industry is so fake on
  413. 18:27YouTube and Instagram. Everyone showing
  414. 18:30you fake 99% winner strategies. So, a
  415. 18:34strategy that's simply green every year
  416. 18:36sounds unimpressive
  417. 18:38next to that. So believe me, one day you
  418. 18:42will find out um that having a solid
  419. 18:45that is positive every year is actually
  420. 18:49really really impressive.
  421. 18:52So that's for this video guys. I'm going
  422. 18:54to stop right here. Next one I'm going
  423. 18:57to test it on other um assets. I'm going
  424. 19:00to see the results. We're going to run
  425. 19:03some um more [music] um tests on it,
  426. 19:06cheat test and so on. So, we know it's
  427. 19:09not cheating or something. Look ahead
  428. 19:10bias, uh, placebo and
  429. 19:14couple of things that we need to go
  430. 19:16through. And we also I'm going to test
  431. 19:19something. It's going to be a really
  432. 19:21exciting video, the next one. So, if you
  433. 19:23have any other questions, guys, leave
  434. 19:25them down in the comments or DM in my
  435. 19:28Twitter account and [music] I'll answer
  436. 19:30you as soon as I can. Now, happy trading
  437. 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.