KR102614595B1 - A stock price prediction system based on real-time macro index prediction - Google Patents

A stock price prediction system based on real-time macro index prediction Download PDF

Info

Publication number
KR102614595B1
KR102614595B1 KR1020210055151A KR20210055151A KR102614595B1 KR 102614595 B1 KR102614595 B1 KR 102614595B1 KR 1020210055151 A KR1020210055151 A KR 1020210055151A KR 20210055151 A KR20210055151 A KR 20210055151A KR 102614595 B1 KR102614595 B1 KR 102614595B1
Authority
KR
South Korea
Prior art keywords
stock price
indicator
stock
data
macro
Prior art date
Application number
KR1020210055151A
Other languages
Korean (ko)
Other versions
KR20220147968A (en
Inventor
홍성혁
지세현
Original Assignee
백석대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 백석대학교산학협력단 filed Critical 백석대학교산학협력단
Priority to KR1020210055151A priority Critical patent/KR102614595B1/en
Publication of KR20220147968A publication Critical patent/KR20220147968A/en
Application granted granted Critical
Publication of KR102614595B1 publication Critical patent/KR102614595B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Economics (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Technology Law (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

주가에 대한 다수의 거시지표 각각의 상관 관계를 분석하고, 다수의 거시지표 각각에 대해 예측된 지표 값과 실제 값 간의 차이를 산출하고, 각 거시지표의 차이에 상관관계를 반영하여 거시지표의 가중치를 산출하고, 산출된 가중치를 예측된 주가에 반영하는, 실시간 거시지표 예측 기반 주가 예측 시스템에 관한 것으로서, 주가 정보 및 경제 지표를 시계열 데이터로서 수집하는 데이터 수집부; 상기 시계열 데이터에 대하여 증분을 산출하여 정규화 하는 데이터 정규화부; 주가 및 각 경제지표 간의 상관계수를 산출하는 상관관계 분석부; 각 주가 및 경제지표 각각을 위한 LSTM 신경망을 학습시키는 신경망 관리부; 학습된 LSTM 신경망으로 주가 및 경제지표 각각을 예측하는 주가및지표 예측부; 및, 각 경제지표의 보정치를 구하고, 구한 보정치를 예측된 주가에 반영하여 보정하는, 주가 보정부를 포함하는 구성을 마련한다.
상기와 같은 시스템에 의하여, 주가에 대한 거시지표의 상관관계를 분석하고 거시지표를 실시간으로 예측하여 거시지표의 영향을 예측된 주가에 가중함으로써, 주가의 시계열성에 의한 예측과 동시에 거시경제 환경을 모두 반영하여 보다 정확한 주가를 예측할 수 있다.
Analyze the correlation between multiple macro indicators for stock prices, calculate the difference between the predicted indicator value and the actual value for each multiple macro indicator, and weight the macro indicator by reflecting the correlation in the difference between each macro indicator. It relates to a stock price prediction system based on real-time macro indicator prediction that calculates and reflects the calculated weights in predicted stock prices, comprising: a data collection unit that collects stock price information and economic indicators as time series data; a data normalization unit that calculates increments and normalizes the time series data; A correlation analysis unit that calculates the correlation coefficient between stock prices and each economic indicator; Neural network management department that trains LSTM neural networks for each stock price and economic indicator; A stock price and index prediction unit that predicts each stock price and economic index using a learned LSTM neural network; And, a configuration is provided that includes a stock price correction unit that obtains correction values for each economic indicator and corrects them by reflecting the obtained correction values in the predicted stock price.
By using the above system, the correlation between macro indicators for stock prices is analyzed, macro indicators are predicted in real time, and the influence of the macro indicators is weighted on the predicted stock prices, thereby predicting the time series of stock prices and simultaneously predicting the macroeconomic environment. By reflecting all of this, you can predict the stock price more accurately.

Description

실시간 거시지표 예측 기반 주가 예측 시스템 { A stock price prediction system based on real-time macro index prediction }Stock price prediction system based on real-time macro index prediction { A stock price prediction system based on real-time macro index prediction }

본 발명은 주가에 대한 다수의 거시지표 각각의 상관 관계를 분석하고, 다수의 거시지표 각각에 대해 예측된 지표 값과 실제 값 간의 차이를 산출하고, 각 거시지표의 차이에 상관관계를 반영하여 거시지표의 가중치를 산출하고, 산출된 가중치를 예측된 주가에 반영하는, 실시간 거시지표 예측 기반 주가 예측 시스템에 관한 것이다.The present invention analyzes the correlation between a plurality of macro indicators for stock prices, calculates the difference between the predicted indicator value and the actual value for each of the plurality of macro indicators, and reflects the correlation in the difference between each macro indicator. This relates to a stock price prediction system based on real-time macro indicator prediction that calculates the weight of the indicator and reflects the calculated weight in the predicted stock price.

최근, 코로나 등 전염병으로 인해 세계 경제가 정체되어, 미연방 준비 제도를 비롯한 대부분의 국가에서 통화량을 늘려 경제를 부양하는 정책을 도입하였다. 시장의 자금이 넘쳐 유동 자금이 주식 시장으로 유입되었고, 미국을 비롯한 국내 증시가 급격히 상승 해 증시 과열로 이어졌다.Recently, the global economy has stagnated due to infectious diseases such as coronavirus, and most countries, including the U.S. Federal Reserve System, have introduced policies to stimulate the economy by increasing the money supply. As the market was overflowing with funds, liquid funds flowed into the stock market, and domestic stock markets, including those in the U.S., rose sharply, leading to overheating of the stock market.

그러나 대부분의 주식 투자자들은 회사의 재무 재표를 분석하지 않고 유명 유튜버나 지인의 추천을 듣는 것만으로 투자하는 경향이 있어 주식 투자 손실 가능성이 높아지고 있다.However, most stock investors tend to invest only by listening to recommendations from famous YouTubers or acquaintances without analyzing the company's financial statements, increasing the possibility of stock investment losses.

일반적으로, 주가 분석은 크게 기본분석과 기술적 분석을 이용하고 있다. 기본분석은 기업의 재무제표, 산업동향, CEO능력 등을 통하여 기업의 가치를 분석하여 예측하는 것이며, 본 연구에서는 기술적 분석을 통한 주가 예측을 의미하며, 기술 분석은 기본적으로 사용되는 주가의 시가, 고가, 저가, 종가, 거래량 등의 기본 주가 데이터와 함께 캔틀 차트(Candle Chart), 이동평균(Moving Average), RSI, (Relative Strength Index), CCI(Commodity Channel Index), MACD(Moving Average Convergence and Divergence), 이격도(Disparity), SIGNAL, stochastic1 등 다양한 보조지표를 사용한다[10-12]. 그러나 이러한 분석은 까다로울 뿐만아니라, 일반인이 분석하기 어려우며, 이러한 분석을 하더라도 주가를 예측하는 것은 쉽지 않다.In general, stock price analysis largely uses fundamental analysis and technical analysis. Basic analysis is analyzing and predicting the value of a company through the company's financial statements, industry trends, CEO ability, etc. In this study, it means predicting the stock price through technical analysis. Technical analysis is basically the market price of the stock price used, Candle Chart, Moving Average, RSI, (Relative Strength Index), CCI (Commodity Channel Index), MACD (Moving Average Convergence and Divergence) along with basic stock price data such as high, low, closing price, and trading volume. ), Disparity, SIGNAL, and stochastic1, etc. are used [10-12]. However, this analysis is not only difficult, but also difficult for the general public to analyze, and even with this analysis, it is not easy to predict stock prices.

이러한 문제점을 해결하고자, 주가를 예측하는 기술들이 개발되고 있다. 일례로서, 과거의 데이터를 분석하여 시계열을 통해 추론하거나[특허문헌 1], 인공지능을 이용하여 주가의 변동 패턴을 학습하고 미래를 예측하는 방식[특허문헌 2] 등이 제시되고 있다.To solve these problems, technologies for predicting stock prices are being developed. As an example, methods such as analyzing past data and making inferences through time series [Patent Document 1], or using artificial intelligence to learn stock price fluctuation patterns and predict the future [Patent Document 2], etc. have been proposed.

그러나 주가에 미치는 요소들이 다양하고, 과거의 데이터를 가지고 미래를 예측하는 것은 사실상 불가능하다. 또한, 주식 시장은 과거의 거래 패턴이 반복하지 않고, 해외 시장이나, 경제 여건 등 세계적인 경제 상황에 영향을 받는다. 또한, 국제 관계, 특정 사건 등 매 순간 새로운 상황에 영향을 받는다. 그래서 통상의 딥러닝 알고리즘을 적용한다고 해도 시시각각 변화하는 주식의 가격을 예측하는 것은 거의 불가능하다.However, there are various factors that affect stock prices, and it is virtually impossible to predict the future using past data. Additionally, the stock market does not repeat past trading patterns and is affected by global economic conditions such as overseas markets and economic conditions. In addition, it is affected by new situations at every moment, such as international relations and specific events. Therefore, even if a typical deep learning algorithm is applied, it is almost impossible to predict the constantly changing prices of stocks.

따라서 주가의 시계열 분석 뿐만 아니라 경제 거시지표나, 뉴스에 의한 시장 상황을 반영하여 주가를 예측할 필요가 있다.Therefore, it is necessary to predict stock prices by reflecting not only time series analysis of stock prices but also economic macro indicators and market conditions based on news.

한국 등록특허공보 제10-1508361호(2015.04.08.공고)Korean Patent Publication No. 10-1508361 (announced on April 8, 2015) 한국 등록특허공보 제10-1458004호(2014.11.04.공고)Korean Patent Publication No. 10-1458004 (announced on November 4, 2014)

Lee Jong-girl. (2008). A comparative analysis of major macro indicators in five Latin American countries. Latin American and Caribbean Studies 26(2), 83-106 Lee Jong-girl. (2008). A comparative analysis of major macro indicators in five Latin American countries. Latin American and Caribbean Studies 26(2), 83-106 Sukha Shin. (2013). Analysis on the Relation between Foreign Investors in Korean Stock Markets and Macroeconomic Variables. INTERNATIONAL BUSINESS REVIEW 17(2), 89-107 Sukha Shin. (2013). Analysis on the Relation between Foreign Investors in Korean Stock Markets and Macroeconomic Variables. INTERNATIONAL BUSINESS REVIEW 17(2), 89-107 Mahdy, F. E. INDUSTRIES STOCK RETURN REACTIONS TO RISK FACTORS: AN EMPIRICAL INVESTIGATION ON THE G-7 COUNTRIES. Mahdy, F. E. INDUSTRIES STOCK RETURN REACTIONS TO RISK FACTORS: AN EMPIRICAL INVESTIGATION ON THE G-7 COUNTRIES. Guru-Gharan, K. K., Rahman, M., & Parayitam, S. (2009). Influences of selected macroeconomic variables on US stock market returns and their predictability over varying time horizons. Academy of Accounting and Financial Studies Journal, 13(1), 13. Guru-Gharan, K. K., Rahman, M., & Parayitam, S. (2009). Influences of selected macroeconomic variables on US stock market returns and their predictability over varying time horizons. Academy of Accounting and Financial Studies Journal, 13(1), 13. Qian, Y., Fan, Y., Hu, W., & Soong, F. K. (2014, May). On the training aspects of deep neural network (DNN) for parametric TTS synthesis. In 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 3829-3833). IEEE. Qian, Y., Fan, Y., Hu, W., & Soong, F. K. (2014, May). On the training aspects of deep neural network (DNN) for parametric TTS synthesis. In 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 3829-3833). IEEE. Mao, J., Xu, W., Yang, Y., Wang, J., Huang, Z., & Yuille, A. (2014). Deep captioning with multimodal recurrent neural networks (m-rnn). arXiv preprint arXiv:1412.6632. Mao, J., Xu, W., Yang, Y., Wang, J., Huang, Z., & Yuille, A. (2014). Deep captioning with multimodal recurrent neural networks (m-rnn). arXiv preprint arXiv:1412.6632. Pascanu, R., Gulcehre, C., Cho, K., & Bengio, Y. (2013). How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026. Pascanu, R., Gulcehre, C., Cho, K., & Bengio, Y. (2013). How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026. Goodfellow, I., Bengio, Y., Courville, A., & Bengio, Y. (2016). Deep learning (Vol. 1, No. 2). Cambridge: MIT press. Goodfellow, I., Bengio, Y., Courville, A., & Bengio, Y. (2016). Deep learning (Vol. 1, No. 2). Cambridge: MIT press. Medsker, L. R., & Jain, L. C. (2001). Recurrent neural networks. Design and Applications, 5. Medsker, L. R., & Jain, L. C. (2001). Recurrent neural networks. Design and Applications, 5. Selvin, S., Vinayakumar, R., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2017, September). Stock price prediction using LSTM, RNN and CNN-sliding window model. In 2017 international conference on advances in computing, communications and informatics (icacci) (pp. 1643-1647). IEEE. Selvin, S., Vinayakumar, R., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2017, September). Stock price prediction using LSTM, RNN and CNN-sliding window model. In 2017 international conference on advances in computing, communications and informatics (icacci) (pp. 1643-1647). IEEE. Dong-Ha Shin, Kwang-Ho Choi, Chang-Bok Kim. (2017). Deep Learning Model for Prediction Rate Improvement of Stock Price Using RNN and LSTM. Korean Institute of Information Technology, 15(10), 9-16. Dong-Ha Shin, Kwang-Ho Choi, and Chang-Bok Kim. (2017). Deep Learning Model for Prediction Rate Improvement of Stock Price Using RNN and LSTM. Korean Institute of Information Technology, 15(10), 9-16. Hsieh, T., Hsiao, H., & Yeh, W. (2011). Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm. Applied Soft Computing, 11(2), 2510-2525. doi:10.1016/j.asoc.2010.09.007 Hsieh, T., Hsiao, H., & Yeh, W. (2011). Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm. Applied Soft Computing, 11(2), 2510-2525. doi:10.1016/j.asoc.2010.09.007 Mahmud, M. S., & Meesad, P. (2014). Time series stock price prediction using recurrent error based neuro-fuzzy system with momentum. 2014 International Electrical Engineering Congress (iEECON). doi:10.1109/ieecon.2014.6925866 Mahmud, M. S., & Meesad, P. (2014). Time series stock price prediction using recurrent error based neuro-fuzzy system with momentum. 2014 International Electrical Engineering Congress (iEECON). doi:10.1109/ieecon.2014.6925866

본 발명의 목적은 상술한 바와 같은 문제점을 해결하기 위한 것으로, LSTM(long short memory networks) 신경망을 이용하여 주가의 과거 데이터를 이용하여 학습시키고, 학습된 신경망으로 주가를 예측하되, 주가와 거시지표의 상관 관계를 통해 실시간 거시 지표를 분석하여 예측된 주가에 가중치를 부가하는, 실시간 거시지표 예측 기반 주가 예측 시스템을 제공하는 것이다.The purpose of the present invention is to solve the problems described above, using a LSTM (long short memory networks) neural network to learn using past data on stock prices, predicting stock prices with the learned neural network, and predicting stock prices and macro indicators. It provides a stock price prediction system based on real-time macro indicator prediction that adds weight to the predicted stock price by analyzing real-time macro indicators through correlation.

또한, 본 발명의 목적은 주가에 대한 다수의 거시지표 각각의 상관 관계를 분석하고, 다수의 거시지표 각각에 대해 예측된 지표 값과 실제 값 간의 차이를 산출하고, 각 거시지표의 차이에 상관관계를 반영하여 거시지표의 가중치를 산출하고, 산출된 가중치를 예측된 주가에 반영하는, 실시간 거시지표 예측 기반 주가 예측 시스템을 제공하는 것이다.In addition, the purpose of the present invention is to analyze the correlation between a plurality of macro indicators for stock prices, calculate the difference between the predicted indicator value and the actual value for each of the plurality of macro indicators, and calculate the correlation between the differences between each macro indicator. It provides a stock price prediction system based on real-time macro indicator prediction that calculates the weight of the macro indicator and reflects the calculated weight in the predicted stock price.

즉, 본 발명의 목적은 기존 자동 거래 조건에서 개발된 인공지능 딥 러닝 기법을 활용하여 주가에 영향을 미치는 거시 지표를 분석 및 예측하고, 주가에 영향을 미치는 상관관계를 통해 개별 주가 예측에 가중치를 부여, 주가를 예측하는, 실시간 거시지표 예측 기반 주가 예측 시스템을 제공하는 것이다.In other words, the purpose of the present invention is to analyze and predict macro indicators that affect stock prices by utilizing artificial intelligence deep learning techniques developed under existing automatic trading conditions, and to apply weight to individual stock price predictions through correlations that affect stock prices. It provides a stock price prediction system based on real-time macro indicator prediction that predicts stock prices.

또한 본 발명의 목적은 주가가 실시간 주식 시장 뉴스에 민감하게 반응하기 때문에 주식 시장 뉴스 텍스트 마이닝을 통해 인공지능으로 예측한 주가에 가중치를 반영하는, 실시간 거시지표 예측 기반 주가 예측 시스템을 제공하는 것이다. In addition, the purpose of the present invention is to provide a stock price prediction system based on real-time macro indicator prediction that reflects weights on stock prices predicted by artificial intelligence through stock market news text mining because stock prices react sensitively to real-time stock market news.

상기 목적을 달성하기 위해 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 관한 것으로서, 주가 정보 및 경제 지표를 시계열 데이터로서 수집하는 데이터 수집부; 상기 시계열 데이터에 대하여 증분을 산출하여 정규화 하는 데이터 정규화부; 주가 및 각 경제지표 간의 상관계수를 산출하는 상관관계 분석부; 각 주가 및 경제지표 각각을 위한 LSTM 신경망을 학습시키는 신경망 관리부; 학습된 LSTM 신경망으로 주가 및 경제지표 각각을 예측하는 주가및지표 예측부; 및, 각 경제지표의 보정치를 구하고, 구한 보정치를 예측된 주가에 반영하여 보정하는, 주가 보정부를 포함하는 것을 특징으로 한다.In order to achieve the above object, the present invention relates to a stock price prediction system based on real-time macro indicator prediction, which includes a data collection unit that collects stock price information and economic indicators as time series data; a data normalization unit that calculates increments and normalizes the time series data; A correlation analysis unit that calculates the correlation coefficient between stock prices and each economic indicator; Neural network management department that trains LSTM neural networks for each stock price and economic indicator; A stock price and index prediction unit that predicts each stock price and economic index using a learned LSTM neural network; And, it is characterized by including a stock price correction unit that calculates the correction value of each economic indicator and corrects it by reflecting the obtained correction value in the predicted stock price.

또한, 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 있어서, 상기 시스템은, 상기 신경망 학습부는, 해당 주가의 종목의 뉴스 데이터를 수집하여 텍스트 마이닝을 수행하여 해당 주가의 뉴스 지수를 산출하는 뉴스 분석부를 더 포함하고, 상기 주가 보정부는 상기 예측된 주가에 뉴스 지수를 곱한 후, 곱한 결과에 경제지표의 보정치를 더하여 최종 주가를 추정하는 것을 특징으로 한다.In addition, the present invention is a stock price prediction system based on real-time macro indicator prediction, in which the system, the neural network learning unit, collects news data of the stock item and performs text mining to calculate the news index of the stock price. It further includes a unit, wherein the stock price correction unit multiplies the predicted stock price by a news index and then adds a correction value of the economic indicator to the multiplication result to estimate the final stock price.

또한, 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 있어서, 상기 신경망 관리부는, 전체 정규화된 증분의 시계열 데이터 M(-N+1),M(-N+2), ....,M(0)로부터 순차적으로 다수의 배치 세트를 생성하되, 배치 크기 n+1로 하나의 세트를 형성하여 일련의 N-n개의 배치 세트를 구성하고, 각 배치 세트는 n개의 과거 데이터 세트와, 해당 세트일 때의 예측 데이터의 정답으로 구성함으로써, 학습 데이터를 생성하는 것을 특징으로 한다.In addition, the present invention is a stock price prediction system based on real-time macro indicator prediction, wherein the neural network management unit provides total normalized incremental time series data M(-N+1), M(-N+2), ....,M A number of batch sets are sequentially generated from (0), and one set is formed with a batch size of n+1 to form a series of N-n batch sets, and each batch set includes n historical data sets and the corresponding set date. It is characterized by generating learning data by configuring the correct answer of the prediction data at the time.

또한, 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 있어서, 상기 주가 보정부는 각 지표의 실제값에서 예측값을 뺀 값에 100을 곱하고, 곱한 값에 상관계수(각 지표와 주가 간의 상관계수)를 곱하여, 해당 지표의 지표별 보정치 wi를 산출하고, 각 지표별 보정치 wi를 평균하여 보정하는 것을 특징으로 한다.In addition, the present invention is a stock price prediction system based on real-time macro indicator prediction, wherein the stock price correction unit multiplies the actual value of each indicator by subtracting the predicted value by 100, and adds a correlation coefficient (correlation coefficient between each indicator and the stock price) to the multiplied value. By multiplying, the correction value w i for each index of the relevant index is calculated, and the correction value w i for each index is averaged.

또한, 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 있어서, 상기 주가는 해당 주가의 고가와 저가의 중간값으로 사용되는 것을 특징으로 한다.In addition, the present invention is characterized in that, in a stock price prediction system based on real-time macro indicator prediction, the stock price is used as the midpoint between the high and low prices of the stock price.

또한, 본 발명은 실시간 거시지표 예측 기반 주가 예측 시스템에 있어서, 상기 신경망은 LSTM(long short-term memory networks) 신경망인 것을 특징으로 한다.In addition, the present invention is a stock price prediction system based on real-time macro indicator prediction, wherein the neural network is a long short-term memory networks (LSTM) neural network.

상술한 바와 같이, 본 발명에 따른 실시간 거시지표 예측 기반 주가 예측 시스템에 의하면, 주가에 대한 거시지표의 상관관계를 분석하고 거시지표를 실시간으로 예측하여 거시지표의 영향을 예측된 주가에 가중함으로써, 주가의 시계열성에 의한 예측과 동시에 거시경제 환경을 모두 반영하여 보다 정확한 주가를 예측할 수 있는 효과가 얻어진다.As described above, according to the stock price prediction system based on real-time macro indicator prediction according to the present invention, by analyzing the correlation of macro indicators with stock prices, predicting macro indicators in real time, and weighting the influence of macro indicators on the predicted stock price, The effect of predicting stock prices more accurately is achieved by reflecting the macroeconomic environment at the same time as predicting the time series of stock prices.

도 1은 본 발명을 실시하기 위한 전체 시스템의 예시 구성도.
도 2는 본 발명의 일실시예에 따른 실시간 거시지표 예측 기반 주가 예측 시스템의 구성에 대한 블록도.
도 3은 본 발명의 일실시예에 따른 각 경제 지표의 시계열 데이터 또는 시계열의 증분 데이터를 예시한 표.
도 4는 본 발명의 일실시예에 따른 각 경제 지표와 주가의 상관 관계 또는 상관 계수를 나타낸 표.
도 5는 본 발명의 일실시예에 따른 LSTM 신경망의 구조를 예시한 도면.
도 6은 본 발명의 일실시예에 따른 주가 및 경제지표의 학습 및 예측 방법에 대한 프로그래밍 코드.
도 7은 본 발명의 일실시예에 따른 주가 예측 분석의 결과를 나타낸 그래프.
도 8은 본 발명의 일실시예에 따른 각 경제 지표의 보정치를 산출하는 과정에서의 결과 값을 예시한 표.
1 is an exemplary configuration diagram of an overall system for implementing the present invention.
Figure 2 is a block diagram of the configuration of a stock price prediction system based on real-time macro indicator prediction according to an embodiment of the present invention.
Figure 3 is a table illustrating time series data or incremental time series data of each economic indicator according to an embodiment of the present invention.
Figure 4 is a table showing the correlation or correlation coefficient between each economic indicator and stock prices according to an embodiment of the present invention.
Figure 5 is a diagram illustrating the structure of an LSTM neural network according to an embodiment of the present invention.
Figure 6 is programming code for a method for learning and predicting stock prices and economic indicators according to an embodiment of the present invention.
Figure 7 is a graph showing the results of stock price prediction analysis according to an embodiment of the present invention.
Figure 8 is a table illustrating result values in the process of calculating correction values for each economic indicator according to an embodiment of the present invention.

이하, 본 발명의 실시를 위한 구체적인 내용을 도면에 따라서 설명한다.Hereinafter, specific details for implementing the present invention will be described with reference to the drawings.

또한, 본 발명을 설명하는데 있어서 동일 부분은 동일 부호를 붙이고, 그 반복 설명은 생략한다.In addition, in explaining the present invention, like parts are given the same reference numerals, and repeated description thereof is omitted.

먼저, 본 발명을 실시하기 위한 전체 시스템의 구성을 도 1을 참조하여 설명한다.First, the configuration of the entire system for implementing the present invention will be described with reference to FIG. 1.

도 1에서 보는 바와 같이, 본 발명을 실시하기 위한 전체 시스템은 사용자 단말(10), 주가를 예측하는 주가예측 서버(30), 주가 정보를 제공하는 주가정보 서버(50), 및, 거시지표 정보, 뉴스 등을 제공하는 경제정보 서버(60)로 구성된다. 추가적으로, 필요한 데이터를 저장하는 데이터베이스(40)를 더 포함하여 구성될 수 있다.As shown in Figure 1, the entire system for implementing the present invention includes a user terminal 10, a stock price prediction server 30 that predicts stock prices, a stock price information server 50 that provides stock price information, and macro indicator information. It consists of an economic information server 60 that provides news, etc. Additionally, it may further include a database 40 that stores necessary data.

먼저, 사용자 단말(10)은 사용자가 사용하는 단말로서, 스마트폰, 태블릿PC, 노트북, 개인용 컴퓨터(PC) 등 컴퓨팅 기능을 가지는 통상의 컴퓨터 단말이나 전용 단말이다.First, the user terminal 10 is a terminal used by a user, and is a general computer terminal or dedicated terminal with a computing function, such as a smartphone, tablet PC, laptop, or personal computer (PC).

사용자 단말(10)은 주가예측 서버(30)에 접속하여, 주가예측 서버(30)에서 제공하는 주가 예측 서비스를 제공받을 수 있다. 즉, 사용자 단말(10)은 주가예측 서버(30)에서 종목을 입력하고, 입력된 종목에 대한 예상 주가를 요청하여 수신한다.The user terminal 10 can access the stock price prediction server 30 and receive a stock price prediction service provided by the stock price prediction server 30. That is, the user terminal 10 inputs an item from the stock price prediction server 30, and requests and receives the expected stock price for the input item.

바람직하게는, 예상 주가는 최고 목표가와 최저 목표가 등으로 구성된다.Preferably, the expected stock price consists of the highest price target and the lowest price target.

다음으로, 주가정보 서버(50)는 주가 정보를 제공하는 통상의 서버로서, 증권사, 주가 정보제공 업체 등에서 운영되는 서버이다. 주가정보 서버(50)는 다수 개가 존재할 수 있으며, 각 주가 정보 서버(50)는 서로 다른 종류의 주가 정보를 제공할 수 있다.Next, the stock price information server 50 is a typical server that provides stock price information, and is a server operated by a securities company, stock price information provider, etc. There may be a plurality of stock price information servers 50, and each stock price information server 50 may provide different types of stock price information.

바람직하게는, 주가 정보는 고가, 저가, 종가 등으로 구성된다. 또한, 각 주가 정보는 날짜별 정보(날짜별 데이터)로 구성된다. 즉, 주가 정보는 현재 또는 과거의 거래 영업일에 거래된 주가 정보를 포함한다.Preferably, the stock price information consists of high price, low price, closing price, etc. Additionally, each stock price information consists of date-specific information (data by date). In other words, the stock price information includes information on stock prices traded on the current or past trading business days.

다음으로, 경제정보 서버(60)는 경제 거시지표, 뉴스 등 경제와 관련된 정보를 제공하는 서버로서, 각 기관,신문사, 방송사, 또는 공시 기관 등에 의해 운영되는 서버이다. 경제정보 서버(60)는 온라인 상에 경제 지표, 또는, 뉴스 등을 제공한다.Next, the economic information server 60 is a server that provides information related to the economy, such as economic macro indicators and news, and is operated by each organization, newspaper company, broadcasting company, or public announcement agency. The economic information server 60 provides economic indicators, news, etc. online.

다음으로, 주가예측 서버(30)은 통상의 서버로서, 사용자 또는 사용자 단말(10)의 요청에 따라, 주가를 예측하고, 예측된 주가 정보를 사용자에게 제공한다. 바람직하게는, 특정 종목명을 입력받아, 해당 종목에 대한 주가를 예측하여, 해당 종목의 예측 주가 데이터를 제공한다.Next, the stock price prediction server 30, which is a normal server, predicts stock prices according to a request from the user or the user terminal 10 and provides predicted stock price information to the user. Preferably, a specific stock name is input, the stock price for the stock is predicted, and predicted stock price data for the stock is provided.

특히, 주가예측 서버(30)은 LSTM 신경망의 신경망을 구비하고, 과거의 주가 정보를 이용하여 LSTM 신경망을 학습시킨다. 그리고 학습시킨 LSTM 신경망에 현재 주가 정보를 입력하여, 예측된 주가 데이터를 획득한다.In particular, the stock price prediction server 30 is equipped with an LSTM neural network and trains the LSTM neural network using past stock price information. Then, the current stock price information is input into the trained LSTM neural network to obtain predicted stock price data.

또한, 주가예측 서버(30)는 예측된 주가 데이터를 최고 목표가와 최저 목표가로 제공할 수 있다. 이때, 바람직하게는, 예측 주가에서 오차 범위를 설정하여 최고 목표가와 최저 목표가를 추출한다.Additionally, the stock price prediction server 30 can provide predicted stock price data with the highest and lowest target prices. At this time, preferably, the highest and lowest target prices are extracted by setting an error range in the predicted stock price.

또한, 주가예측 서버(30)는 주가정보 서버(50)로부터 주가 정보를 수신하여 활용한다.Additionally, the stock price prediction server 30 receives stock price information from the stock price information server 50 and utilizes it.

또한, 주가예측 서버(30)는 신경망을 구비하여, 과거의 거시지표 정보를 이용하여 신경망을 학습시킨다. 그리고 학습시킨 신경망에 현재 거시 지표를 입력하여, 예측된 거시 지표를 획득한다.Additionally, the stock price prediction server 30 is equipped with a neural network and trains the neural network using past macro indicator information. Then, the current macro indicator is input into the trained neural network to obtain the predicted macro indicator.

또한, 주가예측 서버(30)는 텍스트 마이너를 구비하여, 텍스트 마이너를 이용하여 뉴스에 대한 마이닝 분석을 수행한다. 텍스트 마이너를 통해, 현재 뉴스가 긍정적인지 부정적인지를 수치(호재 또는 악재에 대한 수치)로 추출한다. 이때의 수치를 뉴스 평가도라 부르기로 한다.Additionally, the stock price prediction server 30 is equipped with a text miner and performs mining analysis on news using the text miner. Through a text miner, a number is extracted to determine whether the current news is positive or negative (a number for good news or bad news). This figure is called the news rating.

특히, 텍스트 마이너에 해당 종목명을 입력하여, 해당 종목에 대한 뉴스 평가도를 추출한다. 또한, 텍스트 마이너는 뉴스 서버(60)로부터 뉴스 데이터를 분석하여 뉴스 평가도를 추출한다.In particular, by entering the stock name into the text miner, the news rating for the stock is extracted. Additionally, the text miner analyzes news data from the news server 60 and extracts news ratings.

또한, 주가예측 서버(30)는 예측된 거시지표에 의한 가중치를 산출하거나, 뉴스 평가도를 가중치로 변환하여, 앞서 구한 예측 주가 데이터에 해당 가중치를 가중하여 최종 예측 주가 데이터를 산출한다.In addition, the stock price prediction server 30 calculates weights based on predicted macro indicators, or converts news ratings into weights, and calculates final predicted stock price data by adding the corresponding weights to the previously obtained predicted stock price data.

다음으로, 데이터베이스(40)는 주가 정보를 저장하는 주가정보DB(41), 경제 거시지표를 저장하는 경제지표DB(42), 주가와 거시지표의 상관관계를 분석한 결과를 저장하는 상관정보DB(43)로 이루어진다. 그러나 상기 데이터베이스(40)의 구성은 바람직한 일실시예일 뿐이며, 구체적인 장치를 개발하는데 있어서, 접근 및 검색의 용이성 및 효율성 등을 감안하여 데이터베이스 구축이론에 의하여 다른 구조로 구성될 수 있다.Next, the database 40 includes a stock price information DB 41 that stores stock price information, an economic indicator DB 42 that stores economic macro indicators, and a correlation information DB that stores the results of analyzing the correlation between stock prices and macro indicators. It consists of (43). However, the configuration of the database 40 is only a preferred embodiment, and when developing a specific device, it may be configured in a different structure according to database construction theory, taking into account ease of access and search and efficiency.

다음으로, 본 발명의 일실시예에 따른 주가 실시간 예측 시스템(30)의 구성을 도 2를 참조하여 설명한다.Next, the configuration of the real-time stock price prediction system 30 according to an embodiment of the present invention will be described with reference to FIG. 2.

본 발명에 따른 주가 실시간 예측 시스템(30)은 앞서 주가예측 서버(30) 형태로 구현될 수 있다. 또는, 주가 실시간 예측 시스템(30)은 서버-클라이언트 형태로 구현되고, 사용자 단말(10)에 클라이언트 모듈이 설치될 수 있다.The real-time stock price prediction system 30 according to the present invention may be implemented in the form of a stock price prediction server 30. Alternatively, the real-time stock price prediction system 30 may be implemented in a server-client form, and a client module may be installed in the user terminal 10.

도 2에서 보는 바와 같이, 본 발명의 일실시예에 따른 주가 실시간 예측 시스템(30)은 주가 정보, 경제 거시지표, 뉴스 등 주가 관련 데이터를 수집하는 데이터 수집부(31), 주가, 거시지표 등의 값에 대한 증분을 산출하여 정규화 하는 데이터 정규화부(32), 주가 및 거시지표의 상관관계를 분석하는 상관관계 분석부(33), 신경망을 구성하고 학습시키는 신경망 관리부(34), 주가 및 거시지표를 예측하는 주가및지표 예측부(35), 예측된 주가를 보정하는 주가 보정부(37)로 구성된다. 추가적으로, 뉴스를 분석하는 뉴스 분석부(37)를 더 포함하여 구성된다.As shown in Figure 2, the stock price real-time prediction system 30 according to an embodiment of the present invention includes a data collection unit 31 that collects stock price-related data such as stock price information, economic macro indicators, news, stock prices, macro indicators, etc. Data normalization unit 32, which calculates and normalizes increments to the value, correlation analysis unit 33, which analyzes the correlation between stock prices and macro indicators, neural network management unit 34, which configures and learns a neural network, stock price and macro indicators It consists of a stock price and index prediction unit (35) that predicts indicators, and a stock price correction unit (37) that corrects the predicted stock price. Additionally, it further includes a news analysis unit 37 that analyzes news.

먼저, 데이터 수집부(31)는 주가 정보, 경제 거시지표, 뉴스 등 주가 관련 데이터를 수집한다.First, the data collection unit 31 collects stock price-related data such as stock price information, economic macro indicators, and news.

주가 정보는 고가, 저가, 종가 등으로 구성된다. 또한, 각 주가 정보는 날짜별 정보(날짜별 데이터)로 구성된다. 즉, 주가 정보는 현재 또는 과거의 거래 영업일에 거래된 주가 정보를 포함한다.Stock price information consists of high price, low price, closing price, etc. Additionally, each stock price information consists of date-specific information (data by date). In other words, the stock price information includes information on stock prices traded on the current or past trading business days.

또한, 거시지표는 특정 국가의 경제상황을 집계한 경제 지표로서, 해당 국가의 경제상황을 나타낸다. 거시지표는 환율, 이자율, 통화량, GDP, GDP증가율, 실업률, 물가상승률, 경상수지, 소비자지수, 소비자 설문, 생산지수, 신규주택공급수, 실업수당 청구 건수, 장기국채 금리, 원자재 등으로 구성된다[비특허문헌 1]. 거시지표 외에도 모든 경제 지표에 적용할 수 있다. 예를 들어, 거시지표 대신, 금리, 환율, 선물 지수 등은 일일 단위로 수집될 수 있다. 또한, 과거 데이터는 fred.stlouisfed.org 사이트 등에서 월 단위로 다운 받아 사용할 수 있다.In addition, macro indicators are economic indicators that aggregate the economic situation of a specific country and indicate the economic situation of that country. Macro indicators consist of exchange rate, interest rate, money supply, GDP, GDP growth rate, unemployment rate, inflation rate, current account balance, consumer index, consumer survey, production index, number of new housing supply, number of unemployment claims, long-term government bond interest rate, raw materials, etc. [Non-patent Document 1]. In addition to macro indicators, it can be applied to all economic indicators. For example, instead of macro indicators, interest rates, exchange rates, futures indices, etc. can be collected on a daily basis. Additionally, historical data can be downloaded and used on a monthly basis from the fred.stlouisfed.org site.

또한, 거시지표는 기간별 정보(기간별 데이터)로 구성된다. 바람직하게는, 각 거시지표는 월 단위의 데이터로 구성된다. 즉, 날짜 단위는 월 단위로 설정한다. 경제 지표가 일일 단위로 변화되는 데이터인 경우, 일 단위로 설정할 수 있다. 이하에서 설명의 편의를 위하여 일 단위(또는 날짜 단위)로 설명하나, 날짜 단위는 일 단위, 월 단위, 주 단위 등 통상의 기간 단위로 설정할 수 있다.Additionally, macro indicators are composed of period-specific information (period-specific data). Preferably, each macro indicator consists of monthly data. In other words, the date unit is set to month. If the economic indicator is data that changes on a daily basis, it can be set on a daily basis. Below, for convenience of explanation, it is explained in terms of days (or date units), but the date unit can be set to normal period units such as days, months, or weeks.

GDP 등 분기별로 집계되는 데이터는 월별로 나누어 월 단위 데이터로 변환한다. 분기별 데이터를 나누는 방식은 통상의 방식을 적용한다. 예를 들어, 분기 데이터를 3으로 나누어 각 월의 데이터로 사용하거나, 보간법을 적용하여 직전 분기와 다음 분기의 값에 따라, 각 월의 데이터의 연속성을 가지도록 변환할 수도 있다.Data collected quarterly, such as GDP, are divided by month and converted to monthly data. The usual method of dividing quarterly data is applied. For example, quarterly data can be divided by 3 and used as data for each month, or interpolation can be applied to convert each month's data to have continuity according to the values of the previous quarter and the next quarter.

또한, 뉴스 정보는 텍스트로 작성된 뉴스 데이터들이다. 뉴스는 제공자에 따라 구분될 수 있다. 즉, 뉴스 제공자는 금융감독원, 각 신문사 또는 방송사 등이다.Additionally, news information is news data written in text. News can be classified depending on the provider. In other words, the news provider is the Financial Supervisory Service, each newspaper or broadcasting company, etc.

한편, 해당 기간에서 실제 값이 아직 발표되지 않는 경우, 시장에서의 컨센서스 값(또는 추정값)을 수집하여 해당 값으로 대체하여 수집할 수 있다.Meanwhile, if the actual value has not yet been announced in the relevant period, the consensus value (or estimated value) in the market can be collected and replaced with the corresponding value.

다음으로, 데이터 정규화부(32)는 특정 기간 내의 주가, 거시지표 등의 값에 대한 증분을 산출하여 정규화 한다.Next, the data normalization unit 32 calculates increments for values such as stock prices and macro indicators within a specific period and normalizes them.

주가와 각 거시지표는 단위가 각각 다르다. 따라서 각 주가 또는 거시지표의 값에 대하여 증분을 구하여, 해당 값 대신 증분 값을 사용한다. 그리고 기준 날의 증분 값을 0으로 설정(초기화) 한다. 예를 들어, 2010년 1월부터 2020년 12월까지의 데이터를 수집한 경우, 2010년 1월의 데이터의 값을 0으로 설정한다.Stock prices and each macro indicator have different units. Therefore, the increment is calculated for the value of each stock price or macro indicator, and the increment value is used instead of the corresponding value. Then, set (reset) the increment value of the standard day to 0. For example, if data was collected from January 2010 to December 2020, the value of the data for January 2010 is set to 0.

각 데이터(주가, 거시지표 등)의 증분은 당일(당월) 값에서 전일(전월) 값을 뺀 값을 전일(전월) 값으로 나누어 산출한다. 즉, t일(월)의 증분 △M(t)을 다음 식에 의해 구한다.The increment of each data (stock price, macro indicator, etc.) is calculated by subtracting the value of the previous day (previous month) from the value of the current day (month) and dividing it by the value of the previous day (previous month). In other words, the increment △M(t) of day t (month) is obtained by the following equation.

[수학식 1][Equation 1]

Figure 112021049831439-pat00001
Figure 112021049831439-pat00001

여기서, M(t)는 해당 데이터의 t시간에서의 데이터 값을 나타낸다.Here, M(t) represents the data value at time t of the corresponding data.

각 증분 데이터는 시계열 데이터이다. 전체 시계열 데이터의 크기를 N이라 하면, 각 주가 또는 거시지표의 시계열 데이터는 일련의 날짜에 의한 데이터로서, M(-N+1), M(-N+2), ...., M(0) 이다. M(0)는 현재 일(월)의 데이터이고, S(-k)는 k일(월) 이전의 증분 데이터이고, M(0)는 당일(월)의 증분 데이터이다.Each incremental data is time series data. If the size of the entire time series data is N, the time series data of each stock price or macro indicator is data by a series of dates, such as M(-N+1), M(-N+2), ...., M( 0) is. M(0) is the data of the current day (month), S(-k) is the incremental data before the k day (month), and M(0) is the incremental data of the current day (month).

또한, 바람직하게는, 주가 데이터는 주가의 중간값(고가와 저가의 중간값)으로 사용한다. 즉, 중간값은 다음 식과 같이 고가와 저가의 평균으로 구한다.Also, preferably, the stock price data is used as the median value of the stock price (the middle value between the high and low prices). In other words, the median value is obtained as the average of the high and low prices as shown in the following equation.

[수학식 2][Equation 2]

Figure 112021049831439-pat00002
Figure 112021049831439-pat00002

여기서, t는 날짜이고, M(t)은 t일의 중간값이고, H(t)와 L(t)는 각각 t일의 고가와 저가를 나타낸다.Here, t is the date, M(t) is the median value on day t, and H(t) and L(t) represent the high and low prices on day t, respectively.

다음으로, 상관관계 분석부(33)는 주가 및 각 거시지표의 상관관계를 분석한다.Next, the correlation analysis unit 33 analyzes the correlation between stock prices and each macro indicator.

즉, 상관관계 분석부(33)는 특정 기간 내의 주가와 거시지표 각각의 증분 값에 대하여, 상관 분석을 수행하여 주가와 거시지표 간의 상관 계수를 구한다. 즉, 상관 계수를 상관 관계의 분석결과로 이용한다.That is, the correlation analysis unit 33 performs a correlation analysis on the incremental values of each stock price and macro index within a specific period to obtain the correlation coefficient between the stock price and the macro index. In other words, the correlation coefficient is used as the analysis result of correlation.

거시지표와 주가변동률 간의 관계에 대한 연구는 많이 진행되고 있으며, 약간의 차이는 있으나 보통 통화량 및 물가 등 명목경제변수들은 주가변동에 영향을 미치지만 다른 실물경제지표는 큰 영향이 미치지 않는 것으로 분석되고 있다[비특허문헌 2-4].There is a lot of research being done on the relationship between macro indicators and stock price fluctuation rates. Although there are some differences, nominal economic variables such as money supply and prices usually affect stock price fluctuations, but other real economic indicators are analyzed to have no significant impact. There is [Non-patent Document 2-4].

주식종목이 다양하게 있고, 개별 주식 종목 중 거시지표와 상관관계가 높은 것을 분석하여 개별 주식 종목 예측할 때 참고용으로 해당되는 거시지표 예측을 하게 된다면 좀 더 정확한 예측을 할 수 있을 것으로 판단된다.There are a variety of stock items, and it is believed that more accurate predictions can be made if individual stock items that have a high correlation with macro indicators are analyzed and the corresponding macro indicators are predicted for reference when predicting individual stock items.

도 3의 표에서 보는 바와 같이, 거시지표의 값은 증분 값을 이용한다. 즉, 거시지표의 단위가 서로 다르기 때문에, 비교와 상관관계 분석을 위해서, 앞서 구한 증분 값을 이용한다.As shown in the table of Figure 3, the values of macro indicators use incremental values. In other words, since the units of macro indicators are different, the previously obtained incremental values are used for comparison and correlation analysis.

도 4의 표는 2011년부터 2021년까지 10년간 거시지표 데이터의 증분값들을 분석하여, 거시지표와 주가종목간(나스닥 지수 NASDAQ, 다우지수 DOW)의 상관관계를 지수(또는 상관계수)로 나타내고 있다. 이때, 주가와 거시지표 모두 증분을 이용한다. 상관 계수는 통상의 상관 분석에 의해 구해진다.The table in Figure 4 analyzes the incremental values of macro indicator data for 10 years from 2011 to 2021, and shows the correlation between macro indicators and stock price items (NASDAQ index NASDAQ, Dow index DOW) as an index (or correlation coefficient). there is. At this time, both stock prices and macro indicators use increments. The correlation coefficient is obtained by normal correlation analysis.

지수 또는 상관 계수가 1에 가까울수록 강한 상관관계가 있고, 0에 가까울수록 상관관계가 없음을 의미하며, 강한 반대의 상관관계가 있음을 의미한다.The closer the index or correlation coefficient is to 1, the stronger the correlation, and the closer it is to 0, the absence of correlation, meaning there is a strong inverse correlation.

바람직하게는, 상관계수가 사전에 정해진 임계값(또는 임계 계수) 이상인 지표만을 선정하여 사용한다.Preferably, only indicators whose correlation coefficient is greater than or equal to a predetermined threshold (or threshold coefficient) are selected and used.

도 4의 표는 여러 거시지표 중 상관관계 지표가 0.5이상인 것만 나타내고 있다. 도 3의 표에서 GDP는 분기별 집계가 되기 때문에 2020년 10월이후 데이터는 없으며 월별데이터 통일을 위해서 분기별 증분 값을 균등비율로 산출하여 월별로 나타내고 있다.The table in Figure 4 shows only those with a correlation index of 0.5 or higher among various macro indicators. In the table in Figure 3, since GDP is compiled on a quarterly basis, there is no data after October 2020, and in order to unify monthly data, quarterly incremental values are calculated at an equal ratio and expressed monthly.

실업수당 청구건수는 많을수록 주가 하락에 영향을 미치므로 반대의 상관관계를 보이고 있다. 따라서 상관관계를 나타내는 상관 계수의 값이 마이너스(-)를 갖게 된다.The larger the number of unemployment claims, the more it affects the decline in stock prices, showing an inverse correlation. Therefore, the value of the correlation coefficient indicating correlation has a minus (-) value.

다음으로, 신경망 관리부(34)는 각 주가 및 거시지표 각각을 위한 LSTM(long short memory networks) 신경망을 구성하고, LSTM 신경망을 학습시킨다.Next, the neural network management unit 34 configures a long short memory networks (LSTM) neural network for each stock price and macro indicator and trains the LSTM neural network.

인공지능의 정의는 인간의 지각, 추론, 학습과 같은 능력을 인공적으로 구현한 컴퓨터 프로그램 또는 이를 포함한 컴퓨팅 시스템으로 정의를 한다[비특허문헌 7]. 인공지능은 일반적인 용어이며, 머신러닝은 인공지능의 분야 중 반복하여 학습을 스스로 하여 인간의 개입이 없이 스스로 학습해 하는 분야이며, 딥러닝은 머신러닝에서 더 발전하여 여러 히든 레이어를 두고 더욱 정확한 예측을 하기 위한 방법이다. 딥러닝 네트워크로는 ANN (Artificial Neural Network), DNN (Deep Neural Network), RNN (Recurrent Neural Networks), LSTM (Long Short Term Memory)이 대표적이다 [비특허문헌 4-6]. 딥러닝 네트워크를 응용하여 과거 데이터를 바탕으로 예측하기 위해 사용되고 있다.Artificial intelligence is defined as a computer program that artificially implements human abilities such as perception, reasoning, and learning, or a computing system including these [Non-patent Document 7]. Artificial intelligence is a general term, and machine learning is a field of artificial intelligence that learns on its own without human intervention through repetitive learning. Deep learning is a further development of machine learning and makes more accurate predictions with multiple hidden layers. This is a way to do this. Representative deep learning networks include ANN (Artificial Neural Network), DNN (Deep Neural Network), RNN (Recurrent Neural Networks), and LSTM (Long Short Term Memory) [Non-patent Document 4-6]. Deep learning networks are applied to make predictions based on past data.

RNN과 LSTM은 순차적이며 반복적인 데이터 분석에 용이하여 주가 분석에 많이 사용되고 있다[비특허문헌 8]. 과거에 데이터가 현재에 영향을 미치는 것을 가중치(Weight)를 통해 지속적으로 반복하면서 예측을 한다. 따라서 RNN과 LSTM은 주가 예측에 많이 활용이 되고 있다[비특허문헌 9].RNN and LSTM are easy to analyze sequential and repetitive data and are widely used in stock price analysis [Non-patent Document 8]. Predictions are made by continuously repeating the influence of past data on the present through weights. Therefore, RNN and LSTM are widely used in stock price prediction [Non-patent Document 9].

본 발명에서는 주가의 과거 데이터만 활용하여 예측하는 것이 아니라 각각의 거시지표(또는 경제지표)를 분석하여 예측하고 실제 주가와 비교하여 차이 나는 만큼 가중치(Weight) 값을 조절하여 실제 주가에 가장 맞도록 반복학습을 시켜서 주가를 예측한다. 또한, 거시지표별 상관관계에 따라 가중치(Weight) 값을 조절하여 최적의 예측을 하고 반복적인 학습을 통해서 가중치(Weight) 값도 조절한다. In the present invention, rather than predicting stock prices using only past data, each macro indicator (or economic indicator) is analyzed and predicted, and the weight value is adjusted according to the difference compared to the actual stock price to best match the actual stock price. Predict stock prices through repeated learning. In addition, the weight value is adjusted according to the correlation between macro indicators to make optimal predictions, and the weight value is also adjusted through iterative learning.

특히, LSTM(Long Short Term Memory networks) 신경망은 RNN(순환신경망, Recurrent Neural Network)의 한 종류이며, 과거의 데이터가 미래에 영향을 줄 수 있는 구조를 가진다. 따라서 LSTM 신경망은 주가 예측에 가장 적합한 모델이다.In particular, LSTM (Long Short Term Memory networks) neural network is a type of RNN (Recurrent Neural Network) and has a structure in which past data can affect the future. Therefore, the LSTM neural network is the most suitable model for stock price prediction.

기존의 RNN 신경망에서는 장기 의존성 문제점인 체인 룰(Chain Rule)에 의해 [-1, 1]사이의 값들이 계속 곱해지다보니 앞쪽으로 갈수록 그 값이 작아지고 결국에는 소멸한다. 따라서 기존의 RNN 방식은 파라미터(Parameter)들이 업데이트 되지 않는 문제를 가진다. LSTM은 이를 해결하기 위해 제안된 방식이다.In the existing RNN neural network, the values between [-1, 1] are continuously multiplied due to the chain rule, which is a long-term dependency problem, so the value gets smaller as it goes forward and eventually disappears. Therefore, the existing RNN method has a problem in that parameters are not updated. LSTM is a proposed method to solve this problem.

기존의 RNN은 은닉층(Hidden Layer)에서 은닉 상태(Hidden State, St)를 계산할 때 단순히 St=tanh(Uxt+WSt)로 계산하였지만, LSTM에서는 총 4가지의 계산과정이 있다.The existing RNN simply calculated St=tanh(Uxt+WSt) when calculating the hidden state (St) in the hidden layer, but in LSTM, there are a total of four calculation processes.

도 5에서 보는 바와 같이, LSTM의 은닉층(Hidden Layer)에서 신경망 레이어(Neural Network Layer)가 4개가 존재한다. 즉, 도 5의 중앙 사각형 모양 내에 신경망 레이어가 4개 존재함을 확인할 수 있다. 또한 LSTM의 핵심은 뉴럴(A)의 상단부분에 있는 수평선에 아주 마이너한 선형 연산을 거치고 전체 체인을 관통하여 정보는 큰 변함 없이 다음 단계로 전달하게 된다는 것이다.As shown in Figure 5, there are four neural network layers in the hidden layer of LSTM. In other words, it can be confirmed that there are four neural network layers within the central square shape of Figure 5. Additionally, the core of LSTM is that a very minor linear operation is performed on the horizontal line at the top of the neural (A), and the information is passed on to the next step without much change through the entire chain.

한편, 주가, 및, 각 경제 지표(또는 거시 지표) 각각을 예측하는 LSTM 신경망을 각각 구성한다. 즉, 주가에 대한 LSTM 신경망, 소비자 지수에 대한 LSTM 신경망, 생산지수에 대한 LSTM 신경망 등으로 구성된다.Meanwhile, an LSTM neural network is constructed to predict stock prices and each economic indicator (or macro indicator). That is, it consists of an LSTM neural network for stock prices, an LSTM neural network for the consumer index, and an LSTM neural network for the production index.

특히, 각 시계열 데이터에 대해 특정 기간(예를 들어 30일, 이하 반영 기간) 동안 과거 데이터를 가지고 훈련시키고 하루를 예측하여 실제 데이터와 비교한다. 이와 같이 비교하면서 반영 기간(일례로서 30일) 단위로 훈련 세트가 미래로 이동하면서 학습된다.In particular, for each time series data, it is trained with historical data for a specific period (e.g., 30 days, hereinafter referred to as the reflection period), and then predicted for one day and compared with actual data. Through this comparison, the training set is learned by moving into the future in units of reflection periods (30 days, for example).

또한, 바람직하게는, 주가에 대한 LSTM 신경망은 주식 가격의 고가와 저가를 기본값으로 하여 학습된다. 또한, LSTM 신경망은 하나의 종목의 주가에 대하여 학습된다. 따라서 새로운 종목(또는 다른 종목)의 주가를 예측하기 위해서는, LSTM 신경망을 초기화 하고, 해당 종목의 과거 주가 데이터로 다시 학습시킨다. 또는, 다른 실시예로서, LSTM 신경망은 예측하고자 하는 각 종목에 대응되는 LSTM 신경망을 종목별로 구비한다. 즉, 각 종목에 해당하는 LSTM 신경망을 다수 구비하고, 종목별로 해당 종목의 과거 주가 데이터로 학습한다.Also, preferably, the LSTM neural network for stock prices is learned using the high and low prices of stock prices as default values. Additionally, the LSTM neural network is trained on the stock price of one stock. Therefore, in order to predict the stock price of a new stock (or other stock), the LSTM neural network is initialized and retrained with the stock's past stock price data. Or, as another embodiment, the LSTM neural network includes an LSTM neural network corresponding to each item to be predicted. In other words, it has multiple LSTM neural networks corresponding to each stock, and learns each stock from its past stock price data.

또한, 바람직하게는, LSTM 신경망은 하나의 거시지표(또는 경제지표)에 대하여 학습된다. 따라서 다른 경제 지표를 예측하기 위해서는, LSTM 신경망을 초기화 하고, 해당 경제 지표의 과거 데이터로 다시 학습시킨다. 또는, 다른 실시예로서, LSTM 신경망은 예측하고자 하는 각 경제 지표에 대응되는 LSTM 신경망을 지표별로 구비한다. 즉, 각 지표에 해당하는 LSTM 신경망을 다수 구비하고, 지표별로 해당 지표의 과거 시계열 데이터로 학습한다.Also, preferably, the LSTM neural network is learned for one macro indicator (or economic indicator). Therefore, to predict other economic indicators, the LSTM neural network is initialized and retrained with past data of the relevant economic indicator. Or, as another embodiment, the LSTM neural network is equipped with an LSTM neural network corresponding to each economic indicator to be predicted for each indicator. In other words, a number of LSTM neural networks corresponding to each indicator are provided, and each indicator is learned from the past time series data of that indicator.

한편, 신경망 관리부(34)는 각 주가 또는 각 경제지표(또는 거시지표)의 증분의 시계열 데이터로 해당 신경망을 학습시킨다.Meanwhile, the neural network management unit 34 trains the corresponding neural network with incremental time series data of each stock price or each economic indicator (or macro indicator).

전체 시계열 데이터의 크기를 N이라 하고, 배치 크기를 n으로 설정한다. 이때, N > n이고, 바람직하게는, N > 2n을 만족하도록 N과 n을 설정한다. 즉, 배치 크기 보다 많은 배치 개수를 만들기 위한 것이다.Let the size of the entire time series data be N, and set the batch size to n. At this time, N > n, and preferably, N and n are set to satisfy N > 2n. In other words, the purpose is to make the number of batches larger than the batch size.

전체 증분의 시계열 데이터는 일련의 날짜에 의한 데이터로서, M(-N+1), M(-N+2), ...., M(0) 이다. M(-k)는 k일 이전의 정규화된 증분 데이터이고, M(0)는 당일의 정규화된 증분 데이터이다.The full incremental time series data is data by a series of dates, such as M(-N+1), M(-N+2), ...., M(0). M(-k) is the normalized incremental data k days ago, and M(0) is the normalized incremental data of the current day.

이때, 배치 크기 n으로 배치(batch)를 생성한다. 전체 데이터 크기 N인 경우, 다음과 같은 배치들이 N-n개가 생성된다.At this time, a batch is created with batch size n. If the total data size is N, the following N-n batches are created.

[ M(-N+1), M(-N+2), M(-N+3), ..., M(-N+n) ], M(-N+n+1)[ M(-N+1), M(-N+2), M(-N+3), ..., M(-N+n) ], M(-N+n+1)

[ M(-N+2), M(-N+3), M(-N+4), ..., M(-N+n+1) ], M(-N+n+2)[ M(-N+2), M(-N+3), M(-N+4), ..., M(-N+n+1) ], M(-N+n+2)

......

[ M(-n-1), M(-n), M(-n+1), ..., M(-2) ], M(-1)[ M(-n-1), M(-n), M(-n+1), ..., M(-2) ], M(-1)

[ M(-n), M(-n+1), M(-n+2), ..., M(-1) ], M(0)[ M(-n), M(-n+1), M(-n+2), ..., M(-1) ], M(0)

위와 같이, N개의 연속된 시계열 데이터(증분 데이터)를 배치 크기 n+1로 하나의 세트를 구성하되, 순차적으로 세트를 구성하여 일련의 N-n개의 배치 세트를 구성한다. 이때, 각 배치 세트의 마지막 데이터를 해당 세트의 결과 값(진짜 값)으로 설정한다. 즉, 각 배치는 n개의 과거 주가 데이터 세트와, 해당 세트일 때의 익일 주가(예측할 주가의 진짜 주가)(정답인 주가)로 구성된다.As above, N consecutive time series data (incremental data) are formed into a set with a batch size of n+1, and the sets are formed sequentially to form a series of N-n batch sets. At this time, the last data of each batch set is set as the result value (real value) of that set. In other words, each batch consists of n historical stock price data sets and the next day's stock price (the true stock price to predict) (the correct stock price) for that set.

그리고 신경망 관리부(34)는 각 배치 세트를 하나의 학습 데이터로 하여, LSTM 신경망을 학습시킨다. 학습 후, 다음날 하루 가격을 예측하여 주식 투자자가 주식을 판매할 것인지 구매할 것인지 결정할 수 있다.Then, the neural network management unit 34 uses each batch set as one learning data and trains the LSTM neural network. After learning, stock investors can decide whether to sell or buy stocks by predicting the price for the next day.

특히, 신경망 관리부(34)는 주식 또는 경제 지표를 예측하기 위해 데이터 세트(또는 배치 세트)를 정규화한다. 바람직하게는, 훈련 데이터와 훈련 데이터를 검증하는 테스트 데이터 세트를 9 : 1 비율로 나눈다. 즉, 훈련 세트는 데이터 세트의 90%로 설정하고, 테스트 세트는 데이터 세트의 10%로 설정한다. 이러한 비율은 미래에 예측할 주식 또는 경제지표에 따라 해당 비율은 달라질 수 있다. In particular, the neural network management unit 34 normalizes the data set (or batch set) to predict stock or economic indicators. Preferably, the training data and the test data set that validates the training data are divided in a 9:1 ratio. That is, the training set is set to 90% of the data set, and the test set is set to 10% of the data set. These ratios may vary depending on stocks or economic indicators predicted in the future.

구체적인, 학습 방법에 대한 슈도우 코드가 도 6에 도시되고 있다.Pseudocode for the specific learning method is shown in Figure 6.

도 6에서 ① 부분은 csv 파일을 사용하기 위한 pandas, 행렬연산을 위한 numpy, 데이터 시각화를 위한 matplotlib.pyplot, 딥러닝 모델을 작성을 위해 Keras를 사용하였다. ③ 윈도우 사이즈가 20 개 단위로 분석하며 20의 의미는 20개씩 데이터를 분석 후 한 개의 데이터를 예측한다. ④ Sequential()이라는 함수를 사용하여 원도우 사이즈 20개 중 트레이닝 셋(training set)은 90%로 정하고, 나머지 10%는 테스트 셋(test set)으로 정한다.In Figure 6, part ① used pandas to use csv files, numpy for matrix operations, matplotlib.pyplot for data visualization, and Keras to create a deep learning model. ③ The window size is analyzed in units of 20, and the meaning of 20 is to predict one data after analyzing 20 pieces of data. ④ Using the function called Sequential(), set 90% of the 20 window sizes as the training set, and set the remaining 10% as the test set.

도 6에서는 NASDAQ 주가지수 예측을 트레이닝 셋(training set)와 테스트 셋(test set)으로 나눠서 학습시킨다.In Figure 6, the NASDAQ stock index prediction is divided into a training set and a test set for learning.

다음으로, 주가및지표 예측부(35)는 최근 데이터 세트(셋)를 학습된 LSTM 신경망에 입력하여, 해당 데이터의 예측값을 획득한다.Next, the stock price and index prediction unit 35 inputs the latest data set into the learned LSTM neural network and obtains a predicted value of the data.

최근 데이터 세트(또는 배치)는 다음과 같다.The most recent data set (or batch) is as follows:

[ M(-n+1), M(-n+2), ..., M(-1), M(0) ][ M(-n+1), M(-n+2), ..., M(-1), M(0) ]

즉, 최근 데이터 세트는, 최근 날짜 또는 당일 날짜를 포함하여 배치 개수만큼의 최근 시계열 데이터들로 구성된다.That is, the recent data set consists of the latest time series data as many as the number of batches, including the most recent date or the current day's date.

상기 최근 데이터 세트를 LSTM 신경망에 입력시키면, LSTM 신경망은 해당 데이터의 예측값, 즉, 익일(익월)의 예측값 M(1)을 출력한다. 출력된 M(1)이 해당 데이터의 예측값이다.When the latest data set is input to the LSTM neural network, the LSTM neural network outputs the predicted value of the corresponding data, that is, the predicted value M(1) for the next day (next month). The output M(1) is the predicted value of the data.

주가및지표 예측부(35)는 각 주가, 및, 각 경제지표에 대하여, 각각 예측값을 구한다.The stock price and index prediction unit 35 obtains predicted values for each stock price and each economic index.

도 7은 주가에 대하여, 실제 값과 예측된 결과값을 나타내고 있다. 도 7에서, 빨간색이 실제 주가 데이터이고, 파란색이 예측한 결과 값을 나타낸다.Figure 7 shows actual values and predicted result values for stock prices. In Figure 7, red represents the actual stock price data, and blue represents the predicted result value.

다음으로, 뉴스 분석부(37)는 해당 종목의 뉴스 데이터를 수집하여 텍스트 마이닝을 수행하고, 해당 종목의 무드 데이터를 산출한다.Next, the news analysis unit 37 collects news data for the relevant item, performs text mining, and calculates mood data for the relevant item.

바람직하게는, 뉴스 분석부(37)는 YTextMiner 등 상용화된 도구를 사용한다. 텍스트 마이너(YTextMiner 등)는 텍스트를 분석하는 도구로서, 실시간 증시 뉴스를 분석하여 키워드별 주식 종목에 해당하는 뉴스가 호재인지 악재인지를 판단한다.Preferably, the news analysis unit 37 uses a commercially available tool such as YTextMiner. Text miners (such as YTextMiner) are text analysis tools that analyze real-time stock market news and determine whether news corresponding to stock items by keyword is good news or bad news.

무드 데이터는 해당 종목에 대해 호재인지 악재인지를 수치로 나타낸 지표이다. 호재일 경우 무드 데이터의 값은 커지고, 악재일 경우 무드 값은 작아진다.Mood data is a numerical indicator of whether there is good or bad news for the stock. In case of good news, the value of mood data increases, and in case of bad news, the mood value decreases.

바람직하게는, 무드 데이터(또는 무드 값)는 (1-α)와 (1+α) 사이의 값을 가진다. 이때, α는 1% ~ 30%의 값을 가진다. 무드 데이터를 뉴스 지수로 활용한다.Preferably, the mood data (or mood value) has a value between (1-α) and (1+α). At this time, α has a value of 1% to 30%. Mood data is used as a news index.

다음으로, 주가 보정부(37)는 경제지표(또는 거시 지표)의 보정치를 이용하여, 예측된 주가를 보정한다. 또한, 추가적으로, 뉴스 분석에 의한 무드 데이터를 더 추가하여, 예측된 주가를 보정한다.Next, the stock price correction unit 37 corrects the predicted stock price using the correction value of the economic indicator (or macro indicator). Additionally, mood data based on news analysis is added to correct the predicted stock price.

도 8의 표는 경제지표 또는 거시 지표에 의한 보정치를 산출하는 과정을 나타내고 있다.The table in Figure 8 shows the process of calculating correction values based on economic indicators or macro indicators.

보정치의 계산 방법은, 각 지표의 실제값에서 예측값을 뺀 값에 100을 곱하고, 곱한 값에 상관계수(각 지표와 주가 간의 상관계수)를 곱하여, 해당 지표의 지표별 보정치 wi를 산출한다. 그리고 최종 보정치는 이들을 평균하여 구한다. 보정치 wi는 경제 지표 i에 대한 보정치(지표별 보정치)를 말한다.The method of calculating the correction value is to multiply the actual value of each indicator by subtracting the predicted value by 100, and multiply the multiplied value by the correlation coefficient (correlation coefficient between each indicator and the stock price) to calculate the correction value w i for each indicator. And the final correction value is obtained by averaging them. Correction value w i refers to the correction value (correction value for each indicator) for economic indicator i.

한편, 각 지표의 예측값은 앞서 신경망을 통해 예측한 값이고, 실제값은 해당 지표의 실제 값이다. 다만, 실제 값이 아직 발표되지 않는 경우, 시장에서의 컨센서스 값(또는 추정값)을 수집하여 해당 값으로 대체하여 산출한다.Meanwhile, the predicted value of each indicator is the value previously predicted through a neural network, and the actual value is the actual value of the indicator. However, if the actual value has not yet been announced, the consensus value (or estimated value) in the market is collected and replaced with the corresponding value.

그리고 주가 보정부(37)는 주가 예측치에 뉴스 마이닝 지수(또는 뉴스 지수)를 곱하고, 그 값에 지표 보정치를 더하여, 최종 주가(또는 보정된 주가)를 산출한다. 즉, 최종 주가 또는 보정된 주가는 다음 식과 같이 산출한다.Then, the stock price correction unit 37 multiplies the stock price forecast by the news mining index (or news index) and adds the index correction value to the value to calculate the final stock price (or corrected stock price). In other words, the final or corrected stock price is calculated as follows:

[수학식 3][Equation 3]

보정된 주가 = 주가 예측치 × 뉴스 지수 + 지표 보정치Adjusted stock price = stock price forecast × news index + index correction value

여기서, 주가 예측치는 LSTM 신경망에 의하여 예측되는 주가 예측치이고, 뉴스 지수는 앞서 뉴스 분석부(37)에 의해 획득되는 무드 데이터로 활용한다.Here, the stock price forecast is the stock price forecast predicted by the LSTM neural network, and the news index is used as mood data previously obtained by the news analysis unit 37.

따라서, LSTM을 통해서 개별 주가에 대한 예측을 하고 개별 주가와 상관관계가 높거나 반대인 거시지표에 대한 예측을 한 후, 예측된 주가에 거시지표의 예측값을 반영시킨다. 이를 통해, 기존의 과거 주가 시계열 데이터만 가지고 분석하는 방법보다 예측의 정확도를 높일 수 있다.Therefore, through LSTM, predictions are made for individual stock prices, predictions are made for macro indicators that have a high or inverse correlation with individual stock prices, and then the predicted values of the macro indicators are reflected in the predicted stock prices. Through this, the accuracy of prediction can be improved compared to the existing method of analyzing only past stock price time series data.

특히, 경제 지표의 실제값과 예측값의 차이를 반영함으로써, 경제 지표의 서프라이지 정도를 반영하여 보다 주가를 정확하게 예측할 수 있다.In particular, by reflecting the difference between the actual and predicted values of economic indicators, stock prices can be predicted more accurately by reflecting the degree of surprise in economic indicators.

또한, 주가는 예측할 수 없는 증시 뉴스나 유명인의 말에 의해서 요동치는 경우가 있으므로 증시 뉴스를 실시간 텍스트 마이닝을 통하여 주가에 호재인지 악재인지를 판단하여 주가에 반영을 하면 지금까지 사용하고 있는 주가 예측시스템 보다 정확도를 높일 수 있다.In addition, stock prices may fluctuate due to unpredictable stock market news or the words of celebrities, so if stock market news is judged as good or bad news for the stock price through real-time text mining and reflected in the stock price, the stock price prediction system that has been used so far is used. Accuracy can be further improved.

즉, 본 발명에서는 기술분석을 LSTM을 통하여 학습시키고, 다양한 거시지표와 상관관계를 분석하여 가중치(weight) 값을 조절한 후 실시간 주가 뉴스를 텍스트 마이닝 후 최종 주가를 예측함으로써 정확한 주가예측을 할 수 있을 것으로 기대한다.In other words, in the present invention, accurate stock price prediction can be made by learning technical analysis through LSTM, analyzing various macro indicators and correlations to adjust weight values, and then predicting the final stock price after text mining real-time stock price news. I hope there will be.

인공지능의 딥러닝 알고리즘을 이용하여 주가를 예측하는 기술이 많이 제시되고 있지만, 기존 주가 예측 알고리즘 대부분은 과거의 시계열 데이터를 분석한다. 따라서, 돌발상황을 실시간 반영하지 못하기 때문에 한계가 있다. 하지만 인공지능의 머신러닝기법을 이용하여 반복적인 패턴을 학습하고 실시간 뉴스 마이닝을 통해 예측 오류 만큼 수정을 하게 된다면 펀드매니저가 하고 있는 수준의 판단을 내려 스스로 주가를 매매할 수 있다. 본 발명은 주가 예측을 단순히 주가의 지표만 가지고 분석하여 예측하는 것이 아니며 거시지표와 뉴스 마이닝을 통하여 실시간 반복학습하면서 새롭게 변하는 패턴을 찾아내어 주가를 예측한다.Although many technologies have been proposed to predict stock prices using deep learning algorithms of artificial intelligence, most existing stock price prediction algorithms analyze past time series data. Therefore, there are limitations because it cannot reflect unexpected situations in real time. However, if you use artificial intelligence machine learning techniques to learn repetitive patterns and correct prediction errors through real-time news mining, you can make the same level of judgment as a fund manager and trade stock prices yourself. The present invention does not predict stock prices by simply analyzing stock price indicators, but predicts stock prices by finding new changing patterns through real-time repetitive learning through macro indicators and news mining.

이상, 본 발명자에 의해서 이루어진 발명을 실시 예에 따라 구체적으로 설명하였지만, 본 발명은 실시 예에 한정되는 것은 아니고, 그 요지를 이탈하지 않는 범위에서 여러 가지로 변경 가능한 것은 물론이다.Above, the invention made by the present inventor has been specifically described based on examples, but the present invention is not limited to the examples and, of course, can be changed in various ways without departing from the gist of the invention.

10 : 사용자 단말 30 : 주가예측 서버
31 : 데이터 수집부 32 : 데이터 정규화부
33 : 상관관계 분석부 34 : 신경망 관리부
35 : 주가및지표 예측부 36 : 뉴스 분석부
37 : 주가 보정부
40 : 데이터베이스 50 : 주가정보 서버
60 : 경제정보 서버
10: User terminal 30: Stock price prediction server
31: data collection unit 32: data normalization unit
33: Correlation analysis unit 34: Neural network management unit
35: Stock price and index prediction department 36: News analysis department
37: Stock price correction unit
40: Database 50: Stock price information server
60: Economic information server

Claims (6)

실시간 거시지표 예측 기반 주가 예측 시스템에 있어서,
주가 정보 및 경제 지표를 시계열 데이터로서 수집하는 데이터 수집부;
상기 시계열 데이터에 대하여 증분을 산출하여 정규화 하는 데이터 정규화부;
주가 및 각 경제지표 간의 상관계수를 산출하는 상관관계 분석부;
각 주가 및 경제지표 각각을 위한 심층 신경망을 학습시키는 신경망 관리부;
학습된 심층 신경망으로 주가 및 경제지표 각각을 예측하는 주가및지표 예측부; 및,
각 경제지표의 보정치를 구하고, 구한 보정치를 예측된 주가에 반영하여 보정하는, 주가 보정부를 포함하고,
상기 상관관계 분석부는 주가 및 경제지표 각각의 증분 값에 대하여, 상관 분석을 수행하여 주가와 경제지표 간의 상관계수를 산출하고,
상기 신경망 관리부는 주가 및 경제지표 각각을 예측하는 신경망을 각각 구성하고, 각 주가 또는 각 경제지표의 증분의 시계열 데이터로 해당 신경망을 각각 학습시키고,
상기 주가 보정부는 각 경제지표의 실제값에서 예측값을 뺀 값에 100을 곱하고, 곱한 값에 상관계수(각 지표와 주가 간의 상관계수)를 곱하여, 해당 지표의 지표별 보정치 wi를 산출하고, 각 지표별 보정치 wi를 평균하여 보정하고,
상기 주가 보정부는 상기 실제값이 발표되지 않는 경우 시장에서의 컨센서스 값으로 대체하는 것을 특징으로 하는 실시간 거시지표 예측 기반 주가 예측 시스템.
In a stock price prediction system based on real-time macro indicator prediction,
A data collection unit that collects stock price information and economic indicators as time series data;
a data normalization unit that calculates increments and normalizes the time series data;
A correlation analysis unit that calculates the correlation coefficient between stock prices and each economic indicator;
Neural network management department that trains deep neural networks for each stock price and economic indicator;
A stock price and index prediction unit that predicts stock prices and economic indicators using a learned deep neural network; and,
It includes a stock price correction unit that calculates the correction value of each economic indicator and corrects it by reflecting the obtained correction value in the predicted stock price,
The correlation analysis unit performs correlation analysis on the incremental values of each stock price and economic index to calculate the correlation coefficient between the stock price and economic index,
The neural network management unit configures neural networks that predict each stock price and economic index, and trains each neural network with incremental time series data of each stock price or economic index,
The stock price correction unit multiplies the actual value of each economic indicator by subtracting the predicted value by 100, multiplies the multiplied value by the correlation coefficient (correlation coefficient between each indicator and the stock price), calculates the correction value w i for each indicator, and calculates the correction value w i for each indicator. Correction is made by averaging the correction values w i for each indicator,
A stock price prediction system based on real-time macro indicator prediction, wherein the stock price correction unit replaces the actual value with a market consensus value when the actual value is not announced.
제1항에 있어서,
상기 시스템은, 상기 신경망 관리부는, 해당 주가의 종목의 뉴스 데이터를 수집하여 텍스트 마이닝을 수행하여 해당 주가의 뉴스 지수를 산출하는 뉴스 분석부를 더 포함하고,
상기 주가 보정부는 상기 예측된 주가에 뉴스 지수를 곱한 후, 곱한 결과에 경제지표의 보정치를 더하여 최종 주가를 추정하는 것을 특징으로 하는 실시간 거시지표 예측 기반 주가 예측 시스템.
According to paragraph 1,
The system further includes a news analysis unit, wherein the neural network management unit collects news data of an item of a corresponding stock price and performs text mining to calculate a news index of the corresponding stock price,
The stock price correction unit multiplies the predicted stock price by a news index and then adds a correction value of the economic indicator to the multiplication result to estimate the final stock price. A stock price prediction system based on real-time macro indicator prediction.
제1항에 있어서,
상기 신경망 관리부는, 전체 정규화된 증분의 시계열 데이터 M(-N+1),M(-N+2), ....,M(0)로부터 순차적으로 다수의 배치 세트를 생성하되, 배치 크기 n+1로 하나의 세트를 형성하여 일련의 N-n개의 배치 세트를 구성하고, 각 배치 세트는 n개의 과거 데이터 세트와, 해당 세트일 때의 예측 데이터의 정답으로 구성함으로써, 학습 데이터를 생성하는 것을 특징으로 하는 실시간 거시지표 예측 기반 주가 예측 시스템.
According to paragraph 1,
The neural network management unit sequentially generates a plurality of batch sets from the entire normalized incremental time series data M(-N+1), M(-N+2), ...., M(0), and the batch size is A set is formed with n+1 to form a series of Nn batch sets, and each batch set is composed of n past data sets and the correct answer of the predicted data for that set, thereby generating learning data. A stock price prediction system based on real-time macro indicator prediction.
삭제delete 제1항에 있어서,
상기 주가는 해당 주가의 고가와 저가의 중간값으로 사용되는 것을 특징으로 하는 실시간 거시지표 예측 기반 주가 예측 시스템.
According to paragraph 1,
A stock price prediction system based on real-time macro indicator prediction, characterized in that the stock price is used as the midpoint between the high and low prices of the stock price.
제1항에 있어서,
상기 심층 신경망은 LSTM(long short-term memory networks) 신경망인 것을 특징으로 하는 실시간 거시지표 예측 기반 주가 예측 시스템.
According to paragraph 1,
The deep neural network is a stock price prediction system based on real-time macro indicator prediction, characterized in that the LSTM (long short-term memory networks) neural network.
KR1020210055151A 2021-04-28 2021-04-28 A stock price prediction system based on real-time macro index prediction KR102614595B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210055151A KR102614595B1 (en) 2021-04-28 2021-04-28 A stock price prediction system based on real-time macro index prediction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210055151A KR102614595B1 (en) 2021-04-28 2021-04-28 A stock price prediction system based on real-time macro index prediction

Publications (2)

Publication Number Publication Date
KR20220147968A KR20220147968A (en) 2022-11-04
KR102614595B1 true KR102614595B1 (en) 2023-12-14

Family

ID=84045316

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210055151A KR102614595B1 (en) 2021-04-28 2021-04-28 A stock price prediction system based on real-time macro index prediction

Country Status (1)

Country Link
KR (1) KR102614595B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102590232B1 (en) * 2022-11-08 2023-10-17 주식회사 위드크루트 System for providing day trading stock picking service using bigdata based artificial intelligence

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101508361B1 (en) 2013-04-02 2015-04-08 한국과학기술원 Method for prediction of future stock price using analysis of aggregate market value of listed stock
KR20140133185A (en) * 2013-05-10 2014-11-19 주식회사 코스콤 Method of predicting a stock price through an analysis of a social data and system applying the same
KR101458004B1 (en) 2013-12-26 2014-11-04 주식회사 코스콤 System and method for predicting change of stock price using artificial neural network model
KR102146546B1 (en) * 2018-10-31 2020-08-21 주식회사 알스피릿 Method for provide enterprise stock forecasting algorithm based on situation cognition
KR102324783B1 (en) * 2019-08-30 2021-11-11 한국전력공사 Apparatus and method for Deep neural network based power demand prediction

Also Published As

Publication number Publication date
KR20220147968A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
Kaucic Investment using evolutionary learning methods and technical rules
Voronin et al. A hybrid electricity price forecasting model for the Nordic electricity spot market
Ganatr et al. Spiking back propagation multilayer neural network design for predicting unpredictable stock market prices with time series analysis
Marne et al. Predicting Price of Cryptocurrency–A Deep Learning Approach
Sun et al. Using machine learning for cryptocurrency trading
Alkhodhairi et al. Bitcoin candlestick prediction with deep neural networks based on real time data
KR102614595B1 (en) A stock price prediction system based on real-time macro index prediction
Evgeniou et al. Uncovering sparsity and heterogeneity in firm-level return predictability using machine learning
Bai et al. Stock investment strategy based on decision tree
Lee et al. Currency exchange rate prediction with long short-term memory networks based on attention and news sentiment analysis
KR102645528B1 (en) A stock price prediction system based on deep learning and economic indicators
Sarvesh et al. A hybrid model for stock price prediction using machine learning techniques with CNN
Mańdziuk et al. Neuro-evolutionary system for FOREX trading
KR102355255B1 (en) A real-time stock price prediction system using LSTM neural network and text miner
Kumar Prediction of gold and silver prices in an emerging economy: Comparative analysis of linear, nonlinear, hybrid, and ensemble models
Kaneko et al. Sensitivity analysis of factors relevant to extreme imbalance between procurement plans and actual demand: Case study of the Japanese electricity market
Liu et al. A study of BOS investment strategy based on bp neural network prediction
EP3739517A1 (en) Image processing
Dunis et al. The economic value of advanced time series methods for modelling and trading 10-year government bonds
Muruganandham et al. Deep Learning based forecast using RNN for stock price prediction
Larsson et al. Time series forecasting of the SP global clean energy index using a multivariate LSTM
Divernois A Deep Learning Approach to Estimate Forward Default Intensities
Sluis Combining the FT-Transformer with the LSTM model to predict stock prices
Maciejowska et al. Probabilistic forecasting with Factor Quantile Regression: Application to electricity trading
Harish et al. Stock Index Probability Prediction using the FB Prophet Model

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant