
Python for Algorithmic Trading Cookbook
By :

The Fama-French factors are a set of factors identified by economists Eugene F. Fama and Kenneth R. French to explain the variation in stock returns. These factors serve as the foundation of the Fama-French three-factor model. In Chapter 1, Acquire Free Financial Market Data with Cutting-edge Python Libraries, we learned how to use pandas_datareader
to download Fama-French factor data.
In this recipe, we’ll compute the exposure of our portfolio to the size and market value factors.
You should already have pandas_datareader
installed from Chapter 1, Acquire Free Financial Market Data with Cutting-edge Python Libraries. If not, you can install it using pip
:
pip install pandas_datareader
We’ll also assume you have the data
DataFrame loaded with historic prices created in the last recipe.
We’ll reuse what we learned in the prior recipes about using beta...