Recently I was privileged to work with a client whose income came half from real estate rentals and half from stock market investing. After a series of QuickBooks accountants and bookkeepers had messed up his bookkeeping, it was like a tangled mess of hair. Different people had tried this and that way of tracking his stock market investments, none of which were successful.
QuickBooks is the ideal software for business, and property rentals, so I recommended he leave that part of his business there. But I recommended that he switch to Quicken to account for his stock market portfolio. Quicken is better suited for stock market investments than Quickbooks. For example, one drop down choice in Quicken includes "stock split". How else would you track that one share became two shares, but the purchase price and brokerage fees didn't change?
What tax preparers want to know is date of purchase, # of shares purchased, total cost, minus any brokerage fees. Even if you hold that stock for years, decades, you still need this information when you sell for tax purposes. Make a file for "stock purchases" to store the paper that outlines the trade there. One advantage of Quicken is that if the stock pays dividends and interest, you can see watch how profitable this stock is for you.
If I had to track stock market investments in QuickBooks, I would use items and track it the way one tracks job costing. Each stock would be an item, with additional items for brokerage fees, etc. The purchase would be tracked as a purchase order, and the sale as a sales receipt or invoice/payment. There is a job costing report to show profit. But once again I recommend Quicken for tracking your stock portfolio.