When you've figured out how much money you are willing to set aside for stocks and understand that you may not be able to use that money for a while that's when you can start to determine how many shares of a company you should buy.
Determine your Trading Time Frame
Long-Term Position Sizing
If you are looking to hold stocks for the long-term then the answer is easy. The cheaper the stock and the stronger the belief you have in the business itself, then the more of it you should buy. For example, if you have $30,000 then maybe allocate $15,000, $10,000 and $5,000 to three different stocks. Put $15,000 in the stock you have the strongest belief in and $10,000 in the next and then $5,000 in the stock you are not as confident in. Alternatively, you could allocate it evenly between three. It is better to own a lot of three of the best stocks than some shares of twenty different stocks. Why do you ask? The reason is because you will be more selective and only pick the best of the best.
Short-Term Position Sizing
Should you decide to trade in the short-term and engage in stock speculation then you'll have to determine how many shares you buy based on how much you are willing to lose on every trade.
Suppose you buy Clean Energy (CLNE) at $12 a share. You put your STOP LOSS at $10 dollars per share. The stop loss is the point at which you admit defeat and for whatever reason your trading plan no longer works. In other words, time to get out of the position.
In the above situation, you are buying at $12 and because your strategy is to play the $12-$14 trading range you sell when it breaks $10. You do this because you want to protect your capital and limit your losses to $2 per share. Yes, the stock could rebound and go back to $12, but you don't want to take that risk because it could just as easily go down to $8. When your trading strategy stops working it is time to get out because you can no longer with high probability predict where the stock will go next. When you first entered the position at $12, you had a good idea that it could go up to $14 and trade within that trading range. The moment it breaks the trading range, the strategy is to exit immediately. Cut your losses right then and there.