The effect of consumer expectation can be explained using the diagram given below:

If the investors believe that the stock price will decrease in the future based on some information, they will decrease their demand for stock at present, and the demand curve will shift backward. The shift in the demand curve from shows this effect on stock prices. The new equilibrium is achieved at a lower stock price and lower equilibrium quantity .
If investors believe that a rise in stock prices will occur in the future, the demand curve will shift from , thereby increasing the prices to , and quantity demanded and supplied to (increased demand at present).
Thus, the prices change to adjust the demand with the supply of stocks so that, in the end, the equilibrium can be achieved where the numbers of shares sold and purchased are equal.