Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ / / Eparam initialPrice The price of all stocks at the beginning of the day, before any price updates are published. / / /
Eparam initialPrice The price of all stocks at the beginning of the day, before any price updates are published.
aparam orders The sequence of buy and sell orders to be executed.
aparam feed The exchange feed of price updates to various stocks.
apre ap initialprice
apre ap orders is not empty.
@pre @p feed is not empty, and is sorted in ascending order by timestamp.
apre ap The set of all timestamps among orders in ap orders and price updat in ap feed contains no duplicates.
areturns A collection see below with the endofday profits and losses of each stock for which at least one order
was executed. Stocks for which a price update was published but no orders were executed should be excluded from the
return value.
auto profitsAndLossesint initialPrice, const std::vectorrder &orders, const
std: :vectorcdots
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started