Giter VIP home page Giter VIP logo

gluonts_fund_price_forecast's Introduction

Introduction

This project aims to predict the future price of mutual fund via GluonTS package.

TODO:

  • 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
  • Adapt the Model in backtesting to the Deep Trainable Models
  • 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)

Install

Build from new environment

python3 -m virtualenv env
source env/bin/activate
sudo pip install --upgrade pip
pip install -r requirements.txt

Using Pre-installed environment

source env/bin/activate

Run

python backtesting.py

gluonts_fund_price_forecast's People

Contributors

jeffrey82221 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

gluonts_fund_price_forecast's Issues

Access integration with finlab_crypto

Finlab crypto is a python package with nice visualization of backtesting for cypoto trading strategy.

The different of their backtesting from ours is that they use Buy and Sell signal to calculate earning rather than just evaluate the metric-based performance of a model.

I would be nice to leverage their Buy-Sell strategy backtesting module to evaluate a strategy based on our model.

This alternate backtesting module might be named as "StategyBackTestor" to distinguish it to our original BackTestor.

Ref:
https://github.com/finlab-python/finlab_crypto
https://colab.research.google.com/drive/1l1hylhFY-tzMV1Jca95mv_32hXe0L0M_?usp=sharing#scrollTo=zHHvAreOLxR6

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.