GithubHelp home page GithubHelp logo

finol's Introduction

FinOL: Towards Open Benchmarking for Data-Driven Online Portfolio Selection

 

Python 3.9 Platform License


FinOL represents a pioneering open database for facilitating data-driven financial research. As an ambitious project, it collects and organizes extensive assets from global markets over half a century, it provides a long-awaited unified platform to advance data-driven OLPS research.

What's NEW!

Update Status Label
New release! FinOL is going to release the official website Coming soon...... Release
New metric! FinOL is going to support the t-test metric Coming soon...... Enhancement
New feature! FinOL is going to support the Auto Hyperparameter Tuning feature Coming soon...... Enhancement
New model! FinOL is going to support the AlphaStock model Coming soon...... Enhancement
New feature! FinOL now supports the Radar Chart evaluation Supported since 10 June 2024 Enhancement
New model! FinOL now supports the AlphaPortfolio model Supported since 06 June 2024 Enhancement
New feature! FinOL now supports the Economic Distillation feature Supported since 15 May 2024 Enhancement
New feature! FinOL now supports the Interpretability Analysis feature Supported since 16 April 2024 Enhancement
New feature! FinOL now supports the Winner Assets Selection feature Supported since 14 April 2024 Enhancement
Release FinOL tutorials Released on 22 March 2024 Release
Release FinOL v0.0.1 Released on 21 March 2024 Release

Outline

About

Online portfolio selection (OLPS) is an important issue in operations research community that studies how to dynamically adjust portfolios according to market changes. In the past, OLPS research relied on a general database called OLPS containing price relatives data of financial assets across different markets. However, with the widespread adoption of data-driven technologies like machine learning in finance, OLPS can no longer meet the needs of OLPS research due to the lack of support for high-dimensional feature spaces. To solve this problem, we propose FinOL, an open financial platform for advancing research in data-driven OLPS. FinOL expands and enriches the previous OLPS database, containing 9 benchmark financial datasets from 1962 to present across global markets. To promote fair comparisons, we evaluate a large number of past classic OLPS methods on FinOL, providing reusable benchmark results for future FinOL users and effectively supporting OLPS research. More importantly, to lower the barriers to research, FinOL provides a complete data-training-testing suite with just three lines of command. We are also committed to regularly updating FinOL with new data and benchmark results reflecting the latest developments and trends in the field. This ensures FinOL remains a valuable resource as data-driven OLPS methods continue evolving.

Overall Framework of FinOL

Why should I use FinOL?

  1. FinOL contributes comprehensive datasets spanning diverse market conditions and asset classes to enable large-scale empirical validation;
  2. FinOL contributes the most extensive benchmark results to date for portfolio selection methods, providing the academic community an unbiased performance assessment;
  3. FinOL contributes a user-friendly Python library for data-driven OLPS research, providing a comprehensive toolkit for academics to develop, test, and validate new OLPS methods.

Installation

Installing from source (PRIORITY OPTION)

For Windows users, to install the bleeding edge version, clone this repository with:

> git clone https://github.com/jiahaoli57/finol.git
> mv finol finol_
> mv -force finol_/finol .
> Remove-Item -Recurse -Force finol_

For Linux users, use:

> git clone https://github.com/jiahaoli57/finol.git
> mv finol finol_
> mv -force finol_/finol .
> rm -rf finol_

Installing via PIP

FinOL is available on PyPI, therefore you can install the latest released version with:

> pip install finol -t .

Examples and Tutorials

You can find useful tutorials on how to use FinOL in the tutorials folder.

Here we show a simple application (taken from tutorial_2): we transform asset "AA" into a richer representation.

Visualization of Train Normalization Data for Asset "AA"

Using FinOL

To lower the barriers for the research community, FinOL provides a complete data-training-testing suite with just three lines of command.

from finol.data_layer.data_loader import *
from finol.optimization_layer.model_trainer import *
from finol.evaluation_layer.model_evaluator import *


load_dataset_output = load_dataset()
train_model_output = train_model(load_dataset_output)
evaluate_model_output = evaluate_model(load_dataset_output, train_model_output)

Supported Datasets

Name Market Country/Region Data Frequency # of Assets Data Range # of Periods
NYSE(O) Stock United States Daily 26 03/July./1962
-
31/Dec./1984
5,651:
3,390/1,130/1,131
NYSE(N) Stock United States Daily 403 02/Jan./1985
-
30/June./2010
6,430:
3,858/1,286/1,286
DJIA Stock United States Daily 28 14/Jan./2001
-
14/Jan./2003
500:
300/100/100
SP500 Stock United States Daily 339 02/Jan./1998
-
31/Jan./2003
1,268:
756/256/256
TSE Stock Canada Daily 48 12/Jan./1995
-
31/Dec./1998
1,001:
600/200/200
SSE Stock China Weekly 30 05/July./2010
-
26/June./2023
678:
406/136/136
HSI Stock Hong Kong, China Weekly 53 05/July./2010
-
26/June./2023
678:
406/136/136
CMEG Futures United States Weekly 25 05/July./2010
-
26/June./2023
678:
406/136/136
CRYPTO Cryptocurrency World Daily 43 09/Nov./2017
-
01/Mar./2024
2,305:
1,421/442/442

Supported Baselines

Name Category Source Journal/Conference
Market Classic OLPS: Benchmark baseline -- --
Best Classic OLPS: Benchmark baseline -- --
UCRP Classic OLPS: Benchmark baseline Kelly 1956; Cover 1991 The Bell System Technical Journal; Mathematical Finance
BCRP Classic OLPS: Benchmark baseline Cover 1991 Mathematical Finance
UP Classic OLPS: Follow-the-winner Cover 1991 Mathematical Finance
EG Classic OLPS: Follow-the-winner Helmbold et al. 1998 Mathematical Finance
SCRP Classic OLPS: Follow-the-winner Gaivoronski and Stella 2000 Annals of Operations Research
PPT Classic OLPS: Follow-the-winner Lai et al. 2018 IEEE Transactions on Neural Networks and Learning Systems
SSPO Classic OLPS: Follow-the-winner Lai et al. 2018 The Journal of Machine Learning Research
ANTI1 Classic OLPS: Follow-the-loser Borodin et al. 2004 Advances in Neural Information Processing Systems
ANTI2 Classic OLPS: Follow-the-loser Borodin et al. 2004 Advances in Neural Information Processing Systems
PAMR Classic OLPS: Follow-the-loser Li et al. 2012 Machine Learning
CWMR-Var Classic OLPS: Follow-the-loser Li et al. 2013 ACM Transactions on Knowledge Discovery from Data
CWMR-Stdev Classic OLPS: Follow-the-loser Li et al. 2013 ACM Transactions on Knowledge Discovery from Data
OLMAR-S Classic OLPS: Follow-the-loser Li et al. 2015 Artificial Intelligence
OLMAR-E Classic OLPS: Follow-the-loser Li et al. 2015 Artificial Intelligence
RMR Classic OLPS: Follow-the-loser Huang et al. 2016 IEEE Transactions on Knowledge and Data Engineering
RPRT Classic OLPS: Follow-the-loser Lai et al. 2020 IEEE Transactions on Systems, Man, and Cybernetics: Systems
AICTR Classic OLPS: Pattern-matching Lai et al. 2018 IEEE Transactions on Neural Networks and Learning Systems
KTPT Classic OLPS: Pattern-matching Lai et al. 2018 Data Mining and Knowledge Discovery
SP Classic OLPS: Meta-learning Singer 1997 International Journal of Neural Systems
ONS Classic OLPS: Meta-learning Agarwal et al. 2006 International Conference on Machine Learning
GRW Classic OLPS: Meta-learning Levina and Shafer 2008 International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems
WAAS Classic OLPS: Meta-learning Zhang and Yang 2017 Computational Economics
CW-OGD Classic OLPS: Meta-learning Zhang et al. 2021 Knowledge-Based Systems

Supported Metrics

Name Abbreviation Category
Cumulative Wealth CW Profit Metric
Annualized Percentage Yield APY Profit Metric
Sharpe Ratio SR Profit Metric
Volatility Risk VR Risk Metric
Maximum DrawDown MDD Risk Metric
Average Turnover ATO Practical Metric
Transaction Costs-Adjusted Cumulative Wealth TCW Practical Metric
Running Time RT Practical Metric

Supported Visualization

The FInOL project provides a suite of visualization tools to facilitate a comprehensive evaluation of data-driven OLPS research. Here are some examples:

  1. Dynamic Training/Validation Loss Visualization

  1. Daily Cumulative Wealth Visualization

  1. Daily DrawDown

  1. Transaction Cost-Adjusted Cumulative Wealth

  1. Comprehensive Radar Chart

File Structure

FinOL
├─ LICENSE
├─ MANIFEST.in
├─ README.md
├─ TA_Lib-0.4.24-cp39-cp39-win_amd64.whl
├─ figure
│    ├─ FinOL.png
│    ├─ logo.png
│    └─ tutorial_2.png
├─ finol
│    ├─ __init__.py
│    ├─ config.py
│    ├─ data
│    │    ├─ benchmark_results
│    │    │    ├─ __init__.py
│    │    │    ├─ other
│    │    │    │    └─ price_relative
│    │    │    │           ├─ price_relative_CMEG.mat
│    │    │    │           ├─ price_relative_CRYPTO.mat
│    │    │    │           ├─ price_relative_DJIA.mat
│    │    │    │           ├─ price_relative_HSI.mat
│    │    │    │           ├─ price_relative_NYSE(N).mat
│    │    │    │           ├─ price_relative_NYSE(O).mat
│    │    │    │           ├─ price_relative_SP500.mat
│    │    │    │           ├─ price_relative_SSE.mat
│    │    │    │           └─ price_relative_TSE.mat
│    │    │    ├─ practical_metrics
│    │    │    │    ├─ CMEG
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ CRYPTO
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ DJIA
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ HSI
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ NYSE(N)
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ NYSE(O)
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ SP500
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    ├─ SSE
│    │    │    │    │    ├─ final_practical_result.xlsx
│    │    │    │    │    └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    │    └─ TSE
│    │    │    │           ├─ final_practical_result.xlsx
│    │    │    │           └─ transaction_costs_adjusted_cumulative_wealth.xlsx
│    │    │    ├─ profit_metrics
│    │    │    │    ├─ CMEG
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ CRYPTO
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ DJIA
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ HSI
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ NYSE(N)
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ NYSE(O)
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ SP500
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    ├─ SSE
│    │    │    │    │    ├─ daily_cumulative_wealth.xlsx
│    │    │    │    │    ├─ daily_return.xlsx
│    │    │    │    │    └─ final_profit_result.xlsx
│    │    │    │    └─ TSE
│    │    │    │           ├─ daily_cumulative_wealth.xlsx
│    │    │    │           ├─ daily_return.xlsx
│    │    │    │           └─ final_profit_result.xlsx
│    │    │    └─ risk_metrics
│    │    │           ├─ CMEG
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ CRYPTO
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ DJIA
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ HSI
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ NYSE(N)
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ NYSE(O)
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ SP500
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           ├─ SSE
│    │    │           │    ├─ daily_drawdown.xlsx
│    │    │           │    └─ final_risk_result.xlsx
│    │    │           └─ TSE
│    │    │                  ├─ daily_drawdown.xlsx
│    │    │                  └─ final_risk_result.xlsx
│    │    └─ datasets
│    │           ├─ CMEG
│    │           ├─ CRYPTO
│    │           ├─ DJIA
│    │           ├─ HSI
│    │           ├─ NYSE(N)
│    │           ├─ NYSE(O)
│    │           ├─ SP500
│    │           ├─ SSE
│    │           └─ TSE
│    ├─ data_layer
│    │    ├─ __init__.py
│    │    ├─ data_loader.py
│    │    └─ scaler_selector.py
│    ├─ evaluation_layer
│    │    ├─ __init__.py
│    │    ├─ benchmark_loader.py
│    │    ├─ metric_caculator.py
│    │    └─ model_evaluator.py
│    ├─ main
│    │    ├─ main.ipynb
│    │    └─ main.py
│    ├─ model_layer
│    │    ├─ __init__.py
│    │    ├─ CNN.py
│    │    ├─ DNN.py
│    │    ├─ LSRE_CAAN.py
│    │    ├─ LSTM.py
│    │    ├─ RNN.py
│    │    ├─ Transformer.py
│    │    └─ model_selector.py
│    ├─ optimization_layer
│    │    ├─ __init__.py
│    │    ├─ criterion_selector.py
│    │    ├─ model_trainer.py
│    │    └─ optimizer_selector.py
│    ├─ setup.py
│    ├─ tutorials
│    │    ├─ README.md
│    │    ├─ _.ipynb
│    │    ├─ tutorial_1.ipynb
│    │    ├─ tutorial_2.ipynb
│    │    ├─ tutorial_3.ipynb
│    │    └─ tutorial_4.ipynb
│    ├─ update
│    │    └─ __init__.py
│    └─ utils.py
├─ logdir
├─ requirements.txt
└─ setup.py

License

Released under the MIT License.

Contact Us

For inquiries, please get in touch with us at [email protected] (Monday to Friday, 9:00 AM to 6:00 PM)

finol's People

Contributors

ai4finol avatar jiahaoli57 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

finol's Issues

Installation issue

Hi,

I tried to follow the installation instructions in the README:

For installing with pip I get:

pip install finOL
Collecting finOL
Using cached finol-0.0.7.tar.gz (3.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

...
Getting requirements to build wheel did not run successfully.
│ exit code: 1

File "/tmp/pip-install-6gkaibwg/finol_09784b428e8c4ec0b0a954669b25de94/finol/update/init.py", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

For cloning the github repository, I get:

git clone https://github.com/FinOL/finol
Cloning into 'finol'...
remote: Repository not found.
fatal: repository 'https://github.com/FinOL/finol/' not found

Here the .git extension is missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.