Getting the nearest weekly expiry date of BANKNIFTY option

thepunisher
I'm using the PHP API, how do I get the nearest weekly expiry date of BANKNIFTY option?
date( "d-m-Y", strtotime( "this thursday" ) )
This code gets the job done except when it happens to be a market holiday.
  • sujith
    If the last thursday is a trading holiday then it will be prepone to last Wednesday. If Wednesday is also off then expiry will be prepone to tuesday.
    This is the practice but there is no written document or circular about this.
Sign In or Register to comment.