Skip to main content

The bundled opensource toolkit for book Navigate through the Factor Zoo: The Science of Factor Investing.

Project description

F.I.R.E. Factor Investment Research Engine

This repo is the bundled opensource toolkit for book Navigating the Factor Zoo:The Science of Quantitative Investing.

Installation

# for stable version
pip install firefin

# for test and nightly version
pip install -i https://test.pypi.org/simple/ firefin

# Install from source for loacl testing!!!
## replace $ThisRepoURL with the actual repo url
git clone $ThisRepoURL 
## install from source
pip install -e .

Usage

Download the data from here

run the command and download data put in correct path automatically.

# We have not released this repo yet, so you need download the data manually!!! See command below!!!
# Auto download data
firefin download

If you have already downloaded the data from here, you can run the command to check the data and put the data in the correct path

# replace path_to_data.tar.gz with the actual path
firefin load path_to_data.tar.gz

Start to code

import firefin

# get data
data = firefin.fetch_data(["open", "close", "volume"])
open_price = data["open"]


def pv_corr(close, volume):
    # price volume correlation
    return close.rolling(20).corr(volume)


factor = pv_corr(data["close"], data["volume"])

# compute forward returns
fr = firefin.compute_forward_returns(open_price.shift(-1), [1, 5, 10])

# evaluate factor
mng = firefin.Evaluator(factor, fr)
mng.get_ic("pearson")
mng.get_quantile_returns(5)

Features

  1. handy functions for fast factor computation
  2. various tools for factor evaluation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firefin-0.3.2.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

firefin-0.3.2-py3-none-any.whl (62.7 kB view details)

Uploaded Python 3

File details

Details for the file firefin-0.3.2.tar.gz.

File metadata

  • Download URL: firefin-0.3.2.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for firefin-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9626d211e6d0a6fb0ea8f49a24b279c8b30fe045769637737f67698f6773d4c3
MD5 d98ab3e190f67734a1c644f1249d2d8c
BLAKE2b-256 bf4f99690e45a247aea08e22e9ef039bcd88f3fd96f08e3ff24971eb74327fea

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.3.2.tar.gz:

Publisher: pypi.yaml on fire-institute/fire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firefin-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: firefin-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 62.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for firefin-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f977f612617b57b69af62a76de72e626c5c3b6c640a7752214c51f177362f86
MD5 90c37a4d14e6f371d5d8d8d15a6f4885
BLAKE2b-256 f5a9a106bb1f46244718478dd238e0475db52859d3fc099954918f71a5013d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.3.2-py3-none-any.whl:

Publisher: pypi.yaml on fire-institute/fire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page