y******k 发帖数: 1 | 1 Consider two time series. Each time series contains price and time. Time is
expressed in number of seconds since market open. Every time when price
changes – there is a new entry into time series. Write a program that
receives two inputs: time series 1 and 2, and calculates another time series
containing the price difference (spread) between the two products at fixed
10 seconds interval.
//Each timeseries in represented as a key-value object, where keys are times
and values are prices.
//We simply take two timeseries key-value objects and return one that has
times in 10 second intervals.
std::map Problem7::getSpreadTimeSeries(std::map
ts1, std::map ts2)
{
//Fill this function
std::map pseudo_answer = std::map();
pseudo_answer.insert(std::pair(1, 4.0));
return pseudo_answer;
} |
|