The article covers the research of existing forecasting methods and its classification. Basic principles of analysis and forecasting of stock markets are researched Algorithm of forecasting financial markets based on the frequency analysis is studied in the article. The results of the research obtained with the program in Java are presented. Forecasts of stock market analysts are used as an input. Forward-looking statements of studied time series are calculated with a help of extrapolation methods.