Skip to content

This is a PHP Implementation of Markowitz's Modern Portfolio Theory

License

Notifications You must be signed in to change notification settings

BitWire/PHP_MPT

Repository files navigation

The Modern Portfolio Theory

This is a PHP implementation of the Modern Portfolio Theory. I made this as part of a Seminar essay and presentation. This Project is based on Laravel 5.8 and PHP 7.1 and the medium articles about the MPT by Bernard Brenyah. Really worth a read!

All the commands are suited for use under Linux, specifically tested under Ubuntu 19.04.

Installation

In root directory:

composer install

The .env.example to .env and app key generation should be done automatically. Edit the .env File to your needs. Dont forget to input an APIKEY! You can get your free APIKEY at Alpha Vantage

Usage

Start the debugserver with the command php artisan serve in the root directory of the Project.

In a browser, open:

127.0.0.1:8000/?stocks=XXX,XXX,XXX,XXX

where XXX is a valid stock symbol. you can use up to 5 stocks. Optionally you can use timeseries to change the requested data between monthly adjusted (monthly) and daily adjusted (daily) stock prices. This defaults to daily.

Used Libarys:

TODO

  • I have to check the monthly timeseries again, they are apparently broken
  • A good validator would be great for the data to be in the same timespan or else the whole program will break down
  • Lots of stuff I probably forgot and will add here when I remember it.

Setup to contribute

Set up grumPHP to sniff commits.

 php ./vendor/bin/grumphp git:init --config=./grumphp.yml

To autofix possible Codestyle errors, use:

composer autofix-phpcs

About

This is a PHP Implementation of Markowitz's Modern Portfolio Theory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages