Skip to content

Using dynamic mode decomposition to predict stock prices and execute a daily trading algorithm.

Notifications You must be signed in to change notification settings

sambkr/DMDstocks_python

Repository files navigation

DMDstocks_python

Using dynamic mode decomposition (DMD) to predict stock prices and execute a daily trading algorithm.

Description

The daily trading algorithm works as follows:

  1. Take some initial capital and distribute it equally among the companies in the sector proxy that we are trading with.
  2. For each day, build a DMD model that takes the previous seven days of stock close prices as inputs, and yields predictions for the stock prices on the following eighth day as outputs.
  3. Report the best- and worst-performing stocks based on the next-day predictions.
  4. Sell the predicted worst-performing stocks up to a user-specified value of the portfolio, and re-invest the cash into the predicted best-performing stocks.
  5. Repeat from step 2 until the finish time is reached.

Assumptions

  • Eight companies have been chosen to represent a proxy of the retail sector, and all trading is conducted between these companies.
  • There are no withdrawals or new injections of cash, all money generated is re-invested.
  • No transaction costs have been accounted for.
  • Stocks are treated as continuous quanitites.
  • The number of past days (the variable mp) used to predict one future day was chosen to be 7, based on the heatmaps presented in Mann and Kutz (2016). This paramter has yet to be optimised and applied to other sector types.

Contributor

Samuel Baker [email protected]

Acknowledgments and references

About

Using dynamic mode decomposition to predict stock prices and execute a daily trading algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages