This commit is contained in:
2024-08-07 09:12:07 -04:00
parent ca445435a0
commit fdfadd5c7e
1021 changed files with 73601 additions and 0 deletions

35
analytic/INSTRMNT.HPP Normal file
View File

@@ -0,0 +1,35 @@
#ifndef _ANALYTIC_INSTRUMENT_HPP_
#define _ANALYTIC_INSTRUMENT_HPP_
#ifndef _COMMON_GLOBALDATA_HPP_
#include <common/gdata.hpp>
#endif
#ifndef _ANALYTIC_COUPON_HPP_
#include <analytic/coupon.hpp>
#endif
class Instrument
{
public:
enum Type{Generic,StraightBond,ZeroCouponBond};
Instrument(Type type=Generic);
Instrument(const Instrument &instrument);
virtual ~Instrument();
BOOL operator==(const Instrument &instrument)const;
Instrument &operator=(const Instrument &instrument);
double price(void)const;
void price(double price);
const Coupon &coupon(void)const;
void coupon(const Coupon &coupon);
Type type(void)const;
void type(Type type);
virtual BOOL cashflows(GlobalData<double> &cashflows);
virtual double par(void)const;
virtual double fv(int periods);
virtual double discount(double fv,int periods);
private:
double mPrice;
Coupon mCoupon;
Type mType;
};
#endif