Using AI Agents for Trading Strategies Part 2
Alright, everyone. Welcome back to another episode of Line Your Own Pockets. We're gonna follow-up with the AI conversation we had yesterday. I actually just, like, spam turned the start recording button because I showed something to Dave, and I could see how excited he was getting there. We had a lot of fun talking about in the last one, and I think we're gonna be able to continue on that with this one because, again, like I mentioned at end of the last episode, if you missed it, I have been using Claude and Claude code to help me automate doing way more work than I think I could have ever done in the past by, like, a factor of a 100.
Michael:And we're talking about kind of how we're using that and how I've arrived in that. But if you haven't seen that one, we'll put it in the show notes. Make sure you go check it out.
Dave:Yeah. Yeah. Definitely go back and listen to that one first. You could probably pick it up here, but it's gonna make a lot more sense Mhmm. If you go back and listen to that one first.
Dave:But yeah. So, yeah, I'm I'm very interested in the work you're having it do to more fully form your kind of raw ideas.
Michael:Mhmm.
Dave:You said you had a list of several metrics that you were having AI produce, like, basically, come up with the backtest, do the backtest, and then sum up these aggregate metrics. And you said you had a whole bunch of them. And you sent me this wall of images of some of the charts that it was producing. So it's doing that for each each idea you have?
Michael:Each of the it's it's the it's always the top, I believe, 10 to 20 based off of return and things like the what is it called? The the MAR ratio. So return to max drawdown and and sharp, which I hate, but some of these different metrics as a way just to use use numbers, and it's just coming up with all of these different strategies. Yeah. So it and and the open of them.
Dave:You sent me this wall of charts. So you're coming up with that same wall. I've seen several on here. Like, there's spaghetti chart for equity curves. There's there's there's, like, 10 different charts.
Dave:And you're you're having it produce these charts for each strategy?
Michael:Well, no. Each of these is a strategy. So, like, the spaghetti chart, each of these equity curves is a different strategy. So just for listeners, what I what I sent to Dave was this it took the top 10 by return, and it said, here's the equity curves for them. And the reason I just like the spaghetti chart again, those are just a bunch of line charts overlaid on top of each other, is what we talk about all the time.
Michael:The most important thing is not necessarily the absolute return, but how smooth that return is. I'm looking at that and looking at the amount. So the top one there also has over just a one year test period, which I'll extend out when I when I really dive into it, has over 10,000? Yeah. 10,007 trades.
Michael:So but the next one down that the equity curve looks a little bit better only has 5,000 trades. So Yeah. There's some diving into the numbers that you do yourself. That's why I'm saying give me top bunch, which is another lesson that I kinda took away from this is I you have to think about it like an assistant, but you have to think about it like an assistant with just an insane work ethic that you can give a whole bunch of unnecessary, like, boring work to because it will do it. And these charts were actually done after the fact.
Michael:So, you know, I sent Dave a spreadsheet. That's what it did to begin with, but I was going cross eyed looking at it. So you can go back and say, no. I want you to visualize some of this data for me in this way, and then go walk the dogs and come back, and this is what you got.
Dave:So the yeah. I'm reminded of yet another episode that we did that's exactly right in this the exactly what we're talking about, which is what part of your trading business to outsource. That's essentially what you've done is you know, you don't wanna outsource everything. It wouldn't make sense. So you're strategically picking the parts of your trading business that do make sense to have somebody else do, like, basically have an intern do.
Dave:Mhmm. And one that doesn't complain, it works really hard, and, like, whatever you tell it to do. So so, yeah, I love that. We'll put a I'll link you in the show notes about that to that episode. But, yeah, I mean, you wouldn't want to have it do everything.
Dave:You wanna have it do the stuff that is a big pain in the butt, and you do the stuff that's really gonna make a big difference in your trading business, and that's the optimization and figuring out exactly what you're gonna trade and why and and the process of becoming confident in the ideas. That's where, you know, the your human value is always gonna provide value.
Michael:Yes. And and the this particular one with the wall of of charts and everything I gave you, this is from my particular starting point. So it's from, you know, a strategy we both talked about and we know works or has to work, in my opinion, all the time, which is an opening range breakout. At some point, that strategy has to yield a certain amount of results. It's all gonna be the devil in the details around it.
Michael:So when I'm coming up with something that I I have some faith in that the core idea is going to work, it becomes a lot easier then to say, try a million permutations of this particular idea and and figure out as it came. So what ended up happening is, you know, I said, try every from, you know, a five minute opening range break to a thirty minute opening range break. And it just kept running and giving me reports of it noticed kind of exactly what you would expect that the five minute makes more money, but then the fifteen and thirty minute is a smoother return. You start to kinda feel like you're communicating with, like, a trading partner at that point, where now it's it's given me two completely sensical raw pieces of data. One is the five minute opening range break for what I'm working will make more money absolutely in the long run.
Michael:The fifteen minute opening range break will make less money, but the ride will be smoother. So that's the point where it comes back to me. And there's no AI, and there's no, you know, anything that can answer the question of do I want more absolute money, or do I want a smoother return? Because that's not only my personality, but it's what else do I have on the go. Right?
Michael:Do I already have an incredibly risky strategy that accomplishes the a lot of money in an erratic way? And maybe I'm looking to pad that out with a smoother return strategy that's gonna offset that. There there's so many other questions that I have there, but the fact that I can just say, I'm going to bed, do all these tests, and then show me the results in the morning, and then I can sit down and then bring the human back into it. That, I think, is the power that we're we're trying to give to or talk to the people about about that back and forth of you do the work, I do the thinking. Right?
Michael:You do the work, I do the thinking, and just keep going kind of back in that that loop and eventually come up with something that's really cool.
Dave:Yeah. That's a great point about the five minute versus the fifteen minute. That's like, there is no right answer there. That's that's the whole point. There's no you can't say, okay.
Dave:Which one's best? Like, it all depends. Like, what what what what do you how are you defining best? It's a that's a sort of a milestone that a lot of traders finally get through. They think there's all this one answer, this one holy grail, this this one right answer, but there's it's complicated.
Dave:It's not there's not a right answer. It all depends on your risk profile and exactly the things you just mentioned.
Michael:Well so then it also talks about that goes back to how to correctly incentivize the AI. Because if I had told it, just go find the strategy that makes the most amount of money, Well, there's a world where it finds a strategy in which it picked maybe one or two crazy penny stocks that went up 10000% that day, and it goes here. This is the strategy that makes the most amount of money. And it's also why I said, I think what I'm doing for if if I was not someone with my trading experience and and systematic experience, what I'm doing could be a trap. Because someone could look at that and say, well, this strategy over the last year made 10000% return.
Michael:Holy smokes. I'm rich, but got lucky a couple times. And that's not the strategy that is you know, you you give that strategy to a seasoned trader, and then you give one that, you know, you risk one to make two when it does that 60% of the time over the time that most traders are going to that other more consistent one. Whereas if you're new, you and if you give it the wrong incentive of make as much money as you can, you can fall into a trap because it's just gonna do just that. And it's saying dollar value at the end of the test is the most important one.
Michael:Let me just tweak things in until that works. And yeah. So finding the right incentive. So I I talked about things like Sharpe ratio and, you know, regression of of the equity curve and and things like this where I I am more focused on that smooth equity curve with a lot of trades than a handful of trades that that make a whole bunch of money.
Dave:So in the first so, you know, the first three days go by, you're you're know, you're giving it some guardrails. You're you're fixing some of its mistakes. You're having it. You're figuring out ways to make it use fewer tokens to do this. You get your spreadsheet.
Dave:You've got, what, twenty twenty results on there. You've got a whole bunch of columns. And these are from let's just let's just focus on the real test results for now. Yep. What's your what was your next step then?
Dave:Were you like and you said you can't you said it by now, it's come up with it's gone through, like, 200 ideas, and there's maybe, would you say, 10 that are worth looking at?
Michael:There's, like, 20 that were at all profitable, and there was 10 that were like, this is this is really interesting.
Dave:Okay. So was that more than you thought? Less than you thought? Or was it were there some that you thought, gosh. I sure thought that that would have been on there and let dig into why that one wasn't on there, for example?
Michael:There's a couple of those, and that's on my list. For the ratio, 90% of people full of shit. I kinda thought that was probably on on brand. I was just more glad about the the breadth of work. And like we talked about in the last one, I'm still trying to figure out if there are diamonds in the rough, and I've I've got a plan to go back and and have it do that.
Michael:But I was okay with that because the way I looked at it for me is now I have 10 really good ideas that I can really sink my teeth into when the AI is not working and just really get in there and explore. And then I expect of those five strategies, two or three are probably gonna, you know Yeah. Make the test, which is hilarious because it mean I've gone from, like, two fifty down to two from people who said this is how you make a bunch of money trading to actually a way that you can make any amount of money trading.
Dave:Yeah. Well, you know, you may look at that and think, gosh. Wow. How how pessimistic this is. You know?
Dave:There are all these ideas, and, man, you only came up with a couple. But it's actually quite freeing to cross a bunch off your list. Mhmm. So that's incredibly valuable to be able to do. It helps you focus on you know, because otherwise you got this huge backlog of 200 ideas.
Dave:How do you know which ones to work on? Well, you've got your answer here or at least a suitable answer for now, and you go through your regular process for those. That's incredibly it's a huge step forward even though for some it may think, okay. Well, there's just so much BS out there that, you know, it's hardly worth it.
Michael:Well and and what it's also done is shown not just me, but it also taught the AI a whole bunch about how to do these tests. Because like we talked about for the first couple days, it was just trying to do anything. It was running into errors and coming back and fixing the errors. But now that it's seen 250 strategies of everything from a day trading, the the best you can with real tests, which just means, you know, using a limit and then buying at the close or selling at the close to, you know, pairs trading strategies to all this. It had to work itself through all of those, and that's why this initial test took maybe a week or so to get through all of those particular strategies.
Michael:But it has such a detailed memory on how to test things now that it's going to be much more efficient at everything going forward. So I almost feel like just throwing a bunch of stuff at it like that, especially in times that you're sleeping and you're not doing anything anyway, is great because it's doing this thing where it's breaking things and then going back to the Internet to figure out how to fix it and then fixing it and then adding that. And as long as you prompt it with every time you learn something, add it to this this master sheet. Eventually, it gets pretty good at saying, okay. I've seen this error before, and it was this, and I fixed it.
Michael:So let me try that now just like teaching a a person would. So I found that it's just way more the amount of time it spits out errors and and comes back, which in Amity broker, it was having a real hard time with, which we'll which we'll talk about. But even with RealTest, it was having a bit of an issue with, that is, like, 90% gone now because it understands it can always know an error that it saw before and then fix that error based off something that it's it's learned along the way.
Dave:Yeah. And your your trading intern has developed a lot of experience now that it's and and, you know, another way to think about it, it's the worst it's ever gonna be right now. Right? Right. Like, it's and it in every increment and every improvement you make, it's still the worst it's ever gonna be, which is crazy to think about.
Michael:Yes. As long as you have that backup. And then, you know, I said this in the last episode, and I'll say it this time. I had a bit of a heart attack moment where it just it killed itself because of a time change. I think I think the time change was the issue.
Michael:So just make sure that periodically or consistently, you're having it right. It's and it does it in a markdown file. You're having it write everything that it's learned, and I I say, you know, spare no. Right? Incredibly detailed and write that to a markdown file.
Michael:And then right now, I'm currently and I know Dave's gonna cringe here because I still don't understand Git, but I have it in the, like, the Windows OneDrive sync thing. Yeah. So if if the my house gets nuked off the planet, when I buy a new computer, I sign into the account, I can pull that file down, and the AI will be right where it left off. And, yes, I know Git's probably a better way to do it.
Dave:Your life is gonna be so much better when you learn GitHub.
Michael:Well, so this is just a side, and then we'll get back to it. My next thing is gonna tell it to do it. I'm like, do I need to understand Git, or do I just need to say every time you do this? Because there's a in Claude, there's an integration with Git right in there. So I have it has access to my account.
Michael:So I'm just gonna say just put your memory up there. Just save yourself up there.
Dave:Yeah. It's it's AI is probably the best way to learn how to use Git. I mean, it's gonna tell you the exact steps, and it does you know, there's sort of a standard way to use Git and GitHub, at least as far as I'm concerned. And then I'll see I'll see Claude use some different commands that I've never heard of. And I'm like, wow.
Dave:That's let me I'm I'm curious about why I
Michael:did that.
Dave:So but, yeah, I think it's a great way to learn. And so do you are you running all this in a single quad session?
Michael:I have two currently. I have one for RealTest and one for Amnibroker because I found it got confused, and it would use because Amnibroker for just like little things uses a semicolon. Is that semicolon, the dot, the thing, to separate lines, and RealTest doesn't. It's just a new line. Mhmm.
Michael:So it was it was like it was kind of getting confused and mixing on the syntax. And when I split them out, it was a little bit better. So I have one giant chat that uses real test. I have another one that uses a Claude code. And then like I talked about for my nightly things for stats edge trading, I have a different bot and a different scheduled task that happens there.
Michael:And the fact that these are all scheduled to work at different times is great. I'm just I'm kind of the manager. I have it actually updating my calendar for when it's gonna go live to do certain tasks when I sleep to make sure there's no overlap between them.
Dave:So do you so you first when we talked last week, you first started using OpenClaw for this. And then I I I wanted to hear like, it sounded like you have switched to just using ClogCode. So what happened there? Because I'm thinking about going the other way or trying some things in OpenClaw that I'm not doing now in ClogCode. So I'm curious why you made why you thought to make that transition and how that has gone.
Dave:So can you dive into that?
Michael:Yeah. For me, it was just the the frustration. So like we talked about, I have this kinda nightly routine, and I also have a a weekend routine that that's the next thing that I'm gonna automate it. And if I could get these two things away, which are all things that I have to do when the market has closed and and Norgate has updated its data, which is, like, you know, thirty minutes after the market closes. And it was just this annoying thing that was pulling me back to work mentally as well.
Michael:Like, again, I always I pride myself in the fact that, like, an hour or so before the close, I can just grab the kids early. I'm the cool dad who can pick them up early from school. We can go do some fun stuff. And most of the time, I have no problem after they go to bed. I come back in here, and I sit, and I do, you know, my trade recap and and all of that kind of stuff.
Michael:But the fact that I had to was bothering me. And I'm like, if I can get these tasks out of the way, then I don't I don't feel the need that I absolutely have to. So if I just don't want to one day, I I can take a day off kind of thing. And I tried for two weeks with Open Claw, and it just it just could not get the the basic step. And this is a pretty basic process of you you use a CLI to get real tests to import data, and you wait because it's gonna take three to five minutes to import the data and run the orders, and then just a handful of steps in a web browser kinda after that.
Michael:And it just couldn't do it. It it kept coming up with it kept stopping. I had, like, I had it write what it was called the bible. And in the bible, I wrote, do not stop, like, a thousand times, and it just kept stopping the process randomly and and just not continuing on. So it just became a I was watching YouTube videos, and there was all these about the Claude code.
Michael:And I tried it, and within one day, it was it did. And now it's doing it, I said, I think less than, like, three minutes because it's found a way to, like, really narrow down the import that RealTest has to do so it's even saving itself. So it was really at the end of the day, it was just an intelligence thing. It was just way it was way smarter. It was way better.
Michael:It was way faster. The web browsing manipulation, which might not be something you care about, infinitely better. The just being able to click on certain targets because I'm I'm having it clear out an old list in TradingView and then update that list because an indicator watches that list and then sends trades based off the indicator value and just couldn't do the web browser. I have it filling out data for stats that it just could not do that at all. So I don't maybe it's fine if you're not doing that part of it, but it just it felt like it just felt like we keep using the assistant.
Michael:I just didn't listen to my commands. Yeah. And every now and then, it would do something, and I'd say it you know, that's not on the SOP. And it would say, oh, well, I I thought it was a good idea. Like, no.
Michael:I don't want you to think it's a good idea.
Dave:I want you to follow like the real intern.
Michael:Right. I'm like so there was just a lot of that. It just felt like it would go off on its own sometimes, and it would not listen to commands sometimes, and it would not. Which maybe if you're doing, like, like, a creative process could be beneficial. I guess in some ways, you could accidentally, you know, serendipitously discover some things.
Michael:But for this very basic task I want to do, I want it done robotically, and Claude Co did that perfectly.
Dave:Okay. So one question before we go on to the spreadsheet you sent me, because that's gonna be really interesting. So
Michael:Oh, man. Dave had such a smile on his face when I saw the spreadsheet.
Dave:So which model are you using? Are you using the latest Opus, or are you using one of the older ones?
Michael:Opus 4.6. And this might be a problem because I actually had I had the highest end version of ChatGPT before. And when you're setting up OpenClaw, you have to pick its brain. Yeah. And I had it's like Codex 5.3 or something with ChatGPT, and I gave it that brain.
Michael:I don't know if that's what made it. I I even asked it. I said, if I switch you over to something else, will you be better? And it said no, but said it's not an intelligence issue. It's just I'm not following the SOP.
Michael:And I even funny story before I move on. I there was a a Harvard study done on these things. And for some reason, they seem to respond better if you threaten them as opposed to they did this process where they had people talk very nice to it, talk neutral to it, or talk very aggressively, And it performed the task better the more aggressively you taught. So I actually gave Open Claw a ticking time bomb to when I was gonna kill it. I said, you have one more day to figure out this process or you're dead.
Michael:And it it got it got as close as it ever did, but it still wasn't able to do it. So the punchline, the real morbid thing is I was like, I don't know how to get this thing off my computer. So I told it. I said, okay. Now it's time to dig your own grave.
Michael:I want a step by step instruction how to make sure you're gone forever. It wrote it all so morbid. So I basically just said
Dave:That's funny.
Michael:Can you write your own dismissal letter to the to the employee?
Dave:Alright. So tell me about the spreadsheet you sent. So so you you used the opening range breakout that
Michael:Mhmm.
Dave:Comes with my course. Right?
Michael:Right.
Dave:And tell me what you did with this. There's so there's several lines in the spreadsheet. There's some that say good, some that say bad, and there's some it looks like some metrics, like, per strategy maybe. So tell tell me about what this shows.
Michael:So we talked about we had this, I think, two part series where we talked about, you know, what what do people do if they don't have the money to start trading? And the moral of that was invest in the education side. First is kinda what we said, you know, invest in the tools, start back testing, start building stuff, and then also have realistic expectations. At some point, you're not gonna be able to make a million dollars from, like, a $5 account. You're not gonna be able to.
Michael:So we talked about prop firms, and I do some, you know, broadcasting with a company called Trade the Pool just to get, you know, all disclosures and everything out of the way. I I just I'm on their stream, and we talk markets and stuff. But they have an interesting thing. They're one of these prop firms where you put up an initial sum of money for this it's a $120 for a 25 account. And if you pass their evaluation, they give you a 25 account.
Michael:You can trade it, and you keep 70% of the money you made. So one thing I thought would be interesting was I took the opening range breakout strategy that we were talking about and the one that I got with from Dave from Mabe Kit, and I I put that into this AI that I was teaching to use Amibroker. And instead of just saying, figure out how to make me a whole bunch of money, I also gave it the very specific rule set of the amount of money that you can risk per day and the amount of money that you have as a max drawdown before the account's taken away. And I then I gave it some ideas of, right, I wanna do an opening range breakout. I want it to be on something with high relative volume, the news catalyst, things like this.
Michael:Okay. So so
Dave:you so you gave it the parameters for your prop account thing. Right?
Michael:Yes. The rule set, you have to make x before you lose y, and you can't do so much in a certain day and volume requirements for individual stocks and and things because you're trading someone else's money, these are rules they put in place to make it so that they feel comfortable giving you money. Right? They won't let you, you know, short a a penny stock and that that can rally into the moon kind of thing. And the
Dave:parameters are there's they're they create an environment where it's pretty strict. Right? It's it's like a hard optimization problem to solve. It's not super easy to solve. So it's you have to optimize things to get any strategy to work given these constraints.
Dave:Right?
Michael:Right. Because if it was if it's my account and when it's my account because my plan is to use I've talked about this before. Use prop firms and use my own money because why not? I kinda look at prop firms as as a way to leverage and a way to experiment for a $120 if I blow up this account. Who cares?
Michael:Right? But they would. But it's for me, it's it's just an interesting and it'd be it was an interesting problem to have it solve. So I gave it very loose parameters for the trading, but very tight parameters of these are these are the things that would cause a blowup of this account. And the loose parameters for the trade, again, were open range breakouts on something with high relative volume and then go.
Michael:And then I told it, hey. I want to allow thousands and thousands of trades in, and I will refine them over time. And the game plan is to refine the trades, but then increase the the risk on the trade at the same time. And the beauty of that is it created a very interesting and binary pass fail phenomenon inside the thing. So it would run a test, and it would say this one would have failed the challenge over the last year, and this one would have passed the challenge.
Michael:And it did that in this kind of reclusive loop for I think it was twenty six hours straight, and then it came up of 60 some odd trades. Here are 12 strategies that I built that would have passed the account. And here's the some odd strategies.
Dave:There are 12 that would have passed.
Michael:Okay. Yeah.
Dave:So so how what parameters did you give it to say, okay. Here are the things you can vary.
Michael:It was so the requirement was high relative volume, right, opening range breakout, something that's in the news and then breaking out the opening range. What I allowed it to play with was the length of time for the opening range, right, from from five to fifteen to, I think, 30. And I told it to try different stop metrics. I try, you know, at the the low of the day, try an ATR, try also profit target metrics. You know, things that the cruncher wouldn't do easily.
Michael:I'm sure there's ways to for me to go into the code and do this. But the way the things that crunchers wouldn't really do kind of natively right off the bat and saying, while I'm sleeping, do this, and then come up with these different ideas. So, you know, some of these and a lot of these are, you know, yeah, five minute opening range or fifteen minute opening range break, and then here's the stop, and here's the profit target, and this is what we found. And I told it to kind of learn from what it was doing and then go back and and continue to iterate until it found a couple that did it. And I think that's important too is I'm not saying I'm not saying do everything.
Michael:I'm saying the couple that did it because I don't wanna see one strategy that's amazing. I wanna see 10 that are kind of the same, and they're all pretty good.
Dave:So what so what is your conclusion from looking at this and its and its results here? There there is there two or three variations that you're gonna go live with? And or are you gonna what what are the next steps for this for you?
Michael:Well, so the next steps is was couple things to note. Right? Is that most of the ones that passed the top bunch of them were five minute opening range break, not not fifteen minutes. So that's like something you could take and learn from. And then the the other ones were, incredibly wide profit targets, you know, like, talking five, ten times your risk for for profit targets.
Dave:Profit targets, not stop losses.
Michael:Right. And then it also
Dave:How much of the five minute versus fifteen minute was just because you can have more five minute trades over I think
Michael:that's probably a big part of it. But that's also something I told it to weigh very heavily knowing that and, again, to answer your question, the next step is to take this to the optimizer. So this passed as is with 10,000 trades in a year. So the idea is, well, now can I optimize it passing as is with 10,000 trades, I, you know, and and risking a $100 a trade for the entire year? Well, can I shrink that and then crank up the risk at the same time Mhmm?
Michael:And have it then still do the same thing, but it's just taking better trades. The theory is that by getting rid of a whole bunch of maybe I get rid of 5,000 bad trades and I go to a $200 risk per trade or something like that, it should just pass faster, and it should it should
Dave:Be a more efficient strategy. I mean, that's exactly what the Crunchers allows you to do is figure out a more efficient way to trade your strategy.
Michael:And then also the, you know, the the two ways I told it that to test stop losses was to either use the opening range or some ATR metric, and it just found the top I think I'm looking at the top 15 all use the opening range break. The opening range so basically stopped the low of the day at that point. That was something that was interesting to me because, you know, you're I was thinking that maybe a tighter stop loss, even though it would tank the win rate, would do better, and it seems intellectually sloppy. Well, I guess trading sloppy just put the stop below the day. It seems like that's a suboptimal way to do it, but at least that's kinda what it found.
Michael:And so the the game plan, I guess, going forward is two. One is if I think of a better stop loss criteria, then I can say take these particular strategies that already passed, and we know they're already good, and try them with this stop loss. And then I can go to bed, And it can rerun those 15, not all 64, but those 15 strategies with a new stop loss criteria. And then also if I start to think of, you know, different things when it comes to or when I start to add the cruncher, what I'm thinking is I'm gonna run the cruncher on, like, the top five. And if the cruncher finds the same column value or a similar column value to the top five, I'm gonna tell it to add it to all of them and run them all again.
Michael:So, like, let's say, I said relative volume two, but let let's say the cruncher comes out and says relative volume five is way better. I'm gonna go, okay. Now I want you to go back through all the 64 with a relative volume of five and run them all again. Yeah. And then go to bed.
Dave:Yeah. So, yeah, I I alluded to this in the green room, but I I I wanna make the cruncher available to Claude in a in a efficient way to allow this sort of analysis in a very in a really tight way. So I'm definitely thinking that through, and I think that will be incredibly interesting, and it would be it would take what you've done here to at the absolute next level. I mean, it would be really tight.
Michael:Well, that was another thing we talked about in the green room. I said, I'm gonna let this loose on your website. Because eventually, the next the next logical step seems to be take I'm going to bed. Take all of these strategies, every single one, put them into the cruncher, look for some some similarities across all the different variants.
Dave:Yeah.
Michael:And then if you find one that's, say, in 60 or 70% of all the variants, add that in and then rerun the back test across a lot of them, and then do that in some sort of loop. And then you could cap it and say, hey. I don't want you to go below. There's two hundred and fifty two trading days in a year. So you say, I don't want you to go below, like, a thousand trades.
Michael:Right? I want, you know, I want a couple trades a day on average to to do it, but optimize until you get something interesting, and then visualize the data for me. And then it sends me new data visualizations. The thing that I thought that this was interesting and and the main kinda lesson I wanna give to everyone on this was I gave it a very specific goal. And part of it is because, again, I do these streams with Trade the Pool, so I I wanna show them this Yeah.
Michael:As well. But for the people out there that we were talking about a small account, well, say you had a $5,000 account. Say you're Canadian like me, you only have $5,000. So you pattern day trader rule doesn't apply. That is something that you could give if you have an idea, your your very specific rule set.
Michael:Or if you're American and the the PDT, I think, kicks in, what, is once a week, you get three day trades a week or something like that.
Dave:Yeah. I don't
Michael:know. Whatever it's been. I know a long time for Dave, and I've never been down there. But you can give it your specific rule sets that are only for you. In this case, it's a prop firm, but it could be your own personal limitations and say work within those limitations and go.
Michael:So it might be something like, I go to work. You know, you're on the the West Coast. You're like, well, I go to work every day, you know, forty five minutes after the market opens. I have to get up, and I have to go to work then. So I wanna monitor it.
Michael:So whatever trading strategy can only exist in that time frame. You can give it whatever personal criteria you have and say, get to work there. Now if my base idea of this opening range breakout was crap, then none of these would have worked, and that would have been part of it. So it's still not a type a bunch of things into a prompt and and make a million dollars and go whatever. But what I'm saying is that you can take strategies that are out there and that exists and that you find that work and have it help you fit them into your life.
Michael:And, again, in this case, it's passing this account and and getting external money and doing whatever. But for you, it might be more time constraints or or financial constraints or whatever it is.
Dave:Yeah. I think, you know, the the better the better you get at call it strategy taste. The better your strategy taste is, like like, the your your ability to discern what's a good trading strategy or not from, you know, a rough idea, the better you're gonna be at this because you're gonna have you're gonna be able to create a process that zooms down to your answer or or come up with a strategy that is gonna work for you way quicker, and you're not gonna spend you're not gonna spend a lot of essentially tokens spinning your wheels. Right? So the better you are at that, the better this process is gonna be.
Michael:Well and and tokens. But even if you're someone who who doesn't mind the cost and, you know, let's say you're watching this in a bit and tokens have gone down in price or whatever. Because the limiting factor now is Amibroker taking half hour plus to run each of these tests, the idea, you know, your limitation is prob might just be time. Right? So you wanna make sure you're not wasting a lot of time.
Michael:Now don't get frustrated in the beginning because to do this, it probably took a day, a day and a half of it just slamming its head against the wall. And I just kept finding things online and giving it you know, Dave gave me one about using Amy Broker externally like this. Yeah. A lot of it saying, what error do you see on the screen now?
Dave:And
Michael:and me, like, a lot of this kind of back and forth. But when it really got working and it gave me a Python script to to go and and to run these different tests, when it finally figured it out, it was almost flawless. But it was probably a day, maybe two days of just smash your head against the wall.
Dave:So I have to mention. So I I just sent out a message today to my mailing list that gives you the basics for the Python script that allows you to do this automation. So if you're not on my mailing list, definitely check that out. There's an archive where you can go see it. But, yeah, that's gonna be, that's an essential building block for this for this process to work.
Michael:Yeah. And it's patience, but then it's also knowing that you have to be able to go in and and kind of test on your own and and kind of figure things out.
Dave:Yeah. Well, so, yeah, I I I love this, and this is I could see this just getting better and better over time as you, you know, get more and more discerning about how is working, how Claude is spinning its wheels to do certain things, creating the context for it to do better things in a more efficient way. I mean, one one thing is you were talking about the strategy and and what you were allowing it to vary. One other thing I thought was, you know, rather than say, okay, just the sky's the limit. Do, you know, vary everything.
Dave:You could say, okay. Here, you can keep all these other things constant, and then I want you to use all your creativity on position sizing or Yeah. Position sizing and stop placement. And, like, maybe there's some way we hadn't thought about doing that. And it would be interesting to, like, sort of let it loose to see what it could come up with in that area.
Michael:Well, and it was funny because that's actually then so for the the stop loss placement, for example, right, I just said, oh, it kind of said, hey. Every time I'm testing an ATR fraction, even regardless of what that is, it doesn't seem to work. But, yes, it could get to the point where you say, okay. If the opening range break is the the best one that you can think of and the best one that I can think of right now, maybe there's one to think of in the future. Great.
Michael:Let's move on to this. But the other thing is it said so trade the pool, the 25 k account. You're gonna make 1,500 before you lose a thousand. It thought that that thousand dollar was trailing in nature off the bat. So, like, if you made money and then you gave it back, then it would and it's not.
Michael:It's a fixed, you know, thousand dollar loss on the account. So when I went back to it and I said, okay. Not only do I want you to update your memory, so this is this is how it is, but now that we know that, it's time to start thinking about our sizing rules. So then we created kind of a spreadsheet that if the account was up x amount, it's to risk y. And as the account gets further from that thousand dollar drawdown, risk risk more and more.
Michael:And then if it ever goes into drawdown, risk less and less. Yeah. And then redid the test again. So it's like little things like that that it went, this changes everything.
Dave:Oh, yeah. Yeah. That would that gives it a lot more flexibility, just that constraint. So that confusion that it had or that incorrect assumption that it had was really constraining it big time. So, yeah, that's I could see that being it's like, yeah, changing everything about how
Michael:Right. And that was just one of those moments where I said, okay. Now instead of going back and back testing all of these again, now that you have the equity curve for all 64 strategies, you don't need to do this in Amnibroker. You can now do this in Excel, come up with this kind of compounding ideas and compounding rules. And then, yeah, at the end, it just presented a a pretty basic scaling sheet.
Michael:It just said every, you know, $250 you're up, add you know, increase the risk and every you know, if you're down this and increase the risk. And it made, I think, 50% more of these things pass and then Yeah. Shrunk the time to pass on each one. So you're right. It's a lot of just like we talk about, it's a lot of now this does the work, and I I sit and I review it, and I think for a while.
Michael:And if I didn't spot that change, then maybe the strategy that I end up bringing to this would be suboptimal. Right? And now it's to the point where and, again, for me for me, personally, this is a huge thing because I can't program any of this. I know there is a way for Amni Broker to output, like, JSON scripts to webhooks. I know there's some way to do that.
Michael:I I read that online. I have no idea how to do it. But I can go to Cloud Code and say, okay. It's time to take it live. This is the endpoint that you're to look at, and the the JSON package that has to reach there go, and it could just do the rest.
Michael:Right? So it's it's crazy to see, right, someone in the me who cannot program at all. Just I can it's almost like I feel like, you know, the people who can I can understand French because Canada's French and English, and we learn French in school? Someone could talk to me in French, and if they talked slow enough and the language was easy enough, I'd understand what they were saying. I could never in a million years speak it.
Michael:I feel like that's the level I'm at now with Pythor with Andy Broker and RealTest, and I feel like that's kind of enough. I can read it and know where it's kind of screwing up, but I don't actually need to sit there and start typing out the lines anymore. It can do that, and I can just kind of make sure it's not going too crazy. I'd I know the waitress isn't mouthing off to me when I'm somewhere. Right?
Dave:Yeah. Oh, man. That's that's super interesting. Yeah. I got a feeling we're gonna be talking about this on some some future episodes as you continue to make headway with this and and, you know, unlock yourself in different ways that we haven't thought of yet.
Michael:Yeah. I think it's super cool. And, you know, again, I I I wouldn't be surprised if the next one's both more AI, but we'll find out when we get there because I could see this being something that both of us kinda go away for a week and come back and come up with 10 more things to talk about on the topic. But it's been it's been awesome. And as always, I'm Michael Nauss.
Dave:And I'm Dave Mabe. We'll talk to you next week on Line Your Own Pockets.