It shouldn’t be 100% random. I would implement some randomness but very important observations you can make about stock prices is that the more people buy it at a given moment the faster the price increases but not infinitely. To some point which I think is the moment when people are no more confident about the increase and think that now the price will drop. The more people sell at a lower price to get rid of their stocks the faster the price drops.
I suggest to implement at least a little bit of such intuitive logic and your stock prices will look more authentic.