¶ Intro / Opening
Chat with Traders is brought to you by Trade the Pool. Did you know that every decade the market reinvents itself? Online brokers opened the doors. Mobile apps made trading seamless. and commission free trading erased barriers. Now a new era has begun. Meet, trade the pool, limited risk trading. And now you also have unlimited time to reach the profit target. From now on, your trading risk is capped. and your trading opportunities are limitless.
Trade the pool funds home-based stock traders with up to$200,000 in buying power. That means you can trade larger positions and scale your strategies without risking your own savings. It's time to trade with more capital, making it truly worth your time and effort. Ready to trade the pool? Click the link in the description and join the stock trading revolution today.
Are you ready to get serious about trading? Then join Tasty Trade, Investopedia's best platform for options trading in twenty twenty six. Options, futures, and more. Tasty Trade has everything you trade all in one platform. Get low commissions, including zero commissions on stocks. So you can keep more of what you earn. Trade smarter with advanced charting tools, a pre-built strategy selector, risk analysis tools, and more features. Visit Tastytrade.com slash.
Tasty Trade Inc. is a registered broker dealer and member of FINRA, NFA, and SIPC. This is the first one. Podcast.
¶ Dave Bergstrom's Unique Approach
Welcome back. On this episode, I am joined by a quant trader who works at a high frequency trading firm. Though you might be surprised to hear he started out on the exact same path that many retail traders do. His name is Dave Bergstrom. Dave is someone who I've followed on Twitter for quite some time. He always has interesting things to share and I've had the pleasure of speaking with him numerous times also.
Now the thing that I think makes Dave quite unique from most traders who have been on this podcast previously is how he uses data mining techniques during strategy development. Data mining in the realm of trading often has a negative connotation attached to it, but Dave believes this comes from bad practices and poor evaluation of methods.
So in addition to data mining and ways to reduce curve fitting, we also talk about escaping randomness, learning to write code, Dave's three laws for strategy development, setting expectation and a few other things too. And lastly, there are two links I'd like to share with you. So the first one being builda.com. Dave has recently developed a software package which has the functionality to perform many of the techniques and different forms of analysis that we discussed.
on this episode. So if you're really into this sort of thing, you can take a look at that at builda.com. And second of all, Dave has kindly offered to answer any trading questions that you may have. So if you'd like to take advantage of this, Simply go to chatwithraders.com slash one zero three, scroll to the bottom of the page and leave your questions in the comments area. Alright team, that is it. Without any further delay, please welcome Dave Bergstrom.
¶ Trading Career Beginnings
So, you know, let's start right at the very beginning. What was your introduction to trading? How did you start out? So actually back in undergrad, I was on track to go to law school and about halfway through realized that I wanted nothing to do with law school. Um so I kinda searched around for, you know, other things that, you know, maybe I could pick up and change careers with You know, halfway to go in school.
And uh, you know, the market on the side seemed like a pretty good idea and had a a little bit of uh a nudge from my father who worked at uh Del Monty Foods and was kinda involved with their uh you know, corn hedging and all you know, and all that for their ingredients. But yeah, so just kind of
Uh, you know, just see about it, hear about it, you know, think it's a g it's a g an easy way to maybe get rich. Yeah, so that must have been a pretty big decision for you to drop out of law school and pursue something like trading.
Well, yeah, I mean just just to clarify, uh never actually made it to law school. I don't wanna discredit any lawyers or law school people, but uh I was yeah, that was that was the career path. But yeah, the drop out, I mean, I did have some early success trading that kind of made that decision a little easier. But knowing what I know now, I'd I'm not sure that
¶ Early Technical Trading Struggles
that should influence the decision at all. Okay. So how were you you trading in the very beginning? Like what were your decisions to buy and sell based upon? Yes, when I first started, um, I think I took
a pretty common route now. You know, I I kinda just searched for information on the internet and found like finance Twitter and all these chatrooms and uh, you know, podcasts, which I you know, I wish yours would have been around back then. Um, would have saved me some time. But Uh yeah, I mean so I you know, I was trading basically uh, you know, chart patterns, momentum stocks, you know, a lot of the
the popular chatrooms, I kind of been, you know, watching them grow because th they kind of all started evolving when I kind of got into trading, which was like, you know, right around and after the financial crisis. So, you know, my beginning trading is much different than how I trade now. Okay. So I mean, how did you like how did you get into trading? Like were you working a a job at the time? Uh were you still going to school? Um
Obviously you didn't just make the jump into full time trading. Like how just kind of put things in perspective for us? I kind of been a a hustler, I guess, my whole life. Um actually at the time uh in college I was uh selling uh counterfeit like NFL jerseys and purses and you name it. And that that seemed to be
some good cash, you know, m before, you know, stuff at the fan. But I was able to put away a decent bit of money that I was able to, you know, fund a trading account with. And I had some help, you know, along the way. Um You know, dad I think wrote me like a two grand check uh that I've been able to pay obviously pay back. But you know It's you know, humble beginnings, I guess. Okay. So you said that you were trading uh, you know, stocks based on momentum and that sort of thing, is that right?
Yeah, I mean a lot of uh chart patterns. I love to draw lines on charts back when I first started. I think uh you know, sending triangles and falling wedges and, you know, flag patterns, pennants. That that was pretty much my go to. Um, so a lot of technical analysis and a lot of You know, penny stocks and then I kinda evolved to um well I don't know if you call it evolved, but kinda switched paces to uh
you know, high beta options. Um, you know, so like your Apple, Google, Netflix, and and then I was kinda, you know, the same idea I was kind of just, you know, drawing lines on the options charts or the the underlying, you know, and and then buying or selling you know, calls and puts based on whatever my my technical analysis was was telling me at the time. Okay. And how were you going through this period? Like were you doing all right? Were you making money? Yes, I'd have periods um
where I would kinda, you know, get ahead and get to a new equity high in the account. Um, but I would inevitably give it back uh and could never really figure out why. And it just seemed like You know, it it just felt like someone was always out to get me. Like I you know, I'd make some money and then give it back. Make some money and give it back. So it was a lot of inconsistency, but you know, enough success that to I think, you know, keep learning and keep, you know, chugging along.
Yeah, so you said that you didn't know why you were giving it back. Uh, you know, now with a lot more experience under your belt, do you understand why you were giving it back in those early days?
¶ Transition to Quantitative Trading
Yeah, yeah. I really didn't have much of a a system, if you will. What really was uh W I I would call it now it's uh I I call it escaping randomness. And I never was able to really escape randomness, if you will. So I think If I if I can simplify it, it's if you have like a coin toss, uh, you know, a coin that's 70% heads, 30% tails. Um, but every time, you know, the first couple flips happen, if they're not winners for you, if you're betting on heads is seventy percent.
you know, you'll make a tweak or an adjustment, but what that does is it kinda restarts you back at tr you know, coin flip zero or trade zero. And that's what I was doing. And you know, you need to flip the coin a you know, a thousand times to get that seventy percent to play out. But if you tweak, you know, something and you go back to zero, you're back in those early coin flips that are essentially random.
Yes, yes, that's a very good point. And I I guess this is probably around the point where you started to pursue more of a quantitative approach to trading, would I be right? Um sort of. Uh so actually uh I had uh you know, big change of heart, you know, kind of change career paths if you will. And I I wound up moving down uh to Florida and met uh my boss and wound up taking a job as like a trading assistant uh at the high frequency trading firm that I work now.
uh was completely unqualified. I went in there, you know, telling them about how I trade ascending triangles and you name it. And this is somebody that's, you know, worked on Wall Street and worked for Citadel and, you know, a market maker for the CME and And I could just tell that he's you know, he's like, Well that's not really how I go about.
And that kinda opened my eyes up to, you know, from the way that I was I taught myself was that there was technical analysis and fundamental analysis. And then I was kinda, you know, my world opened up to this this quantitative analysis, this this third way, if you will.
And and that kind of, you know, put me down a whole new path. You you had it I had to do it a different way to find I think consistency. So why did you move to Florida in the first place? Did this job come up before you actually made the move or or how'd that work?
¶ Learning to Code in HFT
Uh I just kinda moved on a whim. Yeah, and I don't you know, God works in mysterious ways, I guess. Okay. So, you know, even though you walked into uh the office of this uh this HFT firm and you were talking about how you trade with uh technical analysis and that sort of thing and um you know, that wasn't how they do it.
How did you end up getting a position there with that firm? Uh you know, I so the initial job was uh I really just knew I wanted to be involved with the markets. So I really searched for anything. And this job was really just a trading assistant. So it really wasn't
initially doing anything that was, you know, m making it to the market, if you will, wasn't getting any money put behind it. So, you know, like you hear the old stories how people start off as like a clerk or, you know, a runner on the floor. That's you know, kinda how I I pictured, you know, just in modern times, if you will. And did you try to get any other trading jobs before you landed this one?
No, like I said, God works in mysterious ways. I just kinda lucked out. Right, right, cool. So once you started there, what what sort of things were you doing? You know, really getting used to just how to to look at data d you know, which is not really something um is really
you know, preached in the technical analysis world, if you will. It's you know, it's more visual and and they were obvious, you know, much more not much more, but they are data driven. Um, so, you know, you have I had to kinda Uh, you know, a lot of it was basically like, you know, creating presentations or taking some of the data and then, you know, m you know, making nice reports. Um, but it slowly morphed into where I was able to, you know, do some of the analysis. Um
you know, with basic Excel or s you know, I taught myself how to program. Uh so it you know, kind of transitioned into a, you know, m more useful role, if you will.
¶ Objective Data Analysis vs. TA
Yeah. So when you say looking at the data, can you just maybe go into that a little further? Uh maybe give us some examples of like what sort of things were you actually looking for? What were you looking at in the data? Well, I think I don't wanna get too much into what we're looking at, but I I mean it's it's really searching for, you know, edges. You're trying to, you know, find some anomaly or, you know, some persistent pattern that, you know, can maybe lead you to make some money.
So once you did find something in the data that looked interesting to you, like what was the next step from there? Uh so then you know, you gotta you you gotta test it, you know, back test it. And then from there, you know, you can make a general assumption on, you know, how good is this system um or this this edge or this pattern that I found.
Uh and then from there you you know there's a series of tests that you want to put it through before it goes to the market. But at but at that point, I really didn't understand that. So I had What I thought I found these great edges or systems and I was like, Okay, I'm now down this quant road. I have these systems that have some data behind them. Let's trade'em and I still would have had inconsistent success. So it's
Yeah, the the learning process went on for for years, I think. I mean it's uh ongoing obviously, but Never ends. Yeah, yeah. And once you'd been working in this firm for, you know, a little while Did your prior conceptions about trading begin to change like quite a bit? Um, you know, you'd you'd come from the school of technical analysis. Now here you were working in a a high frequency firm uh who was all about just looking at the data.
Did your did your prior conceptions about trading change in any dramatic way? Yeah, absolutely. Just the whole idea of testing everything. Like you know, you hear a lot of things like, you know, it's it's bullish if the market's above, you know, whatever moving average. Um, but it It's like now I I had a way to I needed to test this. I couldn't just say something like that without having the data to prove it.
And I I think that was the biggest thing is that, you know, there's a book I read and I hate to give a free plug, but uh evidence based technical analysis where it you know, it's basically like there's Subjective technical analysis, which is really what I was doing. And now I've transitioned to this objective technical analysis. And I think that's a major key.
Yeah. I mean a lot of people, uh, when they use technical analysis and they trade in a discretionary way, there's a lot of nuance uh nuance, if I pronounce that right, uh to what they do. Was it hard for you to kind of remove that nuance? uh into a way that you could programmatically test it.
Well, I kinda moved away from chart patterns because I I think chart patterns are still and by chart patterns I mean like the falling wedge and the ascending triangle, those things I mentioned earlier. I think those are tough to program uh and test. So I've kinda I kinda moved away from
from that. Other than that, I think, you know, you you find you kinda let the data speak to you. You kinda let the data show you where the patterns are, as opposed to going and hunting. I mean, I'm a bit of a data miner now. Yeah, and that's something I really want to pick your brain about when we get into things in a little bit.
Just before we do though, what are your views on technical analysis these days? I know you you've obviously said it's not something you use anymore, but what are your views on technical analysis? I don't want to discredit it, uh because you know
Things work differently for different people. Uh and I I'll never tell anybody not to pursue anything. I think, you know, that was a valuable part of my journey and it and it may be for somebody else. But for me, I I think I need something, you know, a little more concrete. I think it's
it you know, it's a little voodoo magic, if you will, at times, but I think, you know, there are ways that you can use it to actually, you know, gain information, but it's just you need to make sure the data is confirming. Okay. Sure. Yeah, I mean that's that's a really good answer.
¶ Programming Is A Superpower
So I want to pick up on a point you made a little earlier about how you learnt how to program. And I don't want to brush over this because it's a pretty big deal. Why did you decide to learn how to program and how did you go about it? Well, I I more or less had to. I wanted to get out of the the traders assistant role, if you will, and kinda move into
you know, the trade desk. If you know everyone wants to be you know be a trader. That's why I got into it. Um and I realized that Excel, you know, really just wasn't going to cut it with the amounts of data that high frequency um, you know, firms go through. So I I knew I had a program um to get to the next level. And to be honest, to me, I think uh learning to program, it's the best trade I ever made because if you think about it, the the risk on it is very small.
Uh but the the gains on it, uh you know, it's asymmetric risk reward hands down. It's the best trade I think somebody could make. And I look at it now as it's it's a superpower. You know, it's
I couldn't imagine trading without programming now. Why do you think it is a superpower, like you like you say? Um I just you know, for for example, you see someone on Twitter, they'll they'll mention a stat and I can instantly go and and program a a couple of lines of code to look for that same stat and and I have the same information or
you know, you have an idea in the middle of the night or in the shower, I can instantly go test it out. Uh or just the whole idea of data mining in general is I can burn through And people will probably hate that word burn through, but uh you know, I can whip through data and find patterns way faster than you can by hand. It's just such an advantage in so many different ways.
¶ Programming Learning Journey
Yeah. So how did you actually go about learning to program? Like where did you where did you kind of start? I think I read, you know, a handful of textbooks, um So C plus plus is obviously the main uh language we were using for the high frequency trading just for uh you know, gives you the you know, the fastest uh response time, if you will.
Um so that's I kind of s just picked one, uh, you know, knowing now that's probably a d a fairly difficult one to start with. But I I read everything. I watched, you know, YouTube videos, tutorials, you know, Coursera. um, you know, free courses. Uh there's tons of resources, but uh just had to, you know, kind of be diligent and was lucky enough to find, you know, some people that would answer questions. Um
You know, when you get stuck'cause it you know, it's no easy task, but it's you know, it's worth it. Yeah. So how long did it take you to become uh somewhat fluent with uh with our language. I think you said you started with uh C. Was it C plus or C? Uh one of those. Yeah, C, C plus plus. They're uh kind of learned'em at the same time. Really didn't understand the the differences when I first started, never really been exposed to, you know, anything in that field. But um yeah, probably took
you know, a c a couple months, uh, just to get like a basic understanding. And th but I kinda had an advantage of, you know, being around programmers, you know, all day and talking to them and And being in that environment probably made it, you know, quite a bit easier. But yeah, that's It's it's it's a time time consuming task without a doubt. Yeah. So when you say it took you a few months to uh become somewhat fluent um in this programming language,
Is this something you were just doing after hours or is this something you were doing, you know, during the day at your job as well? Yeah, I actually had the luxury of being able to do it on the job. Um I'd ex you know, expressed to my boss who's uh you know, I couldn't speak highly enough about, but you know, he was able you know, he put some you know, some basic
tasks, if you will, together for me to kind of speed up the process for me. So, you know, I was I built like uh technical analysis libraries'cause he knew that's what I was familiar with. uh in C plus plus. And I think that's probably a good way to start uh for anybody is you know learn how to just read in data.
And then just, you know, learn how to build a technical indicator, you know, whatever your favorite one is, from that, you know, open, high, low, close data. That's essentially how I I started.
Yeah. So do you have any other advice for someone who is considering learning how to program, like any tips or pointers for how to maybe speed things up a little bit? Because it is quite a big task, uh quite a big challenge to take on. Yeah. Um I would say to to make sure you one, look at a few different resources because I would read something and be stuck.
And then I would read the same concept in another book or watch it, you know, on a YouTube video and it would completely click right away. So I think, you know, sometimes you just you just don't see it from the way that that author presented it. Um and the second one is try to find people that do it um that you can ask questions to.
Um, because you'll inevitably get stuck. And to me, being able to go to my boss or, you know, someone else and say, Hey, I I've no idea what this means and I've looked at two different resources or three different resources, I'm still stuck, you know, and and that you're gonna need that, I think.
Yeah, and that first point you made, that's actually a really good point about looking at multiple resources. And um, you know, for anyone listening is is probably aware that I've been learning how to program over the last 12 months or so. And Stack Exchange is awesome for that because, you know, someone will post a question and pretty much every question you could think of has already been asked on that side.
Yeah, I I still use that every day. I mean that that's a lifesaver, yeah. Without a doubt. And you see like a a bunch of different answers to that that question and different ways of doing it. In some ways are a lot easier to get your head around. Uh they might not necessarily be the cleanest code. Usually the easiest sort of things to implement
um have the code's not as efficient as it could be. But yeah, it's it's good because you can see, you know, different ways of of doing what you want to be able to achieve. So yeah, no, good advice. Um, and why did you decide to learn multiple languages? Like you started with C plus. I know you also know, I think it's Java and Python now. Why did you decide to to learn more than just the one? Well, one was uh
W we use pri well, primarily uh you know, a few in the office. Um so that was kind of it was almost out of necessity. But I think it's beneficial because I think certain tasks uh lend itself, you know, better to different languages. Um, like I think, you know, like the higher level languages like Python and Pearl or R are real simple for
Um, just doing like the basic data analysis and and searching for edges. But uh, you know, if you really go to implement some highly complex strategy, you're probably gonna want something with a little more control, like, you know, C plus plus. Okay. So for anyone starting out, what language would you suggest? I think Python. I actually was just talking to a buddy of mine and he's been talking to recruiters for qu you know, quant jobs.
And they all are like demanding Python. And to me it's it's relatively clean. It's simple. There's so many um open source libraries, uh, you know, free resources and it's It seems to really be, you know, growing in in finance. It's it's almost like I felt obligated to learn it, to be honest. You know, when you're talking to your buddy who's looking for people who are who know Python as a programming language.
What sort of what sort of other qualifications are they looking for? Are they just looking for someone who knows how to program in that language or are they actually looking for some sort of higher education certificate? Um, they did I think he mentioned uh, you know, machine learning background is obviously preferred now. That seems to be the big buzzword in But uh other than that, uh you know, I I think it's probably you know, statistics, probability, anything math based physics is probably
You know, high on the list, but yeah, I don't have much experience to be honest with that. Yeah, yeah. No, that's cool.
¶ Finding Edges Through Data Mining
So let's talk a little bit more about your trading, your kind of approach. You hinted earlier that, you know, you describe yourself as a bit of a a data miner. Usually that's not a good thing, uh, in a trading sense. Usually when people hear that they think um, you know, overfitting and and that sort of thing. But Explain to us why you kind of consider yourself to be a data miner and why that's not such a bad thing.
Okay. I just think there's just so much information. There's so much data that there's you know there's edges out there, but I'll never I may never find them um just by pure luck.
like I think, you know, we talked briefly about um You know, if you if you start with, you know, this moving average cross of a ten and twenty, and I start with you know, thirty and forty and yours turns out to be terrible and mine seems to work well, and then you keep searching until you eventually find mine, uh, you know, it
Is it are you data mining, or was I just lucky that I found it originally? And I think I think if you do enough to prevent against, you know, the overfitting and the over optimization, I don't think there's anything wrong with using the computer as a s you know a search, you know, a search tool and and to find these edges. Yeah, so as a data miner.
Let's just call it that. As a data miner. What are you actually doing to find edges? Like how are you finding edges in the data? Are you running machine learning algorithms and using machine learning techniques?
Um, yeah, I've done that and you can you can be simpler than that too. Um, but now I just kinda have b built this almost master program, if you will, to kinda just you you search for a a fitness function, you know, let's say uh, you know, P and L to draw down ratio or profit factor or win percentage or whatever it is you m you want. Um and you kinda just, you know, search all these different combinations until you find strategies that, you know, meet this
this threshold for that fitness function. So that you say, Hey, I only want strategies that have a profit factor over two and a half, and you just run the search program until you find you know, X amount of strategies over two and a half profit factor. Okay. So doing this sort of thing, do you have a hypothesis to begin with? Like do you have Th the the sort of edges that you that you might discover, is there a fundamental almost a fundamental reason for why that might actually work?
Or you purely just if the if the data shows there's an edge there, that's all you need. Yeah, I don't I don't have one going in. Um I just kinda am searching like you said. But if I d if it does seem to make like logical sense um after I found these strategies, then I I would put a little more confidence behind the ones that that seemed to make sense on their own. Okay. If that makes sense. Yeah. And just so we're clear here and you know, we don't lose anyone, when you talk about finding edges
How do you how do you explain that? What are what are edges in your view? Oh geez. Um we could probably do a whole podcast on this. Like a simple way would just be something that has a a positive expectation. Um so if you think of like the coin flip game, um it's fifty fifty chance of landing on heads or tails. Um, but if the payout on heads is two and the loss on tails is only one, um then you would have a positive expectancy. And I think that's probably the simplest way that I could
um explain like edge. Like that's the most rudimentary, you know, explanation. There's a there's plenty of ways that people define edge. Are you ready to get serious about trading? Then join Tasty Trade, Investopedia's best platform for options trading in twenty twenty six. Stocks, options, futures, and more. Tasty Trade has everything you trade all in one platform. Get low commissions, including zero commission on stocks.
so you can keep more of what you earn. Tasty Trade is packed with advanced charting tools, backtesting, a pre-built strategy selector, risk analysis tools, and more features to help you trade smarter. See equities and derivatives with high trading volumes, dividends, upcoming earnings reports, and more with their pre built watches. Or create a custom watch list to keep an eye on the companies and sectors that matter to you. Manage your positions with speed and precision using Active Trader Mode.
one click trading and smart order tracking. Plus Tastytrad's Stellar Trade Desk team offers live support during trading hours if you need it. Visit Tastytrade.com slash chat for more info. KC Trade Inc. is a registered broker dealer and member of FINRA, NFA, and SIPC. Yeah. Have you ever watched a stock explode and thought, if only I had the capital? Or sat on the sidelines because your account balance felt too small to matter. Good news.
With Trade the Pool's limited risk platform, you don't need millions or even thousands to start trading the US stock market. Bypass the PDT and tap into over twelve thousand US licit equities. From penny stocks to big caps, ETFs, even the newest IPOs, and short anything you like, with zero locate or hard to borrow fees.
Start your evaluation, get funded with up to$200,000 in buying power so you can go big without risking your own savings. And now you can also have unlimited time to reach the profit target. It's a game changer. Not ready to trade yet? Trade the pool offers a free demo and educational resources. Practice on live data, master the platform, and build confidence risk-free before you even pay a cent. Click the link in the show notes to start trading with Trade the Pools Capital.
¶ Preventing Curve Fitting
Now as we're talking about data mining here, um and you know, also mentioned that a lot of people when they hear data mining in a trading sense immediately think uh curve fitting
What sort of measures do you take to prevent curve fitting as much as possible? This is like the I think the most important part if you're data mining. Um so a few like simple ones. I don't know that I want to give away all the sauce, but I think you need like, you know, a minimum number of trades, um, you know, in and out of sample testing, uh cross validation where you would basically uh slice the data into pieces um and test on the different pieces, keeping
uh one of the pieces for out of sample and rotating that each time through. Some other ways are, you know, making sure you don't use uh parameters that lend themselves to optimization, like looking at patterns Uh, for example, like is the high above the high of two ago is much better than just picking a moving average and finding the best length.
Like I I think yeah, we could probably get it deeper into that, but that that seems to be a big mistake with data mining. The pe a lot of people associate it with just optimization. Okay. Yeah. Well let let's break those few things down a little more. Uh so minimum number of trades, how do you think about that? Okay, so um for uh for every um
I guess rule in in the strategy. I would like to see a minimum number of trades. So if I have, you know, three, four or five rules in a strategy, then I want, you know, at least 500 times each rule. So, you know, 300 trades, I need 1500 trades. Or three rules, rather, I need 1500 trades. Just to make a simple example.
Okay. So do you just want to explain uh I think that's a good point you bring up, but do you just want to explain that why you want to do why you want more trades for the more parameters or rules that you have in a strategy? That's that's tough for me to say. Um I mean I it's generally has to do with allowing uh the law of large numbers to play out and make sure that you found something that's real.
Like, for example, if if you flip a coin, and again to go back to this, but if you get seven heads or eight heads out of ten flips, Uh it's tough to say that that coin is really seventy or eighty percent likely to land on heads. But if you were to flip the coin a thousand times and it came up, you know, seven or eight hundred heads. then it's much easier to conclude that that's, you know, not a fair coin.
And I think the same thing can be said about trading. If you know you only have a small number of trades, it's tough to say that that's a real, you know, robust strategy. But if you you know, can show that the edge persists over a large number of trades, then you have much more confidence trading that uh, you know, moving forward. Yeah. I mean I think it's probably also fair to say that the more rules that you add to a strategy, the easier it is to curve fit as well. Would that be correct?
Oh yeah, absolutely. Yeah. So how do you split up your in and out of sample data? Like do you have a certain ratio that you like to work with? Yeah, so usually I you know I'll I'll default with thirty-five percent out of sample, but I'm actually researching this now um because moving that window size is actually uh resulting in me finding different strategies, which I'm you know, that's obviously I'm still working on why or how or what that means.
So you you mentioned something very interesting to me and that was about how you try to avoid using indicators or parameters that have a look back. aspect to them. So that might be the highest high of the last ten days, you know, just as a as an example. If those are the sort of things that you try to avoid as rules for your strategies, what sort of things do you like to be the signal or what sort of things do you like to focus on in your strategy?
Well without giving away too much secret sauce, I think like non parametric things, like I think uh you know, like counting measures are are valid, you know, and and things that Yeah, I d I don't know how far I want to get, you know, down this path. But I but yeah, like I think it's okay to use technical indicators and stuff that have look back parameters.
But I just don't think it's smart to optimize those look back parameters. I think if you want to use one as like a regime filter or something like that, that's completely valid and that's something that I'll do. Um, but to optimize, you know, should it be the nineteen or the twenty seven or the fifty day moving average, to me that's kind of murky water. Okay. I mean, when you said counting measures, what's that referring to? Like you could count consecutive higher highs. Okay.
or, you know, consecutive you know, negative closes or s you know, something like that. Yeah, yeah. Looking at your Twitter feed, uh you post a lot of screenshots of kind of signals that your that your systems are generating. They seem to be very focused around volume and volatility. Do these sort of things play a big impact?
Yeah, yeah. Th yeah, the two two things that I really tend to like to look at. I think that like market regimes are very important and I think that volume and volatility are great tools to put context uh around the market and define, you know w kind of refine, I guess, what your expectation should be.
¶ Setting Realistic Trading Expectations
obviously mentioned that um your your Twitter feed there, you posted on Twitter, this must have been a few months or a couple of months ago, a really interesting graph. And on the left hand side it showed an equity curve just on its own. And then on the right hand side it showed uh Monte Carlo analysis or uh distribution. And you drew in that Monte Carlo analysis. that where that equity curve actually sat. And I thought it was a very powerful uh graph. I'm actually gonna
pull it up and I'll I'll put it into the show notes uh at chatwithraders dot com uh because I I'd really like uh ev everyone who's listening to this to actually see that graph. I think it was very powerful. But I think a lot of people perhaps didn't really understand what was going on there. Would you like to explain the the graph to us and make it I know we don't have any um
uh visuals to guide us here, but you know, just try and make it as simple as possible to understand what was going on there and why it's important to I guess understand this. Yeah. I I think uh There's like three key points uh that kind of turned my trading around and I think all of them have to do with having unrealistic expectations. Um and I think like the simplest example is if you take a d a back test drawdown.
Um, and then people will kind of size their system um or or allocate enough money to that system based on, you know, that worst case scenario. Or maybe they take the back test drawdown times one and a half. Um, and that's kind of what I was doing. And that just wasn't enough. So then I learned about Monte Carlo simulation, which is basically a reshuffling. of the order of the trades in its simplest form, and and kind of recalculating an equity curve for each one of those reshuffles.
Um and that's essentially what that graph that you're referring to is. And I think If you look at the the single equity curve that I hand drew into the the Monte Carlo equity curves, uh you could see that that back test was at the very top of the distribution or of the It was one of the best performers, if you will, of the reshufflings.
And to me, people will look at that the single back test and think that, oh wow, this made, you know, I don't remember in that example what it made, but it made, let's just say it made fifty grand in, you know, a hundred trades or something, to keep it simple. And if you look at the distribution or the Monte Carlo curves from the reshuffling, 50 grand is highly unlikely to repeat itself in the next 100 trades.
So when people begin to trade, you know, they'll they'll realize, you know, after fifty or seventy five trades that they're nowhere near that, you know, that they're not gonna make fifty grand in a hundred trades and they think that their system is broken. Um, and it's it's not really a matter of it being broken. It's just a matter that you had unrealistic expectations going into the next one hundred trades.
And I think looking at that distribution And knowing where your equity curve is in that distribution helps you create more realistic expectations and can contribute a lot to survival and then ultimately success.
Yeah, yeah. Now that's it's a really important point and like I said, I'm gonna dig up that graph and I'm gonna put it in the show notes at chatwithraders dot com. It it'll actually be chatwithraders dot com forward slash the number of this episode, which I'm not sure what that is at this point. Uh but
¶ Strategy Robustness: Variance Testing
You know, you you also talk a lot about variance testing. Is this much the same thing or is variance testing slightly different? So I have variance testing. It's uh it's similar in a way. Um but I noticed a big problem that I had when I was trading was Uh if you would have asked me where do I expect to be in the next N trades, you know, the next hundred trades, five hundred trades, I couldn't have answered that uh, you know, even a few years ago.
And it's it's much more complex than just the average trade amount times that number of trades. Um you really need to think of it as a distribution or a possibility of outcomes. So this variance testing is essentially I are it's like a simulator that takes the you know, the winning trades, the losing trades and your winning percentage and it creates these 1,000 hypothetical equity curves of where you could be in the next end trade.
This is actually software I'm you know working on building uh for you know to release to the public. But I think that knowing where to be in the next end trades uh is really important to success. But then with variance testing with that is is What if you vary your win percentage? Is your strategy still profitable? So what I do is I'll take a back test and let's say it has a 61% win rate. Um but I wanna know what's the li where will I be in end trades if in the next
you know, end trades, my winning percentage is only fifty five percent. Is it still a viable strategy? And I think this type of uh, you know, simulation is kind of missed by a lot of systems traders and I think it contributes to the unrealistic expectations. I think you have to have a range of outcomes based on a variety of possibilities because as we know, the market is never never gives you really what you want. Okay, Dave, well let's talk about
¶ Asymmetric Risk/Reward
The three laws. I think you described it as three laws which you trade by. So let's spend a little time on each of these. I think they're each are really interesting. Um obviously we were talking about these off air. Number one is you said that you much rather prefer asymmetric risk to reward. Uh would you mind explaining that for us?
Yeah, so I think you need to have bigger wins than losses. I think you wanna be you wanna have long volacteristics as opposed to short vol characteristics or uh probably be better to say um more like trend following uh versus mean reversion because Uh and what I mean by that is I mean I'd rather have a lower winning percentage but a higher uh payoff than a very high win percentage and a very low payoff.
Um because I think as you move into real trading, you know, you take a system from production and testing and you take it to live trading. You know, the randomness happens and and it you never really get the expectation from the back tests or whatever testing you wanna do. And I think it's safer to be ha you know, have the the long vault characteristics as opposed to the short vault characteristics. So I'd I tend to prefer
you know, bigger bigger wins than losses. And I'll sacrifice a little bit of my win percentage to achieve that.
¶ Consistent Position Sizing
Okay, that's fair enough. And and number two, um number two, I think there's probably a better way to phrase this, but you you I think you said that all bets mean the same thing to your bottom line. Um I'll I'll let you explain that one. Yeah. So um let's say that you have, you know, ten systems that all have, you know, relatively the same characteristics. Or you you wanna take uh even for discretionary traders, you wanna take, you know, ten trades off of the same pattern whenever they appear.
It's it would not. It would not be in your benefit to have one of those trades be done with five times the size as the other nine. Because if that one that you size up on wipes out, you know, six or seven other winners, um, then you're really
at a disservice to yourself because you're really not allowing, uh, and I don't want to give away the third law, but you're really not allowing, you know, the expectation, you know, the math to play out. You're kind of just Putting all your eggs in one basket, even though you're making ten trades, one of'em, you know, means a lot more to your bottom line. Okay. So you're obviously saying this from the the the position of being a quant.
Uh, you know, for discretionary traders who do, you know, size up on certain trades and do risk more on certain trades, do you think that type of approach is flawed in in some way? Like I said, I never wanna discourage anyone from trying or testing anything. Uh and what works for someone else or doesn't work for me, you know, may work for someone else. So I you know, disclaim with that.
But I do think that that's dangerous. I really n try to avoid excitement in my trading. I think trading should be boring. Um, and I want the expectation uh to play itself out over the thousand coin flip. as opposed to having, you know, ten coin flips and you decide you want to bet your whole lot on the eighth flip, you know, that's to me, that's kind of crazy. Uh you know, if you're you want to bet your winnings from, you know, the fourth through seven flips on the eighth flip.
That to me is crazy. I kinda just want to stay in the game and I want to get to my thousand flips, if you will.
¶ Law of Large Numbers
So that of course leads us into the third law that you trade by and that is the law of large numbers. Um, you know, you want to execute your edge as much as possible. Do you wanna do you wanna explain that one a little further? Yes, I think we kind of brushed upon it earlier. Um, and again to go back to the coin flip, y if you have an unfair coin or i it it's seventy thirty, I think was the the numbers we used before.
And you flip it ten times, you might find that the tails, which was the 30%, might happen seven out of those ten times or eight times out of those ten times. But if you flip that coin a thousand times, then that heads that had the seventy percent chance is gonna be around seven hundred. And I think it's important um if you do the research and you find a positive edge to allow that positive edge to play out. Um, if you only do a couple of, you know, trades or coin flips, you really
you might not experience what the expectation is just because of randomness. And like I said earlier, you need to escape that randomness. You need to get to you know, a lot of number of trades to assure or ideally to assure that your edge will play out.
¶ Maximizing Trade Frequency
Yeah, so I wanna ask you a few questions around this because, you know, this is something I've been giving a little thought to lately myself. How do you actually increase the number of trades that your strategy produces? Well, I don't know that you can take an existing strategy and increase the number of trades. I think uh you probably have to, you know, change time frames or change uh you know the actual strategy itself.
I think that'd be that's kinda dangerous water to just try to get an existing idea to trade more. Well that's yeah, I mean that's that's kind of what I'm getting at. Like do you Because you want to tap into the the the law of large numbers, will you only trade a strategy that's perhaps an intraday strategy, like end of day strategies?
you know, you've only got a limited amount of data and obviously they take a lot longer to play out. Are you only focused on intraday strategies? Are you only focused on trades that, you know, hold for two, three hours? Yeah, I think obviously like the higher frequency data lends itself, you know, to that, you know, the law of large numbers obviously much better. I think that's why there was such a migration towards that, you know, that industry. Um when computing became so prevalent in finance.
Um but I I think it's okay to still trade like daily time frames and stuff. And I think like the the variance testing I do or the Monte Carlo testing I do, you know, if you're happy with those simulation results and and they show you that you know, in let's say, you know, 100 or 200 trades, this is where you can expect to be and you're happy with that distribution.
um then that's then that's fine. You can still find, I think, strategies that do that. I just think it's easier to get to um a higher number, obviously with higher frequency data. And it doesn't have to be high frequency data, just, you know half an hour bars, you know, fifteen minute bars or something like that. Yeah, yeah. Okay.
Uh would you ever consider like I don't know how you approach um strategies in this sense. Like do you create strategies that work on one market? Like you might try to create a strategy that works on the e many S P five hundred futures.
Um, you know, if you have a strategy that looks somewhat promising on that market, but the number of trades aren't high enough for your liking, are you going to bring in other markets and try and bring those into the basket of markets that your strategy trades on? Yeah, it's definitely... A way to go about it. You can d yeah, you can definitely do that. I it's not necessarily something I I do. I do like to see robustness across markets.
But I will kind of shy away from something that I don't think has enough trades. So it's it's tough for me to say. Um but yeah, I think robustness across markets is definitely uh preferred, although not um you know, needed. Assuming you have enough trades. Yeah, and while we're still on this point. Uh I'd like to ask you how do transaction costs factor into this? Like is there a point where you are better off trying to make more profit on each trade rather than trying to take more trades?
You know, because each time you take a trade you've got slippage, you've got uh brokerage fees and and whatever else. Um, is there ever a point where yeah, it it pays to try and look for more profit in each trade? Yeah, I think it is difficult, you know, with like a retail account to to allow this to play out this law of large numbers because you do run into very high transaction costs. But I'm not exactly sure how
You you can really combat that now that I think about it. And I'm kinda, you know, in a situation where I haven't really had to think about this problem um in a while. But I I think there's probably some happy medium where you can you can get a strategy that doesn't kill you with transaction costs.
But maybe doesn't have, you know, a thousand trades, you know, maybe uh only a couple hundred or something. But I think it comes back to that, you know, that variance testing and where do you think it's gonna be? And are you happy with that distribution, you know, is it something you're willing to allow to play out or no? And and you and you have to obviously factor in your transaction costs into that simulation.
¶ Inside High-Frequency Trading
Dave, I'd like to ask you a couple questions about high frequency trading, just in general, about the industry, you know, as someone who's on the inside. Usually I I guess kind of in the media, HFT cops are really bad rap, more often than not. Why do you think this is? Oh, um I hate to be the spokesperson for all of HFT. Uh I think uh it's tough for me to say. I think a lot of the the
the bad rap it gets is from like the Michael Lewis book and what people call like latency arbitrage, which is actually not something uh that we do because we only trade futures um through the CME. So we're only one exchange. And I think, you know, the HFT uh it's it's also very easy just to find a scapegoat. The trading's very tough. And I think, you know, sometimes people just look for a a scapegoat. I'm not so sure that
uh a lot of the bad rap is justified. But I again I'm biased. Yeah, yeah. No, that makes sense. And you know, as someone who is involved in high frequency trading, do you yourself see any negative aspects to it? Uh no. No. I mean I think it's Again, I'm biased, but no, I I don't like I don't think uh you know, at least from my view, it's like, you know, nothing we don't do anything predatory. I'm not so sure that I, you know, believe the claims in
You know, that the book I mention and no, I don't I don't think it's it's bad in any way. I th you know, if anything it's it's probably beneficial and you know, I know people can find articles on both sides of this coin, uh but yeah, from my view no. Yeah, so how is the HFT landscape different from equities and and futures? Like, um is there perhaps some negative aspects about it in in the equity space?'Cause obviously the fut the market structure for futures is totally different.
Yeah, I th I I just think that that's like the one the one area that that people really dislike is that the whole idea of, you know, the I c said latency arbitrage, but where people race from exchange to exchange, or at least that's what people are you know, speculating's happening. Uh and I think
That that is you know, that's uh that's a tough call and a lot of different opinions on that. But it's like I said, it's not something that we do and it's not something I'm, you know, too versed in, to be honest. Yeah. And when we were speaking before the call, you said to me that you you think the the heydays of high frequency trading might be coming towards an end. What do you think the future has in store? I don't know that's coming to an end. I just think it it's
It's obviously much more difficult as time has gone on as more people uh come into the space. Um and a lot you know, and a lot of the strategies, you know, get exposed or people jump from shop to shop or something like that. But I think I think it's tough because I I've we kind of have this debate in the office on, you know, is it
Is it what I just mentioned, is it, you know, too many players and and too efficient, or is it just kind of a a product of the monetary policy, you know, laid out by the Fed and the other central banks? Because it
that monetary policy it really isn't conducive to a two sided market, which is obviously what HFT needs. So it it it could be a mix and I'm sure the truth, you know, always lies somewhere in the middle. But yeah, it's obvious it's definitely much you know, getting much more difficult, um To point my pin point my finger on it, I'm not sure. Sure.
Yeah. I mean I'm actually hoping to get uh Minaj Narang on the podcast. We've actually been scheduled like five times to do the interview, but uh he's a busy man and hard to pin down, so I'm really keen to get him on and and get his take on all of this. That would be great. That would be great. I I had his brother on Rishi Narang um on like episode fifty four I think. Somewhere around that point. And uh he was he was awesome. Um, big fan of his book also. Yes, yeah.
Anyway, Dave, uh this has been this has been really good, man. I've I've thoroughly enjoyed this. Now, you know, some of the things we've talked about here are a little bit tricky to implement and and test and and that sort of thing.
¶ Build Alpha Software Overview
You've been working on a software package, Build Alpha, I believe it's called. Do you want to just tell us a little bit about uh what you're working on and um, you know, how listeners might be able to benefit from using that?
Yeah, yeah, that'd be great. And I like I I enjoyed doing this too, by the way. This thank you very much for the opportunity. Um But yeah, this so this I'm I'm putting together some software um that essentially would allow uh it's I've been using it for a while, but I'm kinda building the public version uh that I I'm
I'm thinking about licensing out. And what it will do is it basically would allow you to select from a list of signals. Um, you know, maybe five hundred at a time, a thousand at a time. We're kind of working on the memory right now. Um and it would search for different strategies based on Um the exit criteria you get you provide it, um and the fitness function you give it. And fitness function, uh, you know, win percentage, payoff ratio, profit factor, sharp ratio, something like that.
Um and all this is kind of built in. And then what it would do is it would search for these strategies and find the best ones given that criteria, those signals and the fitness function. And then from there you would be able to view the strategies. Um, you know, their equity curves, you would be able to run Monte Carlo analysis on it, you would be able to do my variance testing on it, um, and you'd be able to generate uh tradable code uh for each and every strategy.
Um and I'm actually working on, you know, being able to create portfolios. You know, you can kinda pick and choose from the strategies it finds, finds the one that create the distribution you like, uh, and then add'em to a portfolio. And then you can kinda analyze the portfolios the same way. Um so I think this is really cool software and it kinda is kinda like the culmination of
you know, the tools, um, and the process that I go through and have gone through. Uh and I c you know, kinda wanna share it. Maybe I can help some people uh, you know, speed up their learning curve or, you know, even, you know, find some strategies or get an idea of how to you know, how to how to go from signal to live trade. Absolutely. So where can listeners go to find out more about this? Like is it available at the moment? Do you have a website up for it? What's the deal?
Yes, I do have a website up. You know, hopefully by the time this airs it'll be finished. We're, you know, ninety-five percent done, I think. Um, but it's builda dot com. Uh, and you can reach me at David at builda dot com. Um, or um At D Berg D B U R G H on Twitter. Awesome. Builda.com and uh follow Dave on Twitter. Dave, once again, man, thank you very much for doing this. I I truly do appreciate it.
Man, I I appreciate you letting me on. I'm honored. I think you're building something really cool here. All right. Thanks, man. We'll talk soon. All right. Thanks. Take care. You've reached the end of this episode of Chat with Traders, but rest assured there are more episodes. And zero high. if you'd leave a race Chat with traders.
