Go back

052 - Martyn Tinsley - 1 of 2 - Building Robust Trading Strategies - The Masterclass

from The Algorithmic Advantage

1h 24m 56s

052 - Martyn Tinsley - 1 of 2 - Building Robust Trading Strategies - The Masterclass

Martin Tensley, a seasoned algorithmic trader, advocates for a rigorous, data-driven approach to strategy development that prioritizes statistical validity and robustness. He emphasizes that traders must avoid overfitting by testing strategies across multiple assets and timeframes, using a combined sample size to ensure generalizability and confidence. A key insight is that backtest results are often distorted by economic news, creating misleading performance peaks—this noise can be filtered out using a smoothing technique he calls "intelligent edge detection," which isolates the true, repeatable edge of a strategy. He demonstrates that statistical significance is achieved only after thousands of trades, with weak strategies requiring far more data than strong ones. His methodology includes testing across 28 currency pairs to validate performance across diverse markets, rejecting strategies that work only on isolated assets. He also promotes the use of Darwin X as a viable, regulated platform for traders to commercialize their work, offering performance-based fees and a zero-risk learning environment. Drawing on Perry Kauffman’s principles, Martin underscores the importance of filtering noise from signals and making decisions based on repeatable, not accidental, performance. Ultimately, his philosophy centers on building strategies that are resilient, generalizable, and grounded in long-term data—enabling sustainable, consistent returns in live trading.

Transcription

11460 Words, 61174 Characters

English
So the way that I much prefer to do it is to say look, I do my tests on all the assets together combined which gives me a really high sample size, first and foremost, which I can trust and it proves that I've managed to produce a generalized set of parameters that work across the board. And the argument I always get given to me is that, but yes, pound-dollar moves slightly differently to your radar, slightly differently to pound-yam, whatever. So you're missing out on profit there. And my response is always, well, yes, I am, but I've got a lot more confidence. Welcome to the Algorithmic Advantage. We're here to expand the toolkit of the Quant Trading Community and introduce investors to the many advantages of systematic trading. Our goal is to educate and inspire as we embark on a captivating journey into the vast knowledge and experience of leading portfolio managers and other experts in the field. Martin Tensley, welcome to the show. It's been some time I'm really looking forward to this. And thanks for coming on. Yeah, my pleasure. It's taken a long time to get this arranged so it's great that I'm finally here. It is. And I'm very much looking forward to the fact that, you know, we get to riff about trading, but also you've got a presentation for us because we've agreed you could put together a few slides. Once I decided I wanted to pick your brain about, you know, some of these common trader pitfalls and, you know, these two building robust strategies, having a defined process, having strict rules around how we make things robust, how we avoid overfitting. These are really obviously invaluable concepts in our world. And so it's great you've taken the time to put this together. So I do really appreciate it. Thank you for the opportunity. You know, there's I think there's going to be a lot of value, hopefully, for your, for your viewers. Yeah. Fantastic. I am sure of that. Well, look, as I like to do, Martin, let me just ask for a bit of an intro first to give me a bit of your background, a bit of your bio. We can break it up if you like. But how did you get into trading in the first place? Just curious about some of the early days, some of the early pitfalls. And then I'll probably ask about, you know, how you got into into systematic and just trying to work out how your brain works and what your pathway was to this place. So yeah, how did it all start off? Yeah, well, I often ask myself the same question. And really, you know, I can, I can go back to a quite an early age, actually, when I started to get interested in kind of the predictive analysis space. And I was one of the first guys in my class. And we're talking over 40 years ago here to get a personal computer. And I spent a lot of time developing applications that had this kind of predictive side to them. So at this point, I'm kind of 12 or 13 years old. So I was looking at, you know, football predictions, things like that, taking in data from the newspapers, because obviously no internet back then and plugging that in and trying to predict based on those metrics, what the school would be. And that I think is the first exposure for me in that kind of predictive analysis space. What then fueled? And I guess empowered me a little bit more to, to have the right skills required for Algo trading was my first job. So after university, I went to work in a research department at another university. And I was actually working with the PhD guys there, developing software applications to help them do their research. And in this space, you know, we're talking vast quantities of data, quite sophisticated kind of signal analysis capabilities around that data. And again, you know, all of that knowledge and that skill set that I got as part of doing that job really serves me now as an Algo trader, because, you know, the data analysis side the the ability to take information in and form some kind of an assessment and a prediction out of that information and that data is the way I typically operate as an Algo trader. So there the two things I think set me on that path, but it was actually many, many years later that I actually committed to to trading. I didn't really apply it to the trading space at all for probably 20 years. Yeah, your first sort of chart with moving averages on it while you're working at Cable, I think we were talking about this earlier on. And I was working for a, for a big software company, a big American software company. And while the guys I was working with in the office, he said, come and have a look at this. And he showed me that the stock charts of the company that we were working for. And he don't relate two lines on this, two moving averages. And he said, look, when this moving average crosses this one, price goes up. And when it crosses the other way, the price goes down. And of course, we all know it's a lot more and more to it than that, but that was something that just triggered something in my kind of, in my consciousness. And I then took 12 months out, actually, from work to travel around the world with my, my wife. And I kept thinking and coming back to this thing, this guy said to me about the moving averages. And as we were traveling around, you know, there's no, kind of, we didn't have mobile phones back down and things like that. And so I used to stop off in internet cafes really around the world, get information about technical analysis, different kind of techniques, trading techniques and so on. I get them, print them out and read them as I was traveling around. And it was when I came back from my travels that I actually started to put things into place to start looking at how I might apply my skill sets that I got with this new knowledge I gained to try and tackle the financial markets and kind of start there, I guess. No doubt you started discretionary trading back then. What, what was it that, you know, created that transition? How did you go from discretionary to systematic? Yeah, so you're absolutely right. So at the time, I always think quite naively, actually. I tried to certainly trade in a quantitative way. So it was still, you know, I was still looking at the analysis, but then I was actually placing the trades manually. And I did that for too long, too long, two, three years, I think. And it did not suit my kind of, my own style. It wasn't a style that was good for me. I don't have patience Simon. I am, you know, one of those people that I cannot wait for the right time to enter a trade if I'm trading in a discretionary way. So I do my analysis, I work out when I enter and I just couldn't wait to get in early. Okay, and I'd pay the price for that. The other time is when I get up in the morning, look at the charts and realize I'd missed an entry maybe an hour ago and I'd still enter, I'd enter late. I just did not have the, what's the word I'm looking for? The discipline. I didn't have the discipline to trade in that way. And I learned the lesson over a couple of years, but I knew, I still knew if I followed my rules, I would have been profitable. And at that point, I thought that what are I doing here? You know, I've got the skills to develop these strategies into algorithms. Why am I messing about with discretionary trading? Why don't I build them? And that's when, that's when things started to change for me. And, you know, I started to then see profits coming in. And obviously you get to that point first where you start to break even, it's a real milestone. So you start to break even, then you start to drive profits and you just go on from strength to strength from that point forward. And since then, you know, that's been my, that's been my way of trading, you know, there'd never be anything other than an algorithmic trader. 100%. And so you're trading today, Martin, like give us a really high level, like where do you philosophically fit into the picture in terms of the markets that you do spend most of your time on or the timeframes and the strategy styles that make up your portfolio? What's the, what's the high level for you? Okay, so, so I know a full-time trade. you know I don't I don't work and I have been for the past six years and so I have a lot of time now to dedicate to the analysis side of things and so the approach to be completely honest that I take is it I don't restrict myself to any particular asset or asset classes if I think there is a way of gaining an edge from a particular asset class then I'll pursue it, I'll do the analysis, I'll do the work and you know and come out with something as it happens most of my strategies have tended to be most profitable on currencies so predominantly I trade 28 currency pairs but I do also have a strategy that operates on gold and I have actually more recently started to look at an algorithm that's based on an AI model I've developed around portfolio construction for a longer term stock portfolios, but typically at the moment my time frames around my normal go trading that's live at the moment is about kind of you know intraday up to about five to six days in duration for for trade but as I say I'm trying to diversify really with the with the stock selection the stock portfolio side of things where that will be much longer term so I might sort of rebalance that portfolio once a month something like that based on what the AI model I've developed is is telling me so just trying to diversify really around both assets and time frames and I imagine you'd be quite agnostic to the style of strategy if something's got an edge you'll probably pursue it or do you have a tendency to lean toward a trend following camp or a mean reversion camp or is it any of the above well certainly from from the perspective of what I've found is the easiest kind of strategy to develop they're usually based around mean reversion concepts so I have a lot of strategies the bulk of strategies probably around mean reversion concepts but also you know I have some breakout some other trend following strategies I've even tried pairs trading in the past but didn't have much success with that so I don't have anything alive at the moment in that pairs trading space but yeah absolutely I try to diversify try to have as many different types of strategy as possible because you know with different market regimes obviously when some strategy types are doing well others aren't and then things change and it's it's the opposite so the ability to have a range of strategies that operate together in the same accounts comes to helps to smooth the reality that the equity curves but what I found you know easiest to develop have been the mean reversion type of strategy now I can't get you on the show Martin and not ask about Darwin X because anyone who knows YouTube you know probably knows your face from being the face of Darwin X for well I don't know how long you could tell me and I'm quite happy to to continue the conversation we were having offline too about the reality of of commercializing trading and the nature of prop shops and and that kind of thing but I guess tell people what Darwin X is and give us a few of your learnings from your time there and then for people who do want to think about commercializing their trading what are the options on Darwin X and are there some things that you can do and can't do and should know and if you that kind of thing and I guess just to add a bit more context to this too like I've mentioned this to to my community recently that it's a very viable thing to consider if you're getting into trading or you're trading your trading well is to have a plan where you could imagine trading external capital it's it's a it's a really logical way to actually generate increased returns from your trading and what I like about it as well is that the pressure comes off a little bit from trying to make those unrealistic returns and becomes a little more institutionally minded about well let's just make consistent returns and survive and you can do very well with that so I think my two cents but going back to yeah tell us about Darwin X what it is your time there and let's talk about commercializing trading sure yeah well you know you've made some really important and valid points there I think and to just to be clear before I ever worked for Darwin X I was a customer of Darwin X in fact I was one of the first customers so when Darwin X first you know starting to make their offering available I think I was kind of trading number 10 to join the platform yeah well and by the way still am and and a trader with Darwin X and very much an advocate for what those guys are trying to do because they really distinguish themselves from from other participants in the in the space and so it's probably worth well saying what Darwin X does first of all because I'm sure there will be people who aren't aware of that so Darwin X acts as a a regulated asset manager and they enable skilled traders to come onto the platform and they provide a mechanism where they can join those traders up with with investors with real investors coming into the platform who want to invest in trading talent but Darwin X operators that regulated asset manager in the middle okay so from a trader perspective what it means is that I can be completely legally attracting investor capital without having any without having to be regulated myself so it's a real great opportunity for traders as you put it to commercialize themselves and to commercialize their efforts to really increase the amount of revenue that they're generating and you made another a really important point it takes the pressure off okay if you're only trading your own capital there's always that pressure to start you know up in your position sizing to try and make more money and if you go too far you start to over leverage and you risk effectively bankrupting yourself because it only takes one really bad drawdown and if you're over leveraged then you know that's that's that's a prime case for for bankrupting your account you know and we all here have traders who do this again and again and again with Darwin X it's different okay you can keep your position sizing really realistic because if you're successful you won't make the majority of your money from your own account you'll make the majority of your earnings from the performance fees you get from investors so the way it works is that any profit that investors get they pay a 20% performance fee three quarters of that goes down to the trader and a quarter goes to Darwin X for acting as the regulated asset manager it's such a good model in an over regulated world where it is so difficult like to to actually launch a hedge fund especially in my country you know the regulatory costs are just prohibitive and so I love the fact that these alternatives have come online and you know there's there's a few ways there's a few alternatives out there and the other ones are like the pod shops or not the pods but the prop firms where you know you can also come in and trade their capital it's slightly different right it's their capital not necessarily external capital and you know we were saying that we're not really impressed with the way the vast majority of those operate so it's worth saying that the models are completely different okay between what Darwin X is not a prop firm and fundamentally the difference is that with with prop firms they are relying on traders on the majority of traders actually losing money in order for them to make money so the the kind of the the objectives of the trader and the prop firm they just log ahead with each other that they're not the saying. With Darwin X, Darwin X only profits when the traders are profitable. So there's complete alignment there. Darwin X wants its traders to succeed. Proc firms typically don't because they wouldn't make any money if they did. Okay, so that's the, and that's the reason actually that Proc firms put so many restrictions in place around draw-down remits, around all these other things that could potentially cause traders to fail and then have to resubstribe again to get a new account. Okay, that's how they're making their money by churning those traders. With Darwin X, they put no restrictions on how the trader actually goes about their skill. So they say, look, you trade, how you want to trade, how you think is best to trade. And if you're good enough, you're attracting best to capital and you'll make a really nice living. That's the difference. There's complete alignment. So it's like sure can choose, you know, comparing a pro firm with Darwin X, you're absolutely spot on. Yeah, yeah, it really is. All right, that's wonderful. Really appreciate that. Was there anything else that I missed? Did you want to say about that Darwin X thing? I can't recall if there was something else. Well, there's just one more thing I will say. Okay, so Darwin X have two offerings. Okay, so depending on where your viewers are, if they're looking at Darwin X, if they are already profitable, then Darwin X has a full brokerage offering where you can trade your own capital and of course risk your own capital. And that track record is then used to attract investment if it's good enough. Okay, but what Darwin X also offer is another offering called Darwin X zero. And the zero here means zero risk to the trader. So what Darwin X do here is they give you a virtual account. So if you've got traders who are kind of breakeven, they're not quite profitable yet. This gives them an opportunity to start building a track record without risking their own capital. And then once they get good, you know, once they get profitable, they can then migrate that over to a full account. So there's a kind of a journey there to help traders on their own journey to become profitable and investable traders. Yeah, I think it was a couple of years ago or not quite that long that Darwin X introduced this mechanism where you can just continue to trade on your interactive brokers account. As you would today, they'll connect into it. They can pull your track record and then you can continue just to trade on your account. And yeah, it makes that makes that right. Initially it was just matter trade run T4 and T5 and they do have now this offering for for interactive brokers. So you can either open up a new interactive brokers account or I think you can, you know, take your register account and kind of migrate that over to Darwin X. Well, anyway, Darwin X, if you want to sponsor this show, you can. But at the moment, they're not. So, you know, I don't work for Darwin X anymore. Okay, but I'm just, I'm just a huge advocate. I believe in what they're trying to do. And I believe what they're doing is the right way of going about things because it helps traders like me and you to become credible traders and revenue. Yeah, 100%. No, I like what they're doing too. I have spoken to the leaders there in the past and a couple of the guys that you know. And so we we might try and get some of their star traders on the show. We'll see what we can do there. All right, Martin. Well, thanks, heaps. I think we should move into the presentation and yeah, get into what you've got for us there. Because it gets getting to the meat of it and really looking forward to this. Traders, crypto is not a wild, unruly market. It's an asset class with 500% more time for price discovery and opportunity. My new course, Crypto Traders Edge, is now live through Algo Advantage, one of the top quad pods and academies out there. A full systematic framework, back testing, strategy development, validation, real edges with full code, not hype links in the description, or head to my sub-stack at react intelligence. Now back to the show. Okay, so I want to start with what what I think is possibly one of the the biggest pitfalls and the biggest misunderstandings really. That certainly you know, I speak with a lot of traders. So every week I'm talking to traders going through things. I do offer consultancy and and it's pretty much the traders that come to me all have similar misunderstandings about the data they're seeing and similar misconceptions about what they should be doing and the approach they should be taking. So hopefully you can see the chart I've got on the screen. I want to just use this, this is just it's made you know fake data but just to illustrate the point here. So it's really simplistic and I want you to imagine Simon, you've got an optimization on a particular parameter. It could be anything, it could be a moving average what's so. So you've been doing some work to see how you know maybe a moving average affects the the directional bias of a particular strategy. So along the bottom here on the x-axis we've got the parameter values that you've tested and then on the left hand side on the y-axis you've got some kind of measure of performance. So I'll just use sharp ratio as an example. Now the line that I've or the curve that I've drawn on the chart there represents if you like what is the true edge of that particular strategy or parameter. Okay so as you can see here you know we're looking probably at a value of about 65 as being the optimal for this particular parameter be a moving average or whatever. But we're looking here at what is the genuine edge of this parameter okay. Unfortunately life isn't that easy and when you see charts you don't see nice charts that tell you what the edge is because different things get in the way and distort the information. Now as an example economic news is one of the most major aspects of any back test or optimization that gets in the way of giving you the information that you really need to make decisions. Okay so let me give you an example. So we can see here that the parameter we identified that actually has the best edge. When we get to a point of looking at that in reality and the real results of the back test. As you can see the parameter with a value of 65 it doesn't come out that well actually and this might be because it's being negatively affected by the effects of economic news. So what does this mean in reality? So all of these parameters will have different positions open in the market at different times. And if you've got a strategy that may be where the positions last for three days, five days, seven days however long during that period of time while a position is open it's going to have lots of it's going to be impacted by lots of economic news that is occurring during that time frame. So you know some of the some of the biggest market movers fed interest rate decisions non-farm GDP results and so on. These all impact the markets and they either cause the asset that you have a position open in to go up or go down. And it's more or less kind of chance as to which way they're going to go. You know unless you've got inside information you do not know which way a particular piece of economic news is going to make the market go. So in this particular example our optimal parameter of 65 just happened to be negatively impacted, which means that maybe if this was holding an asset long the economic news more often than not during your back test period affected it negatively and went against the trade. And so that has the effect of pushing the perceived performance down. And if we look over here for this parameter that has a value of 50 this was nowhere near as good in terms of the true edge of the strategy but it's the other way here. This just happened to have positions open at times when by chance they were positively affected by economic news. And so that has if you like made this parameter value look better than it really is because this here is the if you're trying to measure the edge of the strategy this is how it performs. So this one has been elevated and this one has been demoted. Okay and so you don't get as an elbow trader looking at a the results of an optimization you're not being told the information you actually need to make the best decisions. Okay now this is this is critical and this is a really important thing to to remember things like the reaction of markets to economic news they are non-repeatable events. So if you're making a decision from back test data that's been influenced by that when you go live with a strategy you can't expect just because something did well in the past because it was affected by economic news in a good way you can't expect that same thing to happen in the future. It's pretty much going back to 50/50 it might be by chance or it might you know disbenefit from it by chance. However it's different when you talk about the true edge of a strategy because that is something that is repeatable. If you perform a back test and you're able to identify parameters that have genuine edge when you then trade those in the future in your live account you can expect that edge to persist and to be able to make money in your live account providing that market dynamics don't overly change. Okay if market dynamics stay broadly similar you can expect that edge to be repeatable in the future. So one is not repeatable the other is and so the challenge as I'll go traders sorry I could actually just say yes so so if you've got an optimizer a list of optimization results like like the one here the fact is that the the parameters that appear at the top of that list are probably at the top of the list because they've been favorably impacted by economic news. No other you know there'll be some elements of edge in there as well but they're there because they've been positively affected so just by choosing the top performers in an optimization and then trading those you cannot expect them to to trade as well in in the future as they did in the past and that is the key I believe what I've just explained is the key reason for that. So let me just play catch up and make sure I'm following along if we go back to the previous slide so what you've put up and some people will have audio only get on Spotify or YouTube if you want to watch the the slides so there's the initial chart you know shaped like an upside down U high point in the middle so this is basically you know you're kind of like running an optimization on a single parameter and saying well the value of 65 also gives you the best sharp in a back test. Yeah exactly. Now in reality what can happen is that there can be other factors noise news and so on that means that of course that particular parameter value may or may not actually deliver the expected result because there could be an upward or downward impact of news say is is a way of framing this is saying well we so we want to find the real factor involved in producing the alpha and strip out the noise exactly yes you you yes you have taken the words from my mouth okay that is exactly what you know over the last few years I've been working on trying to achieve yes yeah it's it's filtering out those elements that are not useful yeah I'm retaining the elements i.e the indication of edge of the strategy keeping those in so yes absolutely right which then helps to deliver alpha in the future because you're making better decisions so have you got any more questions or do you want me to move on just one more quickly were there any key names people maybe that influenced you when you first started having these thoughts because I'm just thinking about John Ellis or Kauffman's efficiency ratio or you know things where people are making this case of trying to find the the signal in the noise through various methods I don't know was there an influencer someone that got you thought thinking about this so I know that's an odd question perhaps yeah so so the biggest influencer by far is Perry Kauffman yes you said it right so so he I've got I've got a bookshelf there which has got all of his books on and you know the guys guys are geniuses a rocket scientist right he worked on the Gemini missions and all of that this guy knows what he's doing with data and and Perry was a a huge influence and also actually I am a massive massive advocate of the Kauffman efficiency ratio I love it it is really but it doesn't provide a solution to this problem I'm talking about all right okay well I will let you go on but I will I will put a little advertisement in here because I'm working with Perry to produce a trend following course for I'll go advantage so keep your eyes open for that in the future yeah so I I've spoken to Perry on a number of occasions myself and I think you know anybody should tune in to that to those Perry Kauffman sessions with Simon because the guy is just full of such useful information and yeah you know I'd encourage anyone and I certainly will be tuning into and of course he was on the pod I can't obviously remember off top my head what episode it was but it's a fantastic podcast with Perry he is a lovely guy and has an enormous amount of experience so you go back and watch that that episode with Perry if you haven't seen it yeah so I've learned so much from from his books and if there's any viewers who don't have those books I've just just get them you know some of the books are a bit expensive but they're worth every single penny and and you know the the thoroughness that he uses to explain information and techniques is just beyond what I've seen with anyone else so yeah anyway all right so so so moving on through through here then so we've got what we need to do exactly as you said Simon is take this rather erratic kind of light blue line that we've actually got in our our optimization and we need to make it more similar to what we're actually trying to identify which is the edge okay now in this example I've kind of represented what that might look like and so now instead of choosing that value of 50 that we were before that didn't actually perform so well we're now much closer to the optimal of 65 and we're choosing now this value of 70 because that's the That's the kind of, you know, the most robust value if you like from the chart we now have. But of course, the key to this is well, how do you do this? So what I have, you know, from the research I've undertaken is that I've, I've come to the conclusion that the strategies edge that you're trying to target is relatively smooth, okay? It changes gradually across the optimization space that you're looking for. And that kind of makes common sense as well because, you know, why would you expect it to be up, then down, then up, then down? You'd expect the genuine edge to change gradually across the optimization space. And I always like things that make common sense because, you know, to me, it says, well, if my research has shown this is the case and it makes sense, then that's good. However, what you will find is that the effects of distortion from noise and economic events is much more erratic. Here, you'll find that it is up and down because different parameters get affected by non-farms just because they were holding long at the time, or the ones negatively because they were holding short at the time. And you get this erratic nature to the data that you're presented with from the optimization. So you've got another way of looking at it is low frequency changes and high frequency changes. And I always like an analogy. Okay, and the analogy I have here is something that certainly anyone who produces podcasts or any kind of audio will be able to relate to immediately. When you record audio, there are two components to it. You've got the sound that you actually want, someone talking, music, whatever it is. And then you have this other element called white noise, which is the background hiss. - Yeah. - And the background hiss is high frequency, very, very high frequency noise. And the sound that you actually want to retain is much lower frequency. So you can use a technique called a low pass filter. It's a sound engineering technique. Also, you know, electronics technique. And what that does is it allows the lower frequencies to persist, but gets read of the others. And through that and an element of smoothing as well, you can actually reduce those effects of noise and economic use, okay? So let me give you a real example. So this is just, this is kind of data I just used to illustrate the point. But if I bring up, so I used to do all of this manually, by the way, used to take forever. I've now developed this into a software application, which I use myself, but also I do make this available to other algorithm traders as well. So what we have here is if you like, the raw results from an optimization I've performed. So here we're looking at two parameters, simultaneously on a 3D surface. And you can see here that, you know, this is, it's really erratic. And if you were expecting to make any decisions over well, you know, what's the best kind of area? What's the most robust area on this surface? - Yeah, where's the stability? Where's the smooth part of the surface? It's very jagged, there's a lot of noise. - Really jagged, a lot of noise and, you know, normally you won't maybe have quite as bad a surface as this. I've chosen this because it is particularly bad and particularly affected by noise. And in this particular case, the reason for that is because the underlying edge of this strategy is actually very, very small if they're at all. Okay, and this is just an example, Algo, that's come with a trading package. It's not meant to be a profitable trading strategy. But because that edge is so small, it means that the effects of noise in relation to that are much bigger. And so you get this really jagged, unintelligible mess of data, okay? - Yeah. - But, so I have this technique, which I call it intelligent edge detection. And this is doing that process I just talked about. It's smoothing and it's using that filtering to filter out the noise. So if I turn this on, you can see now, you get a much clearer picture of what's actually going on behind the scenes. You can see, well, you've got a really bad kind of area down here. And you've got a kind of a number of peaks on this side that you just couldn't really see before. And so through this process of filtering out, you start to be able to identify, okay, you know, the important data, which is that data that is likely to be repeatable in the future after you've chosen the best parameters you would hope they would continue to be fairly optimal in the future, okay? So that is, if you like, that's the first of five areas that I wanted to talk about. And I guess if you wanted to sum that up, it would be the fact that noise and these undesirable effects of the market hide the real edge of your trading strategy and under your ability to make good decisions on that data, on those results. And so through this process, I think I've come up with something that by no means is perfect. There's always going to be some element of noise in your back tests. Let's be clear, you're never going to get rid of that. You can see that here, there's still some noise. Yeah, but the more you can reduce it, the better informed decisions you can make. Right, so Martin, what I'm getting out of this so far is, correct me if I'm wrong, but what I like about this is that you are, you're not trying to select the best after the fact. You are in the research phase here. You are priming the data as it were so that the data is in a better position to give you real answers. 'Cause you are, you're in this research phase and this is something I've been talking a lot about as well. Like staying in this research mode longer, rather than jumping into a strategy and pressing optimize. So you're defining your research goals as it were and you are aware of the fact that there's noise that's getting in the way of the analysis. Therefore, you want to apply this post-processing of the data to put the data in a better position to tell you a better story. Is that a good way of saying it? Am I covering the bulk of it? Are there other aspects to this? Absolutely right, so there are multiple reasons why you might perform an optimization. And you might be doing a final optimization on parameters before you go live. That's kind of not what I'm talking about here. So what I'm talking about here is you might be at the stage where you're researching some kind of a filter to identify if that filter has a genuine edge or not and actually helps your strategy. So while you're in that research phase, being able to look at the data in a way that filters out all of that noise, it will help you come to those conclusions in a much better way as to whether yes, this does offer value to the strategy or maybe no, it doesn't. Whereas with all of that noise and play, if you're making this decisions based on that you might be making the wrong decisions and you might conclude that something is valuable to the strategy when it isn't. It just happened to get positively affected by news and that's not what you want to be making decisions based on. So we're dealing with overfitting traps and am I am I right to say that probably all of the points that you're going to raise are broadly speaking under this category of how to avoid overfitting. Yeah I think most of them are actually and and I guess what I'd say there is that overfitting is a huge topic of conversation and every algo trader has this idea of what they may be think overfitting is or they might just think it's bad and what I what I think actually you know is in play people talk about overfitting without getting into the nitty gritty of what it actually means and what what actually causes overfitting. So what I'm trying to do I guess with some of the some of the things I'm going to be talking about in this in this podcast is putting some meat on the bone of that yeah and that may coming out with something that now this is what it actually means in a practical sense these are the these are the things that are happening in the background that cause it and and hopefully these are the things that I'm saying you can kind of do to get around them and to alleviate them to some to some degree. But yes I think you know overfitting is a big problem and what I'm trying to do here is is really quantified what overfitting or what the different elements of overfitting are because there's there's many. All right so smoothing the data trying to separate the noise from the factor the real edge contributor in the data what else have you got for a smoothing? Well I guess you know staying on that theme of of overoptimization it really brings me to I guess one of the first things I I realized really early on in my my journey as an algo trader that is the real big killer and that is statistical significance and and sample size in the the research and analysis that you are doing. So I actually probably I think about five or six years ago decided to perform some fairly in-depth research into you know what kind of sample size and by sample size I'm talking about you know the number of trades that a trading strategy produces in that in-sample stage of your analysis okay and you can you can tell so that's me in the call about this is actually a screenshot of a video I produce. I think I've seen this video. I'll have you yeah yeah yeah and this this was and even though I knew what I was setting out to do with this research this was a huge eye opener for me and it really moved me along in terms of my understanding of of what was required to produce statistically significant back tests that you can actually trust the results of okay and I tell you I must have three four five people every week who contact me and say they've just seen this video and it's completely changed the way they they look at back testing now okay so walk us through it okay so I'll I'll it looks like a really complex mess that but but let me let me talk through what my my methodology was and what I was setting out to to achieve so if you go on to trading forums you know you try and research information about what is a statistically significant number of trades so that you can look at a back test and believe those results there's an incredibly there's an incredible I think naivety out there about how many trades you do need and many times on many forums there there are there are traders who say you know you're gonna have to have at least 50 trades for it to be you know statistically significant enough to to look at the back test and say yeah that's that's genuine results and that never sat well with me I'm like 50 trades does does not sound as though it's enough trades to be able to trust a back test so I set out on this mission to come out with something that was more quantitative and based on actual research that gave me more of a definitive answer so let me tell you I thought long and hard about how do I how do I do this and the method the methodology that I I eventually came up with was to take a a simulated strategy that had a particular level of edge okay and the way I did it was I had equidistant stop loss and take profit on a particular strategy and I engineered one of the permutations of the strategy to exit at the take profit 10% more often than it exit exit at the stop loss so in other words 55% of the trades would be profitable coming out at the take profit 45% of the trades would be lost making exiting at the stop loss and then for all of the other permutations that I was looking at it was 50 50 it was completely random okay so the red line that you see here is like a simulated back test using that 10% of edge every other line that you see is completely random okay and what you see is that there are out of those those random permutations there are examples lose money there are examples that win money and there are examples that break even and everything in between so this is a simulation okay so this is simulation it's not stock data it's not no data yeah not at all it's a simulation of saying look these strategies have a 50 50 so these parameter or permutations have a 50 50 chance of either winning or losing let's room that through a simulator and see what kind of equity curves they produce based on complete randomness okay whereas the red line we see here well that isn't I get I specifically engineered that to have a positive edge yeah okay and it's it's a it's pure simulation but that achieves what I needed to get out of this so if you look at the right hand side of the chart so obviously they all they all start out at the same point okay with the same amount of equity you then run through all of these permutations and what you notice okay the the red line that has the edge is overall profitable but and this is the important point there are random strategies that perform better and the strategy that had the edge okay so in this particular example let me just look this is 500 traits okay so each of the permutations has 500 traits and after 500 traits there are one two three four possibly five of the of the permutations that were completely random that performed better than the strategy that has a genuine edge okay and that should be worrying to any algorithm trailer because Think what that actually means, if you had run an optimization and some of your parameters did have an edge and you're trying to select those and other parameters don't have an edge at all, maybe they break even. Just because of randomness, you might select a parameter set that has no edge. That's what it means, it's really, really important. That's what happens with low sample sizes, so let me go on and show you a couple of other examples here. This is another one, so you can run this thing through as many times as you want and every time it will give you different results. Here it's even worse. The thing that has the genuine edge, it's barely profitable if it's all wrong. Have you run this through more iterations now as it's longer or just a different run? It's still 500 events. This is a different run, but still assuming there are going to be 500 trades at the moment. Right. So this is the same, still 500 iterations, but the strategy with the edge fell a bit better here. You still wouldn't have chosen it if you were choosing just the highest value because there is one random strategy that just happens to perform better. But you're much closer to actually selecting it, okay? Now this is the key chart. What we're looking at here is how this plays out now over two and a half thousand trades. And what is clear is that the bigger the sample size and the longer you give a strategy to actually show its full potential, the more it will distinguish itself itself from random parameters that have no edge, okay? So it's extremely clear here that one of these strategies has an edge and the others are kind of just random and really clear. You couldn't see that with just 500 trades, okay? And if you look back here on the chart, 500 is about kind of here. And you can see there are some that are still outperforming it at this point, but over the long run, it begins to show itself and show its full potential. And that's the key thing. We've made this point before too, but it makes me think of all the fund managers sitting around in those early years they're having, you know, really they've done less than 500 trades. And all their peers have done 500 trades over the last could be quite a number of years. And they're all at that point still indistinguishable from noise, really. Exactly. And the kind of conclusions that I, at the time, drew from this and still hold by, by the way, is that for a strategy that has this kind of level of edge, and I've termed it, you know, it just basically just 10% more of the time is profitable than it is lost making. So it's the 35, 45 split. With that level of edge, my belief is that you need about 1000 trades to have confidence in the results that you're seeing. Okay. Now, what I've proven with this analysis is that if you have a bigger edge, if you develop the strategy that has a better edge than that, you need fewer trades to have the same level of confidence. So with the strategy that has a really great edge, you might then only need 500 trades to have that confidence level. But if you have a strategy that has a weaker edge, you might need 2000 trades or 5000 trades to have the same level of confidence. So it all depends on how good the strategy is that you're developing and researching as to what you actually need. So there's no single answer to what sample size needs to be, to give you that statistical significance. It depends on the edge, but hopefully what I've conveyed is the principle here. You know, as you can see, you know, from this curve, this long term curve, this 10%, it's not half bad, you know, yeah, there's some drawdowns in there, but it's not too bad. It's pretty good. So even for something that produces that kind of result, longer term, you still need about 1000 trades. And I have traders who come to me for advice all the time and they'll say, you know, I've got a strategy, it works on, it works on pound dollar, you don't work on anything else, it works on pound dollar, but when I put it live, it kind of, you know, it loses money. And when I take a look at the backtests, they might have 60, 70 trades, you know, and what I say is there's nowhere near enough to be able to have any confidence in your back test, none. So you know, it doesn't surprise me at all that when they put that live, it doesn't make any money or lose this money because it probably never had any edge in the first place. You've given away, you've been diluted. Yeah. And you've given away a good example there of how to get more trades is, you said they'd looked at only one market. If you're, if you can run a strategy across many, many more markets, you're giving yourself more data points, aren't you? You are. You are. So I was going to talk about this maybe in the second session, but I'm thinking on the fly now and thinking maybe it would be better and make more sense to bring that forward into this session and probably given the time so far, that would be the kind of final thing we'd look at. But I think it would be sensible for me to just briefly cover that now if that's all right, Simon. Sounds good. Let's do that. So coming back to the point you rightly just made, you know, there are things you can do in order to increase the sample size and therefore statistical significance of the results you're seeing. And, you know, relatively easy ways of doing that are, as you said, by increasing the number of assets that you're performing your analysis on. But also I found it really beneficial to look at multiple time frames as well. So my view is that on the whole strategies, if they have a genuine edge, they should work on multiple assets and maybe within an asset group, but also potentially even across different asset groups. And so anyone who says they've developed a strategy and it only works on Dalian or only works on the S&P 500 or whatever it is, I'm always very skeptical that because they've done that, they probably haven't got much data, their statistical analysis is probably suffering because of that. So I'm always extremely curious about whether they have any kind of strategy at all. There is one exception to that for me which is when someone has gone out to develop a strategy that is specifically targeting a unique characteristic of a particular asset and they've managed to do that, then that's the kind of the exception. So if you look at Dalian, Dalian tends to have good trends that seem to be able to be captured relatively effectively with trend following strategies, much more so than some other currency pairs. And so if you're targeting something that's very, very specifically looking at an aspect of the price action or the characteristics of how that price action moves, then I'm kind of okay to accept that. But if you've just developed a general strategy, like a mean reversion strategy using some kind of indicator, and that only works, you know, you tested it on 28 currency pairs and it just happened to work on one of them that I'm not comfortable with. For me, that's randomness and you haven't really probably got a strategy at all. So general strategy. really speaking, I like to see, if I develop a strategy for example, so I do trade currencies and I typically trade 28 currencies, which is the, you know, the crosses from the seven major currencies, I'll want to see a strategy work on at least 50% of those currency pairs. So that's what I'd be looking for anyway, that kind of, does it work on at least 50% of the assets I've tested it on and that I've researched? And what does work mean? Like, do you have, so say you've got your testing an idea for dollar yen or, well, for currencies, say, and you have this rule that says, I'm going to try the same thing on all the other markets, it should work on more than 50% do you expect less of it like potentially that, you know, maybe it will shine in say, you know, because if you think of the futures markets, for example, you've got currencies, you've got commodities, got soft metals and so on, equities, if the strategy is expected to do equally well on those 50% that could be asking a lot, or do you have a sort of a lower threshold to say, well, look, as long as it passes these bars, then I know that I'm generalizing, this is going to generalize well. Yeah, so if I developed a strategy for a particular asset, which by the way, I don't tend to do, it's not a kind of thing I do. But if I had, then I probably wouldn't even test it on anything else because if I was, if I was, you know, targeting a specific element of price action, then we're probably not going to work on anything else anyway. But from the other perspective, so I like more generalized solutions, I will start out from the very outset trading or researching it on 28 assets, for example, from the get go, and I'm kind of, the approach I tend to take is that I will, if I trade a strategy, on let's say I end up trading a strategy on 20, 20 assets, I'll use exactly the same settings for all 20 assets. Okay, what a lot of traders will do is they'll optimize against your dollar and they'll trade your dollar with a certain set of parameter values. They'll then optimize separately on pound are and they'll tweak the parameters that are used to trade that. But for me, that is just introducing overfitting again. So the way that I much prefer to do it is to say look, I do, I do my tests on all of the assets together combined, which gives me a really high sample size, first and foremost, which I can trust. And it proves that I've managed to produce a generalized set of parameters that work across the board. And the argument I always get given to me is that, but yes, pound dollar moves slightly differently to your dollar, slightly differently to pound yen, whatever. And my, my response is always, well, yes, I am, but I've got a lot more confidence in the strategy that I'm, you know, if I'd optimized to each of those asset or asset classes, I wouldn't have the same level of confidence in the strategy simple class. And I would think to myself, I've overfitted here, or I potentially overfitted, but I taking the approach I take, yes, I might not be targeting specific price characteristics. And so might be losing a little bit of profit there, but I'm a lot more comfortable trading it, because I have 100%. And will we come in the part two to maybe some of the metrics that you look at the way you're sort of building a quote unquote objective function of coming back to this word work, right? What are the strategy works? Like, can we come back to some metrics around what you look at to define that it's working? Yeah, okay, great. In fact, in fact, that was actually going to be one of the, that was going to be the final thing I did today, but then based on the way our conversation went, I thought this may be made more sense to do it. Thank you. I think the first thing I would think for part two. All right. So I mentioned then, you know, as well as this, this ability to diversify across assets and asset classes, it can also be very powerful to look at how strategies perform across multiple timeframes. Now again, there's a kind of a caveat here. There will be some strategies, let's say some day trading strategies where you will devise a strategy that trades at the market open and closes sometime before the market closed that day. That's not a kind of strategy I'm talking about here because clearly with those, in the very nature of the strategy makeup itself, you've kind of decided, well, look, every trade is going to last less than a day and we're going to open pretty much at the beginning of the day or not at all. And then if we did open, we close at some point that's preferable when we've seen the market move that we anticipated. I'm not talking about that kind of strategy. I'm talking here more about maybe swing trading strategies. So you might have developed a mean reversion strategy that might keep you in the market for three days. It might be sometimes be five days or even more than a week. And when you look at those types of strategies, you can then feasibly say, well, if we're using some kind of overboard, oversold measure on, let's say an hourly chart, let's see how it performs if we look at that same overboard, oversold measure on a four hour chart or on a daily chart. And very often what I found is that if you've got a strategy that does have a genuine edge and you've proved that in a statistically significant way, it will very often work on other timeframes and produce relatively uncorrelated positions in the market that you can trade alongside each other. So for example, you could trade things that came from a signal on a one hour chart in the same account as that same strategy working on a daily chart. And because those timeframes are sufficiently different from each other, they should create uncorrelated trades, which then of course, you know, if both are profitable, it helps your return, it helps reduce your drawdowns because you may well have, you know, a trade in Aussie dollar in the one hour time frame that's long and have a short Aussie dollar position from the one hour. And so they kind of, you know, net each other out for the period that they're both open. And generally, that has the effect of reducing drawdown overall. But what it also does is give you that added confidence that you are looking at statistically significant results, because if you have a strategy that maybe has 5,000 trades that are generated from these 28 assets in the one hour chart, that's great. But as you go up the time frame, your trade numbers reduce dramatically because you get a lot fewer signals. So by the time you're in the daily time frame, you now might only have 600, 700 trades compared to 5,000 that you got in the hourly time frame. And so on its own, if you were just using that daily time frame and nothing else, you might look at that and say, you know, have we got enough trades there to be statistically significant. But if you've got the backing of the fact that that works as well, you know, hourly time frame with 5,000 trades, that can give you that added confidence. Yeah. So there's kind of two things you've covered there if I got that correctly. One is as a testing mechanism, as a robustness testing mechanism, you can confirm that the logic applies to the edges found on different timeframes and the second part is the actual ensemble application where you can deploy multiple strategies on different timeframes in order to get better risk adjusted returns. Is that right? That's exactly right, yeah, absolutely, yep, yep. And there is just, there's one final point really that I kind of want to make, which is something I have, you know, I talk a lot about these discussions I have with different traders. And another topic that I've heard maybe not come up quite as often, but certainly, you know, enough to mention this is that traders that I've spoken to often optimize on the time frame. And what I mean by that is they might, you know, they've developed some kind of sophisticated technique within their, within their algorithm that is able in a single back test to trade multiple timeframes. So like a bar size of 15 minutes an hour, a two hour bar, four hour bar, run the back tests on all of those different bar sizes, yep. Exactly. And what they come back with is, and, you know, it was the, it was the hourly time frame that was the best. So that's the one I'm going to trade. And the first thing I say as well, I personally think that's the wrong way to approach this. Yes, you can optimize on some things like, you know, the periods you're using for a trend filter, for example, or the, you know, the level at which you're measuring an asset has become overboard or oversold, in which case, you know, where will you enter? These are logical things to perform an optimization on to determine what the optimal way everything the strategy is. But to optimize on time frame can't, doesn't make sense to me. For me, a much better approach is if you've optimized and all time frames are profitable, don't just choose the best one, choose all of the ones that have an acceptable performance based on what your own criteria are. Because then you can logically, if those time frames, as I said before, are enough apart, you can trade them in the same account and actually get some level of diversification there. I did ability to manage risk, reduce draw downs and everything else. So it doesn't make sense to, and I thought it was worth mentioning because a number of traders have said they've done this to me and it's not an approach that I think is a good approach. So there you go, that's me done, I think, for today. Yeah, awesome. Now I agree, you know, to optimize across different bar sizes and come out with the 15 minute and say, well, I've found an edge on the 15 minute bars. I mean, it sounds a little bit compelling to a new trader, but I guess it comes back to this thing to the benefit of being able to explain what your edge is and why, you know, why do you have the edge there at that on that bar size and not on the 20 minute bar, you're asking for trouble. All right. Well, Martin, that's awesome, man. Yeah, I reckon that we should just keep plotting through in part two and cover this, the other points that you've got. I'm really keen to tie it together into this kind of process to see it sequentially of these different process steps that you would go through. And I'm thinking about some of the stuff we can talk about with the members in the bonus section as well, which should be very interesting. Yeah, and play more to get through. You hit on your trading a little bit as well to give some further context, but mate, so far, this is fantastic stuff. So looking forward to part two. Yeah, I just hope, you know, there's been some value in there for people and I've maybe made people think about things in a slightly different way than they have done in the past. And if I have, that's great. Fantastic.

Podcast Summary

Key Points:

  1. Martin Tensley emphasizes testing strategies across all assets together to achieve a large, reliable sample size and ensure generalized, robust performance.
  2. He argues that optimization results are often distorted by economic news, which creates false performance peaks and valleys that don't reflect true strategy edges.
  3. A key method he uses is "intelligent edge detection," a smoothing technique that filters out noise and identifies the true, repeatable edge of a strategy.
  4. He stresses the critical importance of sample size, showing that strategies with weak edges require thousands of trades—typically 1,000 or more—to be statistically significant and trustworthy.
  5. Martin advocates for testing strategies across multiple timeframes and asset classes to avoid overfitting and ensure generalizability, with a preference for strategies that work across at least 50% of tested assets.
  6. He highlights that Darwin X provides a legitimate, regulated path for traders to commercialize their strategies, with performance-based fees and zero-risk learning accounts to build track records safely.
  7. He identifies Perry Kauffman as a major influence, citing his efficiency ratio and data-driven philosophy as foundational to his own approach to strategy development.
  8. Martin warns against overreliance on small test samples or single markets, noting that such approaches often lead to false confidence and poor live performance due to lack of statistical validity.

Summary:

Martin Tensley, a seasoned algorithmic trader, advocates for a rigorous, data-driven approach to strategy development that prioritizes statistical validity and robustness. He emphasizes that traders must avoid overfitting by testing strategies across multiple assets and timeframes, using a combined sample size to ensure generalizability and confidence. A key insight is that backtest results are often distorted by economic news, creating misleading performance peaks—this noise can be filtered out using a smoothing technique he calls "intelligent edge detection," which isolates the true, repeatable edge of a strategy.

He demonstrates that statistical significance is achieved only after thousands of trades, with weak strategies requiring far more data than strong ones. His methodology includes testing across 28 currency pairs to validate performance across diverse markets, rejecting strategies that work only on isolated assets. He also promotes the use of Darwin X as a viable, regulated platform for traders to commercialize their work, offering performance-based fees and a zero-risk learning environment.

Drawing on Perry Kauffman’s principles, Martin underscores the importance of filtering noise from signals and making decisions based on repeatable, not accidental, performance. Ultimately, his philosophy centers on building strategies that are resilient, generalizable, and grounded in long-term data—enabling sustainable, consistent returns in live trading.

FAQs

Testing across multiple assets increases sample size and provides a more robust, generalizable strategy. It reduces overfitting and builds confidence that the strategy works consistently across different markets.

Statistical significance ensures that backtest results are not due to randomness. A strategy needs a sufficient number of trades—typically around 1,000—to reliably show true edge and avoid false positives from noise.

Economic news impacts markets unpredictably, causing temporary spikes or drops in performance. This noise can make certain parameter values appear better than they truly are, leading to overfitted or unreliable strategy selections.

Intelligent edge detection uses smoothing techniques (like low-pass filters) to separate genuine strategy edge from noise. This helps traders identify stable, repeatable performance that will persist in live trading.

A strategy limited to a single asset lacks statistical robustness and sample size. It's likely overfitted and may fail in live trading due to insufficient diversification and data coverage.

Performance consistency across different timeframes indicates a genuine edge. A strategy that works on daily, hourly, or four-hour charts is more likely to be robust and applicable in various market conditions.

Chat with AI

Loading...

Pro features

Go deeper with this episode

Unlock creator-grade tools that turn any transcript into show notes and subtitle files.