Transcription
So about a week ago, I was doom scrolling on Instagram and I've been seeing this thing everywhere [music] that Claude is incredibly good at investing. So I wanted to put this to the test.
And I sat there thinking, what if I could turn claw code into a gold coin [music] >> and give this thing full control over my portfolio. Have it running 24/7, constantly back testing strategies, watching gold generating trades, optimizing itself, and tracking every trade that I place. So, this thing learns on its own. And for a moment, it was actually showing an 81% win rate, which is either absolutely insane or this thing is completely broken.
The idea was simple. If this thing could survive over 100 signals and actually show me realistic figures that this thing's going to work, then I was going to give it access to my 200k prop firm account, which may or may not have been a really bad idea. But first, I actually have to build this thing, which is way more complicated than I originally thought and took a lot more time.
So, when you're trading gold, you actually have to try and figure out the direction of where this thing is going by looking it at different time frames. So, all this means is basically each one of these candlesticks represents a certain period of time. So right now each candlestick represents 30 minutes. But for our strategy specifically, we wanted to look at the 15-minute chart, the 1 hour chart, the 4hour chart, and the daily chart. And then this is going to allow our system to have a full picture of what's actually going on in the market over different time frames.
So the system ended up looking a little bit like this. So we have the gold chart. It takes the last 200 candlesticks from the 15-minute chart. Takes the last 200 candlesticks from the 1 hour chart, the 4hour chart, and the daily. It then adds this into a Postgress database which is basically just a database that we could speak to. And I didn't just want to give this thing one strategy because that strategy might not work in all market conditions. So instead I gave it four. Strategy one hunts liquidity sweeps when price wicks above a key level. Grab stop losses then reverses. Strategy two follows trend pullbacks, classic EMA continuation. And strategy three waits for volatility compression then breakout expansion. And strategy four just sends it in strong momentum. Each output has an entry, a stop-loss, a takerit, a competent score, and reasoning to why it's took that trade.
So, we've got the data coming in, but now we need a way to actually manage all this data. And I'm going to call this section the brain. So, we had our data coming in, we had our strategies, but now we actually needed to give this thing a real brain. So, somewhere where we could actually see all the results, all the testing that it's doing. So, it built this. So, every 30 minutes, it runs a decision pipeline. It expires stale signals, ranks strategies by performance. Like we can see here, liquidity sweep is coming up top right now. Checks your risk limits, adjusts your position size based on volatility, blocks over exposure, and limits your max daily loss to 2%. And if everything passes and everything lines up between the strategies, it will then send me a signal over Telegram. And these are what I'm going to be using to actually put onto my prop firm account. No emotion, no hesitation, just math.
But here's where it actually gets interesting. So I introduced something called the Monte Carlo simulation. >> Monte Carlo simulation is a mathematical technique which is used to estimate the possible outcomes of an uncertain event. So take for example the calculation of the probability of rolling two standard dice. Well, if you wanted to calculate this probability the brute force way, you would have to roll the dice a whole bunch. Say 36,000 times. Because if we consider that there are six sides to a dice, we have two of them and we want to run this a thousand times to get a good sample size. But with a multicolo simulation, we can reduce the number of rolls by randomly sampling the possible outcomes knowing there are 36 combination of dice rolls and calculating the percentage of times that we get say a seven.
So every 4 hours it rebapt tests itself over a 7-day window, a 14-day window, a 30-day window, and a 60-day window. It then runs forward validation. 80% training and 20% testing. If outer sample performance collapses, then it gets flagged as overfitted. Then every six hours it reoptimizes parameters. 80 combinations. Monte Carlo shuffle. Basically to see if randomness can beat the original. And if it goes really wrong, then it's going to throw the parameters away. If it hits eight stop losses in a row, the entire system shuts down after 24 hours. No signals, no trades, just silence. So you can truly sit with your pain.
So, I decided to give it a couple days to sort of do some back tests, come up with some data, and then we could check on the metrics and see how it was doing. But when I went to look at the metrics, [music] something was a little bit off. The win rate 81%, sharp ratio 9, over 1,500 trades in 30 days, which absolutely makes no sense. Even the best quant funds in the world can't produce that consistency. So, either claw code is crack gold or something was very wrong.
So, it's about four or 5 days later now and well, I've been placing all the trades that has been telling me to place. >> It's not looking good, babe. It's not looking good. >> So, as you can see, this is my live funded account and [music] we are $11,500 down, which is terrible. We are cooked. Basically, we just let this AI bot just absolutely nuke our trading account. And it actually took me to lose $11,000 just to figure out what's wrong with it. So none of this was actually making sense. So it's saying I had an 81% win rate. You know, it's doing these back tests, but somehow I'm $11,000 down. And that's when I realized there was a huge issue. So it turns out that we were accidentally fixing our own trade. So every back test trade was being simulated by the wrong bar. So the signal was generated at $5,000. Say it was tested at 5,100 which led to loads of instant wins.
So I decided to build this thing from scratch to make this thing actually work. So you can see a little terrible diagram of it right now. But the fast API handles the health dashboard, the status, the candles, the euler. So this is where we grab data from. So this is all the candlesticks. It refreshes every 15 to 60 minutes, 30 minutes, 90 seconds, and 4 hours. Then it optimizes this data, sends it through our pipeline, so through the strategy detector. It then picks which strategy to do, monitors the outcome of the trades, does the trade simulator and does the metrics calculator. And then all this data is fed back into the Postgress database where things can then be optimized from there.
So the external service, you've got the 12 data API, got the API for Telegram to send it to us, and then for the dashboard, we've got the signal history, the equity curve, the system status, and the chart just basically shows us a lightweight version of what we look on any trading chart website. And don't worry if you don't understand this. Basically, all you need to know is one API for a website that can get us all the candlestick data, price data, the green and red things you see on a chart. We get claw code to build the brain behind it. Does all these calculations, you know, figures out our strategies, does all that calculation for us. You don't need to know that off top of your head. We're going to let this thing do the work for it. We connect it to Telegram so we can actually receive these signals over it and everything else we let Claude handle in the back end, you know, and let me know in the comments if you actually want me to make this GitHub uh repo public so you can all just access it. If that's useful to you, let me know in the comments. If you do actually want to, you know, jump on a call with me onetoone or speak to me onetoone, I do have a school community below where I can speak to you directly. I can help you with any of your builds. But let's get back to the video.
So, where does the system actually stand now? We've actually got it showing realistic measures. And right now, it's actually showing a 60% win rate, which is extremely good and a little bit suspicious, but I'm sure now that the data is all working correctly. Is Claude now a gold quant? Probably not. Is this going to replace traders by the end of the year? Probably yes. The metrics are realistic. The system self-heals itself, does all the calculations for you. It expects risk and can manage this and shuts down during chaos.
But the real test is now that this is fixed to actually see if we can recover this $11,000 loss and actually make it back because we need to actually give this thing a chance and let it run. Now we fix all the bugs. I'm going to let it loose and we're going to actually either run this account into the ground or make this money back and get the bag. So I'm going to again I'm going to be placing all the trades that it gives me for the next week and I'll catch up with you for part two. Thanks for watching guys and see you in the next one.