🔬 Quantitative analysis and management for financial applications.
Project description
🔎 Overview
The goal of finq is to provide an all-in-one Python library for quantitative portfolio analysis and optimization on historical and real-time financial data.
NOTE: Features are currently being determined and developed continuously. The repo is undergoing heavy modifications and could introduce breaking changes up until first major release. Current version is v0.3.0.
📦 Installation
Either clone this repository and perform a local install with poetry accordingly
git clone https://github.com/wilhelmagren/finq.git
cd finq
poetry install
or install the most recent release from the Python Package Index (PyPI).
pip install pyfinq
🚀 Example usage
The standard way to define a custom dataset is to provide a list of security names and their related ticker symbols,
from finq.datasets import CustomDataset
names = ["Alfa Laval", "Boliden", "SEB A", "Sv. Handelsbanken A"]
symbols = ["ALFA.ST", "BOL.ST", "SEB-A.ST", "SHB-A.ST"]
dataset = CustomDataset(names, symbols, market="OMX", save=True)
dataset.fetch_data("3y") \
.fix_missing_data() \
.verify_data()
dataset.visualize(log_scale=True)
...
or if you don't know the syntax of the ticker symbols that you want, you can pass in a
valid NASDAQ index name and try and fetch its related ticker components. We can also
call the function .run(period)
which performs the three steps the above cell does
(fetching, fixing, and verifying).
from finq.datasets import CustomDataset
dataset = CustomDataset(index_name='NDX', market="NASDAQ", save=False)
dataset.run("1y")
closing_prices = dataset.as_numpy("Close")
...
📋 License
All code is to be held under a general MIT license, please see LICENSE for specific information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.