Hi I'm trying to advance a business date (28-12-2012) by 1 day and 1 week according to the Japan calendar.
import QuantLib as ql
trade_date = ql.Date(28, 12, 2012)
calendar = ql.Japan()
calendar.advance(trade_date, ql.Period('1D'))
Out[23]: Date(4,1,2013)
calendar.advance(trade_date, ql.Period('1W'))
Out[24]: Date(4,1,2013)
Seems a bit strange advancing the trade date by one day or one week give the same result. Any ideas why this might be the case? The 1 day result looks right. But the 1 week result seems off.
Incidentally
calendar.advance(ql_trade_date, ql.Period('5D'))
Out[25]: Date(10,1,2013)
How is calendar.advance(ql_trade_date, ql.Period('1W'))
to be interpreted? I was trying to compute the expiry of a 1 week option.
UnitedStates
for instance. TheJapan
class can be extended in the same way given a motivated contributor. $\endgroup$UnitedStates()
etc by itself did not work, but required the caller to be more specific. People get confused as to whether Good Friday, Columbus Day, etc are "U.S. holidays". $\endgroup$