Imam Ibn Taymiyah (may Allah bestow mercy on him) supported a middle position, saying:
As for paying the value of zakat, the popular view of Mâlik and ash-Shâfi‘i is that it is not permissible. However, according to Abu Ḥaneefah, it is permissible. Aḥmad (may Allah bestow mercy on him) prevented it in some conditions and permitted it in others. The stronger view concerning this is that giving the value out without a need or a greater benefit is not allowed. (Majmoo‘ al-Fatâwâ)
The Zakat on Stocks and Shares
If they are used for trading (as in day trading), then they are treated like merchandise.
If they are used as long-term investments, then zakat is paid on the zakatable portion of the assets. For instance, in general, cash surplus and trade goods are zakatable, while factories and stores are not, so shares in companies that own retail stores will be mostly zakatable, whereas companies that mainly invest in manufacturing will have only small portions of their assets that are zakatable. Individuals may review the companies’ annual reports to determine what is zakatable; if this is not possible, they should ask experts about each particular company or mutual fund, to get an approximate estimate.
This position is in agreement with OIC – International Islamic Fiqh Academy (IIFA) resolutions 28 (3/4) and 121 (3/13).