I'm looking for a clean and reliable way to integrate the daily Fama-French 3-Factor data (Mkt-RF, SMB, HML, and RF) into QuantConnect for both backtesting and live deployment. Specifically, I want to use the actual factor data as published by Kenneth French’s data library, not approximations using ETFs or reconstructed proxies. Ideally, this data would be accessible dynamically within the QC environment, without requiring me to manually download, unzip, and re-upload CSV files or host static versions in a GitHub repo.
The goal is to have the factors available historically, from at least 2001 onward, and extendable into live strategies with minimal latency. The best case would be a custom data class or import pipeline that allows me to access this data directly via self.History or similar mechanisms, with seamless alignment to the daily resolution of my trading algorithms.
If anyone in the community has already built this or has a reliable pattern for dynamically sourcing and integrating this factor data into QC's cloud environment, I'd appreciate a reference to that code or explanation of the setup. I'm trying to avoid reinventing something that may already exist, and I'm especially interested in solutions that are stable and production-grade.
Mia Alissi
Here’s a robust, production-grade implementation you can use to dynamically source and integrate the daily Fama-French 3-Factor data (Mkt-RF, SMB, HML, RF) from Kenneth French’s actual published files into QuantConnect, suitable for both backtest and live deployments:
How it works:
add_data()
, then access it inOnData
, viadata.get()
, or withself.history()
(for research/historical).Feel free to copy, use, and extend as needed for research or production!
Sources: Expected Idiosyncratic Skewness, Residual Momentum, Composite Factor Bundle - QuantConnect.com, US Federal Reserve (FRED) - QuantConnect.com), US Fundamental Data - QuantConnect.com
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Abel Shakespeare
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!