I think selling and buying of shares is independent of subsequent transactions with that money.
for example if u sell and make money and later with same money suffer loss, it does not matter.
Every gain made on shares withing one year of purchase is liable to short term capital gains (10% of profit made).
there are no long term capital gains (AS OF NOW).