xinhe97 / SortCS

sort the assets in the cross-section, and form portfolios.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SortCS

Sort the assets in the cross-section, and form portfolios.

Step 1

Calculate equity characteristics and returns with codes and wrds.

Step 2

Run main_sort_20210202.py

Output

You get an object, in the class cs definded in folder ./tools/. The object contains 61 groups of univariate (quintile) sorted portfolios and 60 groups of bivariate (ME2 x Char3) sorted portfolios, where portfolio returns, long-short factors, portfolio characteristics are very convenient to access via the class cs.

A simple example is there in example.ipynb to demonstrate the features in class cs.

Disclaimer

./data_Jan2021/ is proprietary data. You can calculate your own equity data with the code in step 1.

About

sort the assets in the cross-section, and form portfolios.


Languages

Language:Jupyter Notebook 97.3%Language:Python 2.7%