Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Stock and Order classes #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

c-gamble
Copy link

@c-gamble c-gamble commented Oct 4, 2023

Fixes Issue #1 and Issue #2 by creating Stock and Order classes.

@c-gamble
Copy link
Author

c-gamble commented Oct 6, 2023

Updated PR to include new commit (added Order class)

@c-gamble c-gamble changed the title Create Stock class Create Stock and Order classes Oct 6, 2023
Copy link
Collaborator

@fnorman fnorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, overall this looks good with some minor changes.

int currentPrice,
int shares,
int marketCap,
std::map<std::string, int> priceLog
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition!

Comment on lines +11 to +13
int currentPrice,
int shares,
int marketCap,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these things are dynamic with time, I'm hesitant to include them inside of this class; however, we can leave them in for now given they provide some value.

int orderId;
int userId;
std::string ticker;
bool isBuy;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a bool, let's use an enum. This is so that we can include more information than just buy or sell such as LimitBuy, LimitSell, etc...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To specify, this is to replace the bool isBuy

Comment on lines +19 to +20
std::string ticker,
std::string companyName,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can pass a Stock object here to avoid duplicate work, same as below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create class for Stocks
2 participants