This is a function that returns a string vector containing the expiration dates of options when a serial date vector is given. Also returns the index of the expiration fridays in the serial date vectors.
Nagi Hatoum (2020). Expiration Friday (https://www.mathworks.com/matlabcentral/fileexchange/3040-expiration-friday), MATLAB Central File Exchange. Retrieved .
This function never returns any expiration Fridays in the month of July! This is because it uses datestr(...,'m') which returns the first letter of the month. Therefore the function never catches the change in the month going from June to July. Better to use datestr(...,'mm') and then using the function str2num to convert month numbers into integers.
Speaking of "expiration Fridays," what happens to a Call that expires in the money if the holder doesn't submit a sell order?
I was looking for something like that. Thanks!