# Complete Guide to building an AI Trading Bot with Claude for Beginners
Canonical: https://social-archive.org/jack_bauer111/kWPZXOqJNP
Original URL: https://www.youtube.com/watch?v=oQdkFPhqaGk
Author: Ray Fu
Platform: youtube
Share mode: full
## Content
🔥 Check out all my free Tech and AI guides here: https://www.raycfu.com 🔥 Check out my community: https://www.skool.com/raycfu if you want to make money and learn how to run your business with AI, Hey Guys! In this video, I show you the complete guide on building out an AI trading bot using Claude that will make trades for you based on strategies that you give it. In the community, we have 2 weekly calls and 1:1 help with freelancers, business owners, and agencies for building out AI systems in their business and creating an AI trading bot. Thanks so much for watching and if you have any videos ideas that you want me to make, please comment it below and subscribe for more! All my free guides: https://www.raycfu.com/ Instagram: https://www.instagram.com/raycfu/ Tiktok: https://www.tiktok.com/@ray_fu Facebook: https://www.facebook.com/raycfu --- ## Transcript [0:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=0s) Hey everyone, welcome back to the [0:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=1s) channel. My name is Ray, and if you're [0:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=2s) new here, I help you to make money and [0:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=4s) run your business with AI. I worked at [0:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=6s) Meta for over 6 years as a software [0:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=7s) engineer and quit my job to help [0:08](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=8s) everyone because I saw the huge impact [0:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=10s) that AI had on the whole tech industry. [0:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=12s) And because I want everyone to start [0:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=13s) using AI, I'm giving away a $100 Claude [0:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=15s) or ChatGPT max plan each video to every [0:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=18s) single person watching. All you have to [0:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=20s) do is like, subscribe, and comment below [0:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=22s) on how you use AI in your daily life. [0:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=24s) Thanks everyone for the support so I can [0:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=25s) do so much more for the community. Also, [0:27](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=27s) if you want to learn from me directly [0:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=28s) with weekly meetings and a lot more [0:29](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=29s) one-on-one help and direct support to [0:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=31s) make money and build out your own [0:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=32s) company with AI, feel free to check out [0:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=34s) my school community. I linked it in the [0:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=35s) comments below. In this video, I'm going [0:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=37s) to be showing you how to build a trading [0:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=38s) bot step-by-step from scratch using [0:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=40s) Claude code and Alpaca. And the best [0:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=42s) part is you don't even need to be [0:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=43s) technical or have a technical background [0:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=45s) at all because it's as simple as [0:46](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=46s) speaking to Claude. In this video, I'm [0:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=48s) going to walk through the exact tools [0:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=49s) we'll be using to build our bot, how to [0:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=51s) set them up so they communicate with [0:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=53s) each other, and finally how to create a [0:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=54s) trading bot with a specific beginner [0:56](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=56s) strategy that automatically and [0:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=57s) continuously checks the market for you. [0:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=59s) Before we jump in, I want to give you [1:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=60s) some actual context on what an AI [1:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=62s) trading bot is and why I'm making one [1:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=63s) for this video. Let's talk about what an [1:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=65s) automated AI trading bot actually is. At [1:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=67s) its core, a bot does two things. It [1:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=69s) automates a repetitive strategy and it [1:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=72s) executes better than human can. When I [1:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=73s) started trading, I had the right ideas [1:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=75s) and setups, but my problem was always [1:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=77s) the execution. I'd spot a clean setup [1:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=79s) and not be at my best to take it. I'd [1:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=81s) get in a trade or forget to manage it [1:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=82s) later on, or I'd manage it emotionally [1:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=85s) and hand the profit right back. Every [1:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=86s) single time it cost me a lot of money. [1:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=88s) But, that's the real value of a bot. It [1:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=90s) executes the strategy you've already [1:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=92s) defined exactly the way that you find [1:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=94s) it. It doesn't hesitate or forget or get [1:36](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=96s) scared, and emotion is usually what [1:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=98s) trips up most traders. A bot doesn't [1:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=100s) have any emotions. It uses logic and [1:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=102s) data and just executes the trade. Even [1:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=105s) better is that your bot can work 24/7 [1:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=107s) around the clock even when you're [1:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=109s) asleep. You don't have to worry about [1:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=110s) missing out on a trade just because [1:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=111s) you're not glued to a screen all day, [1:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=113s) and that alone makes a bot worth it in [1:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=115s) general. And if execution was ever your [1:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=117s) weak point, and for most people it is, a [1:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=119s) trading bot is how you fix it. But [2:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=121s) before we start building, I just want to [2:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=122s) give a quick disclaimer. I'm not a [2:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=124s) financial advisor and this is not [2:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=125s) financial advice. I'm just showing you a [2:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=127s) cool use case with AI. Everything we're [2:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=129s) doing today is specifically in paper [2:11](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=131s) trading. Paper trading just means that [2:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=132s) we're using fake money in a real market [2:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=134s) so that we can test our bot and our [2:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=136s) trading strategies using the same [2:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=137s) stocks, the same prices, and have [2:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=139s) everything be the same way as the real [2:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=141s) market without taking any risk for real [2:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=143s) money. When you're comfortable, you can [2:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=145s) add real money to your account for real [2:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=146s) instead of using paper trading. But [2:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=148s) right now, we're going to dive into [2:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=150s) building our trading bot with paper [2:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=152s) trading. First, I'm going to search for [2:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=153s) the Cloud desktop app. You might have [2:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=155s) this already. And if you can, click on [2:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=157s) this link here. If you need any links [2:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=158s) and the tools, I'll have it in the [2:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=159s) description below. I'm going here and [2:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=161s) you see you just want to download the [2:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=162s) app and you can use it for Windows or [2:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=164s) Mac, but make sure you download the [2:46](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=166s) Cloud desktop app. Okay, all right. So, [2:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=168s) after you've installed the app, you'll [2:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=169s) get something that looks like this. Make [2:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=171s) sure your software or your Mac OS up to [2:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=173s) date so you have everything available [2:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=174s) and ideally you have the Pro or Max [2:56](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=176s) version of the Cloud paid for. Once [2:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=178s) again, I'm passing out a Max Cloud to [2:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=179s) someone who likes, subscribes, and [3:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=180s) comments below. So, make sure to do [3:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=182s) that. Then go here and click on code. [3:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=184s) We'll be working with Cloud code to [3:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=186s) actually build out our bot. Next, we'll [3:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=187s) create a folder for our trading bot. I'm [3:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=189s) going to go over here by the chat and [3:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=190s) click this folder icon. I already have [3:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=192s) my projects folder that I keep all my [3:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=193s) Cloud projects in. So, if you don't have [3:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=195s) one, you can do that as well or create a [3:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=197s) folder directly on your desktop. I'm [3:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=199s) going to then create a new folder for my [3:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=201s) projects and name it trading bot. Then [3:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=203s) hit open. Now, above the chat, you see [3:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=205s) that we're working out of the trading [3:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=206s) bot folder. So, any new files that Cloud [3:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=208s) creates will be in that folder. Okay, so [3:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=211s) that's the first step. The next step is [3:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=212s) we need to our brokerage account with [3:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=214s) Alpaca. So, I'm going to go back to the [3:36](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=216s) browser. I'm going to search Alpaca [3:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=217s) trading platform. Go ahead and click on [3:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=219s) Alpaca here and you'll sign up for a new [3:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=220s) trading API and create a new account. [3:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=222s) This takes a little bit, but once you [3:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=224s) entered all your information, you should [3:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=225s) see this dashboard. And in this [3:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=227s) dashboard, if you go to the top left and [3:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=229s) click on the account, you'll see that I [3:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=230s) have an individual trading account. But, [3:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=233s) everything we're going to be doing this [3:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=234s) tutorial is not for real money. It's [3:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=235s) with paper money. So, we're going to [3:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=237s) need an actual paper trading account. [3:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=239s) It's quite easy to set up. You can make [4:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=240s) a new one if you want. I'm going to make [4:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=242s) a new one to keep all things organized [4:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=244s) in Cloud Paper Trading. And then you can [4:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=245s) choose however much ever you want, a [4:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=247s) million dollars, 200 million dollars, [4:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=249s) but I'm just going to say $50,000 and [4:11](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=251s) then click save. And you can see right [4:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=253s) there, we're going to have a paper [4:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=254s) trading account for about with $50,000 [4:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=256s) to essentially play with in the stock [4:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=258s) market. All right, once you have your [4:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=259s) account made, you'll need the account [4:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=261s) API keys. You can find that over here, [4:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=263s) but first we're going to go back to our [4:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=264s) Cloud Desktop app. In the Cloud Desktop [4:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=266s) app, you find your account at the bottom [4:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=268s) left and click on it. Then click on [4:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=270s) settings. Next, click on developer, and [4:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=273s) this is where you'll connect the Alpaca [4:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=275s) MCP to Cloud so that you can trade on [4:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=277s) Alpaca through Cloud. Click on the edit [4:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=279s) config. This window with your Cloud [4:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=281s) config file will pop up with the Cloud [4:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=282s) config file highlighted, and you just [4:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=284s) click on the file to just open it. This [4:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=285s) config file is where you'll copy and [4:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=287s) paste the Alpaca MCP. Now, in order to [4:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=289s) find the Alpaca MCP, we're going to go [4:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=291s) back to our browser and search for [4:52](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=292s) Alpaca Market MCP. Go ahead and click on [4:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=295s) the link here and it'll take you to the [4:56](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=296s) page where you can scroll down and find [4:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=297s) the Cloud Desktop MCP option. Click on [5:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=300s) install, and this will take you to the [5:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=301s) GitHub page with the Alpaca MCP directly [5:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=305s) ready to copy into your Cloud config [5:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=306s) file. [5:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=307s) I already have another MCP in my Cloud [5:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=309s) config file, so I'm just going to add a [5:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=310s) comment after the second to the last [5:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=312s) squiggly bracket, and then click a new [5:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=314s) line and over here copy from where it [5:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=316s) says Alpaca to the second squiggly [5:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=318s) bracket. This just adds the MCP to your [5:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=320s) files. Then I'll paste it into a new [5:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=322s) line on my config file. I'm going to try [5:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=324s) here to match the spacing real quick. If [5:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=326s) Cloud config file is completely empty, [5:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=328s) you just copy and paste everything from [5:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=330s) the code directly into your config file. [5:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=332s) If you don't have any MCPs in your [5:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=334s) config file, but you have some other [5:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=335s) text in there, just copy and paste all [5:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=337s) the code at the top of the Cloud config [5:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=339s) file and add a comment after the last [5:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=340s) squiggly bracket, or else you'll get an [5:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=342s) error. Okay, once they're actually [5:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=344s) pasted in there, you'll get your API [5:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=345s) keys from Alpaca. We can go back to our [5:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=347s) Alpaca account over here to get the API [5:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=349s) keys and click generate new keys. You'll [5:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=351s) get a regular key and a secret key, but [5:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=353s) make sure to save that somewhere because [5:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=354s) the secret key will disappear for a [5:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=355s) while and you won't be able to see it. [5:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=357s) Now, copy your key here, then open the [5:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=358s) Cloud config file with your Alpaca MCP, [6:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=361s) and then paste in the key inside the [6:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=362s) quotes where it says to. Next, we'll do [6:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=364s) the same for our secret key, and now [6:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=365s) that that's done, we can close out of [6:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=367s) our config file, and we'll also need to [6:08](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=368s) close out of the Cloud desktop app [6:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=370s) because the MCP can only update after we [6:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=373s) restart the app. I'm going to reopen the [6:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=374s) Cloud app now and then go back in there [6:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=376s) to my account, then settings and [6:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=378s) developer, and now you should see Alpaca [6:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=380s) in your list of MCPs and that it's [6:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=382s) running. [6:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=383s) Okay, now let's check the connection [6:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=384s) between Cloud and Alpaca. I'm going to [6:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=386s) switch to code and then to a new session [6:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=388s) to make sure I'm in the right trading [6:29](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=389s) bot folder. Then I'm going to ask Cloud, [6:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=392s) "I want to test a connection to my [6:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=393s) Alpaca account. Can you tell me how much [6:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=395s) money I have in my account and if I have [6:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=397s) any stocks?" [6:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=398s) Then hit enter. Also, we're working in [6:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=400s) an older Cloud model right now because [6:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=402s) these are simple tasks and we're going [6:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=403s) to save on token usage. [6:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=405s) Nice. Cloud told us that we have $50,000 [6:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=408s) in our account and no stocks, which is [6:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=410s) correct. And also reminder, this is [6:52](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=412s) $50,000 in fake paper trading money. Now [6:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=414s) that our Alpaca account is actually [6:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=415s) connected to Cloud, we can actually ask [6:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=417s) Cloud to place a trade for us without [6:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=418s) even going to Alpaca. Okay, awesome. We [7:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=420s) see that Cloud says that I successfully [7:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=422s) placed an order for Micron for us. Also, [7:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=424s) since it is the weekend right now, the [7:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=425s) market isn't open, so the order is [7:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=427s) pending, but it will be filled when the [7:08](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=428s) market opens. If we go over here to our [7:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=430s) Alpaca account and refresh the page, we [7:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=432s) can scroll down and we see that the [7:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=434s) order shows up here and it is waiting [7:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=435s) for the market order to be filled. You [7:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=437s) can now prompt Cloud to just buy or sell [7:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=439s) whatever stocks you like. However, the [7:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=441s) whole point of this video is to create a [7:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=442s) bot that automatically trades for you so [7:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=444s) you don't have to worry about executing [7:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=445s) trades yourself. In order to create this [7:27](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=447s) automatic trading bot, we have to give [7:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=448s) it a set of guidelines on when to buy, [7:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=450s) sell, or hold, or else it won't know [7:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=452s) when to execute. [7:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=454s) To do this, we need to give our bot a [7:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=455s) trading strategy. But there are tons of [7:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=457s) different trading strategies out there. [7:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=459s) You can use anyone you like, but for the [7:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=461s) purposes of this video, I'm going to [7:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=462s) give you the simplest one that actually [7:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=464s) works. The strategy we're going to be [7:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=465s) using is called the moving average [7:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=467s) crossover. Let me explain what that [7:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=468s) means. So, a moving average is just the [7:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=471s) average price of a stock over a set [7:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=473s) period of time. [7:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=474s) A 50-day moving average is the average [7:56](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=476s) closing price over the last 50 days. As [7:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=478s) new prices come in, it actually updates [8:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=480s) the average, and that's why it's called [8:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=481s) moving. We're using the averages because [8:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=483s) the averages smooth out all of the [8:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=484s) noise, so you can actually see the [8:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=486s) actual direction that the price is [8:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=487s) trending for a stock. For our bot, we're [8:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=489s) actually be using two moving averages. A [8:11](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=491s) fast one, which is a 20-day average, and [8:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=492s) a slow one, which is a 50-day average. [8:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=495s) The fast one reacts pretty quickly to [8:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=496s) recent price changes, which is why it's [8:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=498s) called fast, and the slow one reacts [8:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=500s) slower to price changes, hence the name. [8:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=502s) So, this is how our two moving averages [8:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=503s) are going to work together for our [8:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=504s) strategy. When the fast line crosses [8:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=506s) above the slow line, this means our [8:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=508s) recent momentum is picking up and the [8:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=510s) stock price is growing. That's actually [8:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=511s) your buy signal. When the fast line [8:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=513s) crosses above the slow line, this [8:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=515s) actually means recent momentum is [8:36](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=516s) turning up and the stock price is [8:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=518s) growing, and that's your buy signal. [8:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=520s) However, when the fast line crosses [8:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=521s) below the slow line, momentum is turning [8:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=523s) down, the stock is declining, and that's [8:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=525s) your signal to get out. That's it. [8:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=527s) That's the crossover. Cross up and [8:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=529s) you're in, cross down and you're out. [8:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=531s) And this is a great starting strategy [8:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=533s) for your bot because it's just math. [8:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=535s) There's no gut feeling, no guessing. [8:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=537s) When two lines cross, an action happens, [8:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=539s) and that's exactly the clear rule that [9:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=540s) Claude can look for for 24/7 and act on [9:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=543s) it the second it triggers. Like I [9:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=544s) mentioned before, there are various [9:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=545s) strategies you can use, and each one has [9:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=547s) its pros and cons. [9:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=549s) But in this case, the crossover strategy [9:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=550s) shines when a stock is trending, but in [9:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=552s) a choppy, sideways market, the lines [9:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=555s) cross back and forth, and you'll rack up [9:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=556s) a bunch of small losing trades. This is [9:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=558s) just a reminder that no strategy wins [9:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=559s) every time, and this one's no exception. [9:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=561s) We're using it because it's simple and [9:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=563s) clear, not because it's a magic way to [9:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=564s) make money. And we're doing with paper [9:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=566s) trading, so you can test out this [9:27](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=567s) strategy as well as other strategies [9:29](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=569s) before you want to use actual money. [9:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=570s) Okay, now that we have a picked of our [9:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=571s) strategy for our bot, it's as simple as [9:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=573s) prompting Claude code. [9:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=575s) I have this prompt here for my school [9:36](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=576s) community that going to copy and paste [9:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=578s) here, but I'll read it aloud for you so [9:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=580s) you can follow along. I'm also going to [9:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=581s) put it in the comments below. Build an [9:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=583s) automated stock trading bot that uses a [9:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=584s) moving average crossover. First, create [9:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=587s) a config file where I can set the stock [9:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=589s) symbol, moving average periods, and [9:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=590s) trade size. We're using Apple with a [9:52](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=592s) 20-day and 50-day moving average trading [9:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=594s) at one share at a time. [9:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=597s) The bot will fetch the last 100 days of [9:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=598s) stock data using YFinance Yahoo Finance. [10:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=601s) Then it calculates both the moving [10:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=603s) averages and looks for a real crossover. [10:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=605s) That means when the 20-day average [10:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=606s) actually crosses above or below the [10:08](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=608s) 50-day average between two consecutive [10:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=610s) days. When that happens, it [10:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=612s) automatically places a buy or sell order [10:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=614s) in my paper trading account, also [10:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=615s) creating an environment file for my API [10:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=617s) credentials so I don't have to give my [10:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=618s) account credentials every time I make a [10:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=620s) trade. I'm going to change this to [10:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=621s) actually use Opus 5 for building this [10:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=623s) bot because it's a lot better for these [10:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=625s) more complicated tasks, and now we just [10:27](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=627s) hit enter and click allow on any pop-up [10:29](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=629s) windows and wait for Claude to build it. [10:32](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=632s) I usually actually just do bypass [10:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=633s) permissions cuz it's a lot easier. [10:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=635s) And then I'll show you what it looks [10:36](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=636s) like. Also, Claude will most likely use [10:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=638s) Python to build out your bot, so make [10:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=640s) sure you have Python and Node.js already [10:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=642s) downloaded and installed. Okay, so here [10:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=643s) we see that Claude has actually built [10:45](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=645s) our bot for us, and we created these [10:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=647s) files in our trading bot folder for our [10:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=648s) bot. Okay, I'm going to open my trading [10:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=650s) bot folder and show you guys the files [10:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=651s) in here. [10:52](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=652s) Also, if you're using a Mac and you [10:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=654s) don't see your .env file in your trading [10:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=655s) bot folder, just hit command shift [10:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=658s) period and you'll be able to see them [10:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=659s) just like this. Okay, so the .env file [11:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=661s) is actually where we'll be putting our [11:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=662s) Alpaca account's API keys so that our [11:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=664s) bot has credentials to access our paper [11:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=666s) trading account without having it for us [11:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=667s) to give that information every time. I'm [11:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=669s) going to go back to my Alpaca account [11:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=670s) for the keys. I'm going to copy the key [11:12](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=672s) in from here and paste it into .env file [11:14](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=674s) where it says to put your paper key [11:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=676s) here. And like I said before, the secret [11:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=679s) key disappeared from my Alpaca [11:20](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=680s) dashboard, but it's not a big deal [11:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=681s) because we can just grab it from our [11:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=683s) Claude config file. All right, I'm going [11:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=684s) to copy this and then paste it right [11:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=686s) where it says paper secret key here and [11:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=688s) then save file and then close out. Okay, [11:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=690s) let's go back to our Claude code [11:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=691s) session, and now I'm going to ask Claude [11:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=693s) to run our bot. Type out, "Can you run [11:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=695s) the bot?" Okay, and then hit enter. [11:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=697s) Okay, looks like the dry run went well [11:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=699s) and our bot is working just like it [11:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=700s) should. Now that we have our bot built [11:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=702s) with a strategy, what we want to do is [11:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=703s) basically keep it alive and keep looping [11:46](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=706s) and checking on a schedule automatically [11:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=707s) for any buy or sell signals for our [11:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=709s) stock. Without this step, we would [11:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=711s) pretty much need to command manually to [11:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=713s) run our bot every single time we want to [11:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=715s) run a trade. And this would defeat the [11:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=717s) whole purpose of having a trading bot so [11:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=718s) you can step away from your computer and [12:00](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=720s) not worry about up with the market and [12:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=722s) executing trades for yourself. So, the [12:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=723s) plan is to automate our bot so that it [12:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=725s) checks our stock and in this case I [12:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=727s) picked Apple, but you can choose any [12:09](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=729s) stock you like from the many different [12:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=730s) ones out there. [12:11](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=731s) So, it checks Apple every single weekday [12:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=733s) morning when the market opens at 9:30 [12:15](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=735s) EST. It runs our moving average [12:17](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=737s) crossover strategy and then depending on [12:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=739s) the output of the logic behind our [12:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=741s) strategy, the bot will either buy, hold, [12:23](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=743s) or sell signal and based off that [12:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=745s) signal, the bot will execute the trade [12:26](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=746s) accordingly and log it for you to review [12:28](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=748s) in a file in your trading bot folder. [12:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=750s) Okay, now I'm just going to copy this [12:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=751s) prompt that I have from my school [12:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=753s) community that I'm going to just paste [12:34](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=754s) here. [12:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=755s) But, I'll read it aloud so you can [12:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=757s) follow along. [12:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=758s) Also, I'm putting in the comments below [12:40](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=760s) and once again, if you need help, please [12:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=761s) join the school community. Automate my [12:43](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=763s) bot so it runs Monday through Friday at [12:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=764s) 9:30 EST, right when the stock market [12:46](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=766s) opens. The bot will fetch the latest [12:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=768s) market data, check for moving average [12:50](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=770s) crossovers, and execute trades if it [12:52](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=772s) finds a signal. The bot will log [12:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=774s) everything it does each morning so I can [12:55](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=775s) check the results whenever I want. [12:57](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=777s) Now hit enter and wait for the Claude to [12:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=779s) finish building out the automation and [13:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=781s) hit allow for any pop-up windows. I [13:03](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=783s) usually do bypass all permissions. I'll [13:05](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=785s) show you what it looks like when it's [13:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=786s) finally done. Okay, nice. Claude has [13:08](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=788s) finished automating our bot so now it'll [13:10](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=790s) run a check every morning when the [13:11](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=791s) market opens and depending on our [13:13](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=793s) signal, our bot will actually buy, hold, [13:16](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=796s) or sell one share of Apple. Also, your [13:18](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=798s) computer should stay on so your bot can [13:19](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=799s) run every single morning and do its job. [13:21](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=801s) And that's pretty much it. If you [13:22](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=802s) haven't built anything with Claude yet [13:24](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=804s) or been wanting to try and haven't tried [13:25](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=805s) it, I highly recommend giving this one a [13:27](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=807s) shot. Building a trading bot sounds more [13:29](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=809s) daunting than it actually is. The [13:30](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=810s) hardest part is actually just setting [13:31](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=811s) everything up, but once you do, you saw [13:33](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=813s) in this video how simple it is to just [13:35](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=815s) have a conversation with Claude to build [13:37](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=817s) out the bot and automate it. If you like [13:38](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=818s) this video and want to learn more about [13:39](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=819s) how to set up or use Claude, how to [13:41](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=821s) create agents, how to set up your [13:42](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=822s) projects, how to make money with YouTube [13:44](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=824s) automations, and more, just subscribe [13:47](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=827s) because I'm going to be putting a lot of [13:48](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=828s) videos out there to help you get the [13:49](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=829s) most out of Claude, ChatGPT, and AI in [13:51](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=831s) general. If you want any help or want to [13:53](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=833s) see me dive deeper in any of these [13:54](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=834s) strategies, once again, join my [13:56](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=836s) community where I do live Q&As and [13:58](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=838s) one-on-one help and I help you build and [13:59](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=839s) make money with AI. This is in my school [14:01](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=841s) community in the comments below. Make [14:02](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=842s) sure to like and subscribe for more and [14:04](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=844s) comment below for any videos that you [14:06](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=846s) want me to make. See you all in the next [14:07](https://www.youtube.com/watch?v=oQdkFPhqaGk&t=847s) video and thanks for watching.
