Skip to content

42QuantOpt/MRAE

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome

This 3-month project aimed at detecting and utilizing mean-reverting phenomenon with machine learning techniques.

Code provides everything to perform the implementation of mean-reverting portfolios from scratch, meaning from data retrieval, to machine learning utilization, and strategies set up.

Preview of results

Analysis were based on 151 financial return series from Euro stocks over the period [2004-2016].

  • Below is a typical result from returns series reconstruction using autoencoders. alt tag
  • The following Figure displays returns we got using neural network (autoencoder) buy/sell signals, compared to benchmark. alt tag

Requirements

Scripts description

Scripts are described in the chronological/logical order they have been used. One can play with the whole model just running bold scripts (mains)

  • marketData
    • Describe data formatting process, and choices made in the project regarding raw data
    • Standalone notebook which explains step by step process
  • statsDesc
    • Quick statistics on returns. Basics + correlations between stocks
    • Standalone notebook
  • neuralNetwork_utils
    • Some utils useful to neural networks: data formatting and plotting functions
    • Normally, no need to edit it (except for model improvement)
  • neuralNetwork_smoothness
    • Smoothness implementation. See script for further details
    • Normally, no need to edit it (except for model improvement)
  • neuralNetwork
    • Describe the neural network structure and all related steps (e.g. fitting, score saving, some plots)
    • Normally, no need to edit it (except for model improvement)
  • neuralNetwork_main
    • Train the above network. Parameters may be edited upond needs !
    • As for now, parameters in the script are parameters retained all along the project. They enable to train all the networks. It is easy just to train a single model: just avoid the loop.
  • portfolio
    • Describe a portfolio and the useful flow to implement a strategy
    • Normally, no need to edit it (except for model improvement)
  • portfolio_main
    • Run the above portfolio. Parameters may be edited upond needs ! As for now, parameters in the script are the last parameters retained. See the script to know how to tune parameters.
  • resultsAnalysis_utils
    • A bunch of useful functions to plot results in a fashion way
    • Normally, no need to edit it (except for model improvement)
  • resultsAnalysis_dataLoading
    • Load hard data that are never edited
    • Normally, no need to edit it (except for model improvement)
  • resultsAnalysis_machineLearning
    • Go through neural network results: statistics, plots, correlations, ...
    • Standalone notebook
  • resultsAnalysis_portfolio
    • Go through portfolio results: statistics, plots, correlations, ...
    • Standalone notebook

About

Implementing mean-reverting portfolios from (denoising) autoencoders

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 55.4%
  • Python 44.6%