Skip to content

Commit 7b76c7d

Browse files
committed
Updated readme to align with new code
1 parent da8f17f commit 7b76c7d

File tree

1 file changed

+47
-13
lines changed

1 file changed

+47
-13
lines changed

README.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,75 @@
11
# Open source cross sectional asset pricing
22

33
This repo accompanies our paper:
4-
[Chen and Zimmermann (2020), "Open source cross-sectional asset pricing"](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3604626)
4+
[Chen and Zimmermann (2021), "Open source cross-sectional asset pricing"](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3604626)
55

6-
If you use data or code based on our work, please cite the paper: [Bibtex entry](https://drive.google.com/open?id=1eP-Tuvmcbs5A7073d_9g2wQbvitqfdPz)
6+
If you use data or code based on our work, please cite the paper:
7+
8+
~~~
9+
@unpublished{ChenZimmermann2021,
10+
author = "Chen, Andrew Y. and Tom Zimmermann",
11+
title = "Open Source Cross Sectional Asset Pricing",
12+
note = "available at https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3604626",
13+
year = 2021
14+
}
15+
~~~
16+
17+
18+
----
719

820
## Data
921

1022
If you are mostly interested in working with the data, we provide benchmark signal and portfolio returns in separate files for direct download.
1123

12-
You can access the benchmark data [here](https://drive.google.com/open?id=1oeX3PVd5KxKqnQuVuPdRwORrqyt1WnJo).
24+
You can access the benchmark data [here](https://sites.google.com/site/chenandrewy/open-source-ap). Please see the [data documentation](https://drive.google.com/file/d/1adFWMGcXEzF2Jls3qTtqb1fmXUTsRBr1/view?usp=sharing) for a description of individual files that are available.
1325

14-
The folder contains 4 files
26+
For reference to individual signals, their acronyms and construction please see the [online appendix to our paper](https://drive.google.com/open?id=1vXRzjxYucXZV-tgLxM26fvRZ5zKvlBXH) and the file `SignalDocumentation.xls` that is part of this repo.
1527

16-
- Portfolio Returns Benchmark Signals: portbase.zip
17-
- Portfolio Returns Additional Signals: portadditional.zip
18-
- Firm-level benchmark signals: signalbase.zip
19-
- Firm-level additional signals: signaladditional.zip
28+
----
2029

21-
For reference to individual signals, their acronyms and construction please see the [online appendix to our paper](https://drive.google.com/open?id=1vXRzjxYucXZV-tgLxM26fvRZ5zKvlBXH) and the file **SignalDocumentation.xls** that is part of this repo.
30+
## Code
2231

32+
The code is separated into two parts:
2333

24-
## Code
34+
1. **Signals**: Contains code to produce stock-level signals
35+
2. **Portfolios** Contains code to produce portfolio returns
36+
37+
You can download the individual signals that are outputs of the **Signals** part of the code from the data repository above and start from the **Portfolios** part if you like.
38+
39+
### 1. Signals
40+
41+
The **Signals code** provides scripts for `DataDownloads`, `Predictors` and `Placebos`. The `master.do` file runs all files but you will need to set paths pointing to your project folder, your R installation and your WRDS connection (see below).
42+
43+
*Optional (i.e. code is modular and will work even if you do not do that)*: To construct signals that rely on IBES, 13F, TAQ or OptionMetrics data run the SAS scripts in `PrepScripts` on the WRDS server. See the [WRDS instructions](https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-sas/) for different ways to run these scripts on the WRDS server. Copy the output of those scripts to `Signals/Data/Prep`. Code to construct trading costs from TAQ data is provided separately and can be downloaded [here](https://drive.google.com/open?id=1W256-g-RxqOZBjNtkSJuuWXUqHZEYHsM).
2544

26-
The code is separated into different files that download and prepare the data, and construct signals and portfolios. Please see the file **runEverything.txt** to get an overview of how the entire code can be run. The current code does some parts in R and some in Stata, so you will need both to run everything.
45+
*See **Data access** part of the readme below for some data access steps that you need to complete before you can run the code.*
2746

28-
Code to construct trading costs from TAQ data is provided separately and can be downloaded [here](https://drive.google.com/open?id=1W256-g-RxqOZBjNtkSJuuWXUqHZEYHsM).
2947

48+
### 2. Portfolios
49+
50+
The _Portfolios_ code constructs portfolio returns from the signal files. The `master.R` can serve as a reference as to the order in which files should run. You need to set the project folder (same as for the Stata code) in `00_SettingsAndTools.R` for everything to work.
51+
52+
----
3053
## Data access
3154

55+
### 1. Wharton Research Data Services
56+
3257
To download raw data from the original sources, you will need access to WRDS. At a minimum, you will need access to the following databases:
3358

3459
- CRSP
3560
- Compustat
3661
- IBES
3762

38-
WRDS provides [instructions for setting up WRDS to work via RStudio on your computer](https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-r/r-from-your-computer/)
63+
To run the download scripts, you will need to install an ODBC driver and have a working Stata version. [WRDS provides instructions for setting up WRDS to work via Stata on your computer.](https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-stata/stata-from-your-computer/)
64+
65+
A few R scripts download CRSP data directly. WRDS provides [instructions for setting up WRDS to work via RStudio on your computer](https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-r/r-from-your-computer/)
66+
67+
68+
### 2. FRED
69+
70+
To download macroeconomic data required for some signals, you will need to [request an API key from FRED](https://research.stlouisfed.org/docs/api/api_key.html). Before you run the download scripts, you need to save your API key in Stata (either via the context menu or via `set fredkey`).
71+
72+
----
3973

4074
## Contribute
4175

0 commit comments

Comments
 (0)