Q6: Your Quant Trading Questions Answered · Delaney Mackenzie — Transcript
Full transcript
- 0:00A chat with traders collaboration with
- 0:02Quantopian episode six.
- 0:14Hey crew, here we are for the sixth
- 0:16episode in the Quantopian and chat with
- 0:18traders mini series. I'm Aaron Fifield
- 0:21and big thanks for tuning in. As I've
- 0:24promised all along, this episode being
- 0:26the final installment in the series, we
- 0:28would dedicate to the Q&A. Answering
- 0:31your questions which you've submitted.
- 0:34Perhaps not you specifically, but
- 0:36questions submitted by listeners.
- 0:39As a way to have some order to this
- 0:40episode, we've loosely categorized the
- 0:43questions. So these categories include
- 0:46resource recommendations, trading with
- 0:48factors, machine learning, live trading,
- 0:51strategy evaluation, and we close with
- 0:54answers to questions about Quantopian
- 0:56itself.
- 0:58And just like we've done for all past
- 1:00episodes, you can find links to all
- 1:02resources mentioned during this episode
- 1:04at quantopian.com/chatwithtraders.
- 1:08And the same on the chat with traders
- 1:11website too.
- 1:12Now before we get into it, I do want to
- 1:14say thank you to datacamp.com for
- 1:17sponsoring this mini series. So if
- 1:20you're new to programming or just maybe
- 1:23want to develop your skills further, I
- 1:25honestly feel your best bet is to sign
- 1:28up with DataCamp and work your way
- 1:30through their courses. Their courses are
- 1:33developed purely to teach data science
- 1:35and languages Python and R, and you can
- 1:38start any course for free. So to get
- 1:41started, simply visit datacamp.com
- 1:44and create a free account.
- 1:46All right, well that concludes the
- 1:48intro. Thanks so much for listening to
- 1:49this mini series guys. I hope you've
- 1:51enjoyed it. I've really enjoyed putting
- 1:53it together and I hope it's been helpful
- 1:55to you in one way or another.
- 1:58Please welcome Delaney.
- 2:02Sounds good. All right, man. Well, let's
- 2:03just hit the record button. Um and we'll
- 2:06just get stuck into it. So, an easy
- 2:09question right off the bat, what are
- 2:11your book recommendations?
- 2:15It's a It's an easy question. Also a
- 2:17little tricky for me cuz I actually I'm
- 2:19not a huge book guy, which I don't know
- 2:21that might come as a shock to people,
- 2:23but I've always like preferred the style
- 2:26of learning, which is, you know, you
- 2:28just try something and then you get
- 2:30stuck and then you Google the answer.
- 2:32Much more of a
- 2:33um kind of like piecemeal consuming the
- 2:35information as you need it versus going
- 2:37through and using a book and then kind
- 2:39of reading the book. But, that said, um
- 2:42I can make a few recommendations just
- 2:43based on my experience. Uh there's two
- 2:46people who are, you know,
- 2:49uh authors of of financial textbooks. I
- 2:52know both of them and I think that
- 2:54they're really good both as as people
- 2:56and as, you know, teachers in their
- 2:58books. And that is Frank Fabozzi, who's
- 3:01uh
- 3:02from
- 3:03uh
- 3:04kind of he he works at uh he's worked at
- 3:06BlackRock for a long time. He's a super
- 3:08senior guy. He's written a ton of
- 3:10textbooks. And also uh Dessislava
- 3:13Pachamanova. And uh that is spelled p a
- 3:17c h a m a n o v a, if I'm getting that
- 3:21right. She is a professor at um
- 3:25Babson and
- 3:27uh kind of a She's been a little bit of
- 3:28a friend of the firm of Quantopian for a
- 3:30while. We really like her. And And she
- 3:31actually co-publishes with Frank. Um
- 3:34they recently released a a textbook um
- 3:37that I'm actually completely blanking on
- 3:38the title, too. But
- 3:40uh we'll I'll try to provide a link in
- 3:42the in the forum thread that we have for
- 3:45uh the Chat With Traders podcast. But,
- 3:47anything by those two.
- 3:49Uh and then another book that we kind of
- 3:51used uh we looked over it on
- 3:53recommendation from another professor
- 3:55that we worked with who uses it to teach
- 3:56his class, Mark Kritzman at Suffolk, but
- 3:59he recommended this book uh actually I
- 4:02have in my notes wrong. It's actually
- 4:03quantitative investment analysis.
- 4:06So, if you just like Google quantitative
- 4:07investment analysis, you'll find this
- 4:09book. It's a pretty good intro,
- 4:10especially for people who haven't dived
- 4:12into it before. And the thing that does
- 4:14a good job of is
- 4:16um laying the topics out kind of in a,
- 4:19you know, very clear step-by-step basis
- 4:22uh and not kind of skipping ahead or
- 4:23assuming that you've had a background in
- 4:25statistics or anything like that.
- 4:27Excellent, right. So, I probably should
- 4:29have mentioned this before I even asked
- 4:31you that first question, but I just want
- 4:33to let the listeners know that we have
- 4:34actually loosely categorized these
- 4:37questions. So, this first kind of
- 4:39category, if you will, that we're
- 4:40working through at the moment is is more
- 4:42of a general category on sort of book
- 4:44recommendations, maths, and, you know,
- 4:47some easy programming languages, but or
- 4:49some easy questions about programming
- 4:51languages, but anyway, so the next
- 4:54question that we got come through here,
- 4:56what's your recommendation for someone
- 4:58that has a business degree on how to
- 5:00jump into the world of quant finance?
- 5:04So, this one's actually like I say the
- 5:06same thing to pretty much everybody
- 5:07here, which is the first thing you need
- 5:08to do is learn to code at the at like
- 5:11the a very minimum just code a little
- 5:13bit. Uh you know, you don't have to
- 5:15become an expert, but learn to code, and
- 5:17get get your hands dirty with that. Um
- 5:19and and especially in a lot of MBA
- 5:21programs, some are good about this, some
- 5:23aren't good,
- 5:24um but a lot of MBA programs don't
- 5:27really kind of teach you to really get
- 5:29down and dirty with technical stuff. Um
- 5:31sometimes they kind of say, "Well, oh,
- 5:33we're going to be
- 5:34uh you know, kind of focusing on the
- 5:36management side, and we'll let someone
- 5:37who's technical worry about the
- 5:38technical side."
- 5:40Um but if you really want to understand
- 5:42and be a good manager and communicate,
- 5:44like you need to have enough, you know,
- 5:45experience. And if you want to jump into
- 5:47the field, I think you should really
- 5:49just learn to code. There's plenty of
- 5:51resources available for doing that. I
- 5:53think the sponsor of this series,
- 5:55DataCamp, has a lot of really good
- 5:56materials for learning to code within a
- 5:58statistics context and other things like
- 6:02There's just If you Google like learn to
- 6:03code, there's a lot of sites that will
- 6:05tell you how to do it.
- 6:06And and and in general, depending on how
- 6:08you learn, if you like just like a lot
- 6:10of material presented to you or you
- 6:13kind of what I was talking about
- 6:14earlier, where you go through
- 6:17multiple, you know, different projects
- 6:19and kind of consume information as you
- 6:21need it. I'm the second, so I would kind
- 6:23of recommend
- 6:25picking something that really interests
- 6:26you
- 6:27and then trying to do it and when you
- 6:29get stuck, Googling how to get unstuck.
- 6:31That's how real engineers work and I
- 6:33think that's a pretty powerful way to to
- 6:35learn. And just before we move on to the
- 6:37next question, it almost sounds a little
- 6:39bit to me like this question was asked
- 6:42by someone who is is looking to pursue
- 6:46quant finance in the professional space,
- 6:49not sort of the DIY approach. When you
- 6:51say learn to code,
- 6:54do you think that they need some sort of
- 6:55certificate or to actually do a
- 6:57university program in learning to code
- 7:00or coding on their own is sufficient?
- 7:03Well, it depends on exactly what role
- 7:05they want to occupy within the quant
- 7:07finance space. Certainly, I would say
- 7:10it's going to be very difficult to
- 7:11compete for a purely technical analyst
- 7:13role because if you're talking about a
- 7:15quantitative analyst, these are people
- 7:17often times who've gone through PhD
- 7:19programs in mathematics. They have years
- 7:21and years of programming experience, but
- 7:23there's a lot of space in between,
- 7:25right? And there's actually the like the
- 7:29famous
- 7:30McKinsey report they published a couple
- 7:33years back where they said there's going
- 7:34to be a huge shortage of data scientists
- 7:37and an even bigger shortage of data
- 7:38science managers. I think the same thing
- 7:41is true in in the quant world that you
- 7:42know, you don't necessarily have to be a
- 7:44pure quant. You can also look at like
- 7:46are there roles where I can talk between
- 7:48quants and other parts of the company
- 7:50like
- 7:51are there roles where maybe I could be
- 7:52evaluating quants
- 7:54you know, and and and communicating that
- 7:56back to a more traditional analysis team
- 7:58or or you know, being the the
- 7:59connection. So
- 8:01I guess it depends on what you're trying
- 8:02to do. I would say it might be tricky
- 8:05yes, if you're trying to compete against
- 8:06the PhDs,
- 8:08but I would focus on being a bit more
- 8:10creative and and looking for more
- 8:12opportunities.
- 8:13Sure. Okay.
- 8:14Now, what areas of mathematics and
- 8:17statistics should aspiring quants be
- 8:20comfortable in? Are there any resources
- 8:22that you would recommend? I think that
- 8:24we've tried to craft the lecture series
- 8:26to reflect this pretty well. Like
- 8:29basically what's covered in the lecture
- 8:31series is is a good chunk of what we
- 8:33think is important and it's not all of
- 8:34it. We're adding to it. But in general,
- 8:36it's just knowing how to validate
- 8:38whether a model makes any sense and then
- 8:40it's the field known as model
- 8:42validation. And a lot of the techniques
- 8:44used for that come from econometrics.
- 8:46Econometrics is the branch of math
- 8:48developed by economist for dealing with
- 8:51time series data. Which of course is
- 8:53very prevalent in economics and and
- 8:55similarly time series analysis is you
- 8:58know, sometimes people conflate time
- 9:01series analysis and econometrics.
- 9:03You know, I'm not saying that's wrong. I
- 9:05think they both are kind of the same
- 9:07thing in a lot of ways, but you know,
- 9:08just learning how to deal with time
- 9:10series rather than stationary analysis
- 9:12because it's very different and you have
- 9:13to deal with effects like auto
- 9:14correlation. And and in general again,
- 9:17like
- 9:18what I say is to all these things is
- 9:20like the in my experience the best way
- 9:22to learn this type of math is not to
- 9:24necessarily just say like I'm going to
- 9:25learn these three subjects and then just
- 9:27read about them. Like pick things that
- 9:29are interesting to you
- 9:31and and you know, muck around with them
- 9:34a bit and Google around for info and let
- 9:35yourself get lost reading like a
- 9:37Wikipedia page on stochastic
- 9:39optimization for a long time. Like it
- 9:41it's you know kind of pick something
- 9:43that's interesting to you first and and
- 9:45and go from there. Yeah, and just to um
- 9:48add on to something you mentioned there,
- 9:50the lectures that you referenced uh
- 9:52they're available at
- 9:53quantopian.com/lectures.
- 9:56And that's a really valuable resource.
- 9:58I've actually been working through
- 10:00a couple of those, you know, since we
- 10:02started doing this series and it's a
- 10:04really good way to learn, especially
- 10:06because they're all done in the Jupyter
- 10:07notebooks. So, you know, you can
- 10:09directly copy the notebook and play
- 10:12around with it yourself and get your
- 10:13hands dirty. It's very easy to do that.
- 10:16Thank you for plugging them, by the way.
- 10:17I I
- 10:18I figured I had already like said that
- 10:20link like 3 million times, so I didn't
- 10:22want to tire you users out on that
- 10:24front. But yeah, thank you and I
- 10:26I'm happy that you're finding them
- 10:27useful. Yeah, yeah, no, they're
- 10:28excellent. So, this question sounds like
- 10:31it came from someone who's just starting
- 10:33to learn how to program or was maybe
- 10:35considering learning how to program.
- 10:38What they're asking are what are some of
- 10:40the pros and cons of the more popular
- 10:43programming languages? So,
- 10:45I think what they're trying to get at
- 10:46here is saying,
- 10:48you know, you've got your programs like
- 10:50uh your brokers TradeStation and
- 10:53MultiCharts which support Easy Language.
- 10:56And then you've got, you know,
- 10:57Quantopian and just any programming
- 11:01script that you write uh which can be
- 11:03done in an open source language like
- 11:06Python or C++ and that sort of thing.
- 11:08So,
- 11:09I think this question's really like what
- 11:11are the pros and cons between your open
- 11:14source languages and your sort of
- 11:17proprietary languages, if that's the
- 11:19right word.
- 11:20Sure. Well, in general, as a rule of
- 11:22thumb, open source languages are going
- 11:24to be higher quality. I mean, there are
- 11:26that's not, you know, an absolute rule,
- 11:28but if you look at a lot of the
- 11:29languages, they're They're like
- 11:30massively used for development
- 11:31everywhere.
- 11:32They're the open source ones. I mean,
- 11:34that's because the standards are open.
- 11:36They're they're kind of universal and
- 11:38something written in C can talk a lot of
- 11:40other stuff because many people use the
- 11:42same standards versus everybody using
- 11:43their own proprietary languages. So,
- 11:46this is too complicated a question to
- 11:48really answer or do justice to in in a
- 11:50short time frame. I mean, every language
- 11:52has many pros and cons and you know, the
- 11:55pros and cons are in many different
- 11:56directions. It's not just speed. It's
- 11:57how easy it is to express different
- 11:59things in that language. Uh it's how big
- 12:02the code is for that language. It's how
- 12:03the language handles multiple types of
- 12:05things. Uh Quantopian picked Python as
- 12:08the language that we're using because we
- 12:10think it's the best all-rounder and has
- 12:12really good statistical library support.
- 12:14That's kind of rivaled right now only by
- 12:16R and MATLAB. Uh but obviously like some
- 12:18other languages are going to beat Python
- 12:20on pure speed. So, again, um I don't
- 12:23want to say like any language is best.
- 12:25They all have pros and cons and it's
- 12:26really just about knowing those pros and
- 12:28cons um and knowing what you need to get
- 12:31done for your project. And and and
- 12:33beyond that, I think that I'd be kind of
- 12:35doing myself and others a disservice by
- 12:37claiming, you know, anything more about
- 12:38a language's goodness without knowing
- 12:41what you're trying to use it for. So,
- 12:43for someone who is totally new to
- 12:45programming though and wants to know
- 12:47which language they should start out
- 12:49with, you think Python is a pretty safe
- 12:51bet?
- 12:53Yeah, Python so as far as being the
- 12:56first language you learn,
- 12:58uh Python I think is is the best one for
- 13:01that. Uh it it really does a good job of
- 13:04being accessible and expressing concepts
- 13:06well and it reads well. Like even
- 13:08someone who hasn't done programming
- 13:10before, if you locked them in a room for
- 13:122 hours, you know, they might be able to
- 13:14tell you something about a Python
- 13:15program because it some of it almost
- 13:17reads like English. I really recommend
- 13:19that for people who are just starting
- 13:21out. Okay, excellent. Now, this one is
- 13:24from a college student who is currently
- 13:26studying traditional accounting and
- 13:29finance. They ask, "What courses should
- 13:32I take to get an introduction to
- 13:34quantitative analysis?" Really, I think
- 13:37what you want to take is you want to
- 13:39take applied math and statistics
- 13:41courses.
- 13:42And if your school has specifically
- 13:45quant courses, awesome.
- 13:48And if it doesn't,
- 13:50you know, you can kind of take the same
- 13:51get the same stuff through applied math
- 13:54and and and physics courses.
- 13:56And like I said, like I would go to the
- 13:58lecture series, look at what topics are
- 14:00in there, and then kind of
- 14:01cross-reference them with the topics
- 14:03that are
- 14:04listed and in your school. And and and
- 14:07go from there. Of course, like every
- 14:08school is going to have different course
- 14:10offerings. Uh And and I might be jumping
- 14:13ahead cuz I have the the question here,
- 14:15but
- 14:16there's a second part of the question,
- 14:17right? Which is that they they said that
- 14:19they're involved in um
- 14:21in an investment fund at the school.
- 14:24And they wanted to experiment with, you
- 14:26know, doing a a quant strategy at the
- 14:28investment fund. Um so I actually have
- 14:30like a
- 14:32a specific answer for that, which I've
- 14:33talked to a few other, you know, school
- 14:35clubs about, which is that I it's really
- 14:37interesting from a quant perspective is
- 14:39to rather than start by trying to
- 14:40implement a quant strategy that makes
- 14:42money, start by using quant techniques
- 14:44to analyze existing strategies or
- 14:48existing
- 14:49portfolios that the club is running. And
- 14:52and and that leads into the to the next
- 14:54question we have on our list here. So
- 14:56maybe you want to ask that question. We
- 14:58can kind of combine two answers into
- 15:00one. Yeah, yeah, absolutely.
- 15:02Um I'm just going to read this
- 15:03submission out in full because I think
- 15:05it adds a little bit of context, which
- 15:07is probably necessary for for anyone
- 15:09who's listening to this. So
- 15:11Uh this is the question as it came
- 15:12through. Um we run a desk that has
- 15:15largely bionic traders. A number of our
- 15:17trading decisions are discretionary, but
- 15:20we use a number of programmable tools to
- 15:23find stocks we trade. Lately, we've been
- 15:25putting together plans to introduce some
- 15:28automation, quant trading, etc. as part
- 15:31of the modus operandi, if I pronounce
- 15:35that right.
- 15:35Modus operandi. There we go.
- 15:38M.O.
- 15:40of our desk. My question is, in finding
- 15:43the right skill sets to work with or
- 15:46hire to make this happen such that we
- 15:48can start automating some of our already
- 15:51successful discretionary trading
- 15:53strategies, what would you advise us to
- 15:55pay strict attention to to attract the
- 15:58right talent pool, especially if they're
- 16:01not necessarily traders or familiar with
- 16:03the trading space? I mean, this is a
- 16:06really great question and I think it
- 16:08gets at kind of the transformation that
- 16:11the field is generally undergoing right
- 16:12now, which is that there's a lot of
- 16:14traditional people
- 16:16still using, you know, kind of
- 16:18techniques that have been around for a
- 16:19while and there's a there's a lot of
- 16:21forces now in in the financial services
- 16:23industry pushing towards more
- 16:25involvement of technology and statistics
- 16:27and mathematics.
- 16:29So,
- 16:30uh
- 16:31it's the same as my answer to the guy
- 16:33who's talking about being in a
- 16:34traditional investment fund at his
- 16:36school and asking how, you know, what's
- 16:37the first thing to do. Well, I think the
- 16:38first thing to do is understand what's
- 16:40going on first, right? Like, don't
- 16:42necessarily like say we're going to
- 16:43build an entirely new machine. Um let's
- 16:46look at the machine you have working
- 16:48first. And so,
- 16:50uh like the classic case would be just
- 16:52say, let's take your return streams that
- 16:54are coming out of your existing trading
- 16:56desk or existing traders
- 16:58um and just do a quant analysis on those
- 17:01return streams. So, the classic case
- 17:03would be looking at um and maybe you're
- 17:05already doing this, you know, in which
- 17:06case, great. I don't want to assume, but
- 17:08the classic case would be looking at
- 17:09like risk exposure. So, you know,
- 17:12starting from something super simple
- 17:13like
- 17:15uh like the Fama-French model
- 17:17um where you're looking at
- 17:19uh and we talked about this in some of
- 17:20the earlier episodes, but you're looking
- 17:21at how your
- 17:23returns correlate with the broad market
- 17:25returns and with like a few of the
- 17:26different sectors maybe, and then a few
- 17:28of the, you know, fundamental factor
- 17:29returns.
- 17:31And then maybe you discover that your
- 17:32trading desk that you think is is, you
- 17:34know, doing something really original is
- 17:36actually just a leveraged bet or like a
- 17:39kind of a well-explained combination of
- 17:42things that people already know about.
- 17:44So things like
- 17:46I think it's the Barra factor model or
- 17:49other well-known factor models will
- 17:51might explain this for you.
- 17:53Um
- 17:54And Quantopian actually offers a tool
- 17:56called Pyfolio. It's free and open
- 17:57source and allows you to put in any
- 17:59return stream and get out like a full
- 18:02quant analysis of that return stream and
- 18:04looking at, you know, what it's exposed
- 18:05to and and kind of a lot of angles that
- 18:08a quant would take when checking whether
- 18:09or not a return stream is good. Now when
- 18:11you're talking about implementing
- 18:12quantitative strategies, I mean, I think
- 18:14the really the first step is just to
- 18:17make sure that you've hired
- 18:18professionals who really really know
- 18:20what they're doing and they're rigorous
- 18:22and they
- 18:23they know how to control risk and
- 18:25they're not just flashy people who like
- 18:28want to sell you some crazy model that's
- 18:31based on, you know, kind of snake oil.
- 18:33And unfortunately, you do have to take
- 18:35the time to kind of learn some of the
- 18:37stats and math yourself because or or
- 18:41have someone that you really trust who
- 18:43knows them because the issue is if
- 18:45you're trying to hire people who are
- 18:46good at this, unless you have a sense of
- 18:49the skills and a sense of what is going
- 18:51to define someone who's good and
- 18:52rigorous versus someone who's selling,
- 18:54you know, like things that don't really
- 18:55work, you you're not going to know who
- 18:57to hire unless you you learn a few of
- 18:59those skills yourself and then get a
- 19:01sense of it. So I think the first step
- 19:03is just getting someone who you trust,
- 19:06consulting with someone who you trust
- 19:08who's, you know, really kind of a
- 19:09rigorous quant
- 19:11who's you're know, going to BS you and
- 19:13and and going from there and letting
- 19:15them guide the process of setting up
- 19:17that machine. Beyond that, I think it's
- 19:19all kind of specifics and and it's
- 19:21depends on what exactly you want to set
- 19:22up. Okay, and I'm just peeking at your
- 19:24notes here.
- 19:26Um, you have one here which I think is
- 19:28probably worth mentioning as well, and
- 19:30that's, uh, about the culture of your
- 19:32company. Do you want to mention that?
- 19:35Yeah, it's a good point. I actually
- 19:36completely forgot that I put that in
- 19:38there. Um, another really important
- 19:39point is that a lot of traditional
- 19:41finance firms have a culture which
- 19:42scares away good technical talent. Uh,
- 19:46and and I again, I have no idea what
- 19:47your culture is like, so I don't want to
- 19:49assume, but a lot of firms will have
- 19:51this kind of kind of jockey or frat
- 19:53culture which a lot of technical folks
- 19:56don't like. Um, they'll have this
- 19:58culture where kind of the suits, the the
- 20:01the the traders who who aren't technical
- 20:04will make a lot of money and then the
- 20:05technical people will kind of be treated
- 20:07more as a, you know, kind of a mill that
- 20:09will turn out, uh, strategies. Um, so
- 20:13just making sure that you kind of put
- 20:15your quant people and your traditional
- 20:16people on the same level and evaluate
- 20:18them objectively, uh, and don't let
- 20:21someone who's better at networking, uh,
- 20:24you know, get paid more because they can
- 20:25negotiate more. Like pay, uh, quants
- 20:28fairly and then, you know, other things
- 20:30like not requiring the people wear suits
- 20:32to work all the time. That's like a
- 20:33classic one is that, you know, a lot of
- 20:34these technical people don't want to
- 20:35have to dress up every day. They want to
- 20:37go in in jeans and a t-shirt. Um, so
- 20:39like little things like that and looking
- 20:41at the culture of your firm versus the
- 20:42culture of maybe a Silicon Valley tech
- 20:44firm, and I'm not saying that they're
- 20:45like the best culture. There's a lot of
- 20:47issues with that, but just comparing it
- 20:49and looking at what companies are
- 20:51attracting the best technical talent
- 20:53right now, you know, what, you know, and
- 20:55then comparing that to your culture and
- 20:56seeing if maybe there are differences
- 20:58that might be scaring away technical
- 20:59people.
- 21:01Yeah, I think that's a really good
- 21:02answer.
- 21:03Um, so these next few questions, uh,
- 21:06more quant orientated, um,
- 21:09and they revolve around factors. Um,
- 21:11obviously that was a big topic, uh,
- 21:13throughout a couple of the episodes,
- 21:15especially. Uh, so this question here,
- 21:18"How would you go about dealing with
- 21:19interaction effects between factors
- 21:22where the signal between the two is not
- 21:24additive? How is this taken into
- 21:27consideration within the workflow, uh,
- 21:29that we've discussed over these past
- 21:31episodes, and how common is it in
- 21:33practice?"
- 21:35So, I actually got really excited when I
- 21:37saw this question because, uh, this is
- 21:39right up my alley. I worked at a
- 21:41computational genetics lab for a long
- 21:43time, and the sole
- 21:45Well, not the sole, but a large part of
- 21:47what we did there was looking at looking
- 21:49for non-additive effects between genes,
- 21:52and and whether those non-additive
- 21:53effects were useful in predicting, um,
- 21:55risk prevalences of, you know, for
- 21:57different diseases. And, uh, so
- 22:01this is super interesting stuff. The
- 22:02short answer is that yes, this stuff is
- 22:04super important, and actually it just
- 22:06came up because, uh, so someone who's
- 22:09currently working, uh, he's
- 22:11developing some quant some content for
- 22:13Quantopian, it's this guy Rob Rider.
- 22:15He's a really, really good quant, career
- 22:17quant. Um, he actually teaches, uh, at,
- 22:21uh, NYU at at in their quant program.
- 22:23Really knows what he's doing. I I I
- 22:25really like him.
- 22:26Um, really nice guy, and, uh, he, uh,
- 22:30has been developing some stuff on
- 22:31Quantopian. If you look on the forum for
- 22:33Rob Rider, um, r e i d e r, you'll see
- 22:37some really good posts he's made. And,
- 22:39uh, he was actually bringing up this
- 22:40exact same point that he thinks it would
- 22:42be really good to do some posts on like
- 22:44looking at factor interactions.
- 22:46Uh, and and generally the way that those
- 22:48that would happen is you just kind of
- 22:50rather than looking at the short answer
- 22:51is like rather than looking at 1D graph,
- 22:54of, you know, factor versus future
- 22:56returns, you'd look at a 2D graph of,
- 22:58you know, one axis is each factor, and
- 23:00then maybe it's a heat map where the
- 23:02color of the graph at that point is is,
- 23:04you know, future returns on average. And
- 23:07And And looking for structure in that
- 23:08heat map. Um
- 23:10that might not make sense to a lot of
- 23:11people, but I think the person asking
- 23:13this question probably kind of gets what
- 23:15I'm saying there. Uh short answer is
- 23:17yes, it's something you want to
- 23:18consider, and it's I think one of a kind
- 23:20of at the forefront of of some of what
- 23:22modern quants are doing. Uh it's not
- 23:24something that's well established in
- 23:26industry as far as I know.
- 23:27Um so, definitely it's a good place to
- 23:30to start looking into. Uh and and I
- 23:32can't, unfortunately, go that much
- 23:34deeper into it without kind of getting
- 23:35into a lot of technical terms, but I
- 23:37just want to say like, yeah, it's a
- 23:38really interesting point. I would look
- 23:39at things like uh you know, just uh like
- 23:43come up for come up with a hypothesis of
- 23:45like why might two factors have an
- 23:46interaction that's non-linear and then
- 23:48test for that interaction because it is
- 23:51easy to get into the data mining problem
- 23:53where you've just like there's, you
- 23:54know, a bajillion possible two-way
- 23:56interactions, and you're you're likely
- 23:58to find one because of multiple
- 23:59comparisons bias, like we talked about
- 24:01in the first episode. Mhm. What we'll do
- 24:04is I'll dig up a link to the that forum
- 24:06post or those posts by Rob Carver, like
- 24:09you mentioned there, um and we'll stick
- 24:10it in the show notes. Just still on that
- 24:12same question, the signal between the
- 24:15two factors is not additive. What does
- 24:18additive mean in that sense?
- 24:21So, there's a there's this notion in in
- 24:24model development where you're saying,
- 24:25let's say that your model is um
- 24:29the returns on the market equals current
- 24:33value of factor one plus current value
- 24:35of factor two. So, that's a model,
- 24:37right? And And it may or may not fit the
- 24:38real world, but that's a model.
- 24:40Uh and that's a an additive model cuz
- 24:42you're adding two things together. It's
- 24:44otherwise known as a linear model. Um
- 24:46and then a non-linear model or
- 24:48non-additive model might be if the
- 24:50returns were equal to something more
- 24:51complicated, like factor one times
- 24:53factor two, or factor one squared minus
- 24:57factor two. You know, some some some
- 24:59more sophisticated relationship. And
- 25:03basically, there's argument that, you
- 25:04know, there may be interesting
- 25:07structures hidden in, you know,
- 25:09large-cap stocks behave differently from
- 25:12small-cap stocks. So, maybe large-cap
- 25:14stocks are more prone to mean reversion
- 25:16and small-cap stocks are more prone to
- 25:17momentum. I don't know. Like, that's
- 25:19just I'm completely picking that out of
- 25:20thin air. It's something you could test.
- 25:22So, that would be an example of a of an
- 25:24interaction where maybe you could like
- 25:26split the universe by large-cap stocks
- 25:29and just split the large-cap stocks and
- 25:31notice that mean reversion was more
- 25:32prevalent. Um and then just look at the
- 25:34small-cap stocks and notice that
- 25:35momentum was more prevalent. Uh and then
- 25:38that would be an example of how two
- 25:39factors are interacting in a non-linear
- 25:41way. You're not just adding them
- 25:43together. Okay. Well, I thought we
- 25:45should just maybe clarify that a little
- 25:46bit.
- 25:47Yeah, that's a great great point.
- 25:48Now, this next question here, it's a bit
- 25:50of a lengthy one, so I think it might be
- 25:53better if I just read it out cuz it
- 25:55sounds like there's a
- 25:56it's probably um important to the
- 25:58context of the question. So, all right,
- 26:00let's go.
- 26:01When would it make sense to group
- 26:03similar factors together into one factor
- 26:06in your model? For example, you might
- 26:09have some factors that all measure some
- 26:11variation of sentiment. In this case,
- 26:14the idea is that different variations of
- 26:17how you measure sentiment might pick up
- 26:19slightly different signals, but are
- 26:21still likely to be pretty correlated,
- 26:24thus diminishing their value as
- 26:27individual factors. Would it make sense
- 26:29to group these factors into one and
- 26:32combine this one master sentiment factor
- 26:35with other categories of factors? If so,
- 26:38what are the key things to consider in
- 26:40doing so? I think that's a good
- 26:42question.
- 26:43Yeah, it's a really good question. Um
- 26:45and I'm very happy again like I'll I'll
- 26:48I'll say it again, but uh I don't think
- 26:50I've said it yet, but I'll I'll say it
- 26:51again. Like I was very impressed at the
- 26:54quality of some of the questions that we
- 26:55got. You know, I'm
- 26:57unused to getting a lot of good
- 26:59questions when we put out, you know,
- 27:00like a call for questions. So,
- 27:03especially cuz I know that a lot of your
- 27:04listeners may have been getting into
- 27:05quant stuff for the first time. I was I
- 27:07was kind of impressed that we got a lot
- 27:09of these questions. So, this is a really
- 27:11good question. I think this demonstrates
- 27:12that whoever asked this question kind of
- 27:14really got some of the stuff that we
- 27:15were talking about in the earlier
- 27:16podcasts. The short answer is yes,
- 27:19that's something that might make a lot
- 27:20of sense to do. And a few points that I
- 27:23wanted to bring up are So, there's this
- 27:25notion of hierarchical clustering, which
- 27:27is a common technique now in
- 27:30you know, statistics and data science.
- 27:32And it's this notion of okay, well, if
- 27:34you have a bunch of things, let's kind
- 27:36of group them by how similar they are
- 27:38and then look at that.
- 27:39And people actually use it for portfolio
- 27:43construction. I recently saw a paper by
- 27:46One Qubit, which is a company that does
- 27:47I think it does quantum computing and
- 27:49they had a white paper which was talking
- 27:50about hierarchical portfolio
- 27:52hierarchical
- 27:54risk parity portfolio construction, I
- 27:56think. I need to go back and
- 27:57double-check. But So, that's an approach
- 27:58you might take where if you have a bunch
- 28:00of factors, you could actually look at
- 28:02the covariance matrices between the
- 28:03factors and then look at a hierarchical
- 28:06clustering of those factors based on the
- 28:07covariance matrix and then but from that
- 28:10decide whether a group of factors is
- 28:11better off just being lumped into one.
- 28:14That said, at the end of the day, all
- 28:16you're really doing by lumping them into
- 28:18one is reducing the weights that you're
- 28:19assigning to each individual one and
- 28:22controlling the exposure of the
- 28:24portfolio that you're holding at the end
- 28:26of the day. So, at the end of the day,
- 28:27the main thing that matters is what is
- 28:29the exposures on your final portfolio.
- 28:32And really all you're doing by grouping
- 28:33them into one is kind of it's more for
- 28:35your sake and like thinking about your
- 28:37model correctly and intuitively. And at
- 28:40the end of the day, like I don't think
- 28:42it necessarily changes what exposure or
- 28:46necessarily the behavior of your of your
- 28:48portfolio.
- 28:49And another thing just to remember is
- 28:50that it's factors all the way up and
- 28:52down, right? Like if you combine two
- 28:53factors, you're left with a factor. And
- 28:55if you combine 100 factors, you're left
- 28:57with a factor. So,
- 28:59you can combine two factors into one and
- 29:01then combine that with another one and
- 29:03then combine that with another one and
- 29:04like at the end of the day you're going
- 29:05to have some factor. And that factor is
- 29:07going to have a set of exposures based
- 29:09on what it's made up of. So, it's just
- 29:10kind of you can also view this as
- 29:12basically a problem of assigning
- 29:13weights. Like I'm not I'm not unless
- 29:15your models are are non-linear, you can
- 29:17combine factors in some non-linear way.
- 29:19As long as you're combining factors
- 29:21linearly, it's I think it's equivalent
- 29:22to just assigning different weights to
- 29:24the factors.
- 29:25Okay.
- 29:27How useful are classic models such as
- 29:30Heston, GARCH,
- 29:33IARCH from financial mathematics in
- 29:36creating trading strategies?
- 29:39It's a good question. Basically, it's
- 29:41just asking like, you know, I think this
- 29:42is asking like, "Hey, I learned these
- 29:43stuff in school or in a textbook. Like
- 29:45how much do they get used in the real
- 29:47world?" And then those models are
- 29:49pronounced GARCH and ARCH, which kind of
- 29:51GARCH doesn't really sound good, but you
- 29:53know, that's that's what it that's what
- 29:55it is. Stands for generalized ARCH. And
- 29:58we have actually have a lecture on it
- 29:59that we co-developed with Andre
- 30:01Kirilenko when he was working at MIT
- 30:03Sloan in the lecture series. But I mean
- 30:06the short answer is
- 30:07it varies. Like I've seen I'm not as
- 30:09familiar with Heston, but I've seen I've
- 30:11seen GARCH and ARCH used in practice
- 30:13for, you know, volatility modeling. I've
- 30:15seen all sorts of different models used.
- 30:18I think that it's really good to have a
- 30:22kind of
- 30:23all of these things in your toolkit, but
- 30:25at the same time you can't be wedded to
- 30:28specific models. Like you don't want to
- 30:30come from this perspective of I have
- 30:31this really cool model and I want to use
- 30:33it, right? Because that makes kind of no
- 30:35sense. What you want to do is you want
- 30:36to look at the data and then say, "Hmm,
- 30:39I interesting how this data is behaving.
- 30:41Let me go into my toolbox of models, my,
- 30:44you know, curated pantry of models and
- 30:46pick the model that I think is going to
- 30:47be a good fit for this data and then see
- 30:50if it fits. So, I would say rather than
- 30:52kind of focusing on the models
- 30:54themselves, just view them as, you know,
- 30:56one of many and and kind of knowing a
- 30:58broader set of models will help you
- 31:00understand more different types of
- 31:01behaviors you might see in data.
- 31:04Um now these this this next set of
- 31:06questions here
- 31:08uh more around machine learning. Uh
- 31:10machine learning was something that we
- 31:11spoke about on episode 5 and I know
- 31:14there's uh I think there's some lectures
- 31:16and I know there's certainly forum posts
- 31:18on the Quantopian site um discussing the
- 31:20topic as well. This question here
- 31:24sort of has uh two parts to it. Let's
- 31:27just tackle it. See how we go. So,
- 31:29in machine learning for trading, you
- 31:32know, okay, so I think they're
- 31:32referencing episode 5. You spoke of
- 31:36dimensionality reduction
- 31:38and then those reduced factors being
- 31:41used in a new model. So, two questions.
- 31:44The first one being, what kind of
- 31:46dimensionality reduction are we talking
- 31:48about?
- 31:50Those are kind of black box. Uh I don't
- 31:53know how to ask this one. Sure. I I
- 31:55think I know what they're getting at
- 31:56here. Um so, I can actually I I I think
- 31:58what they're getting at is uh whether
- 32:01this is kind of So, there's there's a
- 32:02few different kinds of dimensionality
- 32:04reduction and dimensionality reduction
- 32:05is really when you have a bunch of
- 32:08different like independent variables
- 32:10that all could explain your dependent
- 32:12variable and you don't know which ones
- 32:14or which combination of ones will
- 32:15explain your uh your independent
- 32:17variable, your outcome variable. And
- 32:20he's asking whether or not where you
- 32:21want to use some technique like singular
- 32:24value decomposition or principal
- 32:25components, which are effectively matrix
- 32:28operations. They come out of linear
- 32:29algebra and they take your data set and
- 32:31they effectively like
- 32:33contort it around such that what you're
- 32:35left with is a smaller set
- 32:38of
- 32:39uh of independent variables, new
- 32:41synthetic independent variables, and
- 32:43then it tries to figure out how much
- 32:44they explain your your outcome variable.
- 32:47So, the short answer is I wasn't talking
- 32:48about that method of dimensionality
- 32:50reduction, which is also a completely
- 32:52reasonable way to do dimensionality
- 32:53reduction for some problems. I was
- 32:55talking about the
- 32:58second more of the second one, which is
- 33:01you use ML to look at your features, and
- 33:05rather than constructing new synthetic
- 33:07features using, you know, principal
- 33:08components or whatever,
- 33:10you actually just like kick out a bunch
- 33:13of potential independent variables, a
- 33:15bunch of potential features. Same thing,
- 33:16when I say features, I mean independent
- 33:18variables. It's just machine learning
- 33:19speak. And you just kick out a bunch of
- 33:21them, and you let the ML thing say,
- 33:23"Here's your candidate set of five
- 33:26variables that I think are going to do a
- 33:27great job of explaining the outcome."
- 33:30And then from there, you construct a
- 33:33model on those five that you think will
- 33:35explain the outcome. So, that's the type
- 33:37of dimensionality reduction I'm talking
- 33:39about. You're reducing the potential
- 33:40dimensions by kicking out
- 33:42features. And then the the second part
- 33:45of the second question was, "Well, once
- 33:46you're there, why would you go back to
- 33:48using a simple model like linear
- 33:49regression? Why wouldn't you use
- 33:51something more sophisticated like a
- 33:53neural net or
- 33:56or like a vector machine or something?"
- 33:58And the short answer is like, if you use
- 34:01a more complicated black box model like
- 34:03a neural net, you're back to this
- 34:04overfitting problem, and you're back to
- 34:06this problem of poor visibility into
- 34:09whether the model works or it doesn't,
- 34:11and like as time goes on whether the
- 34:13model has stopped working. So, in
- 34:15general, like yeah, ML works really
- 34:17great on filtering and constructing and
- 34:19kind of pairing down data,
- 34:21but then at the end of the day, I prefer
- 34:23to have a simple model that I really
- 34:25understand well, and I understand what
- 34:26it's doing and what's the basis for it,
- 34:28and it's from a from a kind of a
- 34:30hypothesis test my hypothesis, it works
- 34:33perspective
- 34:34rather than I've constructed a neural
- 34:36net and it spit out something that seems
- 34:37to work out of sample, but I can't put
- 34:39my finger on exactly why. So, I mean,
- 34:42it's up to you. My preference is still
- 34:44to use simple models at that point in
- 34:46time. Again, we've talked about this a
- 34:47lot in the ML episode, so I'm not going
- 34:50to go into it too much, but I think that
- 34:51neural nets work
- 34:53more on like stationary environments
- 34:55where conditions don't change super fast
- 34:56and when conditions change fast, like
- 34:58you see in financial markets, it's
- 34:59better to have more transparency into
- 35:01that so you can pick up what's going
- 35:03wrong. Like, you know, we're we're doing
- 35:05some really sophisticated stuff now with
- 35:07neural nets and other forms of machine
- 35:08learning and for instance self-driving
- 35:09cars. They they work really well, I
- 35:12think better than humans at this point.
- 35:14But again, they're dealing with largely
- 35:16largely stationary properties of the
- 35:18environment, you know, like trees don't
- 35:19change how they look all the time and
- 35:21trees, you know, you go to one town over
- 35:23and trees are going to pretty much look
- 35:24the same. It's you know, you're not
- 35:26going to suddenly switch from from
- 35:27looking at tons of different kinds of
- 35:29trees all the time. So, my preference is
- 35:31still for using a simple model at the
- 35:33end of the day. Now, next question here,
- 35:35do you see deep learning as something
- 35:38that will disrupt trading either at
- 35:40hedge funds or automated investing
- 35:42services such as Betterment and
- 35:44Wealthfront,
- 35:46robo advisors I think they're also
- 35:47called
- 35:49or even impacting the market itself. Um,
- 35:52I'll just throw in a question before we
- 35:53get to that though. Do you just want to
- 35:55clarify what is deep learning referring
- 35:57to and how's it different from machine
- 35:59learning?
- 36:01Yes, we're on the exact same page. I was
- 36:03about to do the same thing myself. Deep
- 36:05learning is really just this notion that
- 36:07you're doing multiple layers of machine
- 36:10learning.
- 36:11So, you know, you have your inputs and
- 36:13then your outputs and rather than there
- 36:16just be
- 36:17say you know, one
- 36:19machine learning process in in there,
- 36:21maybe you have like multiple layers of
- 36:23machine learning processes. So, you'd
- 36:25have one process which is trying to fit
- 36:28a model and then you have another
- 36:29process which is trying to train many of
- 36:32those processes to fit many different
- 36:34models. So, um deep learning is just
- 36:36this kind of building complexity and
- 36:38building layers of complexity on top of
- 36:41traditional machine learning models. And
- 36:43and it seems to be working quite well
- 36:45for certain problems. You know, I think
- 36:47I suspect that some of the self-driving
- 36:49cars use some notion of deep learning uh
- 36:51somewhere in there. Apple recently
- 36:54released some interesting white paper
- 36:55work on internal research on um
- 36:58adversarial neural net training which
- 37:00is, you know, interesting in case people
- 37:02want to go check that out. Uh but I
- 37:04think that we talked about a lot of this
- 37:05stuff in the machine learning episode,
- 37:07but basically like I I think that where
- 37:10it's going to disrupt
- 37:12is in replacing jobs that are kind of
- 37:15more easily automated, but not as easy
- 37:18to automate as just, you know, writing a
- 37:20short script. Like um I think there is
- 37:22an example of an insurance company that
- 37:24recently started swapping out some of
- 37:26its claims adjusters or analysts with
- 37:28like uh you know, a deep learning
- 37:30system. Um basically an AI that would
- 37:33kind of do similar stuff because they
- 37:34realized that a lot of what their claims
- 37:35adjusters do is kind of repetitive or
- 37:38just the same thing a lot of the time.
- 37:40Um so I think what will happen is you'll
- 37:41start seeing
- 37:43uh departments, you know, start saying,
- 37:44"Well, why do we have to you know, hold
- 37:4720 equities analysts? Let's just replace
- 37:49them with, you know, an AI, but still
- 37:51have a few people that are in charge of
- 37:53vetting the output of the AI." You know,
- 37:55so the AI is looking at all these
- 37:57equities or your potential properties to
- 38:00buy or companies to acquire
- 38:02um and then suggesting things just like
- 38:03an equity analyst would. Uh and then um
- 38:07you know, you still have people checking
- 38:08those decisions and making sure they
- 38:10make sense, but you know, you can kind
- 38:12of automate a lot of the
- 38:14analytics work potentially. Now, we have
- 38:16one more question on machine learning
- 38:18here. So, how does Quantopian address
- 38:22machine learning efficiently? What are
- 38:24the best practices for using machine
- 38:26learning in the Quantopian research
- 38:28platform?
- 38:30To this, like, I just want to point to I
- 38:32think it's easiest just to point to some
- 38:33of the work that Thomas has done
- 38:35recently.
- 38:36Thomas, our our
- 38:38director of data science here at
- 38:39Quantopian, recently um
- 38:42point like released a bunch of examples
- 38:45in the forums. And if you just look up
- 38:46machine learning on Quantopian in the
- 38:48Quantopian forums, you'll find he did
- 38:50like a three-part series where he
- 38:52showed a ton of examples and and I think
- 38:54that rather than try to like explain
- 38:56what he did, just I would recommend go
- 38:58and check it out yourself cuz I I think
- 38:59it's pretty cool and and you can try the
- 39:01code out yourself. You can modify the
- 39:03code. It's It's a great starting point.
- 39:04Yeah. Yeah, great. That's probably your
- 39:06best bet. Of course, I'll dig up all
- 39:08those links and I'll make sure we put
- 39:09those in the show notes. So, they'll be
- 39:11at quantopian.com/chattraders
- 39:15and they'll also be on the Chat With
- 39:16Traders website as well. So, just
- 39:18whatever's easiest. Now, questions
- 39:21moving on from machine learning, we've
- 39:23kind of categorized these into I guess
- 39:26what could be called live trading. So,
- 39:28how do you measure the effectiveness of
- 39:31a strategy after it's live? Assuming all
- 39:34strategies will eventually lose their
- 39:36edge.
- 39:37And I just want to pick up on that. Do
- 39:39you think that's a fair assumption that
- 39:41all strategies will lose their edge over
- 39:43time? I don't like general statements.
- 39:46So, you know, I would not be comfortable
- 39:48making the statement that all strategies
- 39:50lose their edge. I would be comfortable
- 39:52making the statement that for any given
- 39:54strategy that you show me, it is
- 39:57incredibly likely that it will lose its
- 40:00edge at some point in time.
- 40:02So, for practical considerations, like,
- 40:05you know, assume that a strategy is
- 40:07going to lose its edge over time.
- 40:09And this is for multiple reasons.
- 40:11Usually, it's because the anomaly that
- 40:13you've discovered gets discovered by
- 40:14more people who start trading it and
- 40:16then, you know, it they force the prices
- 40:18in the direction against the strategy,
- 40:20and and there stops being anything left
- 40:22over to make money on.
- 40:24Um
- 40:25Or the market conditions change, and and
- 40:28the anomaly you have discovered
- 40:29gradually just evaporates. You know,
- 40:31there's there's multiple reasons
- 40:34that strategies lose their edge, but but
- 40:36pretty much everything does. Um and and
- 40:39there's a large field of statistics
- 40:41known as process control, which already
- 40:42kind of deals with this and says, "For a
- 40:44given process that I'm looking at,
- 40:46that's spitting out data at me, when
- 40:48should I worry about it? Like, at what
- 40:50point is this process changing, you
- 40:52know? Is it out of control?" So, I I I
- 40:55would look at that sub area of
- 40:57statistics.
- 40:58Uh
- 40:59I would say, you know, some metrics to
- 41:01look at make sense for all strategies.
- 41:02Sharp ratio is a really general one
- 41:04usually that works for a lot of
- 41:05different types of strategies, so you
- 41:07can just look at sharp ratio every day
- 41:10uh and see if it starts to decline. Um
- 41:12of course, like, it's really hard to
- 41:13know uh whether or not you're looking at
- 41:16like a minor deviation, something that's
- 41:18expected, or like something that you
- 41:19should actually be worried about that
- 41:21indicates the strategy is is over. It's
- 41:23done. It's not useful. So, process
- 41:25control has really kind of solved this
- 41:27not solved completely, but done a lot of
- 41:29work towards solving this problem of how
- 41:31do you differentiate random noise from
- 41:34an actual issue? So, I would say just
- 41:36base your analysis on what process
- 41:38control has already figured out. Um and
- 41:41then also, I would say beyond just the
- 41:43general metrics that people use like
- 41:44sharp ratio, max drawdown, try to also
- 41:46look at other metrics that are based on
- 41:48the components of your strategy. Kind of
- 41:50what is your economic hypothesis
- 41:52underlying your strategy? If you think
- 41:54that something to do with value is
- 41:56interesting and you're trading based on
- 41:57value, try to look at properties of
- 42:00value in the market and whether the
- 42:01properties of value in the market appear
- 42:03to have changed distinctly from when you
- 42:04started running your strategy. And
- 42:06sometimes what you can do, especially if
- 42:07you have a multi-factor strategy, is by
- 42:09analyzing the components of your
- 42:10strategy individually as well as the
- 42:12overall performance. You can catch
- 42:14individual components that have broken
- 42:16down before the entire strategy breaks
- 42:18down and then you can swap those
- 42:20components out for something new or
- 42:21better.
- 42:22So, don't don't just look at the the you
- 42:25know, the usual metrics. I think just
- 42:27also try to figure out what metrics make
- 42:29sense for your specific strategy and
- 42:31then also look at those with this notion
- 42:33of process control.
- 42:35Yeah, and I think this next question
- 42:37might be somewhat similar.
- 42:40But this person asks, how would you
- 42:41monitor for alpha decay and when would
- 42:45you decide that a strategy is no longer
- 42:46viable?
- 42:48Yeah, so I mean that's pretty much the
- 42:49same thing. It's just like looking at
- 42:51looking at the alpha over time and and
- 42:54the sharp ratio over time and other
- 42:56metrics and just you know, using kind of
- 42:58notions of process control and
- 43:00statistics to know whether you know,
- 43:02this new behavior you're observing is
- 43:04really different or you know, stuff
- 43:06that's within expected tolerances. And I
- 43:08think another point that I forgot to
- 43:10make during the you know, the first
- 43:12question but it's equally applicable
- 43:13here is that what's really important is
- 43:15that you set tolerances before you start
- 43:18running the strategy and you stick to
- 43:20them. And you don't like you know, give
- 43:22yourself a chance to be like, okay,
- 43:23well, it's it's outside of the tolerance
- 43:26that I set but it's made a lot of money
- 43:28and I really want to stick it, you know,
- 43:30keep going with it. Like that's the
- 43:32really dangerous point at which you're
- 43:33letting your emotions you know, kind of
- 43:34get in the way of all this math that
- 43:36you've done. So, set tolerances, stick
- 43:39to them and if you if it breaks the
- 43:41tolerances, take it off the market and
- 43:42then figure out you know, if you want to
- 43:44set new tolerances, if you want to sign
- 43:46new strategy, etc.
- 43:48And there's another component of the
- 43:49second question here which is just you
- 43:51know,
- 43:52if everybody's using factor models, are
- 43:54they going to decay? And the short
- 43:56answer is that it depends. I mean like
- 43:59yeah, certain factors are going to
- 44:00decay. Common factors that everybody is
- 44:02going and investing in are going to
- 44:04decay for sure. Like common factors, any
- 44:07of the price-based factors, like
- 44:09technical factors, you know, common
- 44:10factors like value or quality,
- 44:13um you know, by themselves are going to
- 44:15start decaying a lot, and you know, as
- 44:17everybody's using factor-based
- 44:18strategies.
- 44:19Uh but, you know, factors this notion of
- 44:22factor-based modeling is very general,
- 44:24and
- 44:25if you develop a new factor that other
- 44:26people aren't using, that's not going to
- 44:27decay. There's no reason it would decay.
- 44:29Factors are just ways of ranking stocks,
- 44:32you know? It's the the fact that someone
- 44:34else is using a factor strategy that has
- 44:35different factors isn't going to affect
- 44:37your factor strategy
- 44:39uh that has, you know, new factors that
- 44:41you've developed. Um so, it's important
- 44:44to kind of note that. Uh and then
- 44:46there's another component, which is just
- 44:47saying like, "How can anyone compete
- 44:49against machine learning models that are
- 44:51automatically picking the the best
- 44:53factors?" Well, uh the answer is just
- 44:55develop new and better factors, cuz, you
- 44:56know, all factors are going to decline,
- 44:58and and it doesn't matter if a machine
- 45:01learning algorithm, if it's presented
- 45:03with 20 bad factors, isn't going to be
- 45:05able to necessarily create something
- 45:06good. Uh you know, a lot of it really
- 45:09comes down to your factors. I would say
- 45:10that a machine learning model can kind
- 45:12of slightly boost the performance of
- 45:14factors, but it's not going to like turn
- 45:15a bad factor into a good factor.
- 45:18Excellent answer. I'm really pleased
- 45:20that you mentioned uh setting tolerance
- 45:22before you actually go live with a
- 45:23strategy. I was going to add that one if
- 45:25you didn't mention that, because I think
- 45:27that's really important. Um you know,
- 45:28once you're live trading a strategy, it
- 45:31it's very easy for your emotions to get
- 45:33in the way, just as it would be if you
- 45:35were to put on a trade by hand. You
- 45:38know, it's
- 45:39typically regarded as a good thing to
- 45:41know when you're going to get out before
- 45:43you get into the trade. Exactly.
- 45:46Okay, so I think this next question is
- 45:48referring to the slippage model, which
- 45:51is built into Quantopian. How does this
- 45:53compare to actual slippage numbers in
- 45:56live trading compared to practice?
- 45:59Sure. So, uh again, we just actually
- 46:03released a full research project. I
- 46:05think it's on the Quantopian blog. If
- 46:07you look at the recent posts, uh
- 46:09uh I'll also make sure it's it's it's
- 46:11linked to in the appropriate places, but
- 46:13it was by one of the members of our
- 46:15research team here, uh Gus, and and he
- 46:19actually did exactly this. He looked at
- 46:20our slippage assumptions, and he
- 46:22compared them to the actual slippage we
- 46:24are seeing in real life on trade
- 46:25execution. Um and you can kind of use
- 46:28that same type of analysis that he did
- 46:31uh in general to kind of do comparisons,
- 46:33but slippage completely depends on the
- 46:35brokerage, completely depends on the
- 46:37brokerage. I don't want to make any
- 46:37claims because it's really brokerage
- 46:39dependent. It's market dependent. Um and
- 46:42and it's you know, there's no I don't
- 46:43think there's any general model that's
- 46:45going to say like slippage is going to
- 46:46be this. Uh it's market dependent, it's
- 46:48season dependent, time of the day
- 46:50dependent. Um you know, and really you
- 46:53just have to model it like you do
- 46:54anything else in finance. And so, you
- 46:56know, banks have teams whose job is to
- 46:59model slippage. And uh you just kind of
- 47:02have to figure out a model that you
- 47:03think makes sense for slippage or use
- 47:05someone else's model that you think
- 47:06makes sense for slippage, and and just
- 47:08make sure kind of check in routinely,
- 47:10maybe you know, once every couple months
- 47:11and make sure that that model still
- 47:12makes sense. Or if you're, you know,
- 47:14trading more frequently, check in more
- 47:15frequently. And and and process control
- 47:17it just like you would any other metric
- 47:18on your algorithm. Yeah, cool. And
- 47:21that's how you understood that question
- 47:22as well. That's that's what they were
- 47:24trying to get at. That's what they're
- 47:25asking. That's how I read it anyway.
- 47:27Yeah, yeah. I think it was just like,
- 47:29you know,
- 47:30it's we talk about slippage abstractly,
- 47:32but what are actual slippage numbers,
- 47:34which is I think a perfectly reasonable
- 47:35question. Mhm.
- 47:37Yeah, but as you said, it it really
- 47:38depends on broker, and it's going to
- 47:40vary from broker to broker.
- 47:42So, this next set of questions we'll
- 47:44probably lump into the category of
- 47:46strategy questions. When should you be
- 47:49satisfied with your trading strategy? Uh
- 47:52this person mentioned that they have a
- 47:54return profile of a 1.6 sharp ratio, 17%
- 47:59annual returns, less than 10% maximum
- 48:01drawdown. Is this good? Would this be
- 48:04considered high enough to attract
- 48:06institutional capital? Is there a
- 48:08certain threshold or benchmark to aim
- 48:10for?
- 48:11Sure. And I mean, it it it might be
- 48:13annoying to hear this, but I mean, these
- 48:15metrics are all completely relative,
- 48:17right? And so, you know, if I'm
- 48:19advertising to you a car that has 30 mi
- 48:22to the gallon, well,
- 48:24what is the miles to the gallon of the
- 48:27competitor's car? And what's the price
- 48:28difference, you know?
- 48:30Uh so, it it's really hard to say. It's
- 48:32also important capacity analysis is
- 48:34really important, right? Like, you have
- 48:35a 1.6 sharp on what capital basis? You
- 48:38know, can you maintain a 1.6 sharp at 10
- 48:41million, at 100 million dollars? Cuz
- 48:43that's the amount that, you know, an
- 48:44institution's going to care about. Um or
- 48:46do you maintain a 1.6 sharp consistently
- 48:49out of sample on 10K dollars, right? It
- 48:52it it really there's a lot of factors
- 48:54that go into it, and and it's all
- 48:55relative. So, I'd say as a rule of
- 48:57thumb, um
- 48:59like, start with, you know, look for
- 49:02Make sure that you can consistently get
- 49:04a sharp greater than one out of sample,
- 49:06and and go from there, because the other
- 49:08important things to check are, you know,
- 49:10is this What is What are the factor
- 49:12exposures of your strategy? Is this just
- 49:14some combination of known factors in the
- 49:17market? Because if so, an invest
- 49:19Institutional investor isn't going to be
- 49:20that interested, because they can just
- 49:22buy those exposures as is.
- 49:24Uh so, the lower the sharp, uh you know,
- 49:26the more generally the more uncorrelated
- 49:29with other known factors it has to be
- 49:31uh to be interesting. And and even if
- 49:33you have like a not a great sharp ratio,
- 49:35if it's super uncorrelated with other
- 49:37stuff, it's just like some crazy new
- 49:39return stream, institutional investors
- 49:42may be interested purely for a
- 49:43diversification perspective. Even if you
- 49:45have multiple sharp ratios that are not
- 49:48so great, uh as long as they're
- 49:49independent and you add them together,
- 49:51the overall portfolio Sharpe ratio will
- 49:53be pretty pretty good because, you know,
- 49:55you your returns are additive, but your
- 49:57your variance increases um
- 49:59slower than your returns increase. Uh
- 50:01so, and and and you know, we talk about
- 50:04this in a bit in the position
- 50:05concentration risk lecture. Uh but uh
- 50:08but yeah, like again, it's all relative,
- 50:11and it really depends on what the
- 50:13options, you know, that the person who's
- 50:15buying the strategy from you has. But
- 50:17again, rule of thumb, you know, get
- 50:19Sharpe consistently above one out of
- 50:21sample, or if it's not above one, like
- 50:23make sure it's really uncorrelated with
- 50:25other known things. Okay. Now, this
- 50:27isn't a question that was submitted. I
- 50:29just want to bounce this question off
- 50:30your response there. Um the first thing
- 50:33you mentioned was the capacity of a
- 50:35strategy. Like, how scalable is it? Can
- 50:37it be traded on, you know, a hundred
- 50:39million dollars of capital, or you're
- 50:41just trading on a ten thousand dollar
- 50:42account? Is there any way to actually
- 50:45uh measure the capacity and the
- 50:47scalability of a strategy somehow?
- 50:51Sure. Uh so, this is like something
- 50:53that's going to be done a lot and and
- 50:54and I I we need to have a lecture on
- 50:57this added to the lecture series at some
- 50:58point. We we currently have not had the
- 51:00time to do so, but basically, what you
- 51:03do is you try to estimate it. Uh and
- 51:05again, like this is an estimation. I
- 51:07think you can get a pretty good idea for
- 51:08capital capacity. It's not as, you know,
- 51:10hard to model as other things.
- 51:12Um but it's what you do is you look at
- 51:15uh
- 51:16basically, there's things that restrict
- 51:18it in two directions, right? Uh there's
- 51:20things that restrict it in the small
- 51:22direction, which are commissions. So,
- 51:24you're paying a lot of commissions, um
- 51:26and you're not trading that much
- 51:27capital, then your commissions can eat
- 51:29up a lot of your profits,
- 51:31um and make it difficult to trade on
- 51:32small amounts of capital. And in in in
- 51:35the big direction, you can have trouble
- 51:37when you're running into being a high
- 51:39volume a high percentage of the market
- 51:41volume. So, if you're trading ten
- 51:43securities with ten million dollars, it
- 51:44means you're pumping a million dollars
- 51:46through each security. If you're trading
- 51:48low market cap securities, small cap
- 51:49securities, you may be a significant
- 51:52percentage of the market on any given
- 51:53trading day. And what that means is like
- 51:55you're trading against yourself.
- 51:57Nobody's going to sell or buy to you.
- 51:58You're going to get You're not going to
- 51:59be able to fill your orders. Your price
- 52:00is going to be terrible. Your slippage
- 52:01is going to be terrible. So,
- 52:03uh
- 52:04generally capacity analysis is done by
- 52:07with a back tester that will model
- 52:10uh slippage and and transaction costs
- 52:12for you. Just run it at a variety of
- 52:14different capital assumptions,
- 52:16uh and then see what the returns curve
- 52:19looks like uh for each of them. Um and
- 52:21and and see if you can kind of notice a
- 52:22peak where you kind of your strategy
- 52:24does best and then it falls off in
- 52:25either direction. Okay, very good. Are
- 52:28signals from price getting harder and
- 52:31harder to find because everyone seems to
- 52:33be trading from it? How do you want to
- 52:35tackle that one?
- 52:36Uh the ans- yes is the answer. It's It
- 52:40basically yes. It like signals that are
- 52:42based on price, factors that are based
- 52:43on price are super, you know,
- 52:46commoditized now. Like every single
- 52:47trading platform tries to sell you some
- 52:49technical analysis or some charts where
- 52:51they say like, "Here's uh you know,
- 52:53let's look at the charts on these stocks
- 52:55and let's look at they go up and down
- 52:56and let's try to pick patterns out."
- 52:58Like it's just everybody has access to
- 53:00that now and it's just completely
- 53:03arbitraged out. I don't want to say
- 53:05completely, but you know, it it's very
- 53:07arbitraged out. Um you're kind of
- 53:09trading against a mob. And and as such,
- 53:11because you're trading against so many
- 53:12people, you're vulnerable to mob
- 53:13psychology. So, some of these things
- 53:15like momentum technical indicators may
- 53:17work just because so many people are
- 53:18using them, right? If everybody uses the
- 53:20same momentum technical indicator
- 53:22uh and it's going up, well, everybody's
- 53:24going to get in on it and that's going
- 53:25to drive the price up and then everybody
- 53:26wins. But, at the same time, people are
- 53:29vulnerable to, you know, mobs are
- 53:30vulnerable to panics. Things may change
- 53:32at any given time. So, I think that
- 53:34quants generally tend to to shy away
- 53:36from using technical indicators alone
- 53:38because they can be, especially the
- 53:40common ones are just, you know, very
- 53:43very prone to people being a little
- 53:45scared on the market. I do like this
- 53:47next question. Someone here says, "I've
- 53:50got a profitable out-of-sample machine
- 53:53learning algorithm." I presume that's
- 53:54just referring to a trading strategy,
- 53:56"but it only works on one financial
- 53:58instrument. Should I be concerned about
- 54:01this? Is this normal?"
- 54:04Sure. Well, I mean, it it it really it
- 54:06depends on how you came up with the
- 54:08strategy, I think, and and and what
- 54:10evidence you have and how consistently
- 54:11it works out of sample. So, I mean,
- 54:15it's entirely possible that if you're
- 54:16looking at like one instrument, maybe
- 54:18the instrument is a sector ETF or a
- 54:19future. Like, you may have discovered an
- 54:23interesting pattern that affects just
- 54:25that instrument and, you know, is is
- 54:27predictive of the movement of that
- 54:29instrument. But, on the other hand, with
- 54:32just one instrument,
- 54:34you're you're you're setting yourself up
- 54:36for a huge amount of position
- 54:37concentration risk, right? And so,
- 54:38that's the lecture I'll cite it again
- 54:40here, but basically, if you're only
- 54:43investing in one instrument, like, if
- 54:45something weird happens to that
- 54:46instrument or if your accuracy is even
- 54:48slightly off, you're subject to huge
- 54:50problems. So,
- 54:52uh
- 54:53the short answer is like, you know, if
- 54:55you came in it from the perspective of
- 54:57like, I want to predict the price of
- 54:58this instrument and I have these
- 55:00variables that I think will work, and
- 55:01your machine learning algorithm works,
- 55:03that to me sounds much more likely.
- 55:06Uh and so, it's all about weighing
- 55:08evidence against prior. So, like, my
- 55:10prior is
- 55:11uh machine learning algorithms can be a
- 55:12little tricky. Um if it only works on
- 55:15one financial instrument, that's really
- 55:17suspicious to me because it it feels
- 55:19like it's just overfit and you're just
- 55:21getting lucky on that instrument. But,
- 55:23on the other hand, if you came to it
- 55:24from like, I think this will work
- 55:26because of A, B, and C, and then it
- 55:28works,
- 55:29that to me feels much stronger. Um and
- 55:31then maybe you could, you know, try the
- 55:33same approach. I think that it will work
- 55:34on this other instrument because of B,
- 55:36C, and D. And And if that works, then
- 55:38maybe you got a better workflow overall.
- 55:40But yeah, in general, if it only works
- 55:42on one instrument,
- 55:43I I'm very dubious of that just because,
- 55:45again, it's sample size of one. You
- 55:47know, that's not a lot of evidence
- 55:48showing that your workflow makes sense.
- 55:51Uh and then also like you can't really
- 55:52trade it effectively because it's just
- 55:54one instrument. Um and And you're
- 55:56setting yourself up for a lot of risk if
- 55:58you're just trading one instrument. What
- 56:00if this person was to create numerous
- 56:02strategies that still only happen to
- 56:05work on on one financial instrument, but
- 56:07they were different strategies on
- 56:09different instruments? Is that going to
- 56:11offset some of what you refer to as the
- 56:14um What was it? Position risk?
- 56:16Was that the right term? Yeah, position
- 56:18concentration risk, yeah. Uh
- 56:20absolutely. No, that And And I I
- 56:22completely Like that's a great way to go
- 56:23about it. Like if you can kind of spend
- 56:26a lot of time on one instrument, get
- 56:27something that works, spend a lot of
- 56:28time on another instrument, get
- 56:29something that works. Well, yeah,
- 56:30combine it, put together 10 instruments,
- 56:3310 strategies that all work on one
- 56:34instrument, have each of your strategies
- 56:36responsible for trading just that
- 56:37instrument, and then add in a bunch of,
- 56:39you know, longs and shorts that are just
- 56:41kind of neutral longs and shorts in the
- 56:43market just to increase your
- 56:44diversification um and avoid the
- 56:47probability that you get stuck in, you
- 56:48know, like if if one of these stocks
- 56:50tanks or does something weird that's 10%
- 56:52of your of your investments all of a
- 56:54sudden is in in trouble. So, yeah, just
- 56:57like I mean, that's not too different
- 56:59from like how analysts work, right?
- 57:00Analysts will specialize in in getting
- 57:02really good at modeling like, you know,
- 57:04a few companies and knowing a few
- 57:05companies and and understanding how
- 57:07those companies work. So, if you're
- 57:09doing that kind of process, uh
- 57:11great. But yeah, I would say like try
- 57:14replicating that same process that you
- 57:15did to get something that works on one
- 57:17instrument and try to see if you can get
- 57:18it on something that works on a few
- 57:19other instruments. Yeah. Yeah,
- 57:21definitely. This question here, I think
- 57:24it came from someone who obviously is
- 57:26quite familiar with options,
- 57:28and it's relating to the use of options
- 57:31for market direction. Do you look at the
- 57:34options delta to identify the
- 57:36probability of stocks increasing and
- 57:39decreasing?
- 57:40I mean,
- 57:41so that's a I'd say that's an example of
- 57:43a specific factor.
- 57:45Right? Like that would be one factor
- 57:47that you might use in a model to try to
- 57:49understand how the market's going to
- 57:50move. And an options delta, you'd have
- 57:53to I don't know. You I'd have to study
- 57:55it and I'd have to evaluate it and I'd
- 57:56have to say like is options delta still
- 57:59a good predictor of market direction?
- 58:00How has it done historically? You know,
- 58:02do I have any evidence that it stopped
- 58:03working? That it's continued working? So
- 58:06like short answer is I don't know about
- 58:08specifically about like, you know, using
- 58:10options delta to to look at stocks.
- 58:12Certainly it sounds like it might be a
- 58:13valuable piece of data, but it really
- 58:15just you have to evaluate it and then
- 58:18see how it fits into the rest of your
- 58:19model. Yeah, I mean it's something that
- 58:21could certainly be tested, isn't it?
- 58:23Exactly. Like this That's what I say
- 58:25about all these things. Like people like
- 58:27to have philosophical debates about like
- 58:29the underpinnings of like does technical
- 58:32analysis work? Or does, you know, using
- 58:34this specific factor work? Well, I just
- 58:36test it, you know? Just just go out and
- 58:38and test it and see if it works.
- 58:40That's the nice thing about all these
- 58:41things is they're all they're all just
- 58:43models. They're all just ways of
- 58:45understanding the world. And and and as
- 58:47long as you're constantly testing them
- 58:48and making sure that they still work,
- 58:50it's fine.
- 58:51Do you recommend any other ways to find
- 58:54alpha factors that define probability
- 58:57mainly without having to rely heavily on
- 58:59Python?
- 59:01So that kind of sounds as though this
- 59:03person isn't a programmer, but isn't
- 59:05interested in this taking a quantitative
- 59:08look at their trading.
- 59:10Yeah, I mean I I I feel like so that's
- 59:12just kind of getting at this point of
- 59:13like how do you find new factors? Right?
- 59:16And
- 59:18I'll I'll go back to I think what I've
- 59:19said before, which is that, you know, I
- 59:20would look at new data sets. Things that
- 59:24other people aren't looking at yet. Like
- 59:25do you have access to data that is, you
- 59:28know, kind of not commonly used at other
- 59:30financial firms? Can you collect a new
- 59:32data set in an interesting way?
- 59:35Um, you know, etc. Uh,
- 59:37and
- 59:39uh, you know, can you can you use
- 59:40weather data to kind of figure out if
- 59:43uh, oil companies are going to have
- 59:45shocks to their production and
- 59:46therefore, you know, like there's
- 59:47there's lots of new data sets you can
- 59:48look at. And yeah, and then also just
- 59:50looking at interactions between known
- 59:52factors like we were talking about
- 59:53earlier. Those are those are two ways to
- 59:55kind of come up maybe with interesting
- 59:57new factors. Um, if you don't want to
- 59:59rely on Python too much, it can get a
- 1:00:01little tricky just because a lot of this
- 1:00:02factor-based stuff does require kind of,
- 1:00:04you know, a lot of data processing and a
- 1:00:06lot of um, you know, chunking, parsing
- 1:00:09data, importing data,
- 1:00:11um, and then like evaluating the
- 1:00:13outcome. But but you can start thinking
- 1:00:16about kind of ways of of looking at new
- 1:00:18data sets that might be kind of
- 1:00:20interesting and novel.
- 1:00:22At Quantopian, are you seeing a shift to
- 1:00:25other types of strategies than
- 1:00:28perhaps strategies that were more common
- 1:00:29in the past? As in like what timeframe
- 1:00:32would be seen the most now and what kind
- 1:00:35of strategies seem to be disappearing?
- 1:00:37It's a little tricky for us to answer
- 1:00:39that because we don't look at people's
- 1:00:41strategies like
- 1:00:43we we can see what's going on in the
- 1:00:45forums for stuff that people have posted
- 1:00:47publicly.
- 1:00:48And we can look at the industry of what
- 1:00:50people are developing. So, like the
- 1:00:51short answer is like I don't really have
- 1:00:53an answer for you on that front. Um, I
- 1:00:56think that in broad terms the industry
- 1:00:57is moving towards
- 1:00:59uh, you know, constructing portfolios
- 1:01:01based on factors and analyzing
- 1:01:03portfolios based on their factor
- 1:01:04exposures.
- 1:01:06Um, and also kind of like aggregating
- 1:01:08many many managers or many many models
- 1:01:10together into like overall aggregate
- 1:01:12models that work much better when, you
- 1:01:14know, taken as a whole
- 1:01:16than the individual parts.
- 1:01:18Uh, but like aside from those broad
- 1:01:20trends, like people are working on all
- 1:01:22kinds of crazy stuff and and I think
- 1:01:23just like
- 1:01:25the main thing is just kind of like
- 1:01:26figuring out what your big piece of
- 1:01:28expertise is. Like, what do you bring to
- 1:01:30the room that other people don't? And
- 1:01:32and really drilling down hard on that.
- 1:01:34It's no different from anything else.
- 1:01:36Like, what is your competitive
- 1:01:37advantage? And drilling down hard on
- 1:01:39that competitive advantage.
- 1:01:41In regard to portfolio optimization, is
- 1:01:44it possible to have too many
- 1:01:46constraints? I I quite like this
- 1:01:48question and I think it's something that
- 1:01:49we actually didn't address um on episode
- 1:01:524, which was dedicated to portfolio
- 1:01:54optimization. So, what do you think
- 1:01:56about this? Is it possible to have too
- 1:01:58many constraints on your portfolio?
- 1:02:01Yes, certainly. Absolutely. The
- 1:02:04Generally, the bad case of having too
- 1:02:06many constraints on your portfolio is
- 1:02:08that your optimizer will fail to
- 1:02:09converge and just be like, I can't solve
- 1:02:12this problem. If there are too many
- 1:02:13constraints, there's no feasible
- 1:02:15solution.
- 1:02:16Uh which isn't a terrible case, you
- 1:02:18know, it's kind of a nice failure mode
- 1:02:19where it tells you that it failed um
- 1:02:22rather than you losing money.
- 1:02:24I mean, other cases may also be that it
- 1:02:25just is unable to make any trades if you
- 1:02:27have too many constraints. Um and
- 1:02:29there's various ways to interpret that,
- 1:02:31right? Like, on the one hand, you could
- 1:02:32say, "I'm over constrained."
- 1:02:35But on the other hand, you could say,
- 1:02:37"Given these sensible constraints that I
- 1:02:39set, there's just no good trades right
- 1:02:41now."
- 1:02:42And so, it's it's important to kind of
- 1:02:44again
- 1:02:45kind of
- 1:02:46pick reasonable constraints and stick
- 1:02:49with them and and not kind of let you uh
- 1:02:52emotionally later then try to to change
- 1:02:54that. So,
- 1:02:56um as long as you have a good process in
- 1:02:58place for creating these constraints, um
- 1:03:02I I think that's the main thing and then
- 1:03:03just kind of stick with them until you
- 1:03:05have a lot of evidence that, you know,
- 1:03:07maybe they're not very good constraints
- 1:03:09to be using anymore. But yeah, I I mean,
- 1:03:12like, I think the failure mode of having
- 1:03:14too many constraints is generally just
- 1:03:15going to be that the optimizer isn't
- 1:03:17going to converge. Sure. Sure.
- 1:03:20Now, this last category of questions
- 1:03:22here mainly revolve around the actual
- 1:03:25Quantopian platform and Quantopian as a
- 1:03:28fund. Um
- 1:03:30So, this first question here in this
- 1:03:32category, uh this may be one that's
- 1:03:34better for the the forum, but someone
- 1:03:37here says, "Not understanding how stop
- 1:03:39limit orders are handled on Quantopian.
- 1:03:42I don't see any references to it in the
- 1:03:44documentation."
- 1:03:46Uh yep, so I would say honestly that
- 1:03:48yeah, just just post that in the forum.
- 1:03:50You're going to get a much more detailed
- 1:03:52response, I think. Basically, that if
- 1:03:54you go to quantopian.com/help,
- 1:03:56it it describes the order method and it
- 1:03:58shows you how you can implement
- 1:04:00uh a stop limit order. And if you really
- 1:04:02want to get down and dirty into the code
- 1:04:03and and uh you can uh actually even just
- 1:04:06go check it out yourself on GitHub. If
- 1:04:08you go to GitHub and you look at the
- 1:04:09Python underlying the order method in in
- 1:04:12Zipline and the precise path of that, if
- 1:04:13you go to the Zipline repo,
- 1:04:15you go Zipline Zipline finance order.py
- 1:04:20is the file which has uh the order
- 1:04:22methods in there. So, but just I would I
- 1:04:25would post that in the forums and you'll
- 1:04:26get you'll get better better response.
- 1:04:28Um at least that way you'll be able to
- 1:04:29get some code that you can implement and
- 1:04:32and try out, too. Are there any plans to
- 1:04:34add international exchanges and data in
- 1:04:37the near future? And in such a case,
- 1:04:40will the portfolio API be able to manage
- 1:04:43multiple assets from global exchanges
- 1:04:46and different currencies in the same
- 1:04:47portfolio?
- 1:04:49So, two questions there. Yes, we we have
- 1:04:51definite plans to add uh international
- 1:04:55um
- 1:04:56international uh equities
- 1:04:59uh as a tradable market on Quantopian.
- 1:05:02Uh I don't want to set a timeline on it.
- 1:05:04Like when you say near future, usually
- 1:05:05that's taken to mean within the next,
- 1:05:07you know, couple months. Certainly,
- 1:05:08we're not running on that kind of time
- 1:05:10frame. We're working on getting futures
- 1:05:11out the door
- 1:05:13uh first. And then when we get futures
- 1:05:14out the door, we'll decide what the next
- 1:05:16set of tradable markets we want to add
- 1:05:18is. And And of course, there's a lot of
- 1:05:20considerations into building that.
- 1:05:22So, I don't want to give you a precise
- 1:05:23timeline, but certainly we are it is in
- 1:05:25our queue.
- 1:05:27And
- 1:05:29in regards to the second part, yeah, we
- 1:05:31have full intention to as we add more
- 1:05:33asset classes, make it all tradable from
- 1:05:35within the same algorithm, same API. It
- 1:05:37all works from the same system. And
- 1:05:39actually, I think that's going to be
- 1:05:40pretty interesting because very few
- 1:05:41other non-institutional systems give you
- 1:05:44the ability to kind of have one
- 1:05:46algorithm which controls your portfolio
- 1:05:48across multiple asset classes. And it
- 1:05:50opens up things like you know,
- 1:05:53cross-market arbitrage and being able to
- 1:05:55hedge futures positions with you know,
- 1:05:58equities. So, we're actually pretty
- 1:06:00excited to be able to to trade say like
- 1:06:03equities and futures in the same
- 1:06:04algorithm. And then hopefully when we
- 1:06:05add more tradable markets, trade them
- 1:06:07all within the same algorithm.
- 1:06:09And is there a timeline for when futures
- 1:06:11will be added to Quantopian?
- 1:06:13I don't want to give a specific date on
- 1:06:17it.
- 1:06:17Certainly, I would say
- 1:06:20we're we're working as hard as we can to
- 1:06:23get that out right now. We have a lot of
- 1:06:26people kind of making sure that that
- 1:06:29gets out the door as as quickly as
- 1:06:30possible.
- 1:06:32I I don't want to over promise because
- 1:06:34the classic failure mode in in in
- 1:06:35engineering is that you say you put a
- 1:06:37specific date on it and then something
- 1:06:38comes up and then you're like, "Oh,
- 1:06:40well, now we can't get it done by that
- 1:06:41date." But certainly
- 1:06:44certainly, you know, I would
- 1:06:47keep keep an eye out keep an eye out.
- 1:06:49We're working on it. It's It's It's
- 1:06:50coming, I promise.
- 1:06:53Certainly, you know, it's It's not going
- 1:06:55to be a a long time at this point. Okay.
- 1:06:58So, it would be safe to say expect to
- 1:07:01see futures on Quantopian sometime in
- 1:07:042017.
- 1:07:06I would I would I would yeah, I'll I'll
- 1:07:09I'll say that. I'll say that. If if we
- 1:07:11yeah, I think definitely definitely
- 1:07:13within 2017. Again, I'm so I'm so
- 1:07:16worried about over promising, but I that
- 1:07:18is a safe that is a safe statement.
- 1:07:20Okay. Okay, sure. Well, I'm keen to see
- 1:07:22that see that happen. Um do you have any
- 1:07:25plans to support deep learning on
- 1:07:28Quantopian, of course? How would that
- 1:07:30work in the event-based architecture of
- 1:07:33the backtester?
- 1:07:34Sure. So, uh the short answer is yes, we
- 1:07:37absolutely we do want to and we we've
- 1:07:39thought about a lot of different ways to
- 1:07:40make the current API more friendly
- 1:07:43towards machine learning and deep
- 1:07:44learning.
- 1:07:45Um and that includes things like, well,
- 1:07:47can we have maybe some kind of
- 1:07:49uh asynchronous call outs where you
- 1:07:51could, you know, call out to some model
- 1:07:53that trains itself and then it would get
- 1:07:55the results back and etc. So, there's
- 1:07:56lots of different ways to potentially
- 1:07:58solve that problem. We're working on
- 1:08:00thinking about how that might happen.
- 1:08:02Um but as far as like what you can
- 1:08:04currently do on the platform, again,
- 1:08:06I'll point to Thomas's stuff where he
- 1:08:07went through that series of three
- 1:08:08examples of using machine learning on
- 1:08:10the platform as is and there's actually
- 1:08:12a good amount of stuff that you can
- 1:08:13currently do on the platform. So, uh I
- 1:08:16would just uh look at what he wrote and
- 1:08:17then, you know, we're we're working on
- 1:08:19improving the product to be able to
- 1:08:21support more cases. Okay. And how do you
- 1:08:24add a private feed to the Quantopian
- 1:08:27platform? I I think this question is
- 1:08:29really asking, is it possible to work
- 1:08:31with your own data as well as the
- 1:08:33Quantopian data that's available?
- 1:08:36Uh sure, there's two ways. Both times
- 1:08:37you have to have basically a CSV. When
- 1:08:40when any of you're looking to integrate
- 1:08:42it into the research environment and do
- 1:08:43research on it, um you can do that just
- 1:08:46by uploading the CSV into the research
- 1:08:47environment uh and and there's tutorials
- 1:08:50and documentation on that in the
- 1:08:52research environment under the tutorials
- 1:08:54and API and documentation folder. Um and
- 1:08:57then if you're looking to integrate it
- 1:08:59into your algorithm, again, at
- 1:09:00quantopian.com/help,
- 1:09:01if you look for fetcher fetch CSV fetch
- 1:09:05CSV, that's how you would integrate it
- 1:09:06into an algorithm
- 1:09:08you know to pull in maybe like some
- 1:09:09daily values for something that some
- 1:09:12private
- 1:09:13data signal that you've you've
- 1:09:14developed. But again, like both of these
- 1:09:16questions I think are or this question
- 1:09:19is particular is is another good forum
- 1:09:20question if if that doesn't clarify it
- 1:09:22for you. Yeah, absolutely. Can an
- 1:09:24individual license an algorithm to use
- 1:09:27to trade? I'm not 100% sure exactly who
- 1:09:30wants to license an algorithm but
- 1:09:32maybe you understand that question a
- 1:09:33little better.
- 1:09:35I think this is kind of we get similar
- 1:09:37questions a decent amount so I don't
- 1:09:39want to assume I know what this person's
- 1:09:40thinking but I the other questions we
- 1:09:41get is like
- 1:09:43can I kind of like come to Quantopian
- 1:09:46see the algorithms that people have
- 1:09:48written and then like license an
- 1:09:49algorithm to to to run my own money
- 1:09:52through and the answer is no that's not
- 1:09:54that's not the business model that we're
- 1:09:56pursuing. Um so
- 1:09:59the short answer to that question I
- 1:10:00think is is is no our our focus is on
- 1:10:03being able to make
- 1:10:04large institutional sized allocations to
- 1:10:07quants who develop strategies. You know,
- 1:10:10our plan for that is we are planning to
- 1:10:13open up um
- 1:10:16an investment vehicle to institutional
- 1:10:18investors at some point in 2017 and then
- 1:10:21use that investment hopefully to be able
- 1:10:24to make large institutional sized
- 1:10:27allocations to quants who have developed
- 1:10:30strategies on the platform and then you
- 1:10:31know, sizes of allocations that would be
- 1:10:33competitive to what you might get you
- 1:10:34know inside a large
- 1:10:36financial institution. So that's our
- 1:10:38current focus. Yeah, absolutely. Will we
- 1:10:41be able to use algorithms developed on
- 1:10:43Quantopian on a trading platform for our
- 1:10:46own investment purposes? I think this
- 1:10:48question's getting at two things. One is
- 1:10:51like does Quantopian take any of the
- 1:10:52intellectual property or restrict you
- 1:10:54and and the answer is no we we don't
- 1:10:55take any you know, intellectual property
- 1:10:57and we don't put in place any
- 1:10:58restrictions. Anything you do on the
- 1:10:59Quantopian platform is yours and and
- 1:11:01that's defined in the user agreement on
- 1:11:03the website and you can take it and you
- 1:11:05can do whatever you want with it.
- 1:11:07Um if you're in a position where we
- 1:11:09have, you know, selected your algorithm
- 1:11:11for a potential allocation, um then, you
- 1:11:14know, it it we would put in place uh
- 1:11:17restrictions on how you'd be able to use
- 1:11:18your algorithm ex you know, outside of
- 1:11:20that just to make sure that we, you
- 1:11:21know, protect the allocation we make to
- 1:11:23your strategy, but unless you're in that
- 1:11:26world where you're already be considered
- 1:11:27for an allocation, there's no
- 1:11:29restrictions. You can you can use it
- 1:11:30wherever.
- 1:11:31Um so I think that's what this question
- 1:11:34is getting at.
- 1:11:35How do you determine whether my strategy
- 1:11:38is a good fit for Quantopian's
- 1:11:40portfolio? That is a complicated
- 1:11:43question that we spent the last a good
- 1:11:44part of the last 18 months trying to
- 1:11:46figure out ourselves. So
- 1:11:48uh
- 1:11:50the short answer is we do a lot of
- 1:11:51different things uh
- 1:11:53and it's really like I don't
- 1:11:55I can't really
- 1:11:57uh
- 1:11:58kind of answer that now easily, but
- 1:12:01there's two resources I'll I'll probably
- 1:12:02want to point people to
- 1:12:04um and the two resources are there's
- 1:12:06actually a webinar that uh
- 1:12:09Jess Stauth, who was one of your one of
- 1:12:10the podcast guests, uh just did
- 1:12:13with the data incubator, which is a data
- 1:12:15science uh organization um and and that
- 1:12:18should have be released like now or
- 1:12:20shortly. So I think she talked about our
- 1:12:23process there a bit and then also
- 1:12:26there's um a webinar that's coming up uh
- 1:12:29well, will already have happened uh by
- 1:12:31the time this is released, but uh that
- 1:12:32was done uh by Jamie, who's someone at
- 1:12:35Quantopian, and it was talking about how
- 1:12:37to get an allocation on Quantopian and
- 1:12:39he goes through some of that process
- 1:12:40there as well. So there's a there's a
- 1:12:41lot of different stuff um
- 1:12:44and it's kind of too complicated to
- 1:12:45address in a in a short time frame, but
- 1:12:47I would I would point people to those
- 1:12:48two those two resources. Sure. Um so I
- 1:12:52presume those webinars will be on
- 1:12:53YouTube, so I'll just grab a link and
- 1:12:55we'll we'll put those in the notes.
- 1:12:57Okay, now, we've only got another couple
- 1:12:59questions here. Uh, this one, what
- 1:13:01percentage of your members do you
- 1:13:03believe will ultimately get a capital
- 1:13:05allocation? I presume that's quite
- 1:13:07difficult to say, but um, I'll let you
- 1:13:09answer that however you please.
- 1:13:12Sure.
- 1:13:13Uh, I mean, yeah, it's it's really
- 1:13:14difficult to say. Um,
- 1:13:17and and it's not something that we
- 1:13:18honestly know at this point. Uh, it it
- 1:13:21really depends on the amount of of good
- 1:13:24strategies that are produced and
- 1:13:26um, you know, how much uh, capital
- 1:13:29Quantopian has to allocate out to the
- 1:13:31strategies. So, those are the two sides
- 1:13:34of the market where, you know, how much
- 1:13:35capital do we have, how much supply of
- 1:13:37good strategies we have, and it's really
- 1:13:39like, you know, I can't really predict
- 1:13:40how that market is going to turn out.
- 1:13:42Um, and and how much how many
- 1:13:44allocations we're going to make. You
- 1:13:46know, certainly I think that we're also
- 1:13:48focusing on adding value beyond just
- 1:13:50getting an allocation. So, like
- 1:13:51something we're actually focusing on a
- 1:13:53lot now is expanding our educational
- 1:13:56initiatives. So, uh, something we've
- 1:13:58noticed is that, you know, a a good
- 1:13:59number of users who come to the platform
- 1:14:01actually want to learn
- 1:14:02uh, kind of before anything else. And
- 1:14:04and so, we're focusing on also being
- 1:14:05able to make sure that like
- 1:14:07regardless of how, you know, regardless
- 1:14:09of whether you get an allocation, we
- 1:14:11want you to come away from the platform
- 1:14:12having learned a lot. Um, and so, uh,
- 1:14:15you know, we're trying to make sure that
- 1:14:16users kind of benefit regardless of how
- 1:14:18their their their time goes on the
- 1:14:21platform.
- 1:14:22Very good. All right, Delaney, let's
- 1:14:24leave it at that. Um, I just want to
- 1:14:26quickly say thank you to everyone who
- 1:14:28submitted questions. I think there's a
- 1:14:30lot of really good questions in there.
- 1:14:32And uh, thanks so much to everyone who's
- 1:14:34been listening uh, to this series. It's
- 1:14:36been a lot of fun. Thanks, Delaney.
- 1:14:38Yeah. Yeah, absolutely. And I apologize
- 1:14:40if there's anybody whose questions we
- 1:14:41didn't get to. Again, it's just like I
- 1:14:43said, like I was impressed at both the
- 1:14:45breadth and quality of questions that we
- 1:14:46got. So, you know, the the downside of
- 1:14:48that is that we can't answer all of
- 1:14:50them.
- 1:14:50Um but again, the Quantopian forums
- 1:14:53exist, so if you feel wronged that we
- 1:14:55didn't get to your question, um complain
- 1:14:57to me on the Quantopian forums and and
- 1:14:59hopefully I'll see it.
- 1:15:00So you can do that at
- 1:15:01quantopian.com/chatwithtraders.
- 1:15:05Uh Delaney, let's leave it that. Thanks
- 1:15:06very much, man. I appreciate it.
About this transcript
This page contains the full transcript of Q6: Your Quant Trading Questions Answered · Delaney Mackenzie by Chat With Traders, generated from the public captions YouTube serves with the video. The transcript has 14,603 words across 2,237 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.