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.2.2.tar.gz (38.2 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.2.2-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for firefin-0.2.2.tar.gz
Algorithm Hash digest
SHA256 67dd674977c6074e4540aa11e5695e85728b91742ae409b4d42df4ff55d652f5
MD5 48d1f541912162957133d8a262777661
BLAKE2b-256 88e75d2331c0a2efaae73e76f54c08ba8b089b125cfc3096b4787c1d6a84b04c

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.2.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.2.2-py3-none-any.whl.

File metadata

  • Download URL: firefin-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 47.6 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68d78013061dd45804b54d09adfec81fe9a20d3a2920009a2389575e1ed429b5
MD5 4479cabc735132419ddee216ab981a29
BLAKE2b-256 5b68d863b8c27ff7ee5528de724c0292e795e0708732f24bac9a5707377a3392

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.2.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