https://github.com/tristeng/OpenTTD/tree/stock-exchange
So far, you start with 50K loan and 50K of investor money (5000 shares at 10 per share) and you can issue or buy back shares. If the shares go over 100 per share, they will split and if they go under 2, they will merge. This event can get triggered every quarter, depending on if the price goes above/below those values.
The share price calculation takes into consideration the company value (less cash) and the earnings from the last 4 quarters, but this is still a work in progress.
Things I intend to work on and would love to see:
- player owned shares - instead of the player and company being one entity, the player could be separate and manage their own shares (to raise net worth as a goal), and same for the company
- player starts out with 20% stake in their company (1000 shares)
- instead of buying a company 25% at a time, you would need to purchase the shares, 1000 at a time and get a 51% stake to take over - you would need to do this to keep controlling interest in your own company as well
- player would get paid a salary from the company - better earnings means bonuses to the player, which would allow the player to invest more money in the stock market, poor earnings means no bonus, less salary and maybe termination
- dividends
- perhaps you could change companies and preside over one of the AI companies, if a position was open
- buying industries and industry profits - industry would be more valuable the more you ship to/from it
- and more...