-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOptionVanilla.h
52 lines (32 loc) · 1.13 KB
/
OptionVanilla.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
#ifndef __lab2_1__Option__
#define __lab2_1__Option__
//#include "Payoff.h"
class Payoff;
class OptionVanilla {
public:
// define a type
enum Type {Put = -1, Call = 1, None = 0};
// constructor
OptionVanilla(Payoff& payoff, double expiry);
// return payoff at the expiration date
bool OptionPayoff (double spot) const;
// double OptionStrikeOff(bool type);
// set and get expiry
void SetExpiry(double expiry) {expiry_=expiry;}
double GetExpiry() const {return expiry_;}
double GetExpiry();
Payoff* GetPayoffPointer() const {return p_payoff_;}
// void SetStrike(double strike) {strike_=strike;}
// double GetStrike() const {return strike_;}
//set and get Strike
~OptionVanilla(){};
protected:
// pointer to Payoff
Payoff* p_payoff_;
// we cannot "Payoff payoff_;", because Payoff is an abstract class, and we cannot creat instances of abstract class
// we can "PayoffVanilla payoff_", but the possibility of our class to contain exotic payoff is lost
// time to expiration
double expiry_;
// double strike_;
};
#endif /* defined(__lab2_1__Option__) */