Alphalens用于股票因子表現(xiàn)分析的 Python 庫
Alphalens 是一個 Python 庫,用于預測(alpha)股票因子的表現(xiàn)分析。Alphalens 可以與 Zipline 和 Pyfolio 配合使用,后者提供金融投資組合的表現(xiàn)和風險分析。
Alphalens 的主要功能是顯示有關 alpha 因子的最相關統(tǒng)計數(shù)據(jù)和圖表,包括:
- 回報分析
- 信息系數(shù)分析
- 成交量分析
- 分組分析
入門
有了信號和定價數(shù)據(jù),創(chuàng)建一個因子 "tear sheet"是一個兩步過程。
import alphalens # Ingest and format data factor_data = alphalens.utils.get_clean_factor_and_forward_returns(my_factor, pricing, quantiles=5, groupby=ticker_sector, groupby_labels=sector_names) # Run analysis alphalens.tears.create_full_tear_sheet(factor_data)
安裝
使用 pip 安裝:
pip install alphalens
使用 conda 安裝:
conda install -c conda-forge alphalens
從 Alphalens 倉庫的 master 分支安裝(開發(fā)代碼):
pip install git+https://github.com/quantopian/alphalens
Alphalens 依賴于:
評論
圖片
表情
