Candlestick Charts: An Introduction To Using Ca...
As an important part of financial market, stock market price volatility analysis has been the focus of academic and industry attention. Candlestick chart, as the most widely used indicator for evaluating stock market price volatility, has been intensively studied and explored. With the continuous development of computer technology, the stock market analysis method based on candlestick chart is gradually changed from manual to intelligent algorithm. However, how to effectively use stock market graphical indicators to analyze stock market price fluctuations has been pending solution, and deep learning algorithms based on structured data such as deep neural networks (DNN) and recurrent neural networks (RNNs) always have the problems of making it difficult to capture the laws and low generalization ability for stock market graphical indicators data processing. Therefore, this paper proposes a quantification method of stock market candlestick chart based on Hough variation, using the graph structure embedding method to represent candlestick chart features and multiple attention graph neural network for stock market price fluctuation prediction. The experimental results show that the proposed method can interpret the candlestick chart features more accurately and has superiority performance over state-of-the-art deep learning methods, including SVM, CNN, LSTM, and CNN-LSTM. Relative to these algorithms, the proposed method achieves an average performance improvement of 20.51% in terms of accuracy and further achieves at least 26.98% improvement in strategy returns in quantitative investment experiments.
Candlestick Charts: An Introduction to Using Ca...
Stock price movement is a nonlinear and nonstationary time series. Over the past three decades, market regulators and investors have never stopped researching and forecasting stock price analysis, from the initial evaluation of manual indicators, to computer-generated trading data indicators, to more intuitive stock market evaluation indicators such as graphs. In fact, the development history of research on stock price forecasting is closely related to the iterations of information technology, with the earliest research on stock price forecasting dating back to the late 20th century, when Lo and Mackinlay demonstrated that stock prices do not follow the nonrandom walk theory, thus corroborating the predictability of stock market prices . Then Allen et al.  used genetic algorithms to achieve the capture of stock price trends through historical trading data. Kim proposed support vector machines (SVMs) for stock price research  and in subsequent studies further studied stock price fluctuations using multilayer perceptrons . Since then, more and more machine learning algorithms have been applied to the study of stock market price fluctuations. In recent years, neural network techniques have started to emerge, and algorithms based on neural networks such as convolutional neural networks (CNN) [5, 6] and recurrent neural networks (RNN) or improved neural networks have been widely used in the field of stock price volatility research [7, 8]. Due to the quality characteristics exhibited by neural network techniques in processing speech and images, neural network techniques can not only parse structured data such as stock quotes and transactions, but also help scholars to predict stock market price movements using stock graphical features, such as historical movement patterns and features based on the candlestick chart and 30-day average . Specifically, among the currently popular stock graphical indicators forecasting methods, scholars mainly use two methods, similar search forecasting  and pattern forecasting . However, neural network techniques often face two important problems in the analysis of stock graphical indicators. First, most of the analysis of candlestick chart technical indicators in the financial field is based on the color, the length of the solid and upper and lower shadows, and the pattern presented by the candlestick chart combination, and the traditional stock market candlestick chart feature embedding methods are mostly expressed in a tensor or vector manner, ignoring the financial characteristics of the candlestick chart as a graphical indicator. Secondly, traditional neural network methods for prediction of stock graphical indicators are mostly state recognition, and due to the uncertainty of the number of hidden layers of neural networks, traditional neural networks will have a long training time, low prediction accuracy, and unsatisfactory analysis when performing stock market prediction . These two critical problems hinder the research of stock graphical indicators prediction based on neural network technology and become a difficult problem to be solved in related research fields.
With the development of computer visualization, graphical indicators such as time-of-day charts, averages, and candlesticks were introduced for stock price trend evaluation in order to be able to reflect stock price fluctuation trends more intuitively. Moving averages proposed by Granville  help traders to confirm existing trends, judge trends that will emerge, and detect overdelayed trends that are about to reverse. Candlestick charts, on the other hand, visually present stock price trends through a wealth of elements such as shapes, colors, and patterns. Therefore, candlestick charts  have been most widely used as an important tool to help investors make decisions, and a large number of researchers have devoted themselves to its study, mainly using search for time series similarity of candlestick charts  and identification of patterns  to predict stock price trends.
With the newer changes in the research of evaluation indexes, the stock market forecasting methods are also evolving. Forecasting methods have gradually changed from the initial manual forecasting through trading data to forecasting aided by the statistical properties of financial time series obtained by computers. For example, methods such as autoregressive moving average model (ARMA) are based on the statistical properties of time series for stock price forecasting . With the rapid development of artificial intelligence, stock trend prediction gradually changed from machine-assisted prediction to computer-autonomous iterative learning prediction. Classical machine learning algorithms such as SVM and LSTM are widely used for stock price trend prediction . Cutting-edge technologies such as computer vision techniques are also commonly applied to quantitative trading, using various graphical indicators such as candlestick and moving averages for forecasting. Kamijo and Tanigawa  applied recurrent neural networks to candlestick pattern recognition to determine the future trend of stock market prices by identifying triangular patterns in the trend. Naranjo et al.  used fuzzy logic to resolve the ambiguity and uncertainty of candlestick patterns and provide rational decision support for investors, when to buy and sell. Scholars have explored a lot of financial time series graphical indicators forecasting, as shown in Table 1, but how to combine the financial characteristics of graphical indicators to achieve an efficient embedding representation of graphical indicators needs to be further explored.
After image processing, the original 5 trading day images are converted to binary images, and the single-day candlestick contours are detected by Hough changes to obtain a list of single-day candlestick contours. On this basis, cv2.rectangle() is used to label the positioned contours using a matrix. cv2.minAreaRect() is calculated to obtain an array of external minimum rectangle point sets and directly obtains the center point coordinates, rectangle width and height, and rotation angle. cv2.boxPoints() locates the candlestick according to the obtained rectangle point set and draws the external minimum rectangle with annotation. Finally, the candlesticks can be quantified as features for further processing in graph learning.
The results presented in Table 6 indicate that the proposed method has good predictive performance for abnormally large stock fluctuations. The outbreak of the novel coronavirus in 2020, the unprecedented panic, and the subsequent economic recovery after the epidemic were under control, which brought about large fluctuations in the stock market. This paper uses multiple attention graph neural networks to predict stocks using graph data with candlestick financial characteristics, efficiently capturing the sudden negative investor sentiment and stopping losses in time, which plays a good risk prevention and control effect and achieves a good quantitative investment return during the backtest period. In Figure 7(e) industrial stocks have a large data sample and there are substantial fluctuations in industrial due to the epidemic during 2020. The strategy return of this category of stocks is 68.22% higher than the benchmark return, which is the highest strategy return among all quantitative investment groups. (i) COSCO China Holdings stock has a relatively small training sample of public utility stocks, and the overall price of this stock shows an upward trend, the strategy return is only 7.79% higher than the basic return, and it is the lowest strategy return among the quantitative investment groups compared to the benchmark return. Table 6 provides a strategy overview of quantitative investment. From the perspective of systematic risk, the average Alpha is 0.22 and the average Beta is 0.95, and the systematic risk is greater than the nonsystematic risk. The average Sharpe ratio is 0.95 and the average Sortino ratio is 1.23, indicating that each downside risk can come with a greater excess return. The average information ratio is 1.12, indicating that excess risk brings more excess return than average risk. The average maximum retracement of the strategy is 23.79%, achieving a smooth investment return in the face of the novel coronavirus outbreak. The overall overview of the investment strategy shows that the proposed method in this paper obtains better prediction and quantitative investment results, and it can also provide more accurate systemic risk warning to market regulators. 041b061a72