The function int Calendar::tradingDays(const Date& p1, const Date& p2) counts trading days between the p1 and p2. Right now, it works so that goes from the smaller to the bigger. However, doing so later allows to create options that have maturities that go before the current date. I suggest to somehow make the user aware of this, for instance returning a negative number of trading days.
Other additional stuff: right now Options can be create only on today's date, could be nice to be able to write options on any date whatsoever. Also, time2maturity allows for various units, like Days/Months/Years. I've assumed a standard conversion rate of Month = 30 days and Year = 365 days. Might wanna look into it
The function
int Calendar::tradingDays(const Date& p1, const Date& p2)
counts trading days between the p1 and p2. Right now, it works so that goes from the smaller to the bigger. However, doing so later allows to create options that have maturities that go before the current date. I suggest to somehow make the user aware of this, for instance returning a negative number of trading days.Other additional stuff: right now Options can be create only on today's date, could be nice to be able to write options on any date whatsoever. Also, time2maturity allows for various units, like Days/Months/Years. I've assumed a standard conversion rate of Month = 30 days and Year = 365 days. Might wanna look into it