https://github.com/abongsjoel/stock-picker
The project implement's a #stock_picker method that takes in an array of stock prices and returns a pair of days representing the best day to buy and the best day to sell.
https://github.com/abongsjoel/stock-picker
ruby
Last synced: 10 months ago
JSON representation
The project implement's a #stock_picker method that takes in an array of stock prices and returns a pair of days representing the best day to buy and the best day to sell.
- Host: GitHub
- URL: https://github.com/abongsjoel/stock-picker
- Owner: abongsjoel
- License: mit
- Created: 2021-01-26T08:45:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T08:59:55.000Z (over 5 years ago)
- Last Synced: 2025-04-11T14:41:40.792Z (about 1 year ago)
- Topics: ruby
- Language: Ruby
- Homepage: https://repl.it/@abongsjoel/stock-picker
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stock Picker
> In this project, I implemented a simple #stock_picker method
The project implement's a #stock_picker method that takes in an array of stock prices, one for each hypothetical day. It should return a pair of days representing the best day to buy and the best day to sell. Days start at 0 and we need to buy before we can sell.
E.g.
```
> stock_picker([17,3,6,9,15,8,6,1,10])
=> [1,4] # for a profit of $15 - $3 == $12
```
## Getting Started
This project is built with Ruby and run at the terminal so in order run it:
- You start by installing ruby on your computer
> [Installing Ruby](https://www.theodinproject.com/courses/ruby-programming/lessons/installing-ruby-ruby-programming)
- Then you clone the project from githup into a local repository
```
git clone git@github.com:abongsjoel/stock-picker.git
```
- Navigagte into the stock-picker folder
```
cd stock-picker
```
- Run the application using the following command
```
ruby main.rb
```
- Voila
- Enjoy
## Built With
- Ruby
## Live Demo
[Repl.it Link](https://repl.it/@abongsjoel/stock-picker)
## Author
👤 **Chi A. Joel**
- GitHub: [@abongsjoel](https://github.com/abongsjoel)
- Twitter: [@thierryjoel10](https://twitter.com/ThierryJoel10)
- LinkedIn: [Chi Abongwa Joel](https://www.linkedin.com/in/chi-abongwa-joel-b4285a97/)
## Acknowledgments
- [The Odin Project](https://www.theodinproject.com)
## Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/abongsjoel/stock-picker/issues).
## Show your support
Give a ⭐️ if you like this project!
## License
This project is MIT licensed.