YouTube2Text

how to actually build an ai trading bot (full guide) — Transcript

by Miles Deutscher Finance · 4,554 words · 646 segments · language en · Watch on YouTube

Full transcript

  1. 0:00I'm going to show you how to build a
  2. 0:01trading bot that actually works, whether
  3. 0:04you trade crypto or stocks. I'm going to
  4. 0:06run you through how to build one from
  5. 0:08scratch and what they're actually good
  6. 0:10for because it's not what most people
  7. 0:12think. You've probably seen the promises
  8. 0:13that AI trading bots are like these
  9. 0:15magic money printers, but the reality is
  10. 0:17different. They can be highly
  11. 0:19profitable. I've personally built
  12. 0:20strategies which have made me over
  13. 0:22$8,000 a week in pure profit, but I've
  14. 0:25also had trading bots, especially
  15. 0:27towards the beginning of my journey a
  16. 0:28few years ago, which went horribly wrong
  17. 0:30and cost me tens of thousands of
  18. 0:32dollars. But, I learned from those
  19. 0:34mistakes and learned how to set up
  20. 0:35trading bots the right way, bots that
  21. 0:37automatically get smarter over time and
  22. 0:39bots that don't fail. The best part is
  23. 0:42you don't have to be a coder for any of
  24. 0:43this. It's actually quite simple. You
  25. 0:45just might need to get your hands a
  26. 0:47little dirty, but I'm going to walk you
  27. 0:48through step-by-step so you don't get
  28. 0:49lost. And by the end, you'll know how to
  29. 0:52actually build a trading bot that works.
  30. 0:54And you'll also know the one mistake
  31. 0:55that kills people's trading bots so you
  32. 0:58don't make it. All right, firstly, let's
  33. 1:00talk about what an automated AI trading
  34. 1:02bot actually is. A bot essentially does
  35. 1:05two things. It automates repetitive
  36. 1:07strategy and it executes better than a
  37. 1:09human. I used to find in my trading, I'd
  38. 1:11have the right ideas, but I'd have an
  39. 1:13execution problem. I'd have a setup, but
  40. 1:16I wouldn't be at the desk to execute the
  41. 1:17trade. I wouldn't be able to manage the
  42. 1:19trade once it's open or I would simply
  43. 1:21forget to manage the trade and that
  44. 1:23would result in me losing money. The
  45. 1:25real value add of a trading bot is that
  46. 1:27it can execute based on a predetermined
  47. 1:30strategy that you've given it. And the
  48. 1:31really important thing which we're going
  49. 1:32to discuss today is that these bots
  50. 1:34actually learn over time and they get
  51. 1:36smarter over time. They learn from their
  52. 1:38mistakes probably even better than a
  53. 1:39human because it's coded into the AI.
  54. 1:42Whereas as a human, you need to go
  55. 1:44through a lot of psychological
  56. 1:45reflection to work out why maybe you're
  57. 1:47not succeeding as a trader. So,
  58. 1:49ultimately, I view trading bots as a way
  59. 1:51to get razor sharp execution and I do
  60. 1:53think over time more and more people are
  61. 1:55going to be using trading bots and in a
  62. 1:57few years pretty much everyone will be
  63. 1:59using one whether they know it or not
  64. 2:01because the big funds and the quant
  65. 2:02firms, they are already doing this.
  66. 2:04Retail just isn't fully up to scratch
  67. 2:06yet. The best part about a bot is that
  68. 2:08it doesn't flinch, it doesn't get
  69. 2:09scared, it can execute without emotions
  70. 2:12and that's what actually catches most
  71. 2:13traders out. So if your problem was ever
  72. 2:15execution as it is for most people, then
  73. 2:17building a trading bot should really
  74. 2:18help you. And the loop of a trading bot
  75. 2:20is actually quite simple. You set up the
  76. 2:22parameters, it executes based on those
  77. 2:24parameters, it learns from those
  78. 2:25parameters and then it goes again. And
  79. 2:27this loop can automate around the clock
  80. 2:2924/7 even while you're sleeping. And
  81. 2:31some of my bots where I've made over
  82. 2:33$8,000 in a week, these have actually
  83. 2:35executed some of my best trades when I
  84. 2:37wasn't awake. Especially if you're not
  85. 2:39available all day or not on US hours, I
  86. 2:41think that's one of the biggest value
  87. 2:42props of automating your trading. But I
  88. 2:45want to make it clear this isn't a magic
  89. 2:46fix. I do think this stuff is getting
  90. 2:48better and better and being at the
  91. 2:50cutting edge of it like I'm trying to is
  92. 2:51a big advantage, but this isn't a full
  93. 2:54replacement for discretionary trading. I
  94. 2:56view trading bots as a great attachment.
  95. 2:58So you can have discretionary ideas,
  96. 3:00ideas that you think will help you get
  97. 3:02an edge in the market and then you use a
  98. 3:04trading bot for the execution piece.
  99. 3:06That's pretty much how I use them in my
  100. 3:08day-to-day life. And then over time, you
  101. 3:10can start to knowledge compress. So take
  102. 3:12strategies from yourself and from others
  103. 3:15that you want to implement and train the
  104. 3:16AI to do so automatically. So before we
  105. 3:19get into how to build a winning trading
  106. 3:20bot, let's firstly discuss why most
  107. 3:23trading bots lose. They're usually four
  108. 3:25reasons why trading bots lose money. The
  109. 3:27first one is they don't have memory. So
  110. 3:29basically it'll open a trade or it'll
  111. 3:31execute something based on its preset
  112. 3:33parameters, but then it doesn't learn,
  113. 3:35improve, and iterate over time. I'll be
  114. 3:37showing you a memory system in today's
  115. 3:38video which pretty much makes that
  116. 3:40mistake irrelevant. Secondly, people set
  117. 3:42up trading bots with no goals or no
  118. 3:44objectives. So they'll set a test, but
  119. 3:46they won't define the parameters for
  120. 3:48that test. So then you're basically
  121. 3:49trading blindly. The bot isn't getting
  122. 3:52smarter, the bot isn't necessarily
  123. 3:54optimizing, it's just running on its own
  124. 3:56accord. So, without a goal and an
  125. 3:58objective and without actually
  126. 4:00implementing that data, it's basically
  127. 4:02just winging it. The third reason bots
  128. 4:03fail is because they don't take into
  129. 4:06account future conditions. Bots are
  130. 4:07trained on past data. So, you need a
  131. 4:10good system to forecast data and some of
  132. 4:13that is discretionary. Some of that
  133. 4:15can't be automated, but you can
  134. 4:16obviously build good market scraping
  135. 4:18systems to plug into the bot to give it
  136. 4:20more informed information. Human traders
  137. 4:23can be very good because they adapt to
  138. 4:24the market very quickly and humans have
  139. 4:26like this creativity element that bots
  140. 4:28don't have. We can actually forecast
  141. 4:30data. Whereas AI models in general,
  142. 4:32they're all trained on past data. So,
  143. 4:35you actually need to manufacture things
  144. 4:36and you can use that to your advantage,
  145. 4:38but you have to set things up properly
  146. 4:40so the AI can actually execute based on
  147. 4:43future expectations. And fourthly, the
  148. 4:45reason why a lot of trading bots fail is
  149. 4:46because a lot of the pre-packaged bots
  150. 4:48simply too many people are using. So,
  151. 4:50they actually lose their edge in the
  152. 4:51market. So, if you just go out and buy a
  153. 4:53popular bot that hasn't been backtested,
  154. 4:55that doesn't have an edge, you're
  155. 4:57probably going to be competing against
  156. 4:58other traders running the same strategy.
  157. 5:00So, it's important to work out your own
  158. 5:02strategy or use a bot that millions of
  159. 5:04people aren't using. In my opinion, to
  160. 5:06summarize what makes a good bot, it
  161. 5:08remembers, it gets smarter over time and
  162. 5:11it's actually yours. So, it's
  163. 5:12configurable based on your beliefs and
  164. 5:15based on the data that it accrues. So,
  165. 5:17now you know why most trading bots fail
  166. 5:19and you know what constitutes a good
  167. 5:21trading bot in my opinion. Now, let's
  168. 5:23move on to your options. What is
  169. 5:24currently available in the market right
  170. 5:26now for you to use? Now, there are a few
  171. 5:29and they all make sense for different
  172. 5:30people and different skill levels. So,
  173. 5:32let's run through them. Firstly, you can
  174. 5:33buy a ready-made AI bot. These are maybe
  175. 5:36some of the bots you've seen advertised
  176. 5:38on some platforms or built into an
  177. 5:39exchange with pre-configured parameters.
  178. 5:42These aren't necessarily bad. In fact,
  179. 5:44they don't require any effort, so that
  180. 5:45is a good thing from a setup and time
  181. 5:47perspective, but ultimately you don't
  182. 5:48have your own edge because it's a black
  183. 5:50box. You don't know exactly how they're
  184. 5:52trained, and even if their algorithm is
  185. 5:53public, you have no ability to influence
  186. 5:56that algorithm. So, you're at the behest
  187. 5:58of the platform that you are using. Good
  188. 6:00option for people just trying to dip
  189. 6:01their toes in the water and maybe use a
  190. 6:03trading bot on an exchange, but maybe
  191. 6:05not so good for people that want proper
  192. 6:07customization, which I do believe is
  193. 6:10very important because the way that you
  194. 6:11run your portfolio or your trading is
  195. 6:13going to be different from how I run my
  196. 6:15portfolio or my trading. So, we need our
  197. 6:17bots to reflect the very unique
  198. 6:19differences in both of our goals, and
  199. 6:21the only way to do that is through
  200. 6:22customization, which brings me on to
  201. 6:24point two. You can use a no-code
  202. 6:26platform. So, this is a platform that
  203. 6:28gives you some customization, but isn't
  204. 6:30a full black box. So, you've got
  205. 6:32Composer for stocks. You've even got
  206. 6:34Robinhood now who launched their agents.
  207. 6:36You don't have full control, and they
  208. 6:37don't make it open source for you to
  209. 6:39necessarily connect an API and do things
  210. 6:41yourself on their exchange. Maybe
  211. 6:43they'll add it in the future, but for
  212. 6:44now, you're limited to the options that
  213. 6:46they're giving you. These are definitely
  214. 6:47better than the previous option, but I
  215. 6:50do feel like you're going to hit your
  216. 6:51ceiling fast, and it's going to limit
  217. 6:53your ability to progress over time. But,
  218. 6:56I'm definitely still experimenting with
  219. 6:57some of these, and I think for some
  220. 6:58traders it makes sense. Like, setting up
  221. 7:00a grid bot, setting up DCA bots, setting
  222. 7:03up basic portfolio management based on
  223. 7:05preset parameters. It makes sense for
  224. 7:07some people, but for people that want a
  225. 7:09fully autonomous strategy, you're going
  226. 7:10to cap out with these types of systems.
  227. 7:12And thirdly, this is something that
  228. 7:14previously used to take months to do,
  229. 7:16but now you can do relatively quickly,
  230. 7:17as I'm about to show you, you can build
  231. 7:19your own trading bot where you actually
  232. 7:21own the memory system, own the data, and
  233. 7:24own the configurability. It's actually
  234. 7:26pretty wild to think that you can now
  235. 7:27have like an AI quant in your pocket,
  236. 7:29essentially, that can trade on your
  237. 7:31behalf 24/7. When, you know, previously
  238. 7:33this stuff was only reserved for the
  239. 7:35elite, and that's what these new
  240. 7:37frontier models like Claude and GPT have
  241. 7:40now unlocked. And many exchanges and
  242. 7:42brokerages have actually embraced this
  243. 7:45cuz they understand users are using
  244. 7:46these products. So, we're actually going
  245. 7:48to create MCPs, which are the bridges
  246. 7:50between Claude and the exchange to
  247. 7:53enable you to automate your trading. And
  248. 7:55this has only really happened in the
  249. 7:57last couple of months. Like I've been
  250. 7:58using trading bots for 3 years, but it
  251. 8:00was only really this year that you could
  252. 8:02fully customize a bot. So, you're
  253. 8:04actually really early to this. If you're
  254. 8:05watching the video right now, make sure
  255. 8:07you subscribe to the channel cuz I'm
  256. 8:08going to keep updating you as things
  257. 8:10evolve because I think in the next
  258. 8:11couple of years things are just going to
  259. 8:13get better and better and better. So,
  260. 8:14I'm pouring a lot of time and resources
  261. 8:17into making sure I can get an edge with
  262. 8:18this kind of stuff. And I want you guys
  263. 8:20to come on this journey with me as well
  264. 8:22because I have a clear thesis that this
  265. 8:23is where the world is heading. I think
  266. 8:25in the future we're heading towards a
  267. 8:27world where people don't just go into
  268. 8:28the computer or grab their phone and
  269. 8:30place a trade manually. I think people
  270. 8:32will be voice prompting agents. I think
  271. 8:34agents will be managing portfolios on
  272. 8:35their behalf. And I think the way you
  273. 8:37interact with exchanges and trading will
  274. 8:39be very, very different. want to be at
  275. 8:40the forefront of that. So, now I'm going
  276. 8:42to give you the three-step approach to
  277. 8:44actually build your own trading bot. And
  278. 8:46if somehow you get lost at any point,
  279. 8:47don't worry. In the description below
  280. 8:49for free, I'm going to have the full
  281. 8:51framework from today's video that you
  282. 8:53can actually just take and paste into an
  283. 8:55LLM like Claude or ChatGPT, and it will
  284. 8:58actually help you execute on your
  285. 9:00behalf. So, all you need to do is go
  286. 9:02down below, enter your email, become a
  287. 9:04part of the newsletter, and then you
  288. 9:06will unlock the WhatsApp community where
  289. 9:08in the pinned link you will be able to
  290. 9:10find the prompt from today's video. All
  291. 9:12right, so let's get into the three
  292. 9:13steps. So, step one, picking your venue.
  293. 9:16Firstly, you want to determine what
  294. 9:18you're trying to trade. Is it stocks or
  295. 9:19is it crypto? And crypto now obviously
  296. 9:21has access to tokenized stocks and gold
  297. 9:24and these sorts of things as well, even
  298. 9:26perps trading. So, a lot of people that
  299. 9:28are trading stocks are now doing it
  300. 9:29through hyperliquid or through X
  301. 9:32tokenized stocks, but obviously that
  302. 9:33comes with its own trade-off. So, first
  303. 9:35and foremost, you want to pick which
  304. 9:37lane you're most interested in. So,
  305. 9:38here's the broader architecture for a
  306. 9:40trading bot, no matter if it's stocks or
  307. 9:42crypto. The brain is going to be your
  308. 9:44LLM. So, in this case, Claude. You can
  309. 9:46also use GPT. So, you're either using
  310. 9:48Claude code on the newest model, or
  311. 9:50you're using GPT's CodeX on the newest
  312. 9:52model. That brain is responsible for
  313. 9:54holding and executing your strategy. The
  314. 9:57hands, what actually delivers the
  315. 9:59information to the exchange that's
  316. 10:00executing the trades, or you can think
  317. 10:02of it as a bridge, is the MCP server.
  318. 10:05That's the piece that actually enables
  319. 10:07Claude to place real orders on an
  320. 10:09exchange or a brokerage. And not every
  321. 10:12single brokerage has a connection, but
  322. 10:14there are a couple really good ones that
  323. 10:15I'll tell you today. For stocks, I
  324. 10:17personally use Alpaca, because they have
  325. 10:20an MCP server, which makes this easy.
  326. 10:22And this video's not sponsored by
  327. 10:23anyone, by the way. These are just the
  328. 10:24best solutions that I've personally
  329. 10:25found. It's free, it has paper trading,
  330. 10:28which is amazing, because you want to
  331. 10:29test this stuff out if you're learning
  332. 10:31on fake money. You don't want to go and,
  333. 10:32you know, blow real money and mess up a
  334. 10:34configuration. The best way to actually
  335. 10:35get started with trading bots is to do
  336. 10:37paper trading. Once you're comfortable,
  337. 10:39and once your strategy's working, then
  338. 10:41you move on to a bit of real money, and
  339. 10:43then you keep leveling up. But
  340. 10:44essentially, you sign up for an Alpaca
  341. 10:46account, you grab your API keys, you
  342. 10:48give Claude the API, and then it uses
  343. 10:50their inbuilt MCP. It might sound
  344. 10:51complex, but honestly, it's easier than
  345. 10:53it sounds. The prompt that I'll give you
  346. 10:54will make this super easy, and Claude
  347. 10:56will just guide you through the whole
  348. 10:57process. And that's the benefit of using
  349. 11:00a platform that has an inbuilt MCP, so
  350. 11:02you don't have to build your own. You're
  351. 11:03not actually coding a connection, you're
  352. 11:05just plugging it in. This gives Claude
  353. 11:06the capability to pull live prices from
  354. 11:09the exchange and execute trades based on
  355. 11:11your strategy. For crypto, it's the
  356. 11:13exact same concept. You want to go
  357. 11:15straight to a crypto exchange. There are
  358. 11:17so many. Binance, Blofin, Bybit, Pionex.
  359. 11:21Pionex and a lot of other exchanges now,
  360. 11:22for example, have an inbuilt MCP that
  361. 11:25you can use, just like Alpaca, so you
  362. 11:27can connect the MCP to Claude. If you go
  363. 11:30into to websites, they're usually
  364. 11:31available. If not, you can just ask
  365. 11:33Claude to help you connect the
  366. 11:35exchanges. Then you need to go into the
  367. 11:37exchange, take the API key, put it into
  368. 11:39Claude, and usually after 10 to 15
  369. 11:42minutes, you'll be able to connect the
  370. 11:44two, even if the exchange doesn't have
  371. 11:46an inbuilt solution, which does make
  372. 11:47things quicker and more secure, but you
  373. 11:49can still use an exchange without an MCP
  374. 11:52if you work around it on Claude code.
  375. 11:54You can also use GPT for this. I think
  376. 11:56both are good. There's arguments that
  377. 11:58GPT is smarter or more reliable for
  378. 12:00coding now. So, I personally use a
  379. 12:01mixture of both, but I found Claude to
  380. 12:03be pretty good as long as you give it
  381. 12:04the right parameters, which we'll also
  382. 12:06discuss, cuz that's obviously the secret
  383. 12:07to creating a really good trading bot.
  384. 12:09One thing on safety, you want to make
  385. 12:11sure your funds, especially if you're
  386. 12:13connecting it through an MCP using an
  387. 12:15API, in case your keys are exposed, in
  388. 12:17case you lose your device or something,
  389. 12:19that you actually create a sub account
  390. 12:20that only has a certain amount of funds
  391. 12:23that you're willing to give the bot
  392. 12:24access to. And a lot of exchanges
  393. 12:26actually have paper trading just like
  394. 12:27Alpaca, so you can actually just paper
  395. 12:30trade and test out your strategies, make
  396. 12:31sure they work, harden security over
  397. 12:33time before you move on to real capital.
  398. 12:36I think humans just learn the best by
  399. 12:37doing. So, if you're able to set this up
  400. 12:39yourself with paper trading, that's
  401. 12:41ultimately going to be the best tuition,
  402. 12:43and I think it's definitely worth the
  403. 12:44time. Step two, you want to actually
  404. 12:46pick your strategy and define the
  405. 12:48feedback loop. So, before any prompt,
  406. 12:51like open this trade for me, open trade
  407. 12:53under these parameters, you need to
  408. 12:55actually define the strategy. Because
  409. 12:57remember, the bot is only as good as the
  410. 13:00parameters that it runs under. Now, this
  411. 13:01is a rabbit hole in itself, and I'm
  412. 13:02going to do future videos on back
  413. 13:04testing strategies, the best strategies.
  414. 13:06This is an entire concept for another
  415. 13:08time, but in the beginning, you want to
  416. 13:10start with a pretty simple strategy just
  417. 13:13to get used to the mechanics of running
  418. 13:15a trading bot. The best part is that you
  419. 13:17can actually just back test strategies
  420. 13:19now, especially now that Claude and
  421. 13:21TradingView actually have an MCP
  422. 13:23connection. You no longer have to do it
  423. 13:25manually on Pine Script. You can just
  424. 13:27connect Claude to TradingView. I did a
  425. 13:28video on it, go and watch it that
  426. 13:30actually shows you how to set this up
  427. 13:32and then you can just start back testing
  428. 13:33any strategy. Hey, what if the RSI hit
  429. 13:36this level and momentum did this? Hey,
  430. 13:38what if price spikes X% in a day, what
  431. 13:40happened if you opened a trade every
  432. 13:41time over the past 3 months? It'll tell
  433. 13:43you how much you would have made. So,
  434. 13:45I'd recommend back testing first, taking
  435. 13:47a strategy which looks to be reliable
  436. 13:49and then using that strategy to start
  437. 13:52your trading bot experiment. And of
  438. 13:54course, you can just go back and forth
  439. 13:55with the AI about your trading style,
  440. 13:58your investment philosophy, what
  441. 13:59strategy you want to follow. Like I
  442. 14:01recommend before people even set up a
  443. 14:03trading bot, they do a bit of a back and
  444. 14:05forth to create a one-page document that
  445. 14:07they put in the instructions folder of
  446. 14:10GPT or Claude so the AI actually knows
  447. 14:13about you, your financial situation, and
  448. 14:16your goals. I think it's also okay to
  449. 14:17run a completely separate AI test, but
  450. 14:20if in the future you do want to make
  451. 14:22these strategies as I guess we're all
  452. 14:23aspiring to do, work within the broader
  453. 14:26context of your goals and your
  454. 14:27portfolio, then obviously you're going
  455. 14:28to need to create the documentation for
  456. 14:30that so the AI can tweak the strategy
  457. 14:32based on that. For this video, I'll show
  458. 14:33you a very simple build that I'm using.
  459. 14:35It's essentially a moving average
  460. 14:37crossover. So, if we see a fast average
  461. 14:38crossing above the slower average, that
  462. 14:41indicates that momentum is increasing.
  463. 14:44That is our signal to buy. If it crosses
  464. 14:45back below, we're going to sell.
  465. 14:48Obviously, over time, you want to create
  466. 14:50parameters across what time frames,
  467. 14:52adding in other conditions, and the AI
  468. 14:54will learn over time, but I'm just
  469. 14:55showing this to you as an example. This
  470. 14:57is simple on purpose because this
  471. 14:59video's about the system. In future
  472. 15:01videos, make sure you subscribe, we'll
  473. 15:02dive deeper into the best strategies,
  474. 15:05but I want to make sure you have a full
  475. 15:07understanding today of what trading bots
  476. 15:08are. Of course, we'll just swap in a
  477. 15:09better strategy later. So, now that you
  478. 15:11have the idea, you can prompt Claude or
  479. 15:13GPT to build it. It'll define every
  480. 15:15interval. The bot will read its memory
  481. 15:17and check the market through the MCP,
  482. 15:19and it will apply your rule to open
  483. 15:21trades, and obviously place paper trades
  484. 15:24in this example if it fires. So, a bot
  485. 15:26essentially has three jobs. It sees the
  486. 15:27market, but it decides whether it wants
  487. 15:29to execute, and then of course, if the
  488. 15:31parameters hit, it executes. You can see
  489. 15:33with this bot, it actually fired on the
  490. 15:35signal, but the trade loses.
  491. 15:38And then the same signal shows up again,
  492. 15:39and then it did the same trade again,
  493. 15:41but it loses again.
  494. 15:42This is because, and this is a common
  495. 15:44issue with bots, it has no memory. So,
  496. 15:47it never kept score of what's working,
  497. 15:48or critically reflected on why it's not
  498. 15:51working. So, this right here is an
  499. 15:52example of a bot that doesn't remember
  500. 15:54its own trades. So, it keeps repeating
  501. 15:55the same mistake. Every single time that
  502. 15:57parameter hits, it'll just execute
  503. 15:59because you've told it to execute. What
  504. 16:00I'll show you now, step three, is going
  505. 16:03to give your bot real memory, so it
  506. 16:05self-improves over time. This is the
  507. 16:07step that really matters, and we create
  508. 16:09this through a two-file system. File one
  509. 16:11is going to be your ledger. It's going
  510. 16:13to log every single trade. It's going to
  511. 16:15show you what happened, when it
  512. 16:16happened, why it fired, and how it
  513. 16:18ended. And you'll actually be able to
  514. 16:20prompt and reflect on this data. The
  515. 16:21second file is going to be the learnings
  516. 16:23file. So, when a trade closes, the bot
  517. 16:26writes itself one plain English lesson.
  518. 16:28So, it lost on this setup, don't take it
  519. 16:30again without confirmation of XYZ. This
  520. 16:33really matters because every single time
  521. 16:34it trades, it's going to read the ledger
  522. 16:36and the learnings file, and then if it
  523. 16:38makes a mistake again, it's going to add
  524. 16:40to it. So, this is essentially giving
  525. 16:42the bot a brain that learns over time,
  526. 16:44just like a human does. So, if you're a
  527. 16:46trader, you'll know you get these
  528. 16:47intuitions, like, "Oh, I think the
  529. 16:48market's going to crash. I think the
  530. 16:50market's probably going to go up." You
  531. 16:51might not be aware of it, but that's
  532. 16:52your mental algorithm based on past data
  533. 16:54that you've analyzed coming into
  534. 16:56account. You we're just engineering the
  535. 16:58exact same thing for the AI, but the
  536. 17:00best thing is, the AI will never make a
  537. 17:01mistake. Once you train it and set hard
  538. 17:03rules, it'll stick to those rules. Now,
  539. 17:05obviously, I've got to make it clear,
  540. 17:06sometimes AIs do hallucinate. Sometimes
  541. 17:09it'll break its rules, because these
  542. 17:10things aren't perfect, but having an
  543. 17:12understanding of how to set this up now
  544. 17:14is extremely beneficial, because in the
  545. 17:16future months and future years, these
  546. 17:18things will get near perfect. We know
  547. 17:20we're heading towards a world where AIs
  548. 17:22are smarter than us, more accurate than
  549. 17:23us, even though they might make some
  550. 17:24mistakes now. I mean, just look at how
  551. 17:26far they've come since I started using
  552. 17:28trading bots a few years ago. Like, they
  553. 17:29are already so much better and they'll
  554. 17:31keep getting better. So, if there are
  555. 17:32issues, just persist. It can be
  556. 17:34frustrating, but that's actually how you
  557. 17:36learn and create better bots over time.
  558. 17:38Now, for the more advanced people, two
  559. 17:40files is okay to start. That is a
  560. 17:41workable memory system, but you may want
  561. 17:44to consider building a cloud memory
  562. 17:46system on something like Superbase or
  563. 17:49Supermemory or Firebase where your
  564. 17:51memory is actually stored on the cloud.
  565. 17:54So, it's the exact same idea, but it's
  566. 17:55actually a database instead of just
  567. 17:57files, so it can hold thousands of
  568. 17:59trades and a much bigger ledger that
  569. 18:02will be less intensive for the bot to
  570. 18:05review. Especially if you're a
  571. 18:07high-frequency trader, you're probably
  572. 18:08going to need to upgrade from the true
  573. 18:10file system after a few weeks of trading
  574. 18:12cuz you'll have so much data and it will
  575. 18:14actually slow your AI down. So, this
  576. 18:16time I'm doing a test where I gave the
  577. 18:18bot some memory. I set up this system
  578. 18:20and if you actually run it again, the
  579. 18:22losing signal shows up, but this time
  580. 18:25the AI actually checks its own record.
  581. 18:28It sees it already lost on a similar
  582. 18:29setup to this, so it decides to skip it.
  583. 18:31This is the key. It's not just being
  584. 18:33cautious, it still takes good setups,
  585. 18:36but it skips the one that it loses from
  586. 18:38in the past. So, if you look at the two
  587. 18:39side by side, the bot with no memory
  588. 18:41just keeps bleeding on the same trade,
  589. 18:43but the one that remembers stops the
  590. 18:45bleeding and keeps the winning trades.
  591. 18:47Now, imagine this iterating over
  592. 18:49thousands of trades, it just gets
  593. 18:51smarter over time. So, that's the same
  594. 18:53strategy, but memory is the key
  595. 18:55differentiator there. But now, let's
  596. 18:56talk about the honest reality. Before
  597. 18:59you run a bot with real money, before
  598. 19:00you just copy a random strategy, make
  599. 19:03sure that you test something with paper
  600. 19:04money first. I'm going to give you some
  601. 19:06homework. Go away, take the prompt from
  602. 19:08today's video available in the
  603. 19:09description below, build your own
  604. 19:10trading bot whether it's for crypto or
  605. 19:12stocks, and paper trade for a week, and
  606. 19:15learn to refine your memory system. Once
  607. 19:18you're confident, then start with a
  608. 19:19little bit of money, maybe 1, 2, 3% of
  609. 19:22your max risk tolerance, and then scale
  610. 19:24up over time. The majority of your
  611. 19:26losses are going to come in the early
  612. 19:28days as you're still figuring things out
  613. 19:30and as the bot is figuring things out,
  614. 19:32and things only become reliable as
  615. 19:34things develop over time. I'm going to
  616. 19:36be backtesting a lot of strategies on
  617. 19:38this channel. If you would like to
  618. 19:39subscribe, because I'm also in the
  619. 19:41process of trying to work out what the
  620. 19:42best strategy is. I found some which are
  621. 19:44amazing and have been highly profitable,
  622. 19:46but I think we can always get better by
  623. 19:47testing more data, and that's what I
  624. 19:49want to do here on the channel. The goal
  625. 19:50of today's video was to help you
  626. 19:52understand what a trading bot is and how
  627. 19:54to actually set one up the right way,
  628. 19:56and then in future videos, we'll go in
  629. 19:58depth on very specific builds and
  630. 20:00strategies, and do lots of live tests
  631. 20:02because I'm just still experimenting all
  632. 20:04the time. I'm even doing a test right
  633. 20:05now where I've put Claude and GPT and
  634. 20:07other models up against each other to
  635. 20:09see which one is the best. So, that is
  636. 20:11how to build a real trading bot. I'll
  637. 20:13leave the prompt available below. It's
  638. 20:15in the WhatsApp community on the pinned
  639. 20:17link. And of course, if you want to keep
  640. 20:18leveling up your own trading and
  641. 20:20investing, subscribe to the channel as
  642. 20:22I'll be bringing you the AI strategies
  643. 20:24that can help you stay at the forefront
  644. 20:26and [music] the edge of the market. I'll
  645. 20:28see you in the next video. Have a lovely
  646. 20:30rest of your day. Peace out.

About this transcript

This page contains the full transcript of how to actually build an ai trading bot (full guide) by Miles Deutscher Finance, generated from the public captions YouTube serves with the video. The transcript has 4,554 words across 646 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.