Comments (9)
@justinlent Seems like we can also get that via pandas data reader: http://pandas.pydata.org/pandas-docs/stable/remote_data.html#remote-data-ff Do you think that's sufficient?
from pyfolio.
It looks like the fama-french data from pandas is weekly/monthly frequency. @justinlent where did you download the daily factors currently in quantrisk from?
EDIT:
It looks like we can get the daily daily data from the Dartmouth site using the pandas DataReader class. The data available there has not been updated since May 29, so the outdated issues are probably because the database is not updated very often, monthly updates is my guess.
Downloading the factors directly sounds like a good idea, the files download pretty quickly. Do we want to expose the webreader functions or wrap them ourselves and keep local versions cached? Using pandas makes it easy to have access to all of the F-F data sets available on the edu site.
from pyfolio.
@twiecki @humdings the daily FF are at this URL:
http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_daily.zip
which is linked to from this data page on Ken French's academic research page - scroll down to section "U.S. Research Returns Data (Downloadable Files)", then a couple links down, the zip is at the link named: Fama/French 3 Factors [Daily]
There's actually TONS of FF data here that may become useful down the road
http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
from pyfolio.
Pandas is awesome once again! These few lines load the daily fama-french data and converts the index to actual timestamps.
import pandas as pd
import pandas.io.data as web
factors = web.DataReader("F-F_Research_Data_Factors_daily", "famafrench")[0]
factors.index = pd.to_datetime(factors.index, format="%Y%m%d", utc=True)
from pyfolio.
great @humdings ! we can hold off on implementing this for the initial public release i think. i'd want to do some testing first to make sure everything works correctly since we weren't pulling directly in the past. e.g. we should wrap the data pull with error checking and failover to the pre-existing csv file, etc
from pyfolio.
Another option is Quandl
https://www.quandl.com/data/KFRENCH/FACTORS_D-Fama-French-Factors-Daily
from pyfolio.
Dartmouth page is down right now. Quandl seems more reliable, but we could have a double fallback i.e. dartmouth -> quandl -> local. I'll try to do this today.
from pyfolio.
Dartmouth seems to be up at your second link here: http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
I think the pandas function and old URL are broken, but we can unzip files with python so shouldn't be a problem.
I can't seem to find UMD anywhere. @justin @humdings anyone know where that's from? Also maybe consider replacing UMD with Rf, but I'm assuming we have a good reason for wanting UMD.
from pyfolio.
From justin, UMD = momentum factors -> http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Momentum_Factor_daily_CSV.zip
from pyfolio.
Related Issues (20)
- AttributeError: module 'pandas_datareader.data' has no attribute 'get_data_google' HOT 1
- Quantopian/pyfolio is NO LONGER MAINTAINED - See other forks
- Pyfolio
- Export output
- TypeError: an integer is required (got type bytes) HOT 1
- backtrader HOT 1
- Performance attribution
- 'NaTType' object has no attribute 'ordinal'
- Cant save figures to files
- Optimizable using market sentiments
- 'Series' object has no attribute 'iteritems' HOT 3
- 'Series' object has no attribute 'iteritems' - iteritems seems to have been deprecated HOT 5
- Inclusion of Google colab codes in the notebook section
- AttributeError: module 'pandas' has no attribute 'Float64Index'
- Inaccurate Returns? HOT 1
- Build problem
- AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime' HOT 2
- code fix : estimate_intraday 'date' is both an index level and a column label, which is ambiguous.
- Incorrect no of months
- 'Series' object has no attribute 'iteritems'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfolio.