2.7 KiB
Multifactor Scanner 3
Multifactor Scanner 3 is an old multifactor equity-screening project. Originated before 2020.
This is the third rewrite (hence the 3), and was handcrafted before AI agents, then cleaned up with agents around 2024.
This README and the repository packaging are later additions.
What the scanner does
The scanner screens equities through factor analysis. It retrieves EOD Historical Data fundamentals and compiles the results into CSV files.
The design covers momentum, size, value, quality, volatility, yield, growth, liquidity, and regional macroeconomic inputs.
Requirements
- Python 3.9
- Everything in
requirements.txt - An EOD Historical Data API token
The legacy run_scanner.bat launcher expects a Conda environment named kwpf. The direct Python command below does not require that environment name.
Setup
-
Create a project virtual environment.
py -3.9 -m venv .venv -
Install the dependencies.
.\.venv\Scripts\python.exe -m pip install -r requirements.txt -
Create the local risk-free-rate working file.
Copy-Item .\parameters\riskfree_rate_template.csv .\riskfree_rate.csv -
Save only the EOD Historical Data token in
licenseFile.key.Set-Content -NoNewline .\licenseFile.key 'YOUR_EODHD_API_TOKEN'
The scanner can update riskfree_rate.csv during a run.
Configuration
Edit the files in parameters/ before a run:
index_inclusion.txtlists the index or ETF tickers that supply constituents.parent_index.txtidentifies the first benchmark ticker.ticker_inclusion.txtadds individual tickers.ticker_exclusion.txtremoves individual tickers.
Place one ticker on each line. Include each exchange suffix, such as .US or .TO.
regions_msci_codes.csv maps each supported country to a regional proxy ticker. The scanner uses this mapping for regional benchmarking.
Run the scanner
Run the scanner from the repository root:
.\.venv\Scripts\python.exe .\run_scanner.py
Generated files
The scanner writes the following:
output/YYYYMMDD.csvcontains the standardized final scores.output/YYYYMMDDdump.csvcontains the unstandardized intermediate table.output/rejected_tickers.txtlists rejected tickers.debug/*.jsoncontains selected API responses for failed calculations.riskfree_rate.csvstores the current rate data and provides fallback data.
Important limitations
This repository preserves old code. The current vendor and source websites have changed since.
The sample contains historical market data. It is not a current ranking, recommendation, or investment result.