The stock market is indeed similar to the ocean because, just as a cork floating upon its surface is, the price of a stock is affected by many different influences at once. And each of those forces can either add to or subtract from the effects of the others.
The broadest influence is, of course, the tide that ebbs and flows regularly and in some places rises 50 feet or more above its low point.
Upon the tide are the broad, rolling waves caused by the various disturbances at the sea bottom. Then there are the large waves caused by storms and major changes in the atmosphere, and there are the various ripples and patterns caused by the whim of the local breeze that blows this way and that over a few square yards of the surface.
That cork is buoyed by a combination of all of these influences, some rising and some falling, all at the same time. If you were to try to predict where that cork would be in relation to sea level in the next moment, you'd have a tough time of it. You can't predict what a storm or even an underground earthquake will do to the cork at any given moment. And if you add to that the effects of the winds and the little breezes, it's hopeless!
However, you would be able to forecast, in general, where your cork would be over the course of the day, instead of at a particular moment. This is because the tides are influenced by the position of the moon, by gravity, and by a variety of other factors that are all scientifically predictable - so predictable, in fact, that almanacs are published that forecast the tides for years ahead, right to the minute.
The stock market is also governed by a diverse set of influences. And just as the sea is, it is predictable over the long term but not over the short term.