Update exposed gotoNextTimeframe and overloaded enterAsk and enterBid

This commit is contained in:
Lev
2021-07-04 17:20:12 -05:00
parent 6d33c0106e
commit 86fc0d8f78
2 changed files with 14 additions and 8 deletions

View File

@ -170,9 +170,10 @@ void MerkelMain::printWallet()
std::cout << wallet.toString() << std::endl;
}
void MerkelMain::gotoNextTimeframe()
void MerkelMain::gotoNextTimeframe(bool silent)
{
std::cout << "Going to next time frame. " << std::endl;
if(!silent)
std::cout << "Going to next time frame. " << std::endl;
for (std::string p : orderBook.getKnownProducts())
{
std::cout << "matching " << p << std::endl;
@ -180,7 +181,8 @@ void MerkelMain::gotoNextTimeframe()
std::cout << "Sales: " << sales.size() << std::endl;
for (OrderBookEntry &sale : sales)
{
std::cout << "Sale price: " << sale.price << " amount " << sale.amount << std::endl;
if(!silent)
std::cout << "Sale price: " << sale.price << " amount " << sale.amount << std::endl;
if (sale.username == "simuser")
{
// update the wallet
@ -238,7 +240,7 @@ void MerkelMain::processUserOption(int userOption)
}
if (userOption == 6)
{
gotoNextTimeframe();
gotoNextTimeframe(false);
}
}