Transcription
This is the definitive course on AI investing using Claude. I used this system to turn my own portfolio from £1,000 into £180,000 over the course of 4 years, which is an insane growth amount. And I'm not promising you that growth, but what I'm saying is AI has massively helped me build this system and was definitely a massive contributing factor to that growth.
If we haven't met yet, my name is Lewis Jackson and I help people build life-changing agents. I have a side interest in investing. It's actually proven to be really fruitful for me. I've been able to apply my world-class agents to investing and it's had some incredible results for me. And I think it's about time that I just kind of share it all for you.
I'm going to give it to you in such a way where you're going to be able to engage with the material that I've provided here and install it into your own computer. I don't think I've seen anyone do it to this degree. Certainly no one who's kind of gating anything. This is all ungated. I want you to have it. It's going to be copy and paste at the end. You can just take it all. But I think it's really important to walk you through the mental models and the the thought process I'm going through in building these agents because whenever you're building an agent for yourself to do this or installing your strategy into this system, you're just going to have better results because you understand it to a deeper level.
For the first part of this video, I'm going to walk you through exactly how all of this works. And then at the end, I'm going to hand you a copy and paste prompt that installs the entire thing into your own system. Stick with me to the end for that. Okay.
So, here's everything that you're going to learn in this course. And it might look like a lot as I scroll through it all, but I'm going to make it simple here just for kind of an overview of what we're going to get into. Everything we're going to be learning is in eight different sections.
Section one is really just kind of a big picture. I want to explain kind of where my brain is coming from, maybe some definitions for some words that we all need to be on the same page about. That's just going to allow the whole system to work better and also when you're working through this material if you can work through it in the simplest most effective way then we need to do that because you know I want to reduce the amount of time that it takes for you to get some benefit from this system.
The second one is where we're going to give AI hands essentially allow the AI to touch into the systems itself. This is kind of like magic when you see it happening when the AI is moving things on a chart and throwing up indicators. It's kind of amazing. I made a video about that a while ago and it actually became my first video that reached a million views. This is just one part of this course that that's just all included here. I'm going to teach you all how to set that up on your system as well so you can do it yourself.
Then in section three, we're going to go into I guess the areas of trading strategy or investing strategy that is absolutely fundamental and it's something that people do before they actually go live with their strategy and it's called back testing or research. So oftentimes you'll get a strategy and say, "Hey, how did this perform in the past?" And that back test is why 99% of people never actually end up doing anything good with their investing. It's mind-boggling how few people understand this. I'm going to explain back testing, how to do it properly. We're going to go through a whole load of different concepts as well.
Additionally, you'll have it all available to copy and paste into your own system. So I want you to sit back and just listen to the course. You will implement it after the video, but it will be a copy and paste thing that you do. I'll show you how to do that at the end.
Section number four, we're going to get into risk mitigation. So, we're going to actually build a whole engine for risk. This is going to ultimately be a big blocker for you. If you if your strategy wants to make a trade, but it is actually assuming too much risk, the risk engine will be responsible for kind of stopping that from happening. There's a whole load of skills that we're going to install in your computer here and agents that are going to work on this side of things. Again, that's going to be copy and paste for you when that time comes.
Then six, we're going to get into the oh, sorry, section five, we're going to get into the execution mode. So, this is okay. Now, we've got the strategy that wants to do something and we've got the system that's done the back testing and it's done the the research there and it's also applied the risk models. How does it now actually go out and do a trade? And whether that's paper trading or real trading, both are going to be covered in this course.
Then in the sixth section, we're going to install that feedback loop. So if we had a good trade, did the system learn why that was a good trade? Like what happened that made that a good trade? Can we replicate that? And can we install that that new idea into the next trade? Or equally, if we lose something, can we learn from that loss and and determine why it lost and implement that into the next trade as well?
Then in section number seven, we're going to basically have the whole system run itself 24/7 on the cloud. So whether your laptop's open or closed, it's still working for you and trading for you. This has been the most wild thing that's happened for me in my trading, in my investing, especially this time round, where I had an agent essentially go into the market buy at the perfect times. And I can show that on a on a screenshot somewhere. It bought the absolute perfect times in the crypto bare market. And I couldn't be happier with it. And it all happened while I was asleep. Every single trade happened in the middle of the night. So if that had if that agent wasn't in place, I would have missed that opportunity. So I'll teach you how to do that. I'll give you all my systems for doing that as well.
And then you're going to take the whole thing home with you. You're going to go come over to the website that I've built for this. You can download all the resources, copy and paste all of the skills, all of the prompts, everything. All you have to do right now is listen with an open mind and a willingness to learn and it should be a good journey.
So I think we have to start with the big picture number one. So this part is really just about differentiating a system versus a strategy. So I want you to kind of look at it almost like a sports car. A sports car is a strategy. It will get you going fast down the roads. It make you look cool. It might get you some results. You might get some ladies that way. I don't know what it is for you. But the infrastructure, the roads itself is the system. The car can only drive as fast as the speed limit. If the roads are clear, then it can drive fast. But if it's if there's traffic, it can't drive fast. There are limitations to a strategy because of the system.
Now, a lot of the time, the system is there deliberately for your safety. There's a reason why we have 30 mph roads, right? It's for safety. If you go too fast down there, you might hit someone and it's more dangerous. So, they slow the speed down so that if you are in an accident, this, you know, the survival of the person who gets hit is greatly increased or the percentage chance. So, it's the exact same thing. The system is the constraints to the speed that you want to go in your Ferrari. We really need to make sure that we understand system is infrastructure. How things are actually done and it's how the strategies flow through that system.
If you grew up in Central America for example, you know, no one's driving around a Ferrari on those roads. Potholes everywhere, the roads aren't made for it. But if you were born in Dubai, then all the roads are made for a Ferrari, right? The degree to which you build and the quality you build your system depends on how fast you can drive in that system. We want to build a system like Dubai or Austin, Texas or Vegas or whatever these nice places with nice roads basically. And we want to install your Ferrari of a strategy. I hope it's a Ferrari of a strategy so we can drive straight through there without hitting anyone, making it dangerous for anyone or running into a pothole. That's the difference between a system and a strategy.
Today, we're going to be building a system. You're going to be installing your own strategy into the system. But as I said, if you don't have a good system, the strategy is not going to work. It's like trying to drive your Ferrari around Nicaragua. It's just not going to work.
There's one thing we have to differentiate here as well, and that is a word called trade intent. If we break that word down, it's very important for all of this because I think when people think trade intent, they they kind of think about the system, and it doesn't doesn't necessarily work like that. Trade intent is the desire to make a trade and there is an order things need to go from the strategy and the system. There's an order of things. You can't have the system first. In this case, it would be weird to have the system and then the strategy in that in that order. Rather, the strategy actually executes first, which is uh I think contrary to what most people think.
The strategy will decide the conditions are met right now for me to make a trade. So let's say you wanted to make a trade when the price comes down to the 30 EMA or whatever whatever it is for you. Your strategy will determine that. And you can build your strategy in this course, right? That's absolutely possible. But we're really going to focus on the system. Your strategy might say, "Hey, we need to make a trade now. It's a bull signal. I want to make the trade." That is the intent. Like the desire of your strategy to make the trade is the trade intent. And that trade intent is sent to the to the system.
Now the system comes pre-installed with all of these different limitations. One of them might be risk like you will have entered in ahead of time. I only want to assume this much risk. You know if I have this much money in my portfolio I only ever want to do a maximum of 1% of my entire portfolio in any in any single trade. So there's like rules here. The system has rules like the signs on the road, right? You can't drive that fast in some areas. You can drive faster in others. or there's a there's a crossing where kids are going to be coming across, right? You have to slow down for it. There's like you can't just speed through that. And so your strategy needs to have the res pulled in on it. Uh if needed, the system will do that. So the trade intent goes out from the strategy. It goes into the system and the system dictates whether the intent is actually followed through with and a trade is made. The system is really the blocker for good reason. Like don't look at blocker as negative. It's for good reason. and you will create those rules yourself in this video as well. It will stop all the bad things happening.
Now, this is something that will also learn, you'll learn over time. The agent will also learn over time because there'll be times where you haven't set up a rule comprehensive enough. So, you put in a rule and then your strategy comes in and actually executes a trade when you actually didn't want it to, but because you didn't implement that in the rule system that we build, then it got away with it and it did the trade and it maybe it ended up badly. This happens all the time with machines that learn. The other day I lost 60% of one of my portfolios just straight away. And I I couldn't believe it because I thought I had a comprehensive rule system, but there was something unforeseen. I hadn't made a rule for it. It missed it and I lost I lost a whole bunch of money there. So, this is something that I've rectified now and won't happen again. This is exactly why we do paper trading before we do real trading. You need to give the paper trading a serious amount of time so that you can encounter all of these side things that can come in from the side and unexpected things. The more unexpected things you can encounter, the better because you can set up defined rules to stop that happening again. And I think for the most part, the key to making lots of money with investing is not losing out so bad when you lose. It's not always about the gain. It's also about not losing.
Okay. So, I think that we've got the big picture. Now, I think you understand the difference between a system and a strategy. They they play together, but they're they're playing different games and they're they're for different purposes.
Now, I'm going to come over to Miro to explain an API. You will have seen APIs all over the place. Whether you're going to a brokerage, uh you might see an API tab at the bottom or you've used any other tool in in AI, you'll always have to link your Claude with an API in order to engage with something else. So, I'm going to try to do my best here to explain what an API is.
An API is always involved in kind of a looping of data. Within that loop, there are a series of different stops. You have an API. You'll also have something called an API key, which I'll just input in here. And you'll also have your your computer. I'll just call that PC. Often times when something isn't on your computer, you have to engage with another system in order to get the data from it. Especially if we're trying to get trading data, right? Or trying to do some research on on assets or whatever. Typically, this data is hosted on another website. You need to you need to have a way to get into that website. The way you get into that website is via an API key. If you can hold that API key, you get access to the API information. And so you have to hold that API key on your on your computer. So we hold that API key on the computer. If we want that data to come in, we give it the key. We open the door and we get access to that data. Once we have that data, it feeds that data back through into the into our computer and it creates a nice little information loop.
There's loads of examples of how you can use APIs. It's almost almost endless ways to to do that. But let's say one of your trading signals was the weather. As crazy as that is, although later on we're going to talk about how that might actually be useful. You might say, "Oh, I think that every time it rains in Okinawa in Japan, the price of Bitcoin seems to go up, right?" That might be your theory. There might be the weather channel, for example, or or a weather outlet that has data about the weather. They will likely have an API. That API allows you to you get a key, you can stick that in and get access to the weather data and it feeds it into your computer creating this loop of weather information. So you can have the API constantly feeding you API data or this weather data. It could be every minute, could be every second, it could be every hour, every day. You can determine the cadence that that happens. Typically the more you use an API key, you see higher charges. So you end up having to pay for API usage. But sometimes the free level of API usage is more than enough for what you need. And you can ask the AI and conversate with it to say what's the best cadence for for me to get this data. I can now inform a trading strategy with this weather information for for that strategy. That itself just that very simple loop of weather information into my computer via the API key could be enough to create a trade intent for you. Then it's up to the system to kind of say, hey, are we just doing this based on the weather or are there other factors here? Which is probably a good thing for your system to do. But you could create a trade intent from just this. I think that's probably the simplest way you can explain APIs.
But there's another thing called MCPs. An MCP is something you use when you can't really the API doesn't quite do enough. And so an MCP, let's just imagine it like this, and I'll use the real example of what we're going to go through in today's video. And that is let's say we're trying to engage with TradingView. So TradingView, if you don't know, is a trading system. It shows you all the charts. You can look at any asset on there. TradingView has like an interface that you have to engage with, right? So if if you actually go on to TradingView, you have to click it and move things around, add indicators, you have to click everywhere. An MCP allows the agent to do all the clicking on its own without opening up the the website. So, it's kind of magic when you see your TradingView move around and you're not doing any clicking. It's kind of it's it's kind of crazy to look at. You will see that happening in in this video and you'll do it yourself in your own system because TradingView doesn't have an API that can do what we need it to do. You have to have an M MCP that does it. The MCP will engage with TradingView by it's a it's a very unique way of doing it. I don't know if you ever saw before or if you ever tried before, there was a lot of kind of hype online about agents using charts and you would end up getting in there, you'd pay the thing to subscribe to it because the agent can now read the charts and read the patterns. But really what was happening was it was taking a screenshot of the chart, sending that to the AI, and the AI was figuring out what happened in that screenshot. The only issue is is if you're working on the 10-second chart or the one minute chart, by the time you've taken the screenshot, you've sent it to the AI, the AI has figured out what to do. That signals all like not relevant anymore. The price has changed since then. The price changes constantly. And so that screenshot method doesn't work. And so the MCP that we're going to install today for TradingView is doing something very different. It's actually looking at all the ongoing things that are happening on the chart.
So actually what I might do here is let's pull up TradingView so I can show you exactly what's happening on any given chart. You know you must know by now that underneath the the screen there's code and this code is dictating what is shown to us on the screen. Right? I think we understand that. What you might not have known is that you can right-click on the page anywhere on the page and you can see this inspect button. When you click inspect, it pulls up the code that's actually happening in the background on this page. As you can see there, there's all types of things happening on this page that you just don't see because all we see is the visual representation of it. Now, because there's a whole load of code happening and this is constantly evolving and changing, which it has to, by the way, because if the chart is changing, which it is all the time, the price is always changing, the code on the page has to be also changing because the code is required to reflect the change on the screen that we're seeing. So, with that knowledge, that's kind of the best way for me to explain what the MCP does. The MCP is actually looking not at the chart. It's looking at the code underneath it to see the exact numerical values of every candle, every wick, everything on the screen it's analyzing in that way. And so, if you want the most up-to-date information of that chart on your screen to inform your strategy, to inform trade intent, what better way than to actually be looking at the live code that's on the on the page. That's what this MCP is doing. When that MCP is looking at TradingView, it's looking at the code behind it, not what's on the screen. Therefore, it's not like a screenshot. It's actually looking at the live data underneath. So, when it comes to actually create a signal, it's as quick of a signal as you could possibly get without having a $1 million computer like the quant analysts have and the hedge funds have. If you have a laptop at home, this is the fastest way to get that real life, real, up-to-date information. That's the best way to find an edge versus all of your competitors. as anyone else out there in the market. If you want an edge, you need fast information and fast data. This is the fastest way to do it. And it can also control the screen. It can change, do I want to be looking at Bitcoin or do I want to be looking at Tesla? It will change it for you. It'll even write the pine scripts on it for you. So, it can even write your strategy into the system as an indicator to see it on the chart.
We now have kind of uncovered here the difference between APIs and MCPs. We're going to be using both of those throughout this material. The API obviously for data intake and the MCPs for engaging with that information in a way that can create trade intent.
So within the system you are actually going to connect your your AI to TradingView. The way that you're going to do this ultimately the way that you're going to do any of this is you're going to come over to 01 systems. The link is in the description here. You're going to come up to classroom. You can once you've clicked classroom, it should take you here. Come down and you'll see the complete AI investing system. That's where you're going to find this all all this material, right? So, you're going to come in here if it lets me click and you'll see all downloads. If you go to the bottom, you'll see the trading suite, the workbook, and the canvas. Each one of these is going to allow you to go through the process step by step. Additionally, there's a whole load of prompts that you can use. If you come over to this site, which is also linked below, you can kind of scroll down. All the resources that we cover in this course is going to be in here. The workbook that will take you from A to Z in this whole process as well. All the copy and paste prompts that you might need like if you want to learn more about the differences between MCPs and APIs, you can copy that to your clipboard, send it over to your AI, and it will explain it. And then it'll also, you know, installing the trading suite. If you want to install this suite, all you do is copy and paste it into your AI and it will just do it. Additionally, just as we have mentioned, if you want this TradingView MCP installed, all you have to do is copy and paste it into your Claude code.
Now that we kind of have this view of how things work and that we know the difference between a system and a strategy, I want to actually get in here and progress this a little bit more. I want to actually put this TradingView thing into your system so that you can use it and actually see it in in action because it is kind of wild. I do something that a lot of people have been doing recently and that is using an IDE to engage with Claude code. Now you can come over to your applications and you can come down and you know choose the Claude application open this up. It is kind of okay just to use the Claude application. I don't tend to use it for the reason I'm going to explain in a second. But let me just wait for Claude to load up here. And I just want to make sure that if you are going to use the Claude code app, there's a few things you need to do. First thing is you need to be on on Claude code mode. All right. So that's clicking code Claude. So that's clicking code on the top left. We can click a new session to start a new session. And you want to make sure you're on bypass permissions because this is going to ask for permissions all the time if you don't if you don't go straight to bypass permissions. And you can just install everything in here and it will do the same job. I just don't like to do it in here. I like to do it in what's called an IDE. The IDE I choose is actually cursor. The reason why this is so brilliant is because if I'm working within a project and there's loads of files and loads of folders, it can get very confusing as to where they are. Sometimes what you need to do is be able to see which files and folders exist there so you can see how everything is built. And you can actually go into the files within cursor and change the files. That's maybe a little bit later on down the line, but it's very very useful. So in here, I might want to open up a project. That would be a project that we're making for this. It might be your investing system or whatever, but I can really just come into any one of these and start working in here. As you can see, I've selected this project. I can see all of the different files and folders in this project. And so, if I wanted to come in here and edit a billing agreement, for example, I could click it and I could see the actual copy in this billing agreement and actually make changes. This is how your strategy will actually be hosted. Your strategy really is just a series of files written in a certain way with certain rules. That's all it is. And so if you're building out a multistrategy system here, then you probably want to be able to see what those strategies are on on the on the right hand side.
All you do if you're going to follow my lead is you're going to come in here and click command J. That's going to allow us to start a new terminal instance. This is the terminal is where I like to operate. What you're seeing right now is exactly how I like to do things. So, what you're going to do is is copy this exactly. You're going to type Claude space dash dash and then you're going to type dangerously dash skip dash permissions. This is going to allow the system to really work the most autonomously that it can. I just find this to be the easiest way. Click enter here and you'll you'll find that your Claude code loads up.
First thing we want to do is, as I said, we want to install this TradingView MCP into our system. So, our Claude code can talk to our TradingView and and have it do a load of magic on there. So, how we do this is we can come down to this page, of course, and if none of this is appearing, all you have to do is kind of enter your email, and it will all kind of appear for you. Uh, there's also music on the page, so I would enable the music if you want to lock in and get some work done. So if you come down here, it says connect TradingView MCP. All we have to do is come over here, click copy to clipboard. We can come over to our IDE in our terminal and just paste that in right there. There it is. It's pasted it in. This also may not if it's not going to work for you, you can actually come over to this site right here, which is GitHub. Trades don't lie. Created this TradingView MCP. I actually made a version of this MCP myself and improved on it. You can get that as well, but if you want to go straight to the source, you go here. All you'd have to do is copy and paste the URL of that GitHub, bring it back over, and just put it in at the end here. And what it will do is it will run through that whole installation process onto your computer. And one thing to note while that is working is that you do need the TradingView app on your Mac. So, it's very again very easy to get if you know where it is, which I'm trying to find it. You can go to your applications and come down and go to TradingView. So, if you're on any trade, you can click this kind of hamburger menu at the top left. Come down, get desktop app. It'll take you to a page to download and you just download it for your system. Very, very easy to do. Make sure you've done that and installed that before you start work on this Claude code message.
So, for me, it said that the MCP is already installed, which obviously it already is. And if you want to make sure that it is already installed on your computer, because it should be installing right now, is you can do forward slash MCP and then click enter. And that should show you a list of all the MCPs that you have in your system and tell you if they're connected or they're not. I can come down this list and see that my TradingView is in fact connected. If it's not connected, you just have to kind of come down, click enter, and then you can reconnect or disable or even view the tools that it can use. It can use 81 of the different features on TradingView using this uh MCP. So, I don't need to see any of that. So, I'm going to exit that and exit it. But, you very well may have to connect your MCP in that way. Just follow the instructions that it gives you. Right now, it says for me that it is in fact installed.
So, let's show you some of that magic. Okay, so we now have Bitcoin on the chart on TradingView, but we're going to change that to another one. Maybe we'll change that to Tesla. And we're also going to define the time frame that we want to see the chart on. So we might say we want to see the one week Tesla chart. So that's exactly what I'll type. But instead of typing, I use a transcription tool, which you absolutely should use. I use Whisper Flow. It's just the best. I just hold down one button. It's kind of like push a button to talk. So you'll see me do that from time to time as well. So, can you show me the Tesla chart on the 1H hour time frame? So, I've just transcribed it. I talked to my AI more than I typed to it. Absolutely. I've said about 700,000 words to my AI over the last like 3 months, which is madness. So, I'll click enter there. And we should see on the right hand side, it may take its time a little bit, but we should see the Bitcoin chart change to Tesla. You can see on the left here, it's saying that TradingView is being called. You can see it just changed to Tesla on the screen right here. And it's on the daily chart. I think we asked for it to go to the hour time frame. And there it is. It changed to the 1 hour time frame.
Now, you don't have to limit yourself there. You can also tell it even more stuff like this. Could you show me the 52 EMA, the 12 EMA, and the 100 EMA on this chart, please? So, I've just listed off a whole load of indicators. is I even made those indicators up. Like I know you can you can fine-tune the settings to make all of that happen, but in this situation, you just don't need to do it. You can just tell it the indicators you want on the chart and it will do it. Additionally, if you already have a strategy that you wanted to install, you could just give the strategy to Claude code here and it will create a pine script and show that strategy as an indicator on the chart. In fact, we may just do that now just as an example. So, as it's doing the EMAs on the chart right now, you'll see that appear as we as we keep going. Hey, could you create a very basic trading strategy and put that throw that up as a pine script and throw it onto the chart so we can see it, please? Um, so it's going to make it a very basic strategy here as I've asked it. I've clicked enter. You can see now that the EMAs are actually already appearing on the screen. I told you that this would look like magic. So, you can see that the one of the EMAs is that color. I don't know which one that is. Yeah, that's the We can go to settings and see which one that is. But the EMAs are being placed on there. Oh, you can see it just popped up. What is it? It doesn't say, you know, and actually that's a good point because these EMAs have been have been put on there, but they haven't confirmed which EMAs they are in the name. So, I might want that as a feature. So, I can say, hey, you put all of those EMAs on the screen, but I can't differentiate which EMA is which. So more than just color, can you change the title to reflect which EMA it is? And really like the main thing is I want to unlock this for you this freedom of being able to talk to AI in this way. It's not so rigid. It's not like you don't have to worry about it too much. Just speak what's in your head. The AI will do the work of uh piecing that together. And I'll just click enter on that now that that's done. And the EMAs are all on the screen apparently. So let me just zoom out because we may see the other EMAs on the chart from a different angle. Oh no, they they are in there. I can actually see I can actually see them. Okay. So you know you can install these indicators into TradingView. You can also install a strategy into TradingView which is doing right now. If you go onto the pine script button, there is a moment where the pine script just appears in the editor which is kind of crazy to look at and then it'll just place it onto the chart for us as well. If there's any issues with the pine script, it will actually make the changes to the P. There you can see the Pine Script just came up. It's going to now put that as an indicator on the chart. And even if you're on the free TradingView plan, there's a way that you can do this that is super smart. And this would be a little nugget of information is that if you have loads of indicators that you want to see on the screen, but your free account limits how many indicators you can have on the screen, all you have to do is make one indicator that is made up of all the other indicators that you want. So really, you're only taking up one space and it's kind of a cool way to get it done. So we'll wait now for that pine script to actually be displayed on the chart.
So as you can see, the EMAs changed their title as I wanted it to. So now I can see which color EMA relates to the number associated with it and then also it installed a brand new strategy for me using pine script and through that strategy in as a indicator as well. So now we can see that it's given us buy signals and actually this strategy wasn't that bad. If you look it had a big buy signal right there and it continued to go up. If you look back through history it had a close along on this on this point here. Maybe there's a false signal there. Oh, it caught this before the big crash. Pretty good. I mean, it just made that it made that strategy just out of nowhere. But the point is that strategy was built and it was put into your TradingView using this TradingView MCP. Really, really cool stuff. So, that should be installed on your system already. If it's not, then make sure you're coming down and you're taking the prompts, the copy and paste prompts from the workbook page. You can just copy and paste them and install these different things. You can see also there's a trading suite in here the check to see if your machine actually can handle all of this. You can just paste in these all of these and in many ways you can just do that now and get all of the stuff installed into the computer but I think also it's probably good to know what's going on as well.
Okay. So in section three I I want to talk about back testing because back testing is something that everyone does on a strategy that they get. Back testing is the process of taking a strategy and applying that strategy to previous price movement uh as a way to determine how it might do in the future. But in fact, back testing that way is the worst possible thing you can do. There's many reasons why. I've spent hundreds and maybe thousands of hours analyzing these quant hedge funds and determining what skills they use for back testing. How do they do back testing? how do they avoid the pitfalls of back testing? And uh I I basically came across a whole load of skills, built a lot of these skills as well, and I've bundled them all together so you can take them and you can find them right in here. So there's a whole load of them here about overfitting, walking forward. These are all types of back tests that you would have to do on your own strategy. So I urge you to do those when it's the right time.
Talking about back testing, I want to talk about the one reason why back testing is just just terrible, especially if you do it the way that most people do it. If you imagine, we've got a whole history of price movement and we are we have our strategy and we want to apply our strategy to all that price history. Well, if we look back at 2012, the price movement in 2012, the strategy that we've created and the results of the back test don't come from what happened in 2020 2012 backwards. It comes from the entire history of that uh chart that we're looking at. It's applying a a knowledge of everything to a time when you didn't have everything as knowledge. It's a really bad way to reflect what the what the strategy is actually doing. And so you have to do something or have to have some sort of process to mitigate against that issue. So the mitigation that we use is something called look ahead bias. Which means that when we're doing a back test, we need to make sure that if we want to go back to 20202 to see how the strategy performed at that moment, we cannot allow the information from any time after 2020 to impact the strategy at that time. So the strategy could only have been at that time what it could have been rather than what it is now. So it's a it's kind of very complex. It's taken me actually a while to get my head around that. But the point is you don't necessarily need to know the details of that cuz you're going to get a skill that you can just copy and paste into your own system to make sure that all the back tests are just done properly.
At this point, I'm assuming you've maybe got a strategy already or maybe you don't have one. Creating a strategy is as simple as I made it look. You know, you could just say, "Build me a strategy." It won't perform very well because it's just pulling data from what everyone else has done. That's what AI does, right? AI doesn't invent anything. It's just accumulating all the information that's already exists and synthesizing it. It's up to you ultimately to make a strategy that is unique. Because I think the only way you can have a strategy that really works is if it is unique or if you're pulling data from somewhere and combining that with other data that no one else has combined. That's really your only fighting chance at making a strategy that really works. But of course, we need to set up the system to work for it in the first place. Otherwise, the s the strategyy's got no chance.
So, there's a whole load of elements of back testing and research and validation that we can get into. We can talk about how slippage and fees eat up at what people believe is profit. Let's say you have $10 and you make $2 as the in your trade. You might think, "Oh, I just got 20% yield on that." Well, if you take away the slippage of that trade, if you take away the fees on that trade, you actually end up somewhere probably close to break even. So, you cannot convince yourself that you're profitable if you actually aren't. This drives people into a really bad situation when they get multiple days, multiple weeks down the line and they think they're profitable and they actually look at their their their portfolio and it hasn't really moved. And it's because they haven't accounted for other factors at play that take away profit from the top. And sometimes if you're playing with small margins, then those small margins are all gone from the fees that you should have um been paying attention to. And so the system needs to understand that. The system needs to understand what the likely what the slippage was on that trade or what is likely the slippage to be on that trade, what the costs are likely to be. Because if your rule isn't to do you you won't do a trade if you're not going to make more than x amount percent on that trade, then the system will stop that from happening. If the system wasn't there and you just went for it, your profit likely would just be eaten up by costs and and slippage. And slippage, if you don't know, is the change in the price or the volatility in the price as the trade is occurring. So you might be trying to make a trade but the trade the the price of the asset moves slightly and you can have tolerances on that slippage. You might say I only want a 3% change and if it's 4% change then don't do it right. And so you can set those rules in the system so that the slippage and the and the fees don't actually you know take away the profit that you thought you had because it's just built in from the beginning. So you've got slippage, you've got things like survivorship bias. We don't I don't even think we need to go entirely into all of this because I've I've spent all the time doing it and creating these skills for you. If you want to audit your strategy, you can copy and paste the audit your strategy prompt in uh right in here. If you want to do a back test on it, you can copy and paste it here as well. Everything is seriously in here. I'm trying to balance the the difference between kind of doing all of this and explaining it. I think oftentimes the explanation might be useful and you can go and apply it with the tools I've provided.
Another thing that's really useful to do is actually to I think we might do this on screen where we link up some data. You know how we talked about APIs earlier on on the Miro. Sometimes this data is behind an API key. Sometimes it's not. Sometimes the information is just readily available. But I've created an an example for you to go through. So it's come back and it said we have to just get an API key. So, all you do is kind of come over to that link, open up that link, and it'll just ask us a few questions so we can get our free API key. So,
We can say, "Yep, sure. I'm an investor." We can say, "I'm from a school, and my email is just make up an email and get free API key." So, that API key is now uh displayed to us. We can see that right here. And you can copy and paste that API key back into your claude. There it is. You have your API key set up.
There's a story of a guy called Archie Carass. And this guy was driving along to Las Vegas with $50 in his pocket. This $50 was in fact his final $50 that he had. He was driving to the casinos to meet a friend in a in a parking lot. He gets to the parking lot and he sees this friend and he somehow manages with a signature on a handkerchief to borrow $10,000 from this friend. He takes that $10,000 and he sits right down at the tables in the casino. Over the course of the next two years, he turns his $50 into $40 million. This is known as the wildest winning streak ever seen in gambling. And he did it starting from $50. The thing is that the casino did not panic. The casino saw this win streak and congratulated him. At one time he held every single $5,000 coin that the casino had. He had it all on the table in front of him. He even had some of the world's best gamblers come in and compete with him and he beat them all. It's just this incredible win streak. And it was exactly for this reason why the casino weren't worried at all. Why? Because the house always wins. They know that when people fly high on a strategy that has no limitations, no risk tolerance, just, you know, going for it, pedal to the metal, they know that that money will return back to them. The house will always win in that instance. So, they congratulated him. Two years later, every single dollar came back to the casino.
The casino in this story is the system and the strategy was Archie just going for it. The only reason why Archie didn't maintain all of his money is because he had no rules set in his strategy. I know that if there were risk tolerances involved there, if there was rules that he had set in place to stop him over gambling, that the casino would have viewed that very differently. They would have seen that in a different way. They probably would have stopped him gambling or tried to get him to buy back into more things at the casino more aggressively. Within this whole thing, you need to almost become the system itself so that you win. So that your strategy, regardless of how pedal to the metal it is, that the system always wins. The system is set up in such a way where you're treating risk as an authority in the process rather than just going for it as the authority. Like if your emotions are the authority, that's going to go wrong. That's what Archie Carass did. But if you allow risk to be the authority in the decision-making, you're in a way better position and the system will win. And if the system in this case wins, you win.
Now, there's a whole load of elements that go into the risk engine that we're building here. Like, one of them, for example, is a draw down limit. You might not think of a draw down limit. A draw down limit is, you know, if the price goes down a certain amount or my portfolio goes down a certain amount, I need to cut my losses. Like, I don't want this to go down anymore. And so, you have a draw down limit before you exit all your trades or you or you reduce your size of your trade. So there's also things like when you're when you're investing as a just an individual with no help or no system. Oftentimes you'll make your decisions based on the confidence you have. And it's weird because most people can't define confidence. If I ask you now, what is confidence? You need some time to think about how to define that. Like you can't even probably say a sentence about how to define confidence. You need real time to think about it. The great thing about agents is that once you've kind of got this word that you're trying to define, you can characterize elements or traits of confidence and it will put together a definition for you. You can use that type of thing in this AI system as well for investing. You can give it ideas of what you imagine a good trade or a good environment to be before it makes a trade and it can create the rules for you. This is the great thing about conversing with the AI. Uh, you don't have to have all the answers yourself. You can kind of talk around the subject and it can do it for you. So this system when you copy and paste it and we go through the demo, it will also go through a whole kind of confidence scale. It will also figure out how much we should invest based on these definitions that we've created. So it means we're never overextending ourselves. We also will have limits on how much money we'll put in on any given trade. All of these limits are the authority in the system and it allows whenever your trades do go through and they do go through the system, you know they're good trades because they've met all the criteria. And all of that allows you to turn from a gambler into the house. Building a system that is completely foolproof. Doesn't matter what happens in the news, the system's going to catch everything that shouldn't be there and and trades that should be there.
Also, within the process, we're going to learn how to use pretend money. This is called paper trading. The reason why we do this is is multifaceted. And one very logical way of explaining it is that if you aren't doing paper trading, eventually you're going to end up with an outlier situation where your rules don't apply or it mispasses your rules and it'll end up losing you a whole bunch of money. This has happened to me even very recently. Sometimes there are outlandish things that can happen, things that you just never expect that you've not built a rule for and something can happen. So, if you take it to live trading too fast, you miss out on the opportunity to have these weird things happen and then for you to build the rules so that they don't happen again. So, we're going to make sure we set this up with paper trading. We're actually going to probably try and get some paper trades actually executed so you can see the whole system working. We'll also have a system that allows you to enable the idea that you can have the ability to confirm a trade. So let's say you've got a trade intent that comes from the strategy. It goes through the system and the system goes, "Yeah, I think this is a pretty good trade to do." It will then ask you for confirmation. And this can all be done at, you know, in the testing phase, it can also be done in the real life version. But certainly, if you want to make trades overnight, make money while you sleep type of thing, you're going to turn that confirmation thing off, but only after you have the confidence that it's actually going to execute good trades over a period of time.
And something that's completely bypassed by a lot of people is reflection. I see this a lot. This is why you also see people in real life making the same mistakes over and over again. It's like why do you do that? Well, it's because there's no reflection process. Because if you do make a mistake in life and you reflect on it, you will change your behavior because the reflection brings out the change in behavior. But if you never do the reflection, you never improve because you keep making the same mistakes. So, it's the same thing with our AI trading system or investing system. We need to make sure that whenever we've made a good decision, we need to know why we've made a good decision. What was the environment? What were the conditions? What were the data points that allowed for this good decision to take place and store that information away in the background to provide this data stream over time where we're essentially installing machine learning into our computer. So after a certain amount of time with enough data points, the AI will build a confidence score in different data points aligning. So if these different data points align, the AI will have let's say an 80% confidence score that this is a bullish signal. And with that confidence score, it can adapt the strategy that originally had to look for more of those trades. And so what ends up happening ultimately is that you end up making better trades more often and better trades over time because it's learning from previous good trades. The same happens on the reverse of that as well. It will also learn why bearish signals took place. You might want to do shorts on the market and and you know bet on the price going down and make money that way. Or you might want to see the price going down and learn the conditions that create the price going down so you can close your long trade. So there's loads of reasons why you would want to know this and the machine learning system in the background which will be installed for you copy and using that copy and paste prompt. There's so much stuff in this prompt by the way like it's really really cool. So we're going to create a system that learns from itself. It monitors and reviews all the trades that take place and ultimately improves over time. Essentially a self-improving investing agent.
With all of the explanation out the way, it's now time to install this agent or this series of agents and systems into your computer. We're going to do it with a copy and paste prompt. It's going to install all of the MCPs. It's going to link up all the APIs. Maybe there's a few things we need to do in between there, but we'll go through all of that in the demo. By the end of this, you will have a full strategy that is actually implemented, hopefully just paper trading for now that can actually execute these paper trades. And in the future whenever you want to turn it on to do real life trading, you can absolutely do that. Everything we've explained in this video so far about self-learning, back testing, everything is all included in this oneshot prompt. So, we're going to come over to the website. The link is in the description. It'll take you to this page. Just enter in your email information and it'll unlock everything. It's absolutely free. Uh, so, come down. We'll keep scrolling down. You'll see the copy and paste prompts section here. So, the first thing we want to do is download the trading suite zip file. We're going to click that. It's going to download in our system. We're going to double click it and it's going to open up into our downloads. This trading suite file is all we need for now. We're going to come back to the oneshot prompt. We're going to copy it. Come over to our Claude. I do that in in here. So, I'm just going to open up my terminal. And once you've got Claude code running, you can also do this in the Claude app as well, but I I like to do it here. You're going to paste in the oneshot prompt and click enter. It's going to take us through the whole process from the first step all the way to the end where you have this whole system set up and working and it's going to do all of that for us. It's going to give a a little commentary as we go along. It says it's going to run this exactly as it's laid out, one step at a time and doing all the work on the machine. Okay, so it says stage one is done. It's actually installed all 19 skills that we have in here that is part of the system. This is all the back testing things. All the elements that make this equitable to a hedge fund kind of trading desk that we're building ourselves. All of the skills have been installed. So now it's ready to start to install the MCPS, which is obviously a fundamental element of this for Trading View and some of the other MCPS we're going to use. All it requires of us at this stage is to say go. It says at the end, say go and I'll begin. I like this to be very low lift for people. Read all the instructions it's giving. Typically what it's asking of you is quite simple. In this instance it was go and it's just going to start installing all the MCPS. The MCPs come with their own full kind of code bases as well. That would be a pain for you to go out and find those code bases for yourself. The agent goes out to those locations where the code bases are and installs them, downloads them for you. Okay, so the MCPs have now been installed. Very nice and easy. We've got Trading View that's been installed and Alpha Vantage. Alpha Vantage is just for pulling loads of data from the market and economic data in. It's not important right now. But now we're moving on to stage three where it's asking us to put the strategy that we have into the system. This is the point where if you have a strategy, you're just going to copy and paste it in. If you want to build a strategy in this system, you can also do that. I'm going to kind of do a mix of the two because it's also suggested a strategy where it wants to buy SPY on the daily chart when the 50-day crosses the 200 day and sell when it crosses back over that. They can be as simple as that. I'm just going to use the example that they gave me. You can install yours if you want to. Can you install the strategy that you suggested about the SPY and the 50-day and the 200 day? For the sake of this video, I'm just going to do what it suggests. So, I want to show you here how it looks when a strategy or a trade intent is actually submitted. See the language that's used because this is going to be a little hack for you that you didn't realize you could do. What's really good is that we're working right now in the backtesting/golden cross/trade intent file. We can actually click that MD file and see it here, right? We can see what it the AI has actually written about what our trade intent is. So the strategy that it created was actually ended up being a golden cross or death cross strategy. Very simple. And right now it's a draft because it's not actually live and it wants to validate things before anything runs and it wants to do it on paper only. So we can see how its thought processes are actually being implemented here. You know, if we wanted to change this not from from paper into real trading, we could actually just take these away, right? We take those away and it would just start trading on its own. We can also tell the AI to do it, but I think it's useful skill for us to be able to see it in this format. So, we can see that this strategy is for the spy. The data source that we're getting the information from is the Alpha Vantage daily. The time frame is the daily time frame. The indicators are the 50 and the 200 SMA. I'm just saying all of this because we know this because this is the strategy we've created. But you can also go in here and add things yourself. You actually have an ability to impact these files by typing them rather than relying on the AI because sometimes the AI will actually make stuff up. And especially when you've got a strategy that's really important, you want to have the ability to scroll through it with your eyes to make sure everything's right. So, it's put in the indicators that would be used on the chart. It's told us where we would enter to go long, like what conditions we're looking at, what conditions would we would exit. It's telling us the direction right now, where our stop loss is because there's none in this classic version. We can we can also tell it to install a really reasonable stop-loss system. In fact, I might do that live on camera here. I noticed that we don't have a stop-loss rule. Can you do some research on like a reasonable stop-loss that we can implement in here? here and then change the MD file with that information. So, what we should be able to see is as this works, we should be able to see this section right here none in the stop-loss section. We should see that change in real time. And when it does, it just shows you when you're interacting with the AI, this is actually what's happening. Really, what you're telling is a a system that can do code in your computer. All it's doing is just changing a file in your computer. There's not anything more magical happening. So, it's suggested here a stop for a slow uh 5200 daily system. Oh, it's kind of gone away. It's now just searching the web to figure out what a good stop-loss system is. And it will change it in real time and then we'll pick back up when that's done. Look, it's just added it into a file. That's really all it's doing. So, that was just to make my point that we're really just editing files and it's not it's not that complex. So, it said done. The stop-loss rule is now in the spec and it's all all been updated. Um, one thing I built into the plan that I want you to know about in stage four, I'm going to back test it both ways, which is pure, so no stop-loss, and one with the stop loss. So, it's actively thinking about how it can use the stop-loss rule in the back testing that we're going to do. So, thank you very much AI for doing that. Stage three is now fully locked and this strategy is now a precise stopped validated ready intent.
So for stage four, we're going to prove or kill this edge that we believe we might have for this strategy. So it's going to do some sort of back test and it's asking me to say go to run it. So very simply, we're going to click go. It's going to now use all the back testing skills that we've created in the system that you now have on your computer, and it's going to run it through not just the original version of the strategy, but also the version of the strategy with the stop-loss to see which one was actually higher performing. And this is again a notice to you if you have various tests you would like to to do, like maybe if it's not the 40 EMA, maybe let's try the 39 EMA to see if there's any improvement. And if there is an improvement, let's figure out why and how we can uh apply that into future strategies. So this is actually showing you when it's running the back test here. You can see how many back testing skills that we have installed. There's numpty, pandas, map pilot, lib, y finance, skippy. All of these different back test skills are a part of the back test kind of process and they're all running on this as well. There's so many elements of this that just go completely under the radar that took so much time to to vet and build. Like the easy part is putting this into a oneshot prompt. And it's even easier if you're just the recipient of the oneshot prompt. It's now gone to Alpha Vantage and it's pulling all of the spy history from it and then back testing using those. Now, previously you would have to come into your trading view, produce some sort of strategy, and then click the back test button. And what the back test button does is back tests again, like I said, all of the history. And you can't do that and expect uh decent results. It's the complete wrong way to do it. And in fact, it completely surprises me that Trading View would even allow such a terrible back testing tool. Yet, it's the most used back testing tool that investors use. We've just got the response back now, and it says that the back test is actually done. There are multiple layers to a back test. We talked about those at the beginning of the video where there's, you know, stress tests that we can apply to the strategy to make sure, you know, is this actually something that is uh an a real edge or is there something else that could have eaten it away? We're talking about slippage and costs that I want to apply all of that. So, it's asking me if it wants me to go into step two. So I'm going to just say A and it's going to find out if this strategy actually has a real edge or whether the initial back test has kind of lied about the outcome. It all is going to be revealed here. Okay, so it tested it did my six-stage kind of testing process. The second step was the walk forward which it actually passed but there is an asterisk associated with that which we could kind of read about. It also did Monte Carlo simulations. This is Monte Carlo simulations are so cool if you see them visualized. Essentially, you start at a certain point and after every trade, it will also imagine a whole series of other trades from that moment. So, you end up with this branching kind of chart that looks at the absolute maximum you could have made with this strategy over this time and the most amount you could have lost over that period of time. It's fascinating to see, but with the Monte Carlo thing, it kind of didn't perform so well. It also did a parameter sensitivity. It passed with flying colors. It did the slippage thing which it also passed. And the draw down actually failed and said it's ugly. The maximum draw down we saw with this strategy was minus 34%. Meaning if we applied this strategy right now, there was in the back test kind of range a 34% decrease in the price that the agent wouldn't have stopped from happening. This is uh something that happened to me even recently. I lost a whole massive portion of my portfolio because my draw down. I didn't expect this thing to happen. A draw down occurred. My rules didn't execute and it put me in a whole bad situation. That 34% draw down actually was the COVID crash uh in this in this back test. It also has told me that the longest amount of time that it spent in a losing position was 3.4 years, which is not great because you have to kind of put that in perspective. If I imagined this strategy in place right now, would I be happy to wait for 3 plus years for that strategy to become profitable again? Maybe that's not what you want. I certainly don't want that. So, it's kind of given me a a table here of the outcomes of all the different uh elements of this test. And it said this is a robust but very weak and under-tested strategy. The good news though is that it's genuinely not overfit. So overfit is a whole concept. It's already pre-installed in the skills. We're not going to necessarily go into it. We also have a sub one sharp score and a 34% draw down. It did only 15 trades in 33 years. So, this this strategy is not one that I would want to be involved with. Likely you wouldn't either. But what this should be doing right now on your system is showing you your strategy and whether it was actually good or not. So, this is the big moment for you. Is your strategy actually decent or is it a complete failure? If it's a complete failure, get to work again. You're going to need to think of novel ways to do this. When I think about trading strategies, I think you're basically playing a losing game if you allow the AI to think of the strategy for you or you use strategies that other people are using. In my experience of the last 10, 11 years of of doing investing like this, I have realized that the only way to make a real edge with a strategy is to build the edge yourself. Something novel about the way you view the world. So data points that two people have never connected before that you have an idea about. It might be ridiculous. It might be nonsensical. It might completely fail. But it is your only shot at competing with everyone else on the planet that's trading. There must be hundreds of millions of people trying to trade and compete with you. And to think that you have the ability to just talk to AI and create something different than everyone else doing the same thing is a it's not it's not a realistic outlook. You have to find something completely unique. Do this like this a really interesting thing. Maybe I'll install it into the oneshot prompt by the time you're viewing this. Essentially like a randomizer, a data randomizer. So you can have almost like a slot machine on you know three three channels on the slot machine. You pull it and the amount of combinations of of data points you can come to is is completely random. No one's ever going to be able to replicate the the combination that you rep that you do there. It might be cool to have a nice slot machine tool that you can use and and basically produce a series of data points that no one else has ever thought of. Maybe that's the ticket and just spin that enough and maybe you'll come to something.
On step four, it set up a test for us, which is the luck versus edge test to know whether our strategy was lucky in its outcome, which considering it's a bad strategy, it probably wasn't lucky, or whether we actually have an edge over the rest of the market in this strategy. Did we create something novel enough to be different? And so, its recommendation is that we run through this very specific test that's been pre-installed into the system. And we're going to run that now by just typing go. And we're going to see if the strategy actually did something meaningful or whether it was just luck. So, it should give some really good insights here for your for your strategy if you really want to get into it and and read it and understand the the intricacies of all the percentages and everything of the results. For the purpose of this video, I'm going to carry on. So, it says, where does this leave us combining steps two and four? The golden cross is a genuine but modest edge, real robust but weak, mostly a draw down reducing overlay on spy. Not a strong standalone alpha strategy, which is interesting because this means that this could act as a good strategy as part of a bigger strategy, almost like a sub strategy, but a strategy on its own, it's not going to get the job done.
Now, step five is going to do what's called a regime check. So, if you go out your front door in the morning and you want to know what the weather's like, you might go out and just get a feeling of what the weather's like. And so, you might think, okay, it's quite humid today or it's quite windy today. A hedge fund won't do that. Using the same analogy, a hedge fund would go out and they would measure the humidity and they would measure the wind and they'd measure the temperature. They'd actually get these numbers, numerical values for this feeling. So where a retail trader would get a feeling and decide, oh, I feel quite good today. I'm going to buy or I feel scared. I'm going to sell. The hedge funds don't operate like that. They operate way more mathematically and they want real values to determine what the actual environment is like. So, a regime is basically the outcome of that assessment of the weather. They might say it's 10% humidity, 28° outside. We would classify that as a warm day, for example. I'm oversimplifying it, but they give a state like a market state, a regime for that day. So, it can either be bullish, bearish, or sideways. And it will do that for every day in all the history of the price movement of that asset. Even more so, it will look at the transitions between states. So, yesterday might have been a sideways day and today might have been a bullish day. A price the prices have gone up today. It'll analyze all that data and tally down every time it went from a sideways state to a bullish state. It will tally that down in a table. Every time it goes from bullish state and continues into a bullish state, it will mark that down. Bullish to bearish, sideways to bearish, bearish to sideways, bearish to bullish. It will do all of those combinations and mark them down on a tally. With that tally, you can then deduce when you're on a specific regime. Let's say today is a bullish day. There is a percentage likelihood that tomorrow will be a bullish day as well. And what you find is you you'll know the phrase the trend is your friend. That comes directly from what's called a stickiness score. So with that calculation, you can determine how likely is it tomorrow that it's going to be a bull state or a bare state. And it's with that differential that that confidence and that percentage you can decide where you place your bets for the following day. This is how the hedge funds work. So if they're not saying tomorrow's going to be bullish, they're saying tomorrow's going to be 68% chance of being bullish. So we'll allocate a very specific formulaic amount of money towards the bullish trade tomorrow. They'll also cover their bets on the bearish trade and the and the sideways trade as well. So basically, I'm going to now ask it to do the regime test. Uh, it's asking me what I want to do. Yeah, I just have to say go and proceed to step five.
All right, so the results have come back from the regime test and it says there is an edge there somewhere, but it's not very strong. So we're going to need to add kind of more agent, more more strategies to this system to make it useful. But it did say that it is a risk management strategy which I found quite interesting. And that is because the regime kind of suggested that this would actually be a really good signal for the eventual strategy to look at when to exit a trade. So it's deduced that from all of the stuff that it's gone through, all the skills that it's used. And it's recommended for me that we do uh one thing. It's it's suggested that we strengthen the strategy first. The improvement path isn't parameter tuning. The PBO says that's a dead end. It's either alpha combine, which is a skill that we've already got in here, or a regime gated faster exit, meaning we're using the regime signal to stop basically that minus 34% draw down that uh was suggested happened in COVID. That would never happen with this strategy. So that's actually really good if we can improve it. So it said, which way do you want to go, A, B, or C? So, I'm going to choose B as it recommended. Eventually, we're going to go through this process and have a strategy that is at least going to work for our paper trading. But it's also very possible that your strategy might perform terribly and you might need to do a lot of work on it to make it better. It's very possible that you've got to go away and think about this to a higher degree and think of something novel. You might actually have to go away and do that. So, I hope that your strategy is good when it comes out of this because if you have a good strategy here, hold on tight and don't tell anyone because a good strategy is very, very hard to come by. You've got hedge funds with multi-million dollar computers crunching more data than you knew even existed and you're on your laptop trying to compete. Like, we're not playing the same game as them. So, if you do get something that does have some sort of an edge, you know, you're in a really, really unique position. But chances are you might need to build a few different strategies and have those plug in as kind of substrategies towards a larger one. We are going to try and do that in this session as well. So this has just suggested to me that the best way to use the strategy that I've already created is to stay in a long trade while the slow 20 to 200 EMA is trending up, but then step aside when the fast regime flips to a bare market and then step in again when it leaves the bare market. So, this strategy has actually ended up being quite good for getting out of trades early, not seeing a massive draw down. So, we're making those improvements now. Our score should improve. And we've got the next step here. So, stage five uh with its second attempt. There's a whole load of data here. I want you to read this for your own one, but for the purposes of this video, it suggested for us that we accept the strategy the way it is now and move on to risk management. And I would agree. So, what does it want me to do? So, I would agree with that and I'm just going to tell it to move on.
So, now we're going to move into the part of the process where we're managing our risk. This is basically determining how much of your portfolio you would want in any one trade at any given time. How much would you be willing to to lose in a trade? How long would you be willing to wait in that situation in a in a losing situation? The part of the risk management skill that we've got installed in here is in fact it's actually quite a few skills including a capital allocator as well. There's just a huge amount of stuff that goes into this. It's now asking us for our account size. So, I'm just going to, for the purposes of this video, I'm going to say it's $100,000. And it's going to use that skill to appropriately tell me how much should be in a trade at any given time. You can, of course, change this yourself, but that's your responsibility to do so. This is going to go on what is best practice for for people who are investing. And typically, the general rule is don't invest more than you can afford to lose. It's definitely going to take that mentality into this. So, it it says once it knows my portfolio value, it's going to pull my strategies, real wins and losses stats from the back test. It's going to walk me through the full half and quarter Kelly, which is a whole skill that I installed here as well. It's going to set our risk per trade, our max exposure, our correlation cap, and a max draw down circuit breaker, and then prove the engine works by having it block a deliberately oversized trade in a test. So, in summary, it's going to have all of that installed, and then it's going to use a paper trade to deliberately try to trade more than it's supposed to than the system will allow. And we're going to watch the system stop it from happening. It's going to actually see the system saving us in real time. So, it's just done a full Kelly assessment, a full a half, and a quarter Kelly, and it has decided that my win rate is 80%. That's crazy. An average win is plus 29% and my average loss is minus 4.5 which gives us a win loss ratio of 6.4 which is insane. We've plugged that into Kelly and it's also suggested here that the Kelly is a trap and it wants to push me towards a quarter not even half. So let's just you know all this information if you're in trading like it it kind of makes sense. There may be some things that you kind of want to understand more. I urge you if you do want to understand more come down into the the page associated with this. You can see that with the validation or risk you can click that and and at a certain point size a position with Kelly right you can copy and paste that and it will explain Kelly to you. It's a lot to explain every definition for everything but just know that these are tests that the hedge funds do and the quant analysts do ahead of making their own trades and all of those skills have been installed into this system. It's kind of insane actually. So, it said because it's a brand new strategy with zero live trades, the allocator ramp rule also applies. We're going to start with 20% of the maximum, which is 5K. If we have a 100K portfolio, we're going to scale up only as the live paper trades prove positive and we're going to build that in. So, that risk level is genuinely your call. I'm defaulting to quarter Kelly. I'm happy to have quarter Kelly. Essentially saying that a quarter of my portfolio can be in a trade at any one time. I'm going to say quarter is fine. And so obviously half Kelly would be, you know, half my portfolio in a trade. That might be too much risk for you. So we've gone for a quarter. The results on a quarter seem to be uh, you know, the best outcome for us. So that's what we're going to do. It's now wiring up our risk manager skill to make sure that all of this is in the right file. You can see here it in the claude skills risk manager skill is now writing this information in to basically create the makeup of what our risk manager skill is to us in our strategy. It's kind of amazing how this all works, isn't it? And if you're enjoying this video, I'd really like to know if you are and if you could leave that in the comments, please do. So, what it's doing right now is actually putting three trades through the system that exceed the quarter Kelly that we've uh set up. One that should go through, one that's oversized, and one that is happening during a draw down breach. So, it's planning different eventualities and seeing how the system responds to trade intent in those different eventualities. As we can see right here, scenario A is a clean trade. This is even kind of like a $5,000 request. It got trimmed down to $4,800, the exact quarter Kelly ramp size for a strategy with zero live trades. So, it's also counting how many trades we've actually done live and using that to inform do we go to the full quarter Kelly like all 25,000 or do we keep that keep that lower and just do 5,000. And in fact, because we didn't have any live trades, it reduced that even more down to 4,800. It's a risk manager. If you worked at a trading desk or you work with a hedge fund, they have risk managers. You've installed one yourself here. So, stage six is complete. The risk engine is now the authority of the system and that correlation check just showed the trap in action. You asked it to add 15k on top of the 20k of the spy and it failed. It basically worked perfectly. It all those tests work perfectly.
So next we have stage seven which is the news blackout. So we're going to configure a new skill which is called the news guard. And the news guard means we are not going to it's not going to allow us to trade in high impact events. So if you have an FOMC meeting or something wrong happens like an outbreak of something or whatever, it will it will then say we're not trading in this news environment. It's like too risky. And obviously you can set these parameters. You can say yes, I actually do want to do this. But but the news guard skill will actually limit that. So we're going to move on. We're just going to say go because it's asked us to say go. So the news blackout thing is now live and it actually ran a test. So it looked for a well it made a pretend FOMC meeting which is typically a meeting that takes place and the price is always volatile around it. Anything that's said in that meeting can have massive impacts on the market. So people might anticipate a word or hear a word and the prices go up or prices go down. It's a very volatile moment and sometimes you can hit a lot of these draw down limits that you don't want to hit. Sometimes you want to stay in a trade even when there is kind of this up and down or maybe you don't want to enter a trade because it can turn down very quickly. What it has done is it suggested that there's an FOMC meeting at 6:00 p.m. It's tried to do a trade at 300 p.m. and it allowed it. That was successfully. It went through. Then a trade tried to go through at uh 5:45 p.m. and it didn't allow it because it was too close to the FOMC meeting. This means that we don't participate in the ups and downs of the craziness of the news and different events that take place in the financial world and we have kind of removed ourselves out of that. Now you can change the limits to this. It has suggested that we only use high impact USD events inside a 30-minute window beforehand. We don't trade and a 15-minute window afterwards. We don't trade. You can actually change those specifically in the MD file associated with it. All you'd have to do is ask it to open up the MD file associated with these events and the rules around them. Then you can go in there and change it.
So the last stop is stage eight, which is actually paper mode. Uh, and actually to see some trades actually really happen. Now, live trading is off. We're on paper trading, but I'm going to say go and see where this takes us. Okay, so the onboarding is complete now and actually at least in the computer making trades. Now, what I want you to do now is as kind of like an extra task is I want to go over to a tool called Alpaca. Alpaca allows you to do paper trading. You can see the chart. You can see all your trades and you can allow it to accumulate over time. And it just it's a nicer place to look at it rather than just looking at this page. So all we need to do to set up an Alpaca account is come over to API on the left hand side. As I said earlier when I explained APIs, we want to go into Alpaca and actually make a trade. That's kind of what we can do with an API as well. Go in and make a trade and have that data come back to us and we can see it nicely on the chart. So we're going to come on to Alpaca. You can come on to app.alpaca.markets. Come onto your dashboard. Very easy. If you go down to the right hand side, you'll see API keys with endpoint and key. All you're going to do is click regenerate or just generate a new key. Those are going to generate. You can select all of this, copy it, come over to your Claude and say, hey, I have the Alpaca details and then paste it in. And then once you've done that, it will then connect your strategy to Alpaca. And when it makes trades, you'll see them visibly on your paper trading account here. What's really cool about Alpaca is that you can actually turn paper trading off on Alpaca and actually trade in real markets using this platform. The platform's so good because it connects via API really well and really reliably. So, there are different plans for it and everything. You're not going to need that necessarily for the paper trading, but you can convert from paper trading into real trading very easily. All of that should actually be installed into your oneshot prompt by the time that you use it. So just for the sake of this video, I've asked it to paper trade on Alpaca and I want you to see that paper trade actually happen on Alpaca as well. I think it's good for you to see that in the knowledge that you can turn Alpaca into real trading. So this system that we've built today in this course isn't just like a a make-believe system. This is an actual system that will actually trade real money if you wanted to. It said it's already done the trade. Okay. So, I'll go over there. There it is. Recent orders. The spy. We bought six of spy. It was filled using the API key that we gave it submitted at this time. You can see when we're recording this and it was filled at that time. We have all the data about it. In fact, we can even expand that information to see all the data about that trade. Now, all this information, it might be very useful to you, but it's way more useful for the for Claude because Claude's looking at all of this and thinking, "Okay, I've got the order ID. I can see what we bought, you know, all the information about that trade." And we can, you can see that it actually makes trades in real life. So, that's where we're going to leave it. We've built a whole system today. We've taught you how to build the infrastructure for your Ferrari. So hopefully you're not riding into any potholes and having any catastrophic accidents. And this should be everything you need for trading with AI using Claude. You've built the entire system. I hope you've enjoyed it. If you want to get any of the resources that we've talked about in today's video, absolutely use the link in the top line of the description. Come down, enter your email. You get access to a canvas which we haven't even talked about today. A canvas which shows you every step of the process, all the skills that are involved, all the tools that are involved as well. You can add to this and add your own flowcharts and everything. You can also get the workbook and use the oneshot copy and paste prompt and the trading suite. You've got it all. And if you have any issues, you can also use these prompts to get out of the issues that you're in. So regardless of whether you're on Mac, Windows, or Linux, you have a solution for you. That's all I have. Thanks for watching. I'll see you in the next one.