https://github.com/sanderhelleso/maxprofitstockmarket
Each day the stock price fluctuates during the day. Given an array of stock prices, what would be the most efficient way to determine the best time to buy and sell to get the max profit. You must buy before you sell.
https://github.com/sanderhelleso/maxprofitstockmarket
csv dataset-generation profit-calculator stock-data stock-market
Last synced: about 1 year ago
JSON representation
Each day the stock price fluctuates during the day. Given an array of stock prices, what would be the most efficient way to determine the best time to buy and sell to get the max profit. You must buy before you sell.
- Host: GitHub
- URL: https://github.com/sanderhelleso/maxprofitstockmarket
- Owner: sanderhelleso
- Created: 2018-10-15T01:52:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-15T19:52:02.000Z (over 7 years ago)
- Last Synced: 2025-02-02T13:15:57.693Z (over 1 year ago)
- Topics: csv, dataset-generation, profit-calculator, stock-data, stock-market
- Language: Java
- Size: 1.36 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# maxProfitStockMarket
```
Each day the stock price fluctuates during the day.
Given an array of stock prices, what would be the most
efficient way to determine the best time to buy and sell
to get the max profit. You must buy before you sell.
Examples:
--------------------------------------------------------------------------
maxProfit( [ 1, 3, 5, 4, 3, 5, 10, 9, 8, 4, 9]) -> buy at 1, sell at 10
maxProfit( [ 2 , 3, 1, 5, 6, 9, 10, 15 14 ]) -> buy at 1, sell at 15
maxProfit( [ 15, 12, 11, 9, 7, 5, 3, 1] ) -> no profit is possible
```
## Program Overview
## Program Description
```
This application reads an array of generated data of user defined size that
simulates the stock market. It then determinesthe best time to sell / buy
to recieve the best potensial profit available of the data.
After generating the result, the application creates a new report CSV file and filled
it up with data from the calculations (id, sellValue, buyValue, sellDay, buyDay)
A nice addition to this application could be to generate a chart using the freshly
created CSV file to further visually display the data.
```