An open API service indexing awesome lists of open source software.

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.

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.