MFBM

Rewrote entire infra

  • instead of multiple envs, now there is only one general env
  • the general env supports any number of stocks
  • the general env can be customized with the following:
    • time horizon generator, this enables the time horizon to vary each time the env is reset, example usage is function that returns based on the number of calls
    • num stocks, this enables for any number of stocks to be traded simultaniously
    • process generator, this alow any kind of process where n is num stocks, for example mfBm
    • optional utility, to be a true generalization of the other envs a utility is needed, default is the identity

for example, the previous AREnv is equivalent to this general environment instantiated with the following:

  • constant time horizon generator
  • num stocks = 1
  • AR(1) process generator with the added arguments
  • utility function
  • self._lambda = 0 for no friction

another example is the previously non existent mfBm environment:

  • constant time horizon generator

  • num stocks = p

  • mfBm process generator with the added arguments like hursts, rho, etc.

  • identity utility

  • many common sense strategies come with the general env:

    • contrarian strategy
    • momentum strategy
    • buy and hold strategy
    • piecewise fBm optimal strategy
  • many time horizon generators are implemented:

    • constant
    • linear
    • exp
    • log
    • noisy log
    • random uniform
  • some other utility functions are also provided, for plotting rollouts and prices etc.

TODO:

  • maybe num_stocks is not necessary for instantiating MultiInvestEnv, because we only need to check the process generator output shape
  • implement OU process generator
  • implement optimal OU strat as defined in Rasonyi Guasoni Nika Example 5.3.