Yes if you are trading in share market then it attracts to TDS but it depends on only that the same is Short Term Capital Gain or Long Term Capital Gain. If you hold the shares of any company more than one year then the same will be called long term and less then one year then the same will be short term. There is proper method prescribed by Income Tax Department and you need to follow the same which are as given below:
Capital gain tax rates
For short-term capital gains, you will be taxed depending on the tax slab relevant to you after you have added the capital gain to your annual income. But if the transaction was levied with Securities Transaction Tax (STT), your gain will be taxed 10%.
For long term capital gains, you will be taxed 20%. But if the transaction was levied with STT, you need not pay any tax on your gain. In case of long term capital gains, you can either calculate your capital gain using an indexed acquisition cost, or you can choose not to opt for indexing.