Dr4k3z / option-calibration

0 stars 0 forks source link

Negative trading days #1

Open Dr4k3z opened 3 months ago

Dr4k3z commented 3 months ago

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

Dr4k3z commented 3 months ago

Also, how to manage when the expiry date is not a trading day?