I have a margin account for my stock trading.
I know capital gain from stocks held for more than one year is called long-term capital gain while capital gain from stocks held for less than one year is called short-term capital gain.
If I bought a stock at 100 dollars and sold it for 120 dollars two months later. Then, I used my original 100 dollars and the 20 dollars capital gain to buy another stock on the same day.
If I have never withdrawn the money from my brokerage account to my bank account, do I have to pay tax?
My question is that if the capital gain is never withdrawn, do I need to pay income tax? Or, do I just need to pay income tax when one day I finally withdraw cash from my account?
I am talking about this situation for a US citizen and income tax to IRS.