Let's say I have $100 in short term capital gains this year. I will need to pay taxes on this gains at the my ordinary tax rate (which we shall assume is 37%).
Let's also say there is a stock that has a dividend in December. It's $1000 stock and the dividend amount is $10. Let's also assume this stock has very low volatility.
So I buy 10 shares for $1000, collect the dividend, then sell the 10 shares for $990.
I've wiped out my short term capital gains. And now I only need to pay taxes on the dividend (which is a much lower rate than 37%).
What is wrong with this logic?