This project aims to predict the future price of mutual fund via GluonTS package.
- Refactor the folder structure:
- Understand the purpose of each file
- Move Similar files to the same folder
- backtest folder contains all backtesting codes
- [-] util folder contains files or tools that is used by many other codes
- reference folder contains the notebooks and experiments
- XXX: Small Refactoring:
- Move fund_price_loader import out of backtest/ and import it in run_backtest.py and pass it to init of backtest/ from there.
- Move NAV_DIR to config.py
- Change billiard Pool to Ray ActorPool (more stable and useful!)
- FIXME: Extension Enhancement:
- Allow time-dependent factors in backtest/ to be generalized (Because the frequency of tick may increase if binance api is adopted).
- Price Prediction of Single Fund
- Load fund price csv file into Gluonts time series object.
- Process the time series so that the missing prices of holiday can be interpolate.
- Connect the time series to the Gluonts Model.
- Plot the predicted trends (probalistically) from the trained model.
- Enhance Evaluation:
- Allow splitting of training, validation, testing time series.
- Allow evaluation of prediction using RMSE on testing data.
- Allow Backtesting (using Off-the-shielf module of Gluonts).
- Parallelize BackTesting
- split_date generator
- split dataset -> prediction -> evaluation
- [-] Try sharing of NAV Table Between Process
- Parallelize BackTesting
- Adapt the Model in backtesting to the Deep Trainable Models
- using pytorch version models with pytorchts package: https://github.com/zalandoresearch/pytorch-ts
- Adapt to all examples in pytorch-ts
- Implicit Quantile Network
- Multivariate-Flow # Next-Up
- Time-Grad
- Refactor the current architechture such that adapting to Multi-Variate mode can be easier to follow.
- Seperate nav splitting methods from fund_price_loader.py to nav_splitter.py
- Refactor so that replication between backtesting and multi_variate_backtesting can be reduced.
- A abstract BackTestBase object
- A basic BackTest object
- A multi-variate BackTest object
- An object allow both single&multi-variate models
- Enhance the evaluation
- adapt the evaluation scheme to more metrices: check implicit_quantile_network.py Line.52-67) (TODO: now-fbprophet is not working)
- Allow comparison of different models in a single plot
- Consider MultiVariate Mode for Single Fund Prediction:
- Find data object in gluonts for storing multiple time series (check multivariate_dataset_examples.py)
- Organize of nav curves of multiple funds into the multi-timeseries objects offered by gluonts.
- Read nav curves into multiple SharableListDataset
- Using Spliter to obtain multiple train, test SharablesListDataset(s)
- [build] a SharableMultiVariateDataset which allow storing of multiple sharable target arrays and allow convertion to grouped_list_dataset (check multivariate_dataset_examples.py for progamming the convertion).
- Before convert those train, test to local ListDataset(s), merge them into SharableMultiVariateDataset
- Convert the multivariate_dataset into local grouped dataset using train_grouper and test_grouper
- Adapt to Multi-Variate Deep Model (see examples of pytorch-ts) and incorporate it into the repo.
- Allow evaluation of Multiple Time Series (see plot and MultivariateEvaluator in Time-Grad-Electricity)
- Create different technical curves for each fund
- Earning of fund in a time period: e.g., (nav tomorrow - nav today) / nav today. (parameter: time_period)
- Standard deviation of earning in a time periods. (parameter: earning_time_period, std_time_period)
- Original NAV curve
- Price Prediction of Multiple Funds
- Load multiple funds and convert to multiple time series
- Parallel loading and processing of multiple time series
- Consider multivariate time series Model
- Plot the predicted trends
- Consider Binance Dataset
- Adoption of Real-time Binance Price
- Allow parameter tuning for each estimator (with ray.tune)
python3 -m virtualenv env
source env/bin/activate
sudo pip install --upgrade pip
pip install -r requirements.txt
source env/bin/activate
python backtesting.py