I'm a little unclear on what happens to in-the-money options on expiration. I know the option will get assigned, but does it also need to be bought/sold to close?
For example, say I sell a covered call, and it expires in the money. The underlying stock will be sold, but what about the option? It's now in-the-money, so it may be more expensive to buy back than the premium received for selling it, and maybe even the capital gain. The profit-loss diagram for covered calls shows a flat upside, which suggests the option is bought back for zero cost, but how can that be if it's in the money?