- 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.
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.).
- Algorithms (
- Backtesting objects (
fynance.backtest) contains: - Module to plot profit and loss, and measure of performance.
- Backtesting objects (
- 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).
- Feature tools (
- 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.).
- Time-series models (
Please refer to the documentation for more details on the tools available in the fynance package.
$ pip install fynance$ git clone https://github.com/ArthurBernard/Fynance.git
$ cd Fynance
$ pip install -e ".[dev]"
$ python setup.py build_ext --inplace- 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):

