Lots of bad information here. You can do this if your broker lets you. Why is less clear, since the tax benefits have been long removed via “constructive sale” rules that treat creating a box position as a taxable event.
TDA will let you do this for stocks, for example, but once you have a...