-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.h
More file actions
61 lines (56 loc) · 2.05 KB
/
Copy pathplot.h
File metadata and controls
61 lines (56 loc) · 2.05 KB
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
53
54
55
56
57
58
59
60
61
#ifndef SM_PLOT_H
#define SM_PLOT_H
#include <vector>
#include <iostream>
#include <boost/tuple/tuple.hpp>
#include <boost/format.hpp>
#include "gnuplot-iostream/gnuplot-iostream.h"
#include "basic.h"
#include "heston.h"
#include "analytic.h"
enum SolvingType{
Analytic,
MC
};
enum Method{
Direct,
Antithetic,
ControlVariate,
};
enum X_axis{
Spot,
Volatility,
Maturity
};
class Plot{
public:
Plot(X_axis X_type, double X_min, double X_max, int N): m_X_type(X_type), m_X_min(X_min), m_X_max(X_max), m_N(N) {}
virtual ~Plot(){}
virtual void set_values(SolvingType RES, Method MTD, double &S, double &K, double &r, double &sigma, double &T, int &M, double &d_S){};
virtual void set_values(SolvingType RES, Method MTD, double &S, double &K, double &r, double &kappa, double &theta, double &sigma, double &rho, double &T, int &M, double &delta_S, double &delta_sigma){};
virtual void show() = 0;
protected:
std::vector<std::pair<double, double> > m_pts_price;
std::vector<std::pair<double, double> > m_pts_delta;
std::vector<std::pair<double, double> > m_pts_gamma;
std::vector<std::pair<double, double> > m_pts_vega;
X_axis m_X_type;
double m_X_min;
double m_X_max;
int m_N;
};
class Plot_GBM : public Plot {
public:
Plot_GBM(X_axis X_type, double X_min, double X_max, int N): Plot(X_type, X_min, X_max, N) {}
~Plot_GBM(){}
void set_values(SolvingType RES, Method MTD, double &S, double &K, double &r, double &sigma, double &T, int &M, double &d_S);
void show();
};
class Plot_Heston : public Plot {
public:
Plot_Heston(X_axis X_type, double X_min, double X_max, int N): Plot(X_type, X_min, X_max, N) {}
~Plot_Heston(){}
void set_values(SolvingType RES, Method MTD, double &S, double &K, double &r, double &kappa, double &theta, double &sigma, double &rho, double &T, int &M, double &delta_S, double &delta_sigma);
void show();
};
#endif //SM_PLOT_H