Python and Cython scripts of machine learning, econometrics and statistical features for financial analysis
Project description
Documentation: http://fynance.readthedocs.io/en/latest/index.html
Source code: http://github.com/ArthurBernard/Fynance
Fynance is a Python (and Cython) package providing machine learning, econometric and statistical tools designed for financial analysis and backtesting of trading strategies. The documentation is available with descriptions and examples for all public APIs.
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 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).
Filters (e.g. Kalman filter with RTS smoother and MLE parameter estimation).
- Time-series models (fynance.models) contains:
Econometric models (e.g. MA, ARMA, ARMA_GARCH, ARMAX_GARCH, etc.).
Neural network models with PyTorch (e.g. MultiLayerPerceptron, LSTM, MultiHeadAttention, etc.).
Rolling walk-forward evaluation for models (e.g. RollMultiLayerPerceptron, etc.).
Please refer to the documentation for more details on the tools available in the fynance package.
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):
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):
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 Distributions
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 fynance-1.3.3.tar.gz.
File metadata
- Download URL: fynance-1.3.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d797932ead1eb8e7225f83fe2c8d7e5e2d0947479fdec519b562ad8e51dd69e
|
|
| MD5 |
d00cc45b595fdd02341352e39fd4775a
|
|
| BLAKE2b-256 |
78653ec57e3fd812f69002d5aea9e6396b71e590ba16697bd37ecd4c665249bf
|
Provenance
The following attestation bundles were made for fynance-1.3.3.tar.gz:
Publisher:
release.yml on ArthurBernard/Fynance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fynance-1.3.3.tar.gz -
Subject digest:
8d797932ead1eb8e7225f83fe2c8d7e5e2d0947479fdec519b562ad8e51dd69e - Sigstore transparency entry: 1510015894
- Sigstore integration time:
-
Permalink:
ArthurBernard/Fynance@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/ArthurBernard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file fynance-1.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fynance-1.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3201788c0a216309f4d1255feacef5617e25957f6fc1076b6c571d11e4d60ed6
|
|
| MD5 |
c481440e8374ddb23eb6554977a19b21
|
|
| BLAKE2b-256 |
869a3dfe8f20b955d329f2654d6366711508c4040a6f6048523dfe282f45ea5a
|
Provenance
The following attestation bundles were made for fynance-1.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on ArthurBernard/Fynance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fynance-1.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
3201788c0a216309f4d1255feacef5617e25957f6fc1076b6c571d11e4d60ed6 - Sigstore transparency entry: 1510015985
- Sigstore integration time:
-
Permalink:
ArthurBernard/Fynance@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/ArthurBernard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file fynance-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fynance-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7583111907e3ffa46d212cb46bbc9b3708642d04ec4e7f4a8f19c95f0778f552
|
|
| MD5 |
c110a5440a3e5710cb2008e68a7d8fce
|
|
| BLAKE2b-256 |
cfc528fbbbba5991b43b63aeb4100a292ea387ab0159f25adbe22fbc2aef4486
|
Provenance
The following attestation bundles were made for fynance-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on ArthurBernard/Fynance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fynance-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
7583111907e3ffa46d212cb46bbc9b3708642d04ec4e7f4a8f19c95f0778f552 - Sigstore transparency entry: 1510016024
- Sigstore integration time:
-
Permalink:
ArthurBernard/Fynance@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/ArthurBernard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file fynance-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fynance-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79664d63ec685f9a509ec11e2ce7f10c0a972f32d8fc54d04c050c408003f467
|
|
| MD5 |
427d4df3a15d04fd3a756fdd089029bb
|
|
| BLAKE2b-256 |
26b3d435494c1f50d3df2efec79cb7249f64a4ab0b6e395dba0eb23789e619b1
|
Provenance
The following attestation bundles were made for fynance-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on ArthurBernard/Fynance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fynance-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
79664d63ec685f9a509ec11e2ce7f10c0a972f32d8fc54d04c050c408003f467 - Sigstore transparency entry: 1510015943
- Sigstore integration time:
-
Permalink:
ArthurBernard/Fynance@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/ArthurBernard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de9e9b132b3ebfb363cfe1a4a4f8cc11b73015dd -
Trigger Event:
push
-
Statement type: