Skip to main content

Python and Cython scripts of machine learning, econometrics and statistical features for financial analysis

Project description

PyPI - Python Version https://img.shields.io/pypi/v/fynance.svg https://img.shields.io/pypi/status/fynance.svg?colorB=blue CI https://img.shields.io/github/license/ArthurBernard/fynance.svg https://pepy.tech/badge/fynance Documentation Status

Fynance is Python (and Cython) package, it provides machine learning, econometric and statistical tools designed for financial analysis and backtest of trading strategy. The documentation is available with some examples of the use of functions and objects.

The fynance.features and fynance.algorithms.allocation subpackages are stable. Other subpackages (fynance.models, fynance.backtest) are actively developed and may evolve.

Presentation

The fynance package contains currently five subpackages:

  • Algorithms (fynance.algorithms) contains:
    • Portfolio allocations (e.g. ERC, HRP, IVP, MDP, MVP, etc.).

    • Rolling objects for algorithms (e.g. rolling_allocation, etc.).

  • Backtesting objects (fynance.backtest) contains:
    • Module to plot profit and loss, and measure of performance.

  • Feature tools (fynance.features) contains:
    • Financial indicators (e.g. bollinger_band, cci, hma, macd_hist, macd_line, rsi, etc.).

    • Statistical momentums (e.g. sma, ema, wma, smstd, emstd wmstd, etc.).

    • Metrics (e.g. annual_return, annual_volatility, calmar, diversified_ratio, mdd, sharpe, z_score, etc.).

    • Scale (e.g. Scale object, normalize, standardize, roll_normalize, roll_standardize, etc.).

    • Rolling functions (e.g. roll_min, roll_max).

  • Time-series models (fynance.models) contains:
    • Econometric models (e.g. MA, ARMA, ARMA_GARCH and ARMAX_GARCH, etc.).

    • Neural network models with PyTorch (e.g. MultiLayerPerceptron, etc.).

    • Rolling objects for models, currently work only with neural network models (e.g. _RollingBasis, RollMultiLayerPerceptron, etc.).

Please refer you to the documentation to see more details on different tools available in fynance package. Documentation contains some descriptions and examples for functions, classes and methods.

Installation

From PyPI

$ pip install fynance

From source (GitHub)

$ git clone https://github.com/ArthurBernard/Fynance.git
$ cd Fynance
$ pip install -e ".[dev]"
$ python setup.py build_ext --inplace

Demo

  • Backtest (performance, drawdown and rolling sharpe ratio) of a trading strategy did with a rolling neural network (see Notebooks/Exemple_Rolling_NeuralNetwork.ipynb for more details):

https://github.com/ArthurBernard/Fynance/blob/master/pictures/backtest_RollNeuralNet.png
  • Loss functions and performances (trading strategy) of five rolling neural networks on the training and testing period (see Notebooks/Exemple_Rolling_NeuralNetwork.ipynb for more details):

https://github.com/ArthurBernard/Fynance/blob/master/pictures/loss_RollNeuralNet.png

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

fynance-1.3.1.tar.gz (1.0 MB view details)

Uploaded Source

Built Distributions

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

fynance-1.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

fynance-1.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

fynance-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file fynance-1.3.1.tar.gz.

File metadata

  • Download URL: fynance-1.3.1.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fynance-1.3.1.tar.gz
Algorithm Hash digest
SHA256 c11c950244e65354595f09975c60ec29cef0c82255078082862076327eb5cfdb
MD5 a3826296bf0ee17efb9f4fd1d98c6725
BLAKE2b-256 38bfe5d5816d2dc98dbda7d54240f46e7cd962279a689d56b8989b3b1abeda43

See more details on using hashes here.

Provenance

The following attestation bundles were made for fynance-1.3.1.tar.gz:

Publisher: release.yml on ArthurBernard/Fynance

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

File details

Details for the file fynance-1.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fynance-1.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 092f59d8b5bedea0b85c03fb9278956532e51c2d49fd85f8953a7377efa23074
MD5 eb577ddc7bb65b3e337636280ac3604a
BLAKE2b-256 9bef451266ac3bbdcf06b9f08df74d88f11e4c4a7bfe3c3731b70f9bf603118f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fynance-1.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ArthurBernard/Fynance

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

File details

Details for the file fynance-1.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fynance-1.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26c724d23e098b434a2c97c32066ef56ae524e241ff1985d73143032f38a0f60
MD5 a6340377c981a29017038ab8d7572352
BLAKE2b-256 3470d18c702687c4a89ed1ca5024cdd979ab17f5e1d2d13eadd6b9fe4e12d098

See more details on using hashes here.

Provenance

The following attestation bundles were made for fynance-1.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ArthurBernard/Fynance

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

File details

Details for the file fynance-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fynance-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a511eaf8876b7670adc8f5402d694a069307b97e3926231b4f23da804cb75c6b
MD5 e182433aa1d924d51d91c36ab1c5f6b8
BLAKE2b-256 df41a6c4b8ea07a4d0e5f3d09a4a0490629b42429227303b1d71e88ba3a24d2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fynance-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ArthurBernard/Fynance

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