Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Member-only story

How to do factor investing

25 min readOct 2, 2026

--

Part 3 of 3 in a series on stock characteristics and factors: 1. What a straight line can miss about stock returns, 2. Testing a stock characteristic as a factor, 3. How to do factor investing.

Factor investing selects and weights stocks by fixed rules based on their characteristics. Value measures how cheap a stock is relative to its fundamentals, and momentum is its return over the past year; using several characteristics together is multifactor investing. Part 2 tested whether a characteristic is a factor. This post takes value and momentum as factors and uses them to build and maintain a portfolio on simulated data.

The portfolio is long-only: it owns stocks and never sells borrowed shares. A factor return in academic papers, such as HML, the value factor of Fama and French (1993), is the return of a long-short portfolio, which buys value stocks and sells borrowed shares of growth stocks.

The simulated data is a daily panel, as a data vendor delivers it: one row per stock and trading day, with the date, ticker, total return, market cap, book equity and sector of 500 stocks from January 2004 to December 2025. Each day’s book equity is the latest published value, as it was known that day. The portfolio runs…

--

--

Alexander Hübbert
Alexander Hübbert

Written by Alexander Hübbert⁠

I'm a postdoctoral researcher in finance. Outside academia, I genuinely enjoy talking about investing: ideas, mistakes, and what has actually worked.