Factor tool is a quant framework for factor research.
Project description
Factor
This is a framework for factor mining and evaluating. The data backend is from anthor quantative tool repository named parquool, see parquool for more information.
Installation
You can simple click download file in zip format on github, or you can use git command line if you want:
git clone git@github.com:ppoak/factool
Quick Start
Factor Source
Factor source is managed by parquool.DuckParquet, which provides a easy and simple way to manage factor data completely offline by your own computer. DuckParquet provides a series of sql-like interfaces, you can simple create a DuckParquet directory by using DuckParquet(path).upsert_from_df(df). And you can also select with where clause, order by clause, etc.
Factor Computing
You can simply create a function starts with calc_ and add the real factor script name to it in a python file. For example, if you want to create a market_size function, which calculate the log market size factor and non-linear market size factor. You can just create one script named market_size.py with one function called calc_market_size. Then by running calc function in calc.py, pass the path to the market_size.py to it, it will compute and save the result to the directory where your environment variable FACTOR_DATA_PATH points to.
Factor Evaluating
To evaluate a factor, you need to tell the evaluate funciton where your factor DuckParquet path is and your k-line data for computing returns of the market. Moreover, if you want to see the performance of the benchmark, you can also assign the benchmark code to the function. If the parameters above are not set, the funciont will automatically find them in environment variable: QUOTESDAY_PATH, INDEXQUOTESDAY_PATH. And the result output will be EVAL_PATH. The result is composed with one excel file with two sheets, one for ic time series, and one for evaluation result. And the other result is ic time-series image and net value of grouping result with benchmark value if set.
Automation
All the processes above can be set in an automatic way. The scritp/agent.py and script/web.py file provide a terminal and web interface for using AI models in calculating and evaluating factors.
For the cli, you can simply input a factor definition markdown file path to the command. All the process will be run automatically. As for the web, just explore it!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file facttool-0.0.1.tar.gz.
File metadata
- Download URL: facttool-0.0.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ce7fa3fde29104043640a6675f2899ea330966ddc9a70e43a78b0c57c81d53
|
|
| MD5 |
ebe000cb918e9c2d29534e2581cfed21
|
|
| BLAKE2b-256 |
708031e1a8b16184b22c72449a1c17a05691ff9128bfa9e4eb9f7ca9db0b8470
|
File details
Details for the file facttool-0.0.1-py3-none-any.whl.
File metadata
- Download URL: facttool-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0dc203668c067e2929e4424652ed66c19234cae5394d302c48918ebc5b1bd2d
|
|
| MD5 |
7c5f122eba0c09f448d87c8dfdb9aa1d
|
|
| BLAKE2b-256 |
9eb1d671f9b4196fa5ec41a8c2469b466566029986518a4af7df2053183c2cc8
|