You should also know that the prices of the LCN stocks will refresh every 45 seconds while you're doing this.
For this reason it is good to do after you've finished all of Lester's assassination missions, for example. This only works for LCN stocks and do make it worthwhile you need A LOT of money. We have a page dedicated to Lester's Assassination Missions here. Basically, it boils down buying and sell specific stocks before and after you complete the assassination missions for Lester (which are a big part of the single player story line).
The 'Lester Assassination Missions' method of investing in GTA 5's stock market is probably the most fool-proof method to make money in in the game, and lots of it too. List of Stock Tickers for all LCN Stocks.List of Stock Tickers for all BAWSAQ Stocks.