delta-theoretic

Blog

  • Stat Arb on QuantConnect

    So I ran a backtest of a prototype stat arb system on QC. Link with code and results is here:
    https://www.quantconnect.cloud/backtest/3f856cd9dcc28e4efc07dc818cddc08e

    I was pretty happy with the initial result – but the performance falls apart with different parameters, like a longer backtest period. I guess the period in the above run was just a favorable market regime.

    The code is a mixture of my own work and work done by an AI agent co-developer. I handled a lot of the basics, like universe selection and neutralization logic. I asked the AI to implement ideas from Zura Kakushadze’s paper here:

    https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2478345

    I have a feeling the AI didn’t do as deep of a job as is possible. I think I will have to thoroughly read the paper and adapt the ideas into code on my own. (ChatGPT pretty much agrees haha)

    The paper is about adding layers of processing to signal neutralization. This is important because it is a possible solution to a problem I run into when trading off of neutralized alpha alone.

    I’ve recreated many of the alphas from Zura Kakushadze’s “101 Formulaic Alphas” from a data wrangling perspective, but they simply don’t work with only neutralization to take positions with.

    For reference, the 101 alphas paper is here:

    https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2701346

    So all of this was inspired by the time I spent with WorldQuant as a contract Research Consultant. But it seems WorldQuant’s training materials left some things out. Probably by design to hinder competition. Would make sense to me if that was the case anyway. Kakushadze’s work on portfolio optimization also clues me in on this.

    So here I am – thinking about optimization matters. I definitely have to brush up on linear algebra though.

  • Alpha in Statistical Arbitrage

    To build off the last post, let’s examine the expected return of a skillfully constructed market neutral portfolio:

    \(E[r_p]=E[\alpha_1]-E[\alpha_2]\)

    Looking at this, it’s straightforward to see that if we can expect the second alpha to be negative, and the first alpha to be positive, we’ll have a very positive expected portfolio return.

    But in what case would this happen, you might ask. Well if the alphas are realizations of a specific quantification of a single factor, and you run this quantification across a pair of stocks, then it’s like seeing the manifestation of a single factor across your cross section of 2 stocks.

    So pricing inefficiencies across a cross section would arise from the buy/sell pressure imbalance that is captured by different scores on the quantification of this factor.

    One might think of it as the cross section having a buy/sell imbalance spread around a factor.

    Now when we think of stat arb beyond pairs trades through this lens, we can frame the endeavor as probabilistic betting on momentum or reversion based on factor quantification.

  • Market Neutrality from a CAPM Perspective – with a bit on what alpha is

    One way to view the construction of market neutral portfolios is through the lens of CAPM, through which we can model returns on an asset as

    \(R_i = \beta_i (R_m – R_f) + R_f +\alpha_i \)

    where beta is the sensitivity of an asset’s return, as fit through simple linear regression, to the market excess return, and alpha is the abnormal, or excess return of the asset. Alpha would also be known as an error term in stricter linear regression terminology. It represents yet unexplained portions of the return and that will be relevant later in this post.

    Consider a pairs trading scheme. We know that in pairs trading, a simple form of statistical arbitrage could be used to always short one stock and long the other. One could model the return of the portfolio consisting of a pair as:

    \(R_p = R_1 – R_2 = (\beta_1-\beta_2)\cdot(R_m – R_f) + R_f – R_f + \alpha_1-\alpha_2\)

    If we assume that the pair has been chosen skillfully, and, that for whatever reasons such as fundamental alignment, it is safe to assume that each stock has an equal beta to the other, then the equation above collapses to:

    \(R_p = 0 \cdot (R_m – R_f) + 0 + \alpha_1 – \alpha_2\)

    \(R_p = \alpha_1 – \alpha_2\)

    Wrapping the resulting equation in some syntactic sugar from probability theory, we get:

    \(E[R_p] = E[\alpha_1] – E[\alpha_2]\)

    So we see that the return of such a portfolio doesn’t depend on market conditions at all, and relies entirely on the abnormal return.

    Since we are shorting asset 2, we would only do so when its alpha is expected to be negative. And since we are going long on asset 1, we would want our position to coincide with its positive expected return so that the net return on our portfolio is only ever positive.

    If we consider that alpha factors often manifest in a cross sectional manner, we can see that it would be reasonable to define alpha in terms of a single dimension or axis, mathematically speaking.

    In other words we are free to quantify alpha for both stocks in the portfolio on just one formula/metric/KPI so that we know to go long on the stock with a higher value on this metric and to go short on the one with a lower value.

    That’s it for my post for now. I’m totally open to questions. Especially if something is unclear. It helps me think things through further.

  • Blog Day 1

    Just started this blog to help with my research efforts. Sometimes, I’ll post short thoughts that don’t necessarily require a whole paper.