-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComputeReturns.h
31 lines (30 loc) · 1.05 KB
/
ComputeReturns.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <vector>
#include <utility>
#include "boost/date_time/gregorian/gregorian.hpp"
#include <algorithm>
#include "boost/variant.hpp"
#include "CsvWriter.h"
namespace MeanVarianceFrontier
{
class ComputeDailyReturns
{
public:
struct ReturnsData
{
std::string financialDataName;
boost::variant<std::vector<std::pair<boost::gregorian::date, double>>, std::vector<double>> returnsData;
};
public:
ComputeDailyReturns(std::string financialDataName, std::vector<std::pair<boost::gregorian::date, double>>&& inputData);
void writeDataToFile(std::string filePath);
std::vector<std::pair<boost::gregorian::date, double>>& getReturnsData();
ReturnsData getReturnsDataWithoutDates();
ReturnsData getReturnsDataWithDates();
private:
void operator()();
std::string m_financialDataName;
std::vector<std::pair<boost::gregorian::date, double>> m_inputData;
std::vector<std::pair<boost::gregorian::date, double>> m_returnsData;
};
}