In bizdays 1.0.2, in the getdate function, I'm unable to pass in '1st bizday before 2nd fri'
contractyear=2002
contractmonth=5
newltd=cal.getdate("1st bizday before 2nd fri",contractyear,contractmonth)
This shows:
File ".../bizdays.py", line 888, in getdate
dt = self._index.getdate(expr, year, month)
File ".../bizdays.py", line 313, in getdate
raise ValueError('Invalid reference day:', tok[4])
ValueError: ('Invalid reference day:', 'fri')
(Incidentally, the usage case for this is for futures market expiries - this one in particular is the 90 Day Bank Accepted Bills contract listed on the Australian Securities Exchange (formerly Sydney Futures Exchange).
Of course, I can do this is a nested fashion, as below, but it'd be nicer for the parser to handle this.
I took some time to investigate in the code.
It is not implemented.
I'm setting this issue as an enhancement and this will be available in future releases.
In bizdays 1.0.2, in the getdate function, I'm unable to pass in '1st bizday before 2nd fri'
This shows:
(Incidentally, the usage case for this is for futures market expiries - this one in particular is the 90 Day Bank Accepted Bills contract listed on the Australian Securities Exchange (formerly Sydney Futures Exchange).
Of course, I can do this is a nested fashion, as below, but it'd be nicer for the parser to handle this.