As far as I understand, in the months before the crash, the US stock market was slightly more unstable than it had been before, but prices were still rising and people were still investing heavily. What caused investors to start selling their stocks towards the end of October '29 (thus initiating the crash)? Did they suddenly lose confidence in the market? Why? Were there signs of economic decline in advance? If yes what signs were there and how did the come to be?
Looking forward to an answer!
First we should mention the reason that stocks grew to such extremes in 1929. The economy of the early-mid 1920s was very strong. This meant that the early 1920s saw genuine, large stock market returns. This wasn't only good news for the US stock market of that decade. In 1925, Winston Churchill restored Britain to the gold standard. In lieu of explaining the complex system of currency pegs and paper-gold exchange rates, the simple lesson to take from this move is that it made investing in English stocks, which in prior decades was the most sought after market, extremely expensive for investors. So a flood of money went from European banks to Wall Street. This pushed stock prices higher.
Stacked on top of all of this, the federal reserve rate was slashed at the urge of many to 3.5% in 1927. This 'easy money' often ended up being invested back into common stocks, fueling the fire, or worse, became used for loans for other people's purchases. The role this played will be returned to later.
So what we have is a stock market starting on solid ground with very solid returns, and then external factors combining to push stock prices very high. As these things often do, years of incredible stock market success produced a kind of mania. After so many years of massive price increases, it can draw in more and more people seeking to get those returns as well. What happens from ~1927 is a powerful, but short lived, price increase as more and more buyers appear to reap the rewards.
The public had a large appetite for these types of 'get rich quick' schemes. As John Kenneth Galbraith says: "[The American people] were also displaying an inordinate desire to get rich quickly with a minimum of physical effort." Indeed, even outside of Wall Street, the 1920s were a decade of financial speculation. 1920, Charles Ponzi was convicted of 86 counts of mail fraud for running a type of scam we now call "Ponzi schemes". In 1925, Florida saw a real estate bubble grow and burst, which was full of swindling and con artistry - including an attempt by Ponzi himself, only recently release from prison.
However, the stock market in the early 1920s was inaccessible to a regular person. A traditional brokerage would require people to have rather large amounts of money to invest. This was long before computerized trading. Exchanges were still done physically done the trading floor. It wasn't seen as worth a broker's time to make small dollar trades. To connect people with smaller amounts the stock market, a new type of financial vehicle was invented: the investment trust. An investment trust was little more than a company to hold stock of other companies. What it allowed people to do was pool together many small amounts of money, so that a brokerage would take them on and they could collectively own stock. A person with only $500 to invest couldn't open an account with a traditional brokerage, they could buy shares in an investment trust. There was no mechanism, either, to ensure the value of the trust matched the value of its underlying assets. While they tended not to diverge too much, they did create some artifical value as demand for stock was so high.
As the mania of stock market returns grew, more and more of these trusts popped up. In 1928, approximately 265 were created - nearly one every day. If all this so far sounds bad - a market driven to a price-spiral mania due to returns, and a bunch of artificial value created from investment trusts - it would get worse. 1929 saw investment trusts get combined with one of finance's most dangerous and powerful weapons: leverage.
The first leveraged trust was concocted by a man named John J. Raskob. The idea was to extend credit to the proletarian - say a man with only $200. With his $200 initial investment, the company would borrow an additional $300, and buy $500 worth of stock. This holder would be entitled to the return on that stock - however, they had to pay back the remaining $300 in $25 installments, with interest. In typical 1920's mania, this plan was described as "a practical utopia" and "the greatest vision of Wall Street's greatest mind".
The benefits of leverage should be explained. Suppose a 'high-leverage trust' - by 1929 virtually all trusts were using some amount of leverage - was 2:1 ratio. This means for every $1 invested into the trust by the public in common stock, $2 would be given to the trust in exchange for preferred stock or bonds - in short, as debt. So $50 million of common stock in a trust could be turned into a $150 million initial investment, with $100 million of that reserved as collateral for the preferred stock and bond holders. If the value of that $150 million rose to $200 million, then the common stock owners would have their slice of the pie increase from $50 million to $100 million - basically doubling the value of their investment, and turning what was initially a 33% return into a 100% return.
On top of this, investment trusts began an incestuous relationship of investing in each other - stacking leverage on top of leverage. Each incenstuous holding could increase these leveraged gains dramatically. As mentioned before, this is where the easy money policy of the Federal Reserve came into effect. The leveraged trust mania was fueled in no small part by this easy money - the fact it was cheaper than previous years to acquire debt meant an explosion of speculation at the worst possible time.
Spring and summer 1929 was when speculative fervor was at its highest. The press, which had previously focused on a wide variety of topics - had become obsessed with the miracle of the markets. Radio stations regularly ran reports on stock prices. However, by the end of summer 1929, voices were not unanimous. Some were starting to question if the market was sustainable. On September 5 1929, Roger Babson said before his Annual National Business Conference: "sooner or later a crash is coming, and it may be terrific". Roger Babson was no small name in business. His comment attracted a big response from the press and business community. Most were scornful and defended current market prices. However, there are signs of tacit agreement from a few places. Some investment trusts began issuing warnings of 'slight setbacks', others of 'a recession in stock prices, but nothing in the nature of a crash'. After his comment, prices dropped for a few days, then returned their ascent. However, this was the first moment doubt began to set in about the prices of the market.
Confidence wavered further in September-October of 1929 when it became apparent a regular business recession was beginning. The Federal Reserve index of industrial production declined to 117 from its summer peak of 126. Steel production was down. Freight car loadings were down. Housing was already in a slump for a few years by this point. By Autumn 1929, these downward trends were increasingly hard to deny. On Semptember 20, an English businessman named Clarence Hatry, who ran a large enterprise, declared bankruptcy without warning. On October 11, the Massachusetts Department of Public Utilities refused to allow Boston Edison to split its stock four to one, finding "due to the action of speculators", the stock had risen to where "no one in our judgment ... on the basis of its earnings, would find it to his advantage to buy it." On September 22, a New York newspaper ran a headline: "OVERSTAYING A BULL MARKET". It described how investors who refused to cash out of a bull run often ended up losing everything. These increasingly common snippets of bad news sewed doubt.
Due to the growing unease, stock prices moved down, but movements were rather minor until October 19. October 19, a Saturday, saw a big selloff in the market. Confidence was finally breaking. But what was most important for the market wasn't the downturn of Saturday itself. It's that the first sweep of margin calls were sent out.