-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathShare.h
52 lines (46 loc) · 1.55 KB
/
Share.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "Date.h"
#include <iostream>
#include <map>
#include <vector>
#include <string>
class Share {
protected:
std::string ticker;
Date start_date;
Date end_date;
std::map<Date, double> price;
std::map<Date, double> ret;
public:
Share() {}
Share(std::string ticker_, Date s, Date e, std::map<Date, double> price_, std::map<Date, double> ret_);
Share(const Share& Share) :ticker(Share.ticker), start_date(Share.start_date), end_date(Share.end_date), price(Share.price), ret(Share.ret) {}
~Share() {}
const Date& GetStartDate() const;
const Date& GetEndDate() const;
std::string GetTicker() const;
const std::map<Date, double>& GetPrice();
const std::map<Date, double>& GetReturn();
void SetStartDate(Date ds) { start_date = ds; }
void SetEndDate(Date de) { end_date = de; }
void SetTicker(std::string Ticker) { ticker = Ticker; }
void SetPrice(std::map<Date, double> Price) { price = Price; }
void SetReturn(std::map<Date, double> Return) { ret = Return; };
Share slice(Date start, Date end) const;
};
class Stock :public Share {
private:
Date eps_date;
double surprise;
public:
Stock() {}
Stock(std::string ticker_, Date s, Date e, Date report, std::map<Date, double> price_, std::map<Date, double> ret_, double surprise_);
Stock(const Stock& stock);
~Stock() {}
const Date& GetEpsDate();
double GetSurprise() const { return surprise; }
Date GetReportDate() const { return eps_date; }
void SetSurprise(double Surprise) { surprise = Surprise; }
void SetReportDate(Date Eps_date) { eps_date = Eps_date; }
void Display(double threshold);
};