Signal Trading with Hybrid Machine Learning Techniques and Technical Indicators on Milan Stock Exchange Index (FTSE MIB)

Signal Trading with Hybrid Machine Learning Techniques and Technical Indicators on Milan Stock Exchange Index (FTSE MIB)

By: Mohsen Asgari

Department of Economics, Management and Quantitative Methods (DEMM), University of Milan, 2017

Firstly, I would like to express my sincere gratitude to Prof. Giancarlo Manzi for the continuous support and also to Emilio Costa and Aliaksandra Alimava who helped me in preparing this report. This report is a brief summary of main paper which is under progress.

Introduction

During the last years, there was an exponential increase in the dimension of available datasets. Considering the data, concerning stock markets movement, it became clear that the volume of available data had far exceeded our ability to process it with a classical approach. According to this, an automatization of the decision process appears to be particularly necessary. Using machine learning techniques makes it possible to predict market movement, concentrating all the information from the data in useful technical indicators. The main goal of this paper is to identify a set of rules to generate trading decisions based on technical signals. In order to achieve this goal, we introduce a novel decision support system, based on a hybrid machine learning, which can be seen as a combination of different classification and clustering techniques, such as: Random Forest, Decision Trees, Neural Networks (NN), Support Vector Machines (SVM), K-Means.

Methodology

We decide to articulate the problem of stock trading decision as a classification problem with three different classes: buy, hold and sell. The aim of this work is the identification of the most efficient Hybrid system, that is, the identification of the best combination of classifier or clustering techniques among the ones that are listed in the previous section.

The indicators used as input for trading systems can be technical indicators, fundamental indicators and macroeconomic indicators. Here, we have examined all indicators of TTR package of R. Nevertheless, some of these indicators may be irrelevant for our data. We have used selection techniques such as lasso shrinkage regression model in order to remove the insignificant predictors. As a result, we obtained these relevant indicators: Moving Average Convergence and Divergence (MACD), Relative Strength Index (RSI), Commodity Channel Index (CCI), On Balance Volume (OBV), William’s %R (WR), Stochastics, Normalized Close Price. These indicators are normalized to be fed as input in different models.

Figure 1: Methodology 

As is known, a machine learning system needs a first stage, during which the system is trained, and a second one, in which the system classifies the data accordingly to the technical indicators trained during the stage one. The result of the analysis is the predicted trend of the market index, which can be used to set out some trading rules:

? If the next day trend is Uptrend, then the decision is BUY

? If BUY decision already exists, then HOLD

? If the next day trend is Downtrend, then the decision is SELL

? If SELL decision already exists, then HOLD

According to the result obtained with these rules, the profits of strategy has been calculated.

Data and Parameters

The dataset that we have used to perform this work is composed of the daily data regarding the market movement of the FTSE MIB index of the Milan stock exchange from 1st December 2000 to 15th November 2016, 4048 observations. The dataset is composed of 6 variables: date, opening price of the day, highest price of the day, lowest price of the day, closing price of the day, traded volume. We used the data from 2001 to 2012 (3018 Trading days) as training dataset and from 2013 to the end of 2016 (1005 Trading days) as testing dataset.

Table 1: Methods and Parameters

Theory

Firstly, it is important the define the different methodologies of analysis that we have combined to perform our work. Decision Tree is a predictive method, which maps observations about an item, creating links with the possible values that the item can take. This methodology is commonly used to realize models with several inputs and to classify datasets. Random Forest is an ensemble of decision trees. It gives as output the mode or the mean of the single results of the decision trees. The principal advantage of the random forest with respect to the decision tree model is the tendency’s correction of the second of over fitting to the training set. Neural Network is a connectionist system, based on a large collection of single neural units that are connected with each other. The aim of a neural network system is to solve problems in the same way a human brain does. Support Vector Machine is a classification method that takes a training set, in which each element is marked as belonging to one of the classes, and assigns new elements without a pre-assigned class to one of the categories. K-Means is a clustering method, which aims to partition the observations in clusters. Linear Discriminant Analysis is a linear classification method that aims to find linear combinations of features that are typical of two or more classes.

Secondly, we can define hybrid models, that are combinations of clustering and classification techniques.

Figure 2: Analytical structure of Hybrid Machine Learning

There are four different combinations: Classifier – Clustering, Classifier – Classifier, Classifier – Clustering, and Clustering – Clustering.

We have also compared the obtained results with those obtained with Simple Moving Average and Ridge, elastic and Lasso regressions.

Results and Conclusions

In table 2 we can see the outputs for all the simple model that we have decided to use to perform our analysis. The first output that we can use to evaluate the efficiency of the models is the Compound Sum of Return (%) computed on the 1005 days of the test dataset. Looking at the table 2 we can see that the two simple models with the best performances are the Neural Network (whose graph is shown below) and the Support Vector Machines, with +49.01% and +35.51% respectively.

Figure 2: NN Network

However, looking at the table 3 where are reported the results of the hybrid models, we can see that an average the performances are higher than the simple models. We can also notice that here is one hybrid model, that obtains better results, comparing to those achieved with the simple NN. This hybrid model is the LDA+NN, which has a Compound Sum of Return of +51.60%, and it seems the best hybrid model to predict the market movement. However, we believe that more tests and studies are necessary in order to obtain the model with the highest and more precise level of performance.

Table 2: Trade Results

Table 3: Trade Results, Hybrid Machine Learning techniques

Conclusion

In last three years (from 2014-2016), if one trade has had decided to invest in Milan Stock Exchange (by buying exchange-traded fund (ETF), or building a portfolio for tracking the FTSE MIB Index) earned 9.52% profit. Many traders used to trade based on one or two indicators which is not appropriate for real markets. For example, simple 15 days moving average has led to -81% loss during this period.

The aim of this study is to investigate the hypothesis of earning well balances return with lowest possible risk in MIB index by using different classification, clustering and hybrid Machine learning technique and beating the market.

As can be seen from the result table, Neural Network and SVM methods could gain much better return in terms of risk and return. As expected, using hybrid combination lead to better or same result. For example, the combination of LDA and NN perform better than other simple and hybrid models.

Reference:

  •  Rajashree Dash, Pradipta Kishore Dash, A hybrid stock trading framework integrating technical analysis with machine learning techniques, The Journal of Finance and Data Science, 2016
  •  Shipra Banik, A. F. M. Khodadad Khan, and Mohammad Anwer, “Hybrid Machine Learning Technique for Forecasting Dhaka Stock Market Timing Decisions”, Computational Intelligence and Neuroscience Volume 2014
  •  Chih-Fong Tsai, Ming-Lun Chen, Credit rating by hybrid machine learning techniques, Applied Soft Computing, 2010
  •  C. F. Tsai and S. P. Wang, “Stock price forecasting by hybrid machine learning techniques,” in Proceedings of the International Multi conference of Engineers and Computer Scientists, Hong Kong, China, 2009.
  •  Tsai, C.-F. and Wang, S.-P, “Stock Price Forecasting by Hybrid Machine Learning Techniques”, Proceedings of the International Multi Conference of Engineers and Computer Scientists, 2009

---------------------------------------------------------------------------------------------------------

Application created in R by Shiny Package

The aim of this application is to analyze, predict, simulate and provide and test trading signal based on quantitative methods, on different financial market data. This app is being completed.


Shakour Alishahi

Trader at Bourse behgozin Brokerage

7 年

????. ?? ???? ?? ????? ????? ??????. ?? ???? ??????? ???? ? ?? ????? ????? ???? ????.(?????? ??????? ? ??????????? ???????? ? ....) ???? ???? ???? ?? ???? ?? ????????? ?? ?? ???? ?? ????? ???? ??????? ???? ???? ??????? ????? ??? ???? ?? ????? ???. ????? ?? ?? ??? ???? ?? ????? ?? ?? ?????? ?? ???? ??????? ?????(???????) ? ??????? ???? ??????? ????????? ?? ???? ?????.(??????? ?????? ? ???)

Mohammad Shahedi

Big Data Engineer and Specialist Solutions Architect - Databricks

7 年

Amazing job. Congrats.

回复
Mohsen Asgari

Dual MSc Quant Finance & Financial Engineering || Quant Developer at HDI Group || Trader

7 年
回复

要查看或添加评论,请登录

Mohsen Asgari的更多文章

社区洞察

其他会员也浏览了