-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Conversation
Updated PR to include new commit (added |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition!
int currentPrice, | ||
int shares, | ||
int marketCap, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
std::string ticker, | ||
std::string companyName, |
There was a problem hiding this comment.
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
Fixes Issue #1 and Issue #2 by creating
Stock
andOrder
classes.